mirror of
https://github.com/kwsch/PKHeX
synced 2025-02-17 05:48:44 +00:00
Relocate some tables to a location closer to where they're used
This commit is contained in:
parent
a7b9fafb69
commit
c432a15a20
18 changed files with 1336 additions and 691 deletions
|
@ -73,19 +73,6 @@ namespace PKHeX.Core
|
|||
_ => Array.Empty<byte>()
|
||||
};
|
||||
|
||||
internal static ICollection<int> GetWildBalls(int generation, GameVersion game) => generation switch
|
||||
{
|
||||
1 => WildPokeBalls1,
|
||||
2 => WildPokeBalls2,
|
||||
3 => WildPokeBalls3,
|
||||
4 => GameVersion.HGSS.Contains(game) ? WildPokeBalls4_HGSS : WildPokeBalls4_DPPt,
|
||||
5 => WildPokeBalls5,
|
||||
6 => WildPokeballs6,
|
||||
7 => GameVersion.Gen7b.Contains(game) ? WildPokeballs7b : WildPokeballs7,
|
||||
8 => GameVersion.GO == game ? WildPokeballs8g : WildPokeballs8,
|
||||
_ => Array.Empty<int>()
|
||||
};
|
||||
|
||||
internal static int GetMaxSpeciesOrigin(PKM pkm)
|
||||
{
|
||||
if (pkm.Format == 1)
|
||||
|
|
|
@ -47,7 +47,7 @@ namespace PKHeX.Core
|
|||
{
|
||||
Species = species,
|
||||
Gift = true, // Forces Poké Ball
|
||||
Ability = Legal.TransferSpeciesDefaultAbility_1.Contains(species) ? 1 : 4, // Hidden by default, else first
|
||||
Ability = Legal.TransferSpeciesDefaultAbilityGen1(species) ? 1 : 4, // Hidden by default, else first
|
||||
Shiny = mew ? Shiny.Never : Shiny.Random,
|
||||
Fateful = mew,
|
||||
Location = Locations.Transfer1,
|
||||
|
@ -65,7 +65,7 @@ namespace PKHeX.Core
|
|||
{
|
||||
Species = species,
|
||||
Gift = true, // Forces Poké Ball
|
||||
Ability = Legal.TransferSpeciesDefaultAbility_2.Contains(species) ? 1 : 4, // Hidden by default, else first
|
||||
Ability = Legal.TransferSpeciesDefaultAbilityGen2(species) ? 1 : 4, // Hidden by default, else first
|
||||
Shiny = mew ? Shiny.Never : Shiny.Random,
|
||||
Fateful = fateful,
|
||||
Location = Locations.Transfer2,
|
||||
|
|
|
@ -37,7 +37,13 @@ namespace PKHeX.Core
|
|||
00, 00, 00, 00, 00, 00
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> TransferSpeciesDefaultAbility_1 = new() {92, 93, 94, 109, 110, 151};
|
||||
internal static bool TransferSpeciesDefaultAbilityGen1(int species)
|
||||
{
|
||||
System.Diagnostics.Debug.Assert(species <= (uint)MaxSpeciesID_1);
|
||||
return species is (int)Species.Gastly or (int)Species.Haunter or (int)Species.Gengar
|
||||
or (int)Species.Koffing or (int)Species.Weezing
|
||||
or (int)Species.Mew;
|
||||
}
|
||||
|
||||
internal static readonly int[] TMHM_RBY =
|
||||
{
|
||||
|
@ -49,12 +55,30 @@ namespace PKHeX.Core
|
|||
|
||||
015, 019, 057, 070, 148
|
||||
};
|
||||
|
||||
internal static readonly int[] WildPokeBalls1 = {4};
|
||||
|
||||
|
||||
internal static readonly HashSet<int> FutureEvolutionsGen1 = new()
|
||||
{
|
||||
169,182,186,196,197,199,208,212,230,233,242,462,463,464,465,466,467,470,471,474,700
|
||||
(int)Species.Crobat,
|
||||
(int)Species.Bellossom,
|
||||
(int)Species.Politoed,
|
||||
(int)Species.Espeon,
|
||||
(int)Species.Umbreon,
|
||||
(int)Species.Slowking,
|
||||
(int)Species.Steelix,
|
||||
(int)Species.Scizor,
|
||||
(int)Species.Kingdra,
|
||||
(int)Species.Porygon2,
|
||||
(int)Species.Blissey,
|
||||
(int)Species.Magnezone,
|
||||
(int)Species.Lickilicky,
|
||||
(int)Species.Rhyperior,
|
||||
(int)Species.Tangrowth,
|
||||
(int)Species.Electivire,
|
||||
(int)Species.Magmortar,
|
||||
(int)Species.Leafeon,
|
||||
(int)Species.Glaceon,
|
||||
(int)Species.PorygonZ,
|
||||
(int)Species.Sylveon,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,20 +53,38 @@ namespace PKHeX.Core
|
|||
};
|
||||
|
||||
internal static readonly int[] Tutors_GSC = {53, 85, 58}; // Flamethrower, Thunderbolt & Ice Beam
|
||||
internal static readonly int[] WildPokeBalls2 = { 4 };
|
||||
|
||||
internal static readonly HashSet<int> FutureEvolutionsGen2 = new()
|
||||
{
|
||||
424,429,430,461,462,463,464,465,466,467,468,469,470,471,472,473,474,700
|
||||
(int)Species.Ambipom,
|
||||
(int)Species.Mismagius,
|
||||
(int)Species.Honchkrow,
|
||||
(int)Species.Weavile,
|
||||
(int)Species.Magnezone,
|
||||
(int)Species.Lickilicky,
|
||||
(int)Species.Rhyperior,
|
||||
(int)Species.Tangrowth,
|
||||
(int)Species.Electivire,
|
||||
(int)Species.Magmortar,
|
||||
(int)Species.Togekiss,
|
||||
(int)Species.Yanmega,
|
||||
(int)Species.Leafeon,
|
||||
(int)Species.Glaceon,
|
||||
(int)Species.Gliscor,
|
||||
(int)Species.Mamoswine,
|
||||
(int)Species.PorygonZ,
|
||||
(int)Species.Sylveon,
|
||||
};
|
||||
|
||||
internal static readonly bool[] ReleasedHeldItems_2 = Enumerable.Range(0, MaxItemID_2+1).Select(i => HeldItems_GSC.Contains((ushort)i)).ToArray();
|
||||
|
||||
internal static readonly HashSet<int> TransferSpeciesDefaultAbility_2 = new()
|
||||
internal static bool TransferSpeciesDefaultAbilityGen2(int species)
|
||||
{
|
||||
92, 93, 94, 109, 110, 151, 200, 201, 251,
|
||||
// Future Evolutions
|
||||
429, // Misdreavus -> Mismagius
|
||||
};
|
||||
System.Diagnostics.Debug.Assert((uint)species <= MaxSpeciesID_2);
|
||||
return species is (int)Species.Gastly or (int)Species.Haunter or (int)Species.Gengar
|
||||
or (int)Species.Koffing or (int)Species.Weezing
|
||||
or (int)Species.Misdreavus or (int)Species.Unown
|
||||
or (int)Species.Mew or (int)Species.Celebi;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -96,11 +96,31 @@ namespace PKHeX.Core
|
|||
590, 591, 592, 593
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> WildPokeBalls3 = new() { 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12};
|
||||
|
||||
internal static readonly HashSet<int> FutureEvolutionsGen3 = new()
|
||||
{
|
||||
407,424,429,430,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,700
|
||||
(int)Species.Roserade,
|
||||
(int)Species.Ambipom,
|
||||
(int)Species.Mismagius,
|
||||
(int)Species.Honchkrow,
|
||||
(int)Species.Weavile,
|
||||
(int)Species.Magnezone,
|
||||
(int)Species.Lickilicky,
|
||||
(int)Species.Rhyperior,
|
||||
(int)Species.Tangrowth,
|
||||
(int)Species.Electivire,
|
||||
(int)Species.Magmortar,
|
||||
(int)Species.Togekiss,
|
||||
(int)Species.Yanmega,
|
||||
(int)Species.Leafeon,
|
||||
(int)Species.Glaceon,
|
||||
(int)Species.Gliscor,
|
||||
(int)Species.Mamoswine,
|
||||
(int)Species.PorygonZ,
|
||||
(int)Species.Gallade,
|
||||
(int)Species.Probopass,
|
||||
(int)Species.Dusknoir,
|
||||
(int)Species.Froslass,
|
||||
(int)Species.Sylveon,
|
||||
};
|
||||
|
||||
internal static readonly int[] UnreleasedItems_3 =
|
||||
|
|
|
@ -164,23 +164,9 @@ namespace PKHeX.Core
|
|||
10, 15, 20, 15, 10, 10, 05, 10, 05, 05, 10, 05, 05, 10, 05, 05, 05,
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> WildPokeBalls4_DPPt = new()
|
||||
{
|
||||
1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
||||
// Cherish ball not usable
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> WildPokeBalls4_HGSS = new()
|
||||
{
|
||||
1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
||||
// Cherish ball not usable
|
||||
17, 18, 19, 20, 21, 22, 23
|
||||
// Comp Ball not usable in wild
|
||||
};
|
||||
|
||||
internal static readonly int[] FutureEvolutionsGen4 =
|
||||
{
|
||||
700
|
||||
(int)Species.Sylveon,
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> UnreleasedItems_4 = new()
|
||||
|
|
|
@ -103,16 +103,6 @@ namespace PKHeX.Core
|
|||
05, 10, 05, 05, 15, 10, 05, 05, 05,
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> WildPokeBalls5 = new()
|
||||
{
|
||||
1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
||||
// Cherish ball not usable
|
||||
// HGSS balls not usable
|
||||
// Dream ball not usable in wild
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> DreamWorldBalls = new(WildPokeBalls5) {(int)Ball.Dream};
|
||||
|
||||
internal static readonly int[] FutureEvolutionsGen5 =
|
||||
{
|
||||
(int)Species.Sylveon,
|
||||
|
@ -178,78 +168,5 @@ namespace PKHeX.Core
|
|||
Locations.Daycare5,
|
||||
60003, // Breeder (NPC)
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Some mixed-gender species were only distributed male-only. Ban hidden abilities on these species when bred in Gen5.
|
||||
/// </summary>
|
||||
internal static readonly HashSet<int> Ban_BreedHidden5 = new()
|
||||
{
|
||||
// Only males distributed; unable to pass to offspring
|
||||
001, // Bulbasaur
|
||||
004, // Charmander
|
||||
007, // Squirtle
|
||||
128, // Tauros
|
||||
152, // Chikorita
|
||||
155, // Cyndaquil
|
||||
158, // Totodile
|
||||
236, // Tyrogue
|
||||
252, // Treecko
|
||||
255, // Torchic
|
||||
258, // Mudkip
|
||||
387, // Turtwig
|
||||
390, // Chimchar
|
||||
393, // Piplup
|
||||
511, // Pansage
|
||||
513, // Pansear
|
||||
515, // Panpour
|
||||
574, // Gothita
|
||||
|
||||
// Genderless; unable to pass to offspring
|
||||
081, // Magnemite
|
||||
100, // Voltorb
|
||||
120, // Staryu
|
||||
132, // Ditto... can't breed anyway.
|
||||
137, // Porygon
|
||||
374, // Beldum
|
||||
436, // Bronzor
|
||||
622, // Golett
|
||||
|
||||
// Not available at all
|
||||
092, // Gastly
|
||||
109, // Koffing
|
||||
200, // Misdreavus
|
||||
201, // Unown
|
||||
287, // Slakoth
|
||||
311, // Plusle
|
||||
311, // Minun
|
||||
337, // Lunatone
|
||||
338, // Solrock
|
||||
343, // Baltoy
|
||||
351, // Castform
|
||||
352, // Kecleon
|
||||
355, // Duskull
|
||||
358, // Chimecho
|
||||
420, // Cherrim
|
||||
433, // Chingling
|
||||
479, // Rotom
|
||||
489, // Phione
|
||||
495, // Snivy
|
||||
498, // Tepig
|
||||
501, // Oshawott
|
||||
538, // Throh
|
||||
539, // Sawk
|
||||
561, // Sigilyph
|
||||
562, // Yamask
|
||||
566, // Archen
|
||||
570, // Zorua
|
||||
597, // Ferroseed
|
||||
599, // Klink
|
||||
602, // Tynamo
|
||||
607, // Litwick
|
||||
615, // Cryogonal
|
||||
627, // Rufflet
|
||||
633, // Deino
|
||||
636, // Larvesta
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -275,189 +275,6 @@ namespace PKHeX.Core
|
|||
};
|
||||
|
||||
internal static readonly int[] CosplayPikachuMoves = { 309, 556, 577, 604, 560, 0 };
|
||||
internal static readonly HashSet<int> WildPokeballs6 = new() {0x01, 0x02, 0x03, 0x04, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F};
|
||||
|
||||
/// <summary>
|
||||
/// Species that are male only in Generation 6; for ball inheritance, these behave the same as Genderless species (no ball inherited).
|
||||
/// </summary>
|
||||
internal static readonly HashSet<int> BreedMaleOnly6 = new()
|
||||
{
|
||||
(int)Species.Tauros,
|
||||
(int)Species.Rufflet, (int)Species.Braviary,
|
||||
(int)Species.Tyrogue, (int)Species.Hitmonlee, (int)Species.Hitmonchan, (int)Species.Hitmontop,
|
||||
(int)Species.Sawk, (int)Species.Throh
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> Ban_NoHidden6 = new()
|
||||
{
|
||||
// Not available at Friend Safari or Horde Encounter
|
||||
(int)Species.Flabébé + (2 << 11), // Orange
|
||||
(int)Species.Floette + (2 << 11), // Orange
|
||||
(int)Species.Florges + (2 << 11), // Orange
|
||||
(int)Species.Flabébé + (4 << 11), // White
|
||||
(int)Species.Floette + (4 << 11), // White
|
||||
(int)Species.Florges + (4 << 11), // White
|
||||
|
||||
// Super Size can be obtained as a Pumpkaboo from event distributions
|
||||
(int)Species.Pumpkaboo + (1 << 11), // Small
|
||||
(int)Species.Gourgeist + (1 << 11), // Small
|
||||
(int)Species.Pumpkaboo + (2 << 11), // Large
|
||||
(int)Species.Gourgeist + (2 << 11), // Large
|
||||
|
||||
// Same abilities (1/2/H), not available as H
|
||||
(int)Species.Honedge,
|
||||
(int)Species.Doublade,
|
||||
(int)Species.Aegislash,
|
||||
(int)Species.Carnivine,
|
||||
(int)Species.Cryogonal,
|
||||
(int)Species.Archen,
|
||||
(int)Species.Archeops,
|
||||
(int)Species.Rotom,
|
||||
(int)Species.Rotom + (1 << 11),
|
||||
(int)Species.Rotom + (2 << 11),
|
||||
(int)Species.Rotom + (3 << 11),
|
||||
(int)Species.Rotom + (4 << 11),
|
||||
(int)Species.Rotom + (5 << 11),
|
||||
|
||||
(int)Species.Castform,
|
||||
(int)Species.Furfrou,
|
||||
(int)Species.Furfrou,
|
||||
(int)Species.Furfrou + (1 << 11),
|
||||
(int)Species.Furfrou + (2 << 11),
|
||||
(int)Species.Furfrou + (3 << 11),
|
||||
(int)Species.Furfrou + (4 << 11),
|
||||
(int)Species.Furfrou + (5 << 11),
|
||||
(int)Species.Furfrou + (6 << 11),
|
||||
(int)Species.Furfrou + (7 << 11),
|
||||
(int)Species.Furfrou + (8 << 11),
|
||||
(int)Species.Furfrou + (9 << 11),
|
||||
};
|
||||
|
||||
#region Ball Table
|
||||
internal static readonly HashSet<int> Inherit_Sport = new()
|
||||
{
|
||||
010, 013, 046, 048, 123, 127, 265, 290, 314, 401, 415,
|
||||
|
||||
313, // Via Illumise
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> Inherit_Safari = new()
|
||||
{
|
||||
016, 019, 020, 021, 022, 023, 024, 025, 027, 029, 035, 039, 041,
|
||||
043, 046, 048, 050, 054, 055, 060, 063, 066, 069, 070, 074, 077, 079, 080, 083, 084, 088, 092, 095, 096, 098,
|
||||
099, 102, 104, 108, 109, 111, 113, 114, 115, 118, 122, 123, 125, 126, 127, 129, 131, 147, 161, 163, 165, 167,
|
||||
177, 179, 183, 187, 189, 190, 191, 193, 194, 198, 200, 202, 203, 204, 207, 209, 213, 214, 216, 223, 228, 229,
|
||||
231, 234, 235, 241, 246, 263, 264, 270, 271, 273, 283, 284, 285, 286, 288, 298, 299, 304, 305, 307, 308, 309,
|
||||
310, 314, 315, 316, 318, 324, 327, 328, 331, 332, 335, 336, 339, 341, 352, 353, 354, 355, 356, 357, 358, 363,
|
||||
364, 371, 372, 396, 399, 400, 403, 404, 406, 417, 418, 419, 433, 443, 447, 449, 451, 453, 455,
|
||||
|
||||
032, // Via Nidoran-F
|
||||
313, // Via Illumise
|
||||
|
||||
172, // Via Pikachu
|
||||
173, // Via Clefairy
|
||||
174, // Via Jigglypuff
|
||||
239, // Via Electabuzz
|
||||
240, // Via Magmar
|
||||
298, // Via Marill
|
||||
360, // Via Wobbuffet
|
||||
406, // Via Roselia
|
||||
433, // Via Chimecho
|
||||
439, // Via Mr. Mime
|
||||
440, // Via Chansey
|
||||
|
||||
287, // Via Vigoroth
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> Inherit_Dream = new()
|
||||
{
|
||||
010, 013, 016, 019, 021, 023, 027, 029, 037, 041, 043, 046, 048, 050, 052, 054, 056, 058, 060, 063, 066, 069,
|
||||
072, 074, 077, 079, 083, 084, 086, 088, 090, 092, 095, 096, 098, 102, 104, 108, 109, 111, 113, 114, 115, 116,
|
||||
118, 122, 123, 127, 129, 131, 133, 138, 140, 142, 143, 147, 161, 163, 165, 167, 170, 173, 174, 175, 177, 179,
|
||||
183, 185, 187, 190, 191, 193, 194, 198, 200, 202, 203, 204, 206, 207, 209, 211, 213, 214, 215, 216, 218, 220,
|
||||
222, 223, 225, 226, 227, 228, 231, 234, 235, 238, 239, 240, 241, 246, 261, 263, 265, 270, 273, 276, 278, 280,
|
||||
283, 285, 287, 290, 293, 296, 299, 300, 302, 303, 304, 307, 309, 311, 312, 314, 315, 316, 318, 320, 322, 324,
|
||||
325, 327, 328, 331, 333, 335, 336, 339, 341, 345, 347, 349, 351, 352, 353, 355, 357, 358, 359, 361, 363, 366,
|
||||
369, 370, 371, 396, 399, 401, 403, 408, 410, 412, 415, 417, 418, 420, 422, 425, 427, 431, 434, 441, 442, 443,
|
||||
447, 449, 451, 453, 455, 456, 459, 517, 519, 525, 529, 531, 533, 535, 545, 546, 548, 550, 553, 556, 558, 559,
|
||||
561, 564, 578, 580, 583, 587, 588, 594, 596, 605, 610, 616, 618, 621, 624, 631, 632,
|
||||
|
||||
032, // Via Nidoran-F
|
||||
313, // Via Illumise
|
||||
|
||||
// Via Evolution
|
||||
524, // Roggenrola
|
||||
532, // Timburr
|
||||
543, // Venipede
|
||||
551, // Sandile
|
||||
557, // Dwebble
|
||||
577, // Solosis
|
||||
582, // Vanillite
|
||||
595, // Joltik
|
||||
|
||||
// Via Incense Breeding
|
||||
298, 360, 406, 433, 438, 439, 440, 446, 458,
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> Ban_DreamHidden = new()
|
||||
{
|
||||
311, // Plusle
|
||||
312, // Minun
|
||||
352, // Kecleon
|
||||
355, // Duskull
|
||||
|
||||
// Via Pre-Evolution
|
||||
356, // Dusclops
|
||||
477, // Dusknoir
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> Ban_Gen3Ball = new()
|
||||
{
|
||||
252, 255, 258, //1 - Treeko, Torchic, Mudkip
|
||||
253, 256, 259, //2
|
||||
254, 257, 260, //3
|
||||
387, 390, 393, //1 - Turtwig, Chimchar, Piplup
|
||||
388, 391, 394, //2
|
||||
389, 392, 395, //3
|
||||
495, 498, 501, //1 - Snivy, Tepig, Oshawott
|
||||
496, 499, 502, //2
|
||||
497, 500, 503, //3
|
||||
566, 567, 696, 697, 698, 699 // Fossil Only obtain
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> Ban_Gen3BallHidden = new()
|
||||
{
|
||||
// can have HA and can be in gen 3 ball as eggs but can not at same time.
|
||||
152, 155, 158, //1 - Gen2 Starters
|
||||
153, 156, 159, //2
|
||||
154, 157, 160, //3
|
||||
585 + (1 << 11), //Deerling-Summer
|
||||
586 + (1 << 11), //Sawsbuck-Summer
|
||||
585 + (2 << 11), //Deerling-Autumn
|
||||
586 + (2 << 11), //Sawsbuck-Autumn
|
||||
585 + (3 << 11), //Deerling-Winter
|
||||
586 + (3 << 11), //Sawsbuck-Winter
|
||||
710 + (3 << 11), //Pumpkaboo-Super
|
||||
711 + (3 << 11), //Gourgeist-Super
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> Ban_Gen4Ball_6 = new()
|
||||
{
|
||||
152, 155, 158, //1 - Chikorita, Cyndaquil, Totodile
|
||||
153, 156, 159, //2
|
||||
154, 157, 160, //3
|
||||
252, 255, 258, //1 - Treeko, Torchic, Mudkip
|
||||
253, 256, 259, //2
|
||||
254, 257, 260, //3
|
||||
387, 390, 393, //1 - Turtwig, Chimchar, Piplup
|
||||
388, 391, 394, //2
|
||||
389, 392, 395, //3
|
||||
495, 498, 501, //1 - Snivy, Tepig, Oshawott
|
||||
496, 499, 502, //2
|
||||
497, 500, 503, //3
|
||||
566, 567, 696, 697, 698, 699 // Fossil Only obtain
|
||||
};
|
||||
#endregion
|
||||
|
||||
internal static readonly byte[] MovePP_XY =
|
||||
{
|
||||
|
|
|
@ -152,13 +152,6 @@ namespace PKHeX.Core
|
|||
internal static readonly ushort[] HeldItems_SM = ArrayUtil.ConcatAll(Pouch_Items_SM, Pouch_Berries_SM, Pouch_Medicine_SM, Pouch_ZCrystalHeld_SM);
|
||||
internal static readonly ushort[] HeldItems_USUM = ArrayUtil.ConcatAll(Pouch_Items_SM, Pouch_Berries_SM, Pouch_Medicine_SM, Pouch_ZCrystalHeld_USUM, Pouch_Roto_USUM);
|
||||
|
||||
internal static readonly HashSet<int> WildPokeballs7 = new()
|
||||
{
|
||||
0x01, 0x02, 0x03, 0x04, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
|
||||
0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, // Johto Balls
|
||||
0x1A, // Beast
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> AlolanOriginForms = new()
|
||||
{
|
||||
019, // Rattata
|
||||
|
@ -234,227 +227,6 @@ namespace PKHeX.Core
|
|||
100, 101 // Voltorb & Electrode
|
||||
};
|
||||
|
||||
public static readonly HashSet<int> PastGenAlolanNativesUncapturable = new()
|
||||
{
|
||||
142, // Aerodacyl
|
||||
137, 233, 474, // Porygon++
|
||||
138, 139, 140, 141, // Gen1 Fossils
|
||||
345, 346, 347, 348, // Gen3 Fossils
|
||||
408, 409, 410, 411, // Gen4 Fossils
|
||||
564, 565, 566, 567, // Gen5 Fossils
|
||||
696, 697, 698, 699, // Gen6 Fossils
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> PastGenAlolanScans = new()
|
||||
{
|
||||
069, // Bellsprout
|
||||
111, // Rhyhorn
|
||||
116, // Horsea
|
||||
152, // Chikorita
|
||||
155, // Cyndaquil
|
||||
158, // Totodile
|
||||
220, // Swinub
|
||||
363, // Spheal
|
||||
543, // Venipede
|
||||
574, // Gothita
|
||||
599, // Klink
|
||||
607, // Litwick
|
||||
610, // Axew
|
||||
633, // Deino
|
||||
679, // Honedge
|
||||
|
||||
183, 298, // Marill {Azurill}
|
||||
315, 406, // Roselia {Budew}
|
||||
|
||||
175, // [468] Togekiss (Togepi)
|
||||
287, // [288] Vigoroth (Slakoth)
|
||||
396, // [397] Staravia (Starly)
|
||||
403, // [404] Luxio (Shinx)
|
||||
495, // [497] Serperior (Snivy)
|
||||
577, // [578] Duosion (Solosis)
|
||||
|
||||
498, // [500] Emboar (Tepig)
|
||||
501, // [503] Samurott (Oshawott)
|
||||
532, // [534] Conkeldurr (Timburr)
|
||||
540, // [542] Leavanny (Sewaddle)
|
||||
602, // [604] Eelektross (Tynamo)
|
||||
|
||||
004, // Charmander
|
||||
007, // Squirtle
|
||||
095, // Onix
|
||||
663, 664, // Scatterbug
|
||||
001, // Bulbasaur
|
||||
280, // Ralts
|
||||
255, 256, // Combusken
|
||||
013, 014, 015, // Beedrill
|
||||
252, 253, // Grovyle
|
||||
258, 259, // Marshtomp
|
||||
393, 394, // Prinplup
|
||||
387, 388, // Grotle
|
||||
016, 017, 018, // Pidgeot
|
||||
389, 390, 391, // Monferno
|
||||
304, 305, 306, // Aggron
|
||||
479, // Rotom
|
||||
650, 651, 652, // Chesnaught
|
||||
656, 657, 658, // Greninja
|
||||
653, 654, 655, // Delphox
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> Inherit_Apricorn6 = new()
|
||||
{
|
||||
010, 013, 016, 019, 021, 023, 025, 027, 029, 035, 037, 039, 041,
|
||||
043, 046, 048, 050, 052, 054, 056, 058, 060, 063, 066, 069, 072, 074, 077, 079, 083, 084, 086, 088, 090, 092,
|
||||
095, 096, 098, 102, 104, 108, 109, 111, 113, 114, 115, 116, 118, 122, 124, 125, 126, 129, 131, 143, 147, 161,
|
||||
163, 165, 167, 170, 177, 179, 183, 185, 187, 190, 191, 193, 194, 198, 200, 202, 203, 204, 206, 207, 209, 211,
|
||||
213, 214, 215, 216, 218, 220, 222, 223, 225, 226, 227, 228, 231, 234, 235, 241, 246, 261, 263, 265, 273, 276,
|
||||
278, 280, 285, 287, 293, 296, 302, 303, 307, 311, 312, 316, 322, 325, 327, 333, 339, 359, 366, 369, 370, 396,
|
||||
399, 401, 403, 406, 412, 415, 418, 420, 427, 433, 441, 455,
|
||||
|
||||
032, // Via Nidoran-F
|
||||
|
||||
440, // Via Chansey
|
||||
238, // Via Jynx
|
||||
239, // Via Electabuzz
|
||||
240, // Via Magmar
|
||||
298, // Via Marill
|
||||
360, // Via Wobbuffet
|
||||
438, // Via Sudowoodo
|
||||
439, // Via Mr. Mime
|
||||
446, // Via Snorlax
|
||||
458, // Via Mantine
|
||||
358, // Via Chingling
|
||||
172, // Via Pikachu
|
||||
173, // Via Clefairy
|
||||
174, // Via Jigglypuff
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> AlolanCaptureOffspring = new()
|
||||
{
|
||||
010, 019, 021, 025, 027, 035, 037, 039, 041, 046,
|
||||
050, 052, 054, 056, 058, 060, 063, 066, 072, 074,
|
||||
079, 081, 088, 090, 092, 096, 102, 104, 113, 115,
|
||||
118, 120, 123, 127, 128, 129, 131, 132, 133, 143,
|
||||
147, 165, 167, 170, 172, 173, 174, 185, 198, 200,
|
||||
209, 212, 215, 222, 225, 227, 235, 239, 240, 241,
|
||||
278, 283, 296, 299, 302, 318, 320, 324, 327, 328,
|
||||
339, 349, 351, 359, 361, 369, 370, 371, 374, 422,
|
||||
425, 438, 440, 443, 446, 447, 456, 506, 524, 546,
|
||||
548, 551, 568, 582, 587, 594, 627, 629, 661, 674,
|
||||
703, 704, 707, 708,
|
||||
|
||||
731, 734, 736, 739, 741, 742, 744, 746, 747, 749,
|
||||
751, 753, 755, 757, 759, 761, 764, 765, 766, 767,
|
||||
769, 771, 774, 775, 776, 777, 778, 779, 780, 781,
|
||||
782,
|
||||
|
||||
// USUM Additions
|
||||
023, 086, 108, 122, 163, 177, 179, 190, 204,
|
||||
206, 214, 223, 226, 228, 238, 246, 303, 309, 341, 343,
|
||||
352, 353, 357, 366, 427, 439, 458, 550,
|
||||
559, 570, 572, 592, 605, 619, 621, 622, 624, 636,
|
||||
667, 669, 676, 686, 690, 692, 701, 702,
|
||||
714,
|
||||
|
||||
// Wormhole
|
||||
333, 193, 561, 580, 276, 451, 531, 694, 273, 325,
|
||||
459, 307, 449, 557, 218, 688, 270, 618, 418, 194,
|
||||
|
||||
// Static Encounters
|
||||
100,
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> AlolanCaptureNoHeavyBall = new() { 374, 785, 786, 787, 788}; // Beldum & Tapus
|
||||
|
||||
internal static readonly HashSet<int> Inherit_ApricornMale7 = new()
|
||||
{
|
||||
100, // Voltorb
|
||||
343, // Baltoy
|
||||
436, // Bronzor
|
||||
|
||||
// Others are capturable in the Alola region
|
||||
// Magnemite, Staryu, Tauros
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> Inherit_Apricorn7 = new(Inherit_Apricorn6.Concat(Inherit_ApricornMale7).Concat(PastGenAlolanScans).Concat(AlolanCaptureOffspring).Distinct());
|
||||
|
||||
internal static readonly HashSet<int> Inherit_SafariMale = new()
|
||||
{
|
||||
128, // Tauros
|
||||
|
||||
081, // Magnemite
|
||||
100, // Voltorb
|
||||
337, // Lunatone
|
||||
338, // Solrock
|
||||
374, // Beldum
|
||||
436, // Bronzor
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> Inherit_DreamMale = new()
|
||||
{
|
||||
// Starting with Gen7, Males pass Ball via breeding with Ditto.
|
||||
001, 004, 007, // Gen1 Starters
|
||||
025, // Pikachu
|
||||
128, // Tauros
|
||||
172, // Pichu
|
||||
236, // Tyrogue (100% Male)
|
||||
252, 255, 258, // Gen2 Starters
|
||||
387, 390, 393, // Gen3 Starters
|
||||
511, 513, 515, // Gen5 Monkeys
|
||||
538, // Throh
|
||||
539, // Sawk
|
||||
574, // Gothita
|
||||
|
||||
081, // Magnemite
|
||||
100, // Voltorb
|
||||
120, // Staryu
|
||||
137, // Porygon
|
||||
337, // Lunatone
|
||||
338, // Solrock
|
||||
343, // Baltoy
|
||||
374, // Beldum
|
||||
436, // Bronzor
|
||||
479, // Rotom
|
||||
599, // Klink
|
||||
622, // Golett
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> Ban_Gen3Ball_7 = new()
|
||||
{
|
||||
489, // Phione
|
||||
566, 567, 696, 697, 698, 699 // Fossil Only obtain
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> Ban_Gen4Ball_7 = new()
|
||||
{
|
||||
489, // Phione
|
||||
566, 567, 696, 697, 698, 699 // Fossil Only obtain
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> Ban_SafariBallHidden_7 = new()
|
||||
{
|
||||
029, 030, 031, 032, 033, 034, // Nidos
|
||||
313, 314, // Volbeat/Illumise
|
||||
|
||||
081, // Magnemite
|
||||
100, // Voltorb
|
||||
115, // Kangaskhan
|
||||
128, // Tauros
|
||||
132, // Ditto
|
||||
241, // Miltank
|
||||
374, // Beldum
|
||||
436, // Bronzor
|
||||
440, // Happiny
|
||||
|
||||
// others not possible
|
||||
236, // Tyrogue (100% Male)
|
||||
120, // Staryu
|
||||
337, // Lunatone
|
||||
338, // Solrock
|
||||
479, // Rotom
|
||||
599, // Klink
|
||||
622, // Golett
|
||||
};
|
||||
|
||||
internal static readonly int[] ZygardeMoves =
|
||||
{
|
||||
245, // Extreme Speed
|
||||
|
@ -550,53 +322,6 @@ namespace PKHeX.Core
|
|||
01, 01, 01, 05, 05, 10, 10, 10, 20, 10, 10, 10, 05, 05, 20, 10, 10, 10, 01, 05, 15, 05, 01, 01, 01, 01, 01, 01,
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> Ban_NoHidden7 = new()
|
||||
{
|
||||
// SOS slots have 0 call rate
|
||||
(int)Species.Wimpod,
|
||||
(int)Species.Golisopod,
|
||||
(int)Species.Komala,
|
||||
|
||||
// No Encounter
|
||||
(int)Species.Minior + (07 << 11),
|
||||
(int)Species.Minior + (08 << 11),
|
||||
(int)Species.Minior + (09 << 11),
|
||||
(int)Species.Minior + (10 << 11),
|
||||
(int)Species.Minior + (11 << 11),
|
||||
(int)Species.Minior + (12 << 11),
|
||||
(int)Species.Minior + (13 << 11),
|
||||
|
||||
// Previous-Gen
|
||||
(int)Species.Pumpkaboo + (1 << 11), // Small
|
||||
(int)Species.Gourgeist + (1 << 11), // Small
|
||||
(int)Species.Pumpkaboo + (2 << 11), // Large
|
||||
(int)Species.Gourgeist + (2 << 11), // Large
|
||||
|
||||
// Same abilities (1/2/H), not available as H
|
||||
(int)Species.Honedge,
|
||||
(int)Species.Doublade,
|
||||
(int)Species.Aegislash,
|
||||
(int)Species.Carnivine,
|
||||
(int)Species.Cryogonal,
|
||||
(int)Species.Archen,
|
||||
(int)Species.Archeops,
|
||||
(int)Species.Rotom,
|
||||
(int)Species.Rotom + (1 << 11),
|
||||
(int)Species.Rotom + (2 << 11),
|
||||
(int)Species.Rotom + (3 << 11),
|
||||
(int)Species.Rotom + (4 << 11),
|
||||
(int)Species.Rotom + (5 << 11),
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> Ban_NoHidden7Apricorn = new()
|
||||
{
|
||||
029, // Nidoran
|
||||
032, // Nidoran
|
||||
100, // Voltorb
|
||||
436, // Bronzor
|
||||
669 + (3 << 11), // Flabébé-Blue
|
||||
};
|
||||
|
||||
#region Unreleased Items
|
||||
internal static readonly HashSet<int> UnreleasedHeldItems_7 = new()
|
||||
{
|
||||
|
|
|
@ -15,11 +15,6 @@ namespace PKHeX.Core
|
|||
internal static readonly ushort[] HeldItems_GG = Array.Empty<ushort>();
|
||||
public const int AwakeningMax = 200;
|
||||
|
||||
internal static readonly HashSet<int> WildPokeballs7b = new()
|
||||
{
|
||||
(int)Ball.Master, (int)Ball.Ultra, (int)Ball.Great, (int)Ball.Poke, (int)Ball.Premier,
|
||||
};
|
||||
|
||||
#region Met Locations
|
||||
|
||||
internal static readonly int[] Met_GG_0 =
|
||||
|
|
|
@ -222,45 +222,6 @@ namespace PKHeX.Core
|
|||
|
||||
internal static readonly ushort[] HeldItems_SWSH = ArrayUtil.ConcatAll(Pouch_Items_SWSH, Pouch_Berries_SWSH, Pouch_Medicine_SWSH, TR_SWSH, Pouch_Treasure_SWSH, Pouch_Ingredients_SWSH);
|
||||
|
||||
internal static readonly HashSet<int> WildPokeballs8g = new()
|
||||
{
|
||||
(int)Ball.Ultra, (int)Ball.Great, (int)Ball.Poke, (int)Ball.Premier,
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> WildPokeballs8 = new()
|
||||
{
|
||||
(int)Ball.Poke,
|
||||
(int)Ball.Great,
|
||||
(int)Ball.Ultra,
|
||||
(int)Ball.Master,
|
||||
(int)Ball.Net,
|
||||
(int)Ball.Dive,
|
||||
(int)Ball.Nest,
|
||||
(int)Ball.Repeat,
|
||||
(int)Ball.Timer,
|
||||
(int)Ball.Luxury,
|
||||
(int)Ball.Premier,
|
||||
(int)Ball.Dusk,
|
||||
(int)Ball.Heal,
|
||||
(int)Ball.Quick,
|
||||
|
||||
// Ball Guy
|
||||
(int)Ball.Fast,
|
||||
(int)Ball.Level,
|
||||
(int)Ball.Lure,
|
||||
(int)Ball.Heavy,
|
||||
(int)Ball.Love,
|
||||
(int)Ball.Friend,
|
||||
(int)Ball.Moon,
|
||||
(int)Ball.Dream,
|
||||
(int)Ball.Beast,
|
||||
|
||||
// DLC 1 Additions
|
||||
(int)Ball.Safari,
|
||||
(int)Ball.Sport,
|
||||
// no cherish ball
|
||||
};
|
||||
|
||||
internal static readonly int[] Tutors_SWSH_1 =
|
||||
{
|
||||
805, 807, 812, 804,
|
||||
|
@ -385,17 +346,6 @@ namespace PKHeX.Core
|
|||
10, 05, 20, 20, 10, 10, 05, 05, 05, 40, 10, 20, 10, 10, 10, 10, 05, 05, 15, 05, 10, 10, 10, 05, 05, 05,
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> Ban_NoHidden8 = new(); // none as of DLC 1!
|
||||
|
||||
internal static readonly HashSet<int> Ban_NoHidden8Apricorn = new()
|
||||
{
|
||||
// 029, // Nidoran -- Used to not be encounterable in Gen7 with HA; Gen8 now can via Raids
|
||||
// 032, // Nidoran -- Used to not be encounterable in Gen7 with HA; Gen8 now can via Raids
|
||||
100, // Voltorb
|
||||
// 436, // Bronzor -- Used to not be encounterable in Gen7 with HA; Gen8 now can via Raids
|
||||
669 + (3 << 11), // Flabébé-Blue
|
||||
};
|
||||
|
||||
#region Unreleased Items
|
||||
internal static readonly HashSet<int> UnreleasedHeldItems_8 = new()
|
||||
{
|
||||
|
|
153
PKHeX.Core/Legality/Verifiers/Ability/AbilityBreedLegality.cs
Normal file
153
PKHeX.Core/Legality/Verifiers/Ability/AbilityBreedLegality.cs
Normal file
|
@ -0,0 +1,153 @@
|
|||
using System.Collections.Generic;
|
||||
using static PKHeX.Core.Species;
|
||||
|
||||
namespace PKHeX.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Tables used for <see cref="AbilityVerifier"/>
|
||||
/// </summary>
|
||||
internal static class AbilityBreedLegality
|
||||
{
|
||||
/// <summary>
|
||||
/// Species that cannot be bred with a Hidden Ability originating in <see cref="GameVersion.Gen5"/>
|
||||
/// </summary>
|
||||
internal static readonly HashSet<int> BanHidden5 = new()
|
||||
{
|
||||
// Only males distributed; unable to pass to offspring
|
||||
(int)Bulbasaur, (int)Charmander, (int)Squirtle,
|
||||
(int)Tauros,
|
||||
(int)Chikorita, (int)Cyndaquil, (int)Totodile,
|
||||
(int)Tyrogue,
|
||||
(int)Treecko, (int)Torchic, (int)Mudkip,
|
||||
(int)Turtwig, (int)Chimchar, (int)Piplup,
|
||||
(int)Pansage, (int)Pansear, (int)Panpour,
|
||||
(int)Gothita,
|
||||
|
||||
// Genderless; unable to pass to offspring
|
||||
(int)Magnemite,
|
||||
(int)Voltorb,
|
||||
(int)Staryu,
|
||||
(int)Ditto,
|
||||
(int)Porygon,
|
||||
(int)Beldum,
|
||||
(int)Bronzor,
|
||||
(int)Golett,
|
||||
|
||||
// Not available at all
|
||||
(int)Gastly,
|
||||
(int)Koffing,
|
||||
(int)Misdreavus,
|
||||
(int)Unown,
|
||||
(int)Slakoth,
|
||||
(int)Plusle,
|
||||
(int)Plusle,
|
||||
(int)Lunatone,
|
||||
(int)Solrock,
|
||||
(int)Baltoy,
|
||||
(int)Castform,
|
||||
(int)Kecleon,
|
||||
(int)Duskull,
|
||||
(int)Chimecho,
|
||||
(int)Cherubi,
|
||||
(int)Chingling,
|
||||
(int)Rotom,
|
||||
(int)Phione,
|
||||
(int)Snivy, (int)Tepig, (int)Oshawott,
|
||||
(int)Throh, (int)Sawk,
|
||||
(int)Sigilyph,
|
||||
(int)Yamask,
|
||||
(int)Archen,
|
||||
(int)Zorua,
|
||||
(int)Ferroseed,
|
||||
(int)Klink,
|
||||
(int)Tynamo,
|
||||
(int)Litwick,
|
||||
(int)Cryogonal,
|
||||
(int)Rufflet,
|
||||
(int)Deino,
|
||||
(int)Larvesta,
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Species that cannot be bred with a Hidden Ability originating in <see cref="GameVersion.Gen6"/>
|
||||
/// </summary>
|
||||
internal static readonly HashSet<int> BanHidden6 = new()
|
||||
{
|
||||
// Not available at Friend Safari or Horde Encounter
|
||||
(int)Flabébé + (2 << 11), // Orange
|
||||
(int)Flabébé + (4 << 11), // White
|
||||
|
||||
// Super Size can be obtained as a Pumpkaboo from event distributions
|
||||
(int)Pumpkaboo + (1 << 11), // Small
|
||||
(int)Pumpkaboo + (2 << 11), // Large
|
||||
|
||||
// Same abilities (1/2/H), not available as H
|
||||
(int)Honedge,
|
||||
(int)Carnivine,
|
||||
(int)Cryogonal,
|
||||
(int)Archen,
|
||||
(int)Rotom,
|
||||
(int)Rotom + (1 << 11),
|
||||
(int)Rotom + (2 << 11),
|
||||
(int)Rotom + (3 << 11),
|
||||
(int)Rotom + (4 << 11),
|
||||
(int)Rotom + (5 << 11),
|
||||
|
||||
(int)Castform,
|
||||
(int)Furfrou,
|
||||
(int)Furfrou + (1 << 11),
|
||||
(int)Furfrou + (2 << 11),
|
||||
(int)Furfrou + (3 << 11),
|
||||
(int)Furfrou + (4 << 11),
|
||||
(int)Furfrou + (5 << 11),
|
||||
(int)Furfrou + (6 << 11),
|
||||
(int)Furfrou + (7 << 11),
|
||||
(int)Furfrou + (8 << 11),
|
||||
(int)Furfrou + (9 << 11),
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Species that cannot be bred with a Hidden Ability originating in <see cref="GameVersion.Gen7"/>
|
||||
/// </summary>
|
||||
internal static readonly HashSet<int> BanHidden7 = new()
|
||||
{
|
||||
// SOS slots have 0 call rate
|
||||
(int)Wimpod,
|
||||
(int)Golisopod,
|
||||
(int)Komala,
|
||||
|
||||
// No Encounter
|
||||
(int)Minior + (07 << 11),
|
||||
(int)Minior + (08 << 11),
|
||||
(int)Minior + (09 << 11),
|
||||
(int)Minior + (10 << 11),
|
||||
(int)Minior + (11 << 11),
|
||||
(int)Minior + (12 << 11),
|
||||
(int)Minior + (13 << 11),
|
||||
|
||||
// Previous-Gen
|
||||
(int)Pumpkaboo + (1 << 11), // Small
|
||||
(int)Pumpkaboo + (2 << 11), // Large
|
||||
|
||||
// Same abilities (1/2/H), not available as H
|
||||
(int)Honedge,
|
||||
(int)Doublade,
|
||||
(int)Aegislash,
|
||||
(int)Carnivine,
|
||||
(int)Cryogonal,
|
||||
(int)Archen,
|
||||
(int)Archeops,
|
||||
(int)Rotom,
|
||||
(int)Rotom + (1 << 11),
|
||||
(int)Rotom + (2 << 11),
|
||||
(int)Rotom + (3 << 11),
|
||||
(int)Rotom + (4 << 11),
|
||||
(int)Rotom + (5 << 11),
|
||||
};
|
||||
|
||||
// <summary>
|
||||
// Species that cannot be bred with a Hidden Ability originating in <see cref="GameVersion.Gen8"/>
|
||||
// </summary>
|
||||
// internal static readonly HashSet<int> BanHidden8 = new(); // none as of DLC 1!
|
||||
}
|
||||
}
|
|
@ -281,7 +281,7 @@ namespace PKHeX.Core
|
|||
|
||||
case EncounterEgg e when pkm.AbilityNumber == 4:
|
||||
// Hidden Abilities for some are unbreedable or unreleased
|
||||
if (Legal.Ban_BreedHidden5.Contains(e.Species))
|
||||
if (AbilityBreedLegality.BanHidden5.Contains(e.Species))
|
||||
return GetInvalid(LAbilityHiddenUnavailable);
|
||||
break;
|
||||
}
|
||||
|
@ -302,7 +302,7 @@ namespace PKHeX.Core
|
|||
if (!valid)
|
||||
return GetInvalid(LAbilityMismatchHordeSafari);
|
||||
}
|
||||
if (Legal.Ban_NoHidden6.Contains(pkm.SpecForm))
|
||||
if (AbilityBreedLegality.BanHidden6.Contains(enc.Species | (enc.Form << 11)))
|
||||
return GetInvalid(LAbilityHiddenUnavailable);
|
||||
|
||||
return VALID;
|
||||
|
@ -317,7 +317,7 @@ namespace PKHeX.Core
|
|||
if (!valid)
|
||||
return GetInvalid(LAbilityMismatchSOS);
|
||||
}
|
||||
if (Legal.Ban_NoHidden7.Contains(pkm.SpecForm) && pkm.AbilityNumber == 4)
|
||||
if (AbilityBreedLegality.BanHidden7.Contains(enc.Species | (enc.Form << 11)) && pkm.AbilityNumber == 4)
|
||||
return GetInvalid(LAbilityHiddenUnavailable);
|
||||
|
||||
return VALID;
|
||||
|
@ -328,8 +328,8 @@ namespace PKHeX.Core
|
|||
var pkm = data.pkm;
|
||||
if (enc is EncounterSlot && pkm.AbilityNumber == 4)
|
||||
return GetInvalid(LAbilityHiddenUnavailable);
|
||||
if (Legal.Ban_NoHidden8.Contains(pkm.SpecForm) && pkm.AbilityNumber == 4)
|
||||
return GetInvalid(LAbilityHiddenUnavailable);
|
||||
//if (BreedLegality.Ban_NoHidden8.Contains(pkm.SpecForm) && pkm.AbilityNumber == 4)
|
||||
// return GetInvalid(LAbilityHiddenUnavailable);
|
||||
|
||||
return VALID;
|
||||
}
|
987
PKHeX.Core/Legality/Verifiers/Ball/BallBreedLegality.cs
Normal file
987
PKHeX.Core/Legality/Verifiers/Ball/BallBreedLegality.cs
Normal file
|
@ -0,0 +1,987 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using static PKHeX.Core.Species;
|
||||
|
||||
namespace PKHeX.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Tables used for <see cref="BallVerifier"/>
|
||||
/// </summary>
|
||||
internal static class BallBreedLegality
|
||||
{
|
||||
/// <summary>
|
||||
/// Species that are male only in Generation 6; for ball inheritance, these behave the same as Genderless species (no ball inherited).
|
||||
/// </summary>
|
||||
internal static readonly HashSet<int> BreedMaleOnly6 = new()
|
||||
{
|
||||
(int)Tauros,
|
||||
(int)Rufflet,
|
||||
(int)Braviary,
|
||||
(int)Tyrogue,
|
||||
(int)Sawk,
|
||||
(int)Throh,
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> PastGenAlolanNativesUncapturable = new()
|
||||
{
|
||||
// Porygon++
|
||||
(int)Porygon,
|
||||
// Gen1 Fossils
|
||||
(int)Aerodactyl, (int)Omanyte, (int)Kabuto,
|
||||
// Gen3 Fossils
|
||||
(int)Lileep, (int)Anorith,
|
||||
// Gen4 Fossils
|
||||
(int)Cranidos, (int)Shieldon,
|
||||
// Gen5 Fossils
|
||||
(int)Tirtouga, (int)Archen,
|
||||
// Gen6 Fossils
|
||||
(int)Tyrunt, (int)Amaura,
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> PastGenAlolanScans = new()
|
||||
{
|
||||
(int)Bellsprout,
|
||||
(int)Rhyhorn,
|
||||
(int)Horsea,
|
||||
(int)Chikorita,
|
||||
(int)Cyndaquil,
|
||||
(int)Totodile,
|
||||
(int)Swinub,
|
||||
(int)Spheal,
|
||||
(int)Venipede,
|
||||
(int)Gothita,
|
||||
(int)Klink,
|
||||
(int)Litwick,
|
||||
(int)Axew,
|
||||
(int)Deino,
|
||||
(int)Honedge,
|
||||
(int)Marill, (int)Azurill,
|
||||
(int)Roselia, (int)Budew,
|
||||
(int)Togepi,
|
||||
(int)Slakoth,
|
||||
(int)Starly,
|
||||
(int)Shinx,
|
||||
(int)Snivy,
|
||||
(int)Solosis,
|
||||
(int)Tepig,
|
||||
(int)Oshawott,
|
||||
(int)Timburr,
|
||||
(int)Sewaddle,
|
||||
(int)Tynamo,
|
||||
(int)Charmander,
|
||||
(int)Squirtle,
|
||||
(int)Onix,
|
||||
(int)Talonflame,
|
||||
(int)Scatterbug,
|
||||
(int)Bulbasaur,
|
||||
(int)Ralts,
|
||||
(int)Weedle,
|
||||
(int)Torchic,
|
||||
(int)Treecko,
|
||||
(int)Mudkip,
|
||||
(int)Piplup,
|
||||
(int)Turtwig,
|
||||
(int)Pidgey,
|
||||
(int)Chimchar,
|
||||
(int)Aron,
|
||||
(int)Rotom,
|
||||
(int)Chespin,
|
||||
(int)Fennekin,
|
||||
(int)Froakie,
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> Inherit_Sport = new()
|
||||
{
|
||||
(int)Caterpie,
|
||||
(int)Weedle,
|
||||
(int)Paras,
|
||||
(int)Venonat,
|
||||
(int)Scyther,
|
||||
(int)Pinsir,
|
||||
(int)Wurmple,
|
||||
(int)Nincada,
|
||||
(int)Illumise,
|
||||
(int)Kricketot,
|
||||
(int)Combee,
|
||||
(int)Volbeat,
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> Inherit_Safari = new()
|
||||
{
|
||||
(int)Pidgey,
|
||||
(int)Rattata,
|
||||
(int)Spearow,
|
||||
(int)Ekans,
|
||||
(int)Sandshrew,
|
||||
(int)NidoranF,
|
||||
(int)Zubat,
|
||||
(int)Oddish,
|
||||
(int)Paras,
|
||||
(int)Venonat,
|
||||
(int)Diglett,
|
||||
(int)Psyduck,
|
||||
(int)Poliwag,
|
||||
(int)Abra,
|
||||
(int)Machop,
|
||||
(int)Bellsprout,
|
||||
(int)Geodude,
|
||||
(int)Ponyta,
|
||||
(int)Slowpoke,
|
||||
(int)Farfetchd,
|
||||
(int)Doduo,
|
||||
(int)Grimer,
|
||||
(int)Gastly,
|
||||
(int)Onix,
|
||||
(int)Drowzee,
|
||||
(int)Krabby,
|
||||
(int)Exeggcute,
|
||||
(int)Cubone,
|
||||
(int)Lickitung,
|
||||
(int)Koffing,
|
||||
(int)Rhyhorn,
|
||||
(int)Chansey,
|
||||
(int)Tangela,
|
||||
(int)Kangaskhan,
|
||||
(int)Goldeen,
|
||||
(int)MrMime,
|
||||
(int)Scyther,
|
||||
(int)Pinsir,
|
||||
(int)Magikarp,
|
||||
(int)Lapras,
|
||||
(int)Dratini,
|
||||
(int)Sentret,
|
||||
(int)Hoothoot,
|
||||
(int)Ledyba,
|
||||
(int)Spinarak,
|
||||
(int)Natu,
|
||||
(int)Mareep,
|
||||
(int)Marill,
|
||||
(int)Hoppip,
|
||||
(int)Jumpluff,
|
||||
(int)Aipom,
|
||||
(int)Sunkern,
|
||||
(int)Yanma,
|
||||
(int)Wooper,
|
||||
(int)Murkrow,
|
||||
(int)Misdreavus,
|
||||
(int)Wobbuffet,
|
||||
(int)Girafarig,
|
||||
(int)Pineco,
|
||||
(int)Gligar,
|
||||
(int)Snubbull,
|
||||
(int)Shuckle,
|
||||
(int)Heracross,
|
||||
(int)Teddiursa,
|
||||
(int)Remoraid,
|
||||
(int)Houndour,
|
||||
(int)Phanpy,
|
||||
(int)Stantler,
|
||||
(int)Smeargle,
|
||||
(int)Miltank,
|
||||
(int)Larvitar,
|
||||
(int)Zigzagoon,
|
||||
(int)Linoone,
|
||||
(int)Lotad,
|
||||
(int)Seedot,
|
||||
(int)Surskit,
|
||||
(int)Shroomish,
|
||||
(int)Slakoth,
|
||||
(int)Nosepass,
|
||||
(int)Aron,
|
||||
(int)Lairon,
|
||||
(int)Meditite,
|
||||
(int)Electrike,
|
||||
(int)Illumise,
|
||||
(int)Roselia,
|
||||
(int)Gulpin,
|
||||
(int)Carvanha,
|
||||
(int)Torkoal,
|
||||
(int)Spinda,
|
||||
(int)Trapinch,
|
||||
(int)Cacnea,
|
||||
(int)Zangoose,
|
||||
(int)Seviper,
|
||||
(int)Barboach,
|
||||
(int)Corphish,
|
||||
(int)Kecleon,
|
||||
(int)Shuppet,
|
||||
(int)Duskull,
|
||||
(int)Tropius,
|
||||
(int)Chimecho,
|
||||
(int)Spheal,
|
||||
(int)Bagon,
|
||||
(int)Starly,
|
||||
(int)Bidoof,
|
||||
(int)Shinx,
|
||||
(int)Budew,
|
||||
(int)Pachirisu,
|
||||
(int)Buizel,
|
||||
(int)Chingling,
|
||||
(int)Gible,
|
||||
(int)Riolu,
|
||||
(int)Hippopotas,
|
||||
(int)Skorupi,
|
||||
(int)Croagunk,
|
||||
(int)Carnivine,
|
||||
|
||||
// Splitbreed/Baby
|
||||
(int)NidoranM, // Via Nidoran-F
|
||||
(int)Volbeat, // Via Illumise
|
||||
(int)Pichu,
|
||||
(int)Cleffa,
|
||||
(int)Igglybuff,
|
||||
(int)Elekid,
|
||||
(int)Magby,
|
||||
(int)Azurill,
|
||||
(int)Wynaut,
|
||||
(int)Budew,
|
||||
(int)Chingling,
|
||||
(int)MimeJr,
|
||||
(int)Happiny,
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> Inherit_Dream = new()
|
||||
{
|
||||
(int)Caterpie,
|
||||
(int)Weedle,
|
||||
(int)Pidgey,
|
||||
(int)Rattata,
|
||||
(int)Spearow,
|
||||
(int)Ekans,
|
||||
(int)Sandshrew,
|
||||
(int)NidoranF,
|
||||
(int)Vulpix,
|
||||
(int)Zubat,
|
||||
(int)Oddish,
|
||||
(int)Paras,
|
||||
(int)Venonat,
|
||||
(int)Diglett,
|
||||
(int)Meowth,
|
||||
(int)Psyduck,
|
||||
(int)Mankey,
|
||||
(int)Growlithe,
|
||||
(int)Poliwag,
|
||||
(int)Abra,
|
||||
(int)Machop,
|
||||
(int)Bellsprout,
|
||||
(int)Tentacool,
|
||||
(int)Geodude,
|
||||
(int)Ponyta,
|
||||
(int)Slowpoke,
|
||||
(int)Farfetchd,
|
||||
(int)Doduo,
|
||||
(int)Seel,
|
||||
(int)Grimer,
|
||||
(int)Shellder,
|
||||
(int)Gastly,
|
||||
(int)Onix,
|
||||
(int)Drowzee,
|
||||
(int)Krabby,
|
||||
(int)Exeggcute,
|
||||
(int)Cubone,
|
||||
(int)Lickitung,
|
||||
(int)Koffing,
|
||||
(int)Rhyhorn,
|
||||
(int)Chansey,
|
||||
(int)Tangela,
|
||||
(int)Kangaskhan,
|
||||
(int)Horsea,
|
||||
(int)Goldeen,
|
||||
(int)MrMime,
|
||||
(int)Scyther,
|
||||
(int)Pinsir,
|
||||
(int)Magikarp,
|
||||
(int)Lapras,
|
||||
(int)Eevee,
|
||||
(int)Omanyte,
|
||||
(int)Kabuto,
|
||||
(int)Aerodactyl,
|
||||
(int)Snorlax,
|
||||
(int)Dratini,
|
||||
(int)Sentret,
|
||||
(int)Hoothoot,
|
||||
(int)Ledyba,
|
||||
(int)Spinarak,
|
||||
(int)Chinchou,
|
||||
(int)Cleffa,
|
||||
(int)Igglybuff,
|
||||
(int)Togepi,
|
||||
(int)Natu,
|
||||
(int)Mareep,
|
||||
(int)Marill,
|
||||
(int)Sudowoodo,
|
||||
(int)Hoppip,
|
||||
(int)Aipom,
|
||||
(int)Sunkern,
|
||||
(int)Yanma,
|
||||
(int)Wooper,
|
||||
(int)Murkrow,
|
||||
(int)Misdreavus,
|
||||
(int)Wobbuffet,
|
||||
(int)Girafarig,
|
||||
(int)Pineco,
|
||||
(int)Dunsparce,
|
||||
(int)Gligar,
|
||||
(int)Snubbull,
|
||||
(int)Qwilfish,
|
||||
(int)Shuckle,
|
||||
(int)Heracross,
|
||||
(int)Sneasel,
|
||||
(int)Teddiursa,
|
||||
(int)Slugma,
|
||||
(int)Swinub,
|
||||
(int)Corsola,
|
||||
(int)Remoraid,
|
||||
(int)Delibird,
|
||||
(int)Mantine,
|
||||
(int)Skarmory,
|
||||
(int)Houndour,
|
||||
(int)Phanpy,
|
||||
(int)Stantler,
|
||||
(int)Smeargle,
|
||||
(int)Smoochum,
|
||||
(int)Elekid,
|
||||
(int)Magby,
|
||||
(int)Miltank,
|
||||
(int)Larvitar,
|
||||
(int)Poochyena,
|
||||
(int)Zigzagoon,
|
||||
(int)Wurmple,
|
||||
(int)Lotad,
|
||||
(int)Seedot,
|
||||
(int)Taillow,
|
||||
(int)Wingull,
|
||||
(int)Ralts,
|
||||
(int)Surskit,
|
||||
(int)Shroomish,
|
||||
(int)Slakoth,
|
||||
(int)Nincada,
|
||||
(int)Whismur,
|
||||
(int)Makuhita,
|
||||
(int)Nosepass,
|
||||
(int)Skitty,
|
||||
(int)Sableye,
|
||||
(int)Mawile,
|
||||
(int)Aron,
|
||||
(int)Meditite,
|
||||
(int)Electrike,
|
||||
(int)Plusle,
|
||||
(int)Minun,
|
||||
(int)Illumise,
|
||||
(int)Roselia,
|
||||
(int)Gulpin,
|
||||
(int)Carvanha,
|
||||
(int)Wailmer,
|
||||
(int)Numel,
|
||||
(int)Torkoal,
|
||||
(int)Spoink,
|
||||
(int)Spinda,
|
||||
(int)Trapinch,
|
||||
(int)Cacnea,
|
||||
(int)Swablu,
|
||||
(int)Zangoose,
|
||||
(int)Seviper,
|
||||
(int)Barboach,
|
||||
(int)Corphish,
|
||||
(int)Lileep,
|
||||
(int)Anorith,
|
||||
(int)Feebas,
|
||||
(int)Castform,
|
||||
(int)Kecleon,
|
||||
(int)Shuppet,
|
||||
(int)Duskull,
|
||||
(int)Tropius,
|
||||
(int)Chimecho,
|
||||
(int)Absol,
|
||||
(int)Snorunt,
|
||||
(int)Spheal,
|
||||
(int)Clamperl,
|
||||
(int)Relicanth,
|
||||
(int)Luvdisc,
|
||||
(int)Bagon,
|
||||
(int)Starly,
|
||||
(int)Bidoof,
|
||||
(int)Kricketot,
|
||||
(int)Shinx,
|
||||
(int)Cranidos,
|
||||
(int)Shieldon,
|
||||
(int)Burmy,
|
||||
(int)Combee,
|
||||
(int)Pachirisu,
|
||||
(int)Buizel,
|
||||
(int)Cherubi,
|
||||
(int)Shellos,
|
||||
(int)Drifloon,
|
||||
(int)Buneary,
|
||||
(int)Glameow,
|
||||
(int)Stunky,
|
||||
(int)Chatot,
|
||||
(int)Spiritomb,
|
||||
(int)Gible,
|
||||
(int)Riolu,
|
||||
(int)Hippopotas,
|
||||
(int)Skorupi,
|
||||
(int)Croagunk,
|
||||
(int)Carnivine,
|
||||
(int)Finneon,
|
||||
(int)Snover,
|
||||
(int)Munna,
|
||||
(int)Pidove,
|
||||
(int)Boldore,
|
||||
(int)Drilbur,
|
||||
(int)Audino,
|
||||
(int)Gurdurr,
|
||||
(int)Tympole,
|
||||
(int)Scolipede,
|
||||
(int)Cottonee,
|
||||
(int)Petilil,
|
||||
(int)Basculin,
|
||||
(int)Krookodile,
|
||||
(int)Maractus,
|
||||
(int)Crustle,
|
||||
(int)Scraggy,
|
||||
(int)Sigilyph,
|
||||
(int)Tirtouga,
|
||||
(int)Duosion,
|
||||
(int)Ducklett,
|
||||
(int)Vanillish,
|
||||
(int)Emolga,
|
||||
(int)Karrablast,
|
||||
(int)Alomomola,
|
||||
(int)Galvantula,
|
||||
(int)Elgyem,
|
||||
(int)Axew,
|
||||
(int)Shelmet,
|
||||
(int)Stunfisk,
|
||||
(int)Druddigon,
|
||||
(int)Pawniard,
|
||||
(int)Heatmor,
|
||||
(int)Durant,
|
||||
(int)NidoranM, // Via Nidoran-F
|
||||
(int)Volbeat, // Via Illumise
|
||||
|
||||
// Via Evolution
|
||||
(int)Roggenrola,
|
||||
(int)Timburr,
|
||||
(int)Venipede,
|
||||
(int)Sandile,
|
||||
(int)Dwebble,
|
||||
(int)Solosis,
|
||||
(int)Vanillite,
|
||||
(int)Joltik,
|
||||
|
||||
// Via Incense Breeding
|
||||
(int)Azurill,
|
||||
(int)Wynaut,
|
||||
(int)Budew,
|
||||
(int)Chingling,
|
||||
(int)Bonsly,
|
||||
(int)MimeJr,
|
||||
(int)Happiny,
|
||||
(int)Munchlax,
|
||||
(int)Mantyke,
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> Ban_DreamHidden = new()
|
||||
{
|
||||
(int)Plusle,
|
||||
(int)Minun,
|
||||
(int)Kecleon,
|
||||
(int)Duskull,
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> Ban_Gen3Ball = new()
|
||||
{
|
||||
(int)Treecko, (int)Torchic, (int)Mudkip,
|
||||
(int)Turtwig, (int)Chimchar, (int)Piplup,
|
||||
(int)Snivy, (int)Tepig, (int)Oshawott,
|
||||
|
||||
// Fossil Only obtain
|
||||
(int)Archen, (int)Tyrunt, (int)Amaura,
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> Ban_Gen3BallHidden = new()
|
||||
{
|
||||
// can have HA and can be in gen 3 ball as eggs but can not at same time.
|
||||
(int)Chikorita, (int)Cyndaquil, (int)Totodile,
|
||||
(int)Deerling + (1 << 11), //Deerling-Summer
|
||||
(int)Deerling + (2 << 11), //Deerling-Autumn
|
||||
(int)Deerling + (3 << 11), //Deerling-Winter
|
||||
(int)Pumpkaboo + (3 << 11), //Pumpkaboo-Super
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> Ban_Gen4Ball_6 = new()
|
||||
{
|
||||
(int)Chikorita, (int)Cyndaquil, (int)Totodile,
|
||||
(int)Treecko, (int)Torchic, (int)Mudkip,
|
||||
(int)Turtwig, (int)Chimchar, (int)Piplup,
|
||||
(int)Snivy, (int)Tepig, (int)Oshawott,
|
||||
|
||||
// Fossil Only obtain
|
||||
(int)Archen, (int)Tyrunt, (int)Amaura,
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> Inherit_Apricorn6 = new()
|
||||
{
|
||||
(int)Caterpie,
|
||||
(int)Weedle,
|
||||
(int)Pidgey,
|
||||
(int)Rattata,
|
||||
(int)Spearow,
|
||||
(int)Ekans,
|
||||
(int)Sandshrew,
|
||||
(int)NidoranF,
|
||||
(int)Vulpix,
|
||||
(int)Zubat,
|
||||
(int)Oddish,
|
||||
(int)Paras,
|
||||
(int)Venonat,
|
||||
(int)Diglett,
|
||||
(int)Meowth,
|
||||
(int)Psyduck,
|
||||
(int)Mankey,
|
||||
(int)Growlithe,
|
||||
(int)Poliwag,
|
||||
(int)Abra,
|
||||
(int)Machop,
|
||||
(int)Bellsprout,
|
||||
(int)Tentacool,
|
||||
(int)Geodude,
|
||||
(int)Ponyta,
|
||||
(int)Slowpoke,
|
||||
(int)Farfetchd,
|
||||
(int)Doduo,
|
||||
(int)Seel,
|
||||
(int)Grimer,
|
||||
(int)Shellder,
|
||||
(int)Gastly,
|
||||
(int)Onix,
|
||||
(int)Drowzee,
|
||||
(int)Krabby,
|
||||
(int)Exeggcute,
|
||||
(int)Cubone,
|
||||
(int)Lickitung,
|
||||
(int)Koffing,
|
||||
(int)Rhyhorn,
|
||||
(int)Chansey,
|
||||
(int)Tangela,
|
||||
(int)Kangaskhan,
|
||||
(int)Horsea,
|
||||
(int)Goldeen,
|
||||
(int)MrMime,
|
||||
(int)Magikarp,
|
||||
(int)Lapras,
|
||||
(int)Snorlax,
|
||||
(int)Dratini,
|
||||
(int)Sentret,
|
||||
(int)Hoothoot,
|
||||
(int)Ledyba,
|
||||
(int)Spinarak,
|
||||
(int)Chinchou,
|
||||
(int)Natu,
|
||||
(int)Mareep,
|
||||
(int)Marill,
|
||||
(int)Sudowoodo,
|
||||
(int)Hoppip,
|
||||
(int)Aipom,
|
||||
(int)Sunkern,
|
||||
(int)Yanma,
|
||||
(int)Wooper,
|
||||
(int)Murkrow,
|
||||
(int)Misdreavus,
|
||||
(int)Wobbuffet,
|
||||
(int)Girafarig,
|
||||
(int)Pineco,
|
||||
(int)Dunsparce,
|
||||
(int)Gligar,
|
||||
(int)Snubbull,
|
||||
(int)Qwilfish,
|
||||
(int)Shuckle,
|
||||
(int)Heracross,
|
||||
(int)Sneasel,
|
||||
(int)Teddiursa,
|
||||
(int)Slugma,
|
||||
(int)Swinub,
|
||||
(int)Corsola,
|
||||
(int)Remoraid,
|
||||
(int)Delibird,
|
||||
(int)Mantine,
|
||||
(int)Skarmory,
|
||||
(int)Houndour,
|
||||
(int)Phanpy,
|
||||
(int)Stantler,
|
||||
(int)Smeargle,
|
||||
(int)Miltank,
|
||||
(int)Larvitar,
|
||||
(int)Poochyena,
|
||||
(int)Zigzagoon,
|
||||
(int)Wurmple,
|
||||
(int)Seedot,
|
||||
(int)Taillow,
|
||||
(int)Wingull,
|
||||
(int)Ralts,
|
||||
(int)Shroomish,
|
||||
(int)Slakoth,
|
||||
(int)Whismur,
|
||||
(int)Makuhita,
|
||||
(int)Sableye,
|
||||
(int)Mawile,
|
||||
(int)Meditite,
|
||||
(int)Plusle,
|
||||
(int)Minun,
|
||||
(int)Gulpin,
|
||||
(int)Numel,
|
||||
(int)Spoink,
|
||||
(int)Spinda,
|
||||
(int)Swablu,
|
||||
(int)Barboach,
|
||||
(int)Absol,
|
||||
(int)Clamperl,
|
||||
(int)Relicanth,
|
||||
(int)Luvdisc,
|
||||
(int)Starly,
|
||||
(int)Bidoof,
|
||||
(int)Kricketot,
|
||||
(int)Shinx,
|
||||
(int)Budew,
|
||||
(int)Burmy,
|
||||
(int)Combee,
|
||||
(int)Buizel,
|
||||
(int)Cherubi,
|
||||
(int)Buneary,
|
||||
(int)Chingling,
|
||||
(int)Chatot,
|
||||
(int)Carnivine,
|
||||
(int)NidoranM, // Via Nidoran-F
|
||||
(int)Happiny, // Via Chansey
|
||||
(int)Smoochum, // Via Jynx
|
||||
(int)Elekid, // Via Electabuzz
|
||||
(int)Magby, // Via Magmar
|
||||
(int)Azurill, // Via Marill
|
||||
(int)Wynaut, // Via Wobbuffet
|
||||
(int)Bonsly, // Via Sudowoodo
|
||||
(int)MimeJr, // Via Mr. Mime
|
||||
(int)Munchlax, // Via Snorlax
|
||||
(int)Mantyke, // Via Mantine
|
||||
(int)Chimecho, // Via Chingling
|
||||
(int)Pichu, // Via Pikachu
|
||||
(int)Cleffa, // Via Clefairy
|
||||
(int)Igglybuff, // Via Jigglypuff
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> AlolanCaptureOffspring = new()
|
||||
{
|
||||
(int)Caterpie,
|
||||
(int)Rattata,
|
||||
(int)Spearow,
|
||||
(int)Sandshrew,
|
||||
(int)Vulpix,
|
||||
(int)Jigglypuff,
|
||||
(int)Zubat,
|
||||
(int)Paras,
|
||||
(int)Diglett,
|
||||
(int)Meowth,
|
||||
(int)Psyduck,
|
||||
(int)Mankey,
|
||||
(int)Growlithe,
|
||||
(int)Poliwag,
|
||||
(int)Abra,
|
||||
(int)Machop,
|
||||
(int)Tentacool,
|
||||
(int)Geodude,
|
||||
(int)Slowpoke,
|
||||
(int)Magnemite,
|
||||
(int)Grimer,
|
||||
(int)Shellder,
|
||||
(int)Gastly,
|
||||
(int)Drowzee,
|
||||
(int)Exeggcute,
|
||||
(int)Cubone,
|
||||
(int)Chansey,
|
||||
(int)Kangaskhan,
|
||||
(int)Goldeen,
|
||||
(int)Staryu,
|
||||
(int)Scyther,
|
||||
(int)Pinsir,
|
||||
(int)Tauros,
|
||||
(int)Magikarp,
|
||||
(int)Lapras,
|
||||
(int)Ditto,
|
||||
(int)Eevee,
|
||||
(int)Snorlax,
|
||||
(int)Dratini,
|
||||
(int)Ledyba,
|
||||
(int)Spinarak,
|
||||
(int)Chinchou,
|
||||
(int)Pichu,
|
||||
(int)Cleffa,
|
||||
(int)Igglybuff,
|
||||
(int)Sudowoodo,
|
||||
(int)Murkrow,
|
||||
(int)Misdreavus,
|
||||
(int)Snubbull,
|
||||
(int)Scizor,
|
||||
(int)Sneasel,
|
||||
(int)Corsola,
|
||||
(int)Delibird,
|
||||
(int)Skarmory,
|
||||
(int)Smeargle,
|
||||
(int)Elekid,
|
||||
(int)Magby,
|
||||
(int)Miltank,
|
||||
(int)Wingull,
|
||||
(int)Surskit,
|
||||
(int)Makuhita,
|
||||
(int)Nosepass,
|
||||
(int)Sableye,
|
||||
(int)Carvanha,
|
||||
(int)Wailmer,
|
||||
(int)Torkoal,
|
||||
(int)Spinda,
|
||||
(int)Trapinch,
|
||||
(int)Barboach,
|
||||
(int)Feebas,
|
||||
(int)Castform,
|
||||
(int)Absol,
|
||||
(int)Snorunt,
|
||||
(int)Relicanth,
|
||||
(int)Luvdisc,
|
||||
(int)Bagon,
|
||||
(int)Beldum,
|
||||
(int)Shellos,
|
||||
(int)Drifloon,
|
||||
(int)Bonsly,
|
||||
(int)Happiny,
|
||||
(int)Gible,
|
||||
(int)Munchlax,
|
||||
(int)Riolu,
|
||||
(int)Finneon,
|
||||
(int)Lillipup,
|
||||
(int)Roggenrola,
|
||||
(int)Cottonee,
|
||||
(int)Petilil,
|
||||
(int)Sandile,
|
||||
(int)Trubbish,
|
||||
(int)Vanillite,
|
||||
(int)Emolga,
|
||||
(int)Alomomola,
|
||||
(int)Rufflet,
|
||||
(int)Vullaby,
|
||||
(int)Fletchling,
|
||||
(int)Pancham,
|
||||
(int)Carbink,
|
||||
(int)Goomy,
|
||||
(int)Klefki,
|
||||
(int)Phantump,
|
||||
(int)Pikipek,
|
||||
(int)Yungoos,
|
||||
(int)Grubbin,
|
||||
(int)Crabrawler,
|
||||
(int)Oricorio,
|
||||
(int)Cutiefly,
|
||||
(int)Rockruff,
|
||||
(int)Wishiwashi,
|
||||
(int)Mareanie,
|
||||
(int)Mudbray,
|
||||
(int)Dewpider,
|
||||
(int)Fomantis,
|
||||
(int)Morelull,
|
||||
(int)Salandit,
|
||||
(int)Stufful,
|
||||
(int)Bounsweet,
|
||||
(int)Comfey,
|
||||
(int)Oranguru,
|
||||
(int)Passimian,
|
||||
(int)Wimpod,
|
||||
(int)Sandygast,
|
||||
(int)Pyukumuku,
|
||||
(int)Minior,
|
||||
(int)Komala,
|
||||
(int)Turtonator,
|
||||
(int)Togedemaru,
|
||||
(int)Mimikyu,
|
||||
(int)Bruxish,
|
||||
(int)Drampa,
|
||||
(int)Dhelmise,
|
||||
(int)Jangmoo,
|
||||
|
||||
// USUM Additions
|
||||
(int)Ekans,
|
||||
(int)Seel,
|
||||
(int)Lickitung,
|
||||
(int)MrMime,
|
||||
(int)Hoothoot,
|
||||
(int)Natu,
|
||||
(int)Mareep,
|
||||
(int)Aipom,
|
||||
(int)Pineco,
|
||||
(int)Dunsparce,
|
||||
(int)Heracross,
|
||||
(int)Remoraid,
|
||||
(int)Mantine,
|
||||
(int)Houndour,
|
||||
(int)Smoochum,
|
||||
(int)Larvitar,
|
||||
(int)Mawile,
|
||||
(int)Electrike,
|
||||
(int)Corphish,
|
||||
(int)Baltoy,
|
||||
(int)Kecleon,
|
||||
(int)Shuppet,
|
||||
(int)Tropius,
|
||||
(int)Clamperl,
|
||||
(int)Buneary,
|
||||
(int)MimeJr,
|
||||
(int)Mantyke,
|
||||
(int)Basculin,
|
||||
(int)Scraggy,
|
||||
(int)Zorua,
|
||||
(int)Minccino,
|
||||
(int)Frillish,
|
||||
(int)Elgyem,
|
||||
(int)Mienfoo,
|
||||
(int)Druddigon,
|
||||
(int)Golett,
|
||||
(int)Pawniard,
|
||||
(int)Larvesta,
|
||||
(int)Litleo,
|
||||
(int)Flabébé,
|
||||
(int)Furfrou,
|
||||
(int)Inkay,
|
||||
(int)Skrelp,
|
||||
(int)Clauncher,
|
||||
(int)Hawlucha,
|
||||
(int)Dedenne,
|
||||
(int)Noibat,
|
||||
|
||||
// Wormhole
|
||||
(int)Swablu,
|
||||
(int)Yanma,
|
||||
(int)Sigilyph,
|
||||
(int)Ducklett,
|
||||
(int)Taillow,
|
||||
(int)Skorupi,
|
||||
(int)Audino,
|
||||
(int)Helioptile,
|
||||
(int)Seedot,
|
||||
(int)Spoink,
|
||||
(int)Snover,
|
||||
(int)Meditite,
|
||||
(int)Hippopotas,
|
||||
(int)Dwebble,
|
||||
(int)Slugma,
|
||||
(int)Binacle,
|
||||
(int)Lotad,
|
||||
(int)Stunfisk,
|
||||
(int)Buizel,
|
||||
(int)Wooper,
|
||||
|
||||
// Static Encounters
|
||||
(int)Voltorb,
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> Ban_NoHidden7Apricorn = new()
|
||||
{
|
||||
(int)NidoranF,
|
||||
(int)NidoranM,
|
||||
(int)Voltorb,
|
||||
(int)Bronzor,
|
||||
(int)Flabébé + (3 << 11), // Flabébé-Blue
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> AlolanCaptureNoHeavyBall = new() { (int)Beldum, (int)TapuKoko, (int)TapuLele, (int)TapuBulu, (int)TapuFini, };
|
||||
|
||||
private static readonly HashSet<int> Inherit_ApricornMale7 = new()
|
||||
{
|
||||
(int)Voltorb,
|
||||
(int)Baltoy,
|
||||
(int)Bronzor,
|
||||
|
||||
// Others are capturable in the Alola region
|
||||
// Magnemite, Staryu, Tauros
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> Inherit_Apricorn7 = new(Inherit_Apricorn6.Concat(Inherit_ApricornMale7).Concat(PastGenAlolanScans).Concat(AlolanCaptureOffspring).Distinct());
|
||||
|
||||
internal static readonly HashSet<int> Inherit_SafariMale = new()
|
||||
{
|
||||
(int)Tauros,
|
||||
|
||||
(int)Magnemite,
|
||||
(int)Voltorb,
|
||||
(int)Lunatone,
|
||||
(int)Solrock,
|
||||
(int)Beldum,
|
||||
(int)Bronzor,
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> Inherit_DreamMale = new()
|
||||
{
|
||||
// Starting with Gen7, Males pass Ball via breeding with Ditto.
|
||||
(int)Bulbasaur, (int)Charmander, (int)Squirtle,
|
||||
(int)Tauros,
|
||||
(int)Pichu,
|
||||
(int)Tyrogue,
|
||||
(int)Treecko,
|
||||
(int)Torchic, (int)Mudkip, (int)Turtwig,
|
||||
(int)Chimchar, (int)Piplup, (int)Pansage,
|
||||
(int)Pansear, (int)Panpour,
|
||||
(int)Throh, (int)Sawk,
|
||||
(int)Gothita,
|
||||
|
||||
(int)Magnemite,
|
||||
(int)Voltorb,
|
||||
(int)Staryu,
|
||||
(int)Porygon,
|
||||
(int)Lunatone,
|
||||
(int)Solrock,
|
||||
(int)Baltoy,
|
||||
(int)Beldum,
|
||||
(int)Bronzor,
|
||||
(int)Rotom,
|
||||
(int)Klink,
|
||||
(int)Golett,
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> Ban_Gen3Ball_7 = new()
|
||||
{
|
||||
(int)Phione,
|
||||
(int)Archen,
|
||||
(int)Tyrunt,
|
||||
(int)Amaura,
|
||||
};
|
||||
|
||||
// Same as Gen3 Balls
|
||||
internal static readonly HashSet<int> Ban_Gen4Ball_7 = Ban_Gen3Ball_7;
|
||||
|
||||
internal static readonly HashSet<int> Ban_SafariBallHidden_7 = new()
|
||||
{
|
||||
(int)NidoranF,
|
||||
(int)NidoranM,
|
||||
(int)Volbeat, (int)Illumise,
|
||||
(int)Magnemite,
|
||||
(int)Voltorb,
|
||||
(int)Kangaskhan,
|
||||
(int)Tauros,
|
||||
(int)Ditto,
|
||||
(int)Miltank,
|
||||
(int)Beldum,
|
||||
(int)Bronzor,
|
||||
(int)Happiny,
|
||||
(int)Tyrogue,
|
||||
(int)Staryu,
|
||||
(int)Lunatone,
|
||||
(int)Solrock,
|
||||
(int)Rotom,
|
||||
(int)Klink,
|
||||
(int)Golett,
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> Ban_NoHidden8Apricorn = new()
|
||||
{
|
||||
// Nidoran, Bronzor -- Used to not be encounterable in Gen7 with HA; Gen8 now can via Raids
|
||||
(int)Voltorb, // Voltorb
|
||||
(int)Flabébé + (3 << 11), // Flabébé-Blue
|
||||
};
|
||||
}
|
||||
}
|
69
PKHeX.Core/Legality/Verifiers/Ball/BallUseLegality.cs
Normal file
69
PKHeX.Core/Legality/Verifiers/Ball/BallUseLegality.cs
Normal file
|
@ -0,0 +1,69 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using static PKHeX.Core.Ball;
|
||||
|
||||
namespace PKHeX.Core
|
||||
{
|
||||
internal static class BallUseLegality
|
||||
{
|
||||
internal static ICollection<int> GetWildBalls(int generation, GameVersion game) => generation switch
|
||||
{
|
||||
1 => WildPokeBalls1,
|
||||
2 => WildPokeBalls2,
|
||||
3 => WildPokeBalls3,
|
||||
4 => GameVersion.HGSS.Contains(game) ? WildPokeBalls4_HGSS : WildPokeBalls4_DPPt,
|
||||
5 => WildPokeBalls5,
|
||||
6 => WildPokeballs6,
|
||||
7 => GameVersion.Gen7b.Contains(game) ? WildPokeballs7b : WildPokeballs7,
|
||||
8 => GameVersion.GO == game ? WildPokeballs8g : WildPokeballs8,
|
||||
_ => Array.Empty<int>()
|
||||
};
|
||||
|
||||
private static readonly int[] WildPokeBalls1 = { 4 };
|
||||
private static readonly int[] WildPokeBalls2 = WildPokeBalls1;
|
||||
|
||||
private static readonly HashSet<int> WildPokeBalls3 = new()
|
||||
{
|
||||
(int)Master, (int)Ultra, (int)Great, (int)Poke, (int)Net, (int)Dive,
|
||||
(int)Nest, (int)Repeat, (int)Timer, (int)Luxury, (int)Premier,
|
||||
};
|
||||
|
||||
private static readonly HashSet<int> WildPokeBalls4_DPPt = new(WildPokeBalls3)
|
||||
{
|
||||
(int)Dusk, (int)Heal, (int)Quick,
|
||||
};
|
||||
|
||||
private static readonly HashSet<int> WildPokeBalls4_HGSS = new(WildPokeBalls4_DPPt)
|
||||
{
|
||||
(int)Fast, (int)Level, (int)Lure, (int)Heavy, (int)Love, (int)Friend, (int)Moon,
|
||||
};
|
||||
|
||||
private static readonly HashSet<int> WildPokeBalls5 = WildPokeBalls4_DPPt;
|
||||
|
||||
internal static readonly HashSet<int> DreamWorldBalls = new(WildPokeBalls5) {(int)Dream};
|
||||
|
||||
internal static readonly HashSet<int> WildPokeballs6 = WildPokeBalls5; // Same as Gen5
|
||||
|
||||
internal static readonly HashSet<int> WildPokeballs7 = new(WildPokeBalls4_HGSS) {(int)Beast}; // Same as HGSS + Beast
|
||||
|
||||
private static readonly HashSet<int> WildPokeballs7b = new()
|
||||
{
|
||||
(int)Master, (int)Ultra, (int)Great, (int)Poke,
|
||||
(int)Premier,
|
||||
};
|
||||
|
||||
private static readonly HashSet<int> WildPokeballs8g = new()
|
||||
{
|
||||
(int)Ultra, (int)Great, (int)Poke,
|
||||
(int)Premier,
|
||||
};
|
||||
|
||||
internal static readonly HashSet<int> WildPokeballs8 = new(WildPokeballs7) // All Except Cherish
|
||||
{
|
||||
(int)Dream,
|
||||
(int)Safari,
|
||||
(int)Sport,
|
||||
// no cherish ball
|
||||
};
|
||||
}
|
||||
}
|
|
@ -49,7 +49,7 @@ namespace PKHeX.Core
|
|||
return VerifyBallEquals(data, (int)Poke); // Pokeball Only
|
||||
}
|
||||
|
||||
if (pkm.Ball == (int)Heavy && Legal.AlolanCaptureNoHeavyBall.Contains(EncounterMatch.Species) && !EncounterMatch.EggEncounter && pkm.SM)
|
||||
if (pkm.Ball == (int)Heavy && BallBreedLegality.AlolanCaptureNoHeavyBall.Contains(EncounterMatch.Species) && !EncounterMatch.EggEncounter && pkm.SM)
|
||||
return GetInvalid(LBallHeavy); // Heavy Ball, can inherit if from egg (USUM fixed catch rate calc)
|
||||
|
||||
return EncounterMatch switch
|
||||
|
@ -72,8 +72,8 @@ namespace PKHeX.Core
|
|||
private CheckResult VerifyBallStatic(LegalityAnalysis data, EncounterStatic s)
|
||||
{
|
||||
if (s.Location == 75 && s.Generation == 5) // Entree Forest (Dream World)
|
||||
return VerifyBallEquals(data, Legal.DreamWorldBalls);
|
||||
return VerifyBallEquals(data, Legal.GetWildBalls(data.Info.Generation, data.Info.Game));
|
||||
return VerifyBallEquals(data, BallUseLegality.DreamWorldBalls);
|
||||
return VerifyBallEquals(data, BallUseLegality.GetWildBalls(data.Info.Generation, data.Info.Game));
|
||||
}
|
||||
|
||||
private CheckResult VerifyBallWild(LegalityAnalysis data, EncounterSlot w)
|
||||
|
@ -82,7 +82,7 @@ namespace PKHeX.Core
|
|||
if (req != None)
|
||||
return VerifyBallEquals(data, (int) req);
|
||||
|
||||
return VerifyBallEquals(data, Legal.GetWildBalls(data.Info.Generation, data.Info.Game));
|
||||
return VerifyBallEquals(data, BallUseLegality.GetWildBalls(data.Info.Generation, data.Info.Game));
|
||||
}
|
||||
|
||||
private CheckResult VerifyBallEgg(LegalityAnalysis data)
|
||||
|
@ -111,15 +111,16 @@ namespace PKHeX.Core
|
|||
private CheckResult VerifyBallEggGen6(LegalityAnalysis data)
|
||||
{
|
||||
var pkm = data.pkm;
|
||||
int species = data.EncounterMatch.Species;
|
||||
if (pkm.Gender == 2 || Legal.BreedMaleOnly6.Contains(species)) // Genderless
|
||||
var enc = data.EncounterMatch;
|
||||
int species = enc.Species;
|
||||
if (pkm.Gender == 2 || BallBreedLegality.BreedMaleOnly6.Contains(species)) // Genderless
|
||||
return VerifyBallEquals(data, (int)Poke); // Must be Pokéball as ball can only pass via mother (not Ditto!)
|
||||
|
||||
Ball ball = (Ball)pkm.Ball;
|
||||
|
||||
if (ball == Safari) // Safari Ball
|
||||
{
|
||||
if (!Legal.Inherit_Safari.Contains(species))
|
||||
if (!BallBreedLegality.Inherit_Safari.Contains(species))
|
||||
return GetInvalid(LBallSpecies);
|
||||
if (IsHiddenAndNotPossible(pkm))
|
||||
return GetInvalid(LBallAbility);
|
||||
|
@ -127,7 +128,7 @@ namespace PKHeX.Core
|
|||
}
|
||||
if (ball.IsApricornBall()) // Apricorn Ball
|
||||
{
|
||||
if (!Legal.Inherit_Apricorn6.Contains(species))
|
||||
if (!BallBreedLegality.Inherit_Apricorn6.Contains(species))
|
||||
return GetInvalid(LBallSpecies);
|
||||
if (IsHiddenAndNotPossible(pkm))
|
||||
return GetInvalid(LBallAbility);
|
||||
|
@ -135,7 +136,7 @@ namespace PKHeX.Core
|
|||
}
|
||||
if (ball == Sport) // Sport Ball
|
||||
{
|
||||
if (!Legal.Inherit_Sport.Contains(species))
|
||||
if (!BallBreedLegality.Inherit_Sport.Contains(species))
|
||||
return GetInvalid(LBallSpecies);
|
||||
if (IsHiddenAndNotPossible(pkm))
|
||||
return GetInvalid(LBallAbility);
|
||||
|
@ -143,30 +144,30 @@ namespace PKHeX.Core
|
|||
}
|
||||
if (ball == Dream) // Dream Ball
|
||||
{
|
||||
if (Legal.Ban_DreamHidden.Contains(species) && IsHiddenAndNotPossible(pkm))
|
||||
if (BallBreedLegality.Ban_DreamHidden.Contains(species) && IsHiddenAndNotPossible(pkm))
|
||||
return GetInvalid(LBallAbility);
|
||||
if (Legal.Inherit_Dream.Contains(species))
|
||||
if (BallBreedLegality.Inherit_Dream.Contains(species))
|
||||
return GetValid(LBallSpeciesPass);
|
||||
return GetInvalid(LBallSpecies);
|
||||
}
|
||||
if (Dusk <= ball && ball <= Quick) // Dusk Heal Quick
|
||||
{
|
||||
if (!Legal.Ban_Gen4Ball_6.Contains(species))
|
||||
if (!BallBreedLegality.Ban_Gen4Ball_6.Contains(species))
|
||||
return GetValid(LBallSpeciesPass);
|
||||
return GetInvalid(LBallSpecies);
|
||||
}
|
||||
if (Ultra <= ball && ball <= Premier) // Don't worry, Safari was already checked.
|
||||
{
|
||||
if (Legal.Ban_Gen3Ball.Contains(species))
|
||||
if (BallBreedLegality.Ban_Gen3Ball.Contains(species))
|
||||
return GetInvalid(LBallSpecies);
|
||||
if (Legal.Ban_Gen3BallHidden.Contains(pkm.SpecForm) && IsHiddenAndNotPossible(pkm))
|
||||
if (BallBreedLegality.Ban_Gen3BallHidden.Contains(species | (enc.Form << 11)) && IsHiddenAndNotPossible(pkm))
|
||||
return GetInvalid(LBallAbility);
|
||||
return GetValid(LBallSpeciesPass);
|
||||
}
|
||||
|
||||
if (species > 650 && species != 700) // Sylveon
|
||||
{
|
||||
if (Legal.WildPokeballs6.Contains(pkm.Ball))
|
||||
if (BallUseLegality.WildPokeballs6.Contains(pkm.Ball))
|
||||
return GetValid(LBallSpeciesPass);
|
||||
return GetInvalid(LBallSpecies);
|
||||
}
|
||||
|
@ -188,23 +189,23 @@ namespace PKHeX.Core
|
|||
|
||||
if (ball == Safari)
|
||||
{
|
||||
if (!(Legal.Inherit_Safari.Contains(species) || Legal.Inherit_SafariMale.Contains(species)))
|
||||
if (!(BallBreedLegality.Inherit_Safari.Contains(species) || BallBreedLegality.Inherit_SafariMale.Contains(species)))
|
||||
return GetInvalid(LBallSpecies);
|
||||
if (Legal.Ban_SafariBallHidden_7.Contains(species) && IsHiddenAndNotPossible(pkm))
|
||||
if (BallBreedLegality.Ban_SafariBallHidden_7.Contains(species) && IsHiddenAndNotPossible(pkm))
|
||||
return GetInvalid(LBallAbility);
|
||||
return GetValid(LBallSpeciesPass);
|
||||
}
|
||||
if (ball.IsApricornBall()) // Apricorn Ball
|
||||
{
|
||||
if (!Legal.Inherit_Apricorn7.Contains(species))
|
||||
if (!BallBreedLegality.Inherit_Apricorn7.Contains(species))
|
||||
return GetInvalid(LBallSpecies);
|
||||
if (Legal.Ban_NoHidden7Apricorn.Contains(species | pkm.Form << 11) && IsHiddenAndNotPossible(pkm))
|
||||
if (BallBreedLegality.Ban_NoHidden7Apricorn.Contains(species | pkm.Form << 11) && IsHiddenAndNotPossible(pkm))
|
||||
return GetInvalid(LBallAbility);
|
||||
return GetValid(LBallSpeciesPass);
|
||||
}
|
||||
if (ball == Sport) // Sport Ball
|
||||
{
|
||||
if (!Legal.Inherit_Sport.Contains(species))
|
||||
if (!BallBreedLegality.Inherit_Sport.Contains(species))
|
||||
return GetInvalid(LBallSpecies);
|
||||
if ((species is (int)Species.Volbeat or (int)Species.Illumise) && IsHiddenAndNotPossible(pkm)) // Volbeat/Illumise
|
||||
return GetInvalid(LBallAbility);
|
||||
|
@ -212,19 +213,19 @@ namespace PKHeX.Core
|
|||
}
|
||||
if (ball == Dream) // Dream Ball
|
||||
{
|
||||
if (Legal.Inherit_Dream.Contains(species) || Legal.Inherit_DreamMale.Contains(species))
|
||||
if (BallBreedLegality.Inherit_Dream.Contains(species) || BallBreedLegality.Inherit_DreamMale.Contains(species))
|
||||
return GetValid(LBallSpeciesPass);
|
||||
return GetInvalid(LBallSpecies);
|
||||
}
|
||||
if (Dusk <= ball && ball <= Quick) // Dusk Heal Quick
|
||||
{
|
||||
if (!Legal.Ban_Gen4Ball_7.Contains(species))
|
||||
if (!BallBreedLegality.Ban_Gen4Ball_7.Contains(species))
|
||||
return GetValid(LBallSpeciesPass);
|
||||
return GetInvalid(LBallSpecies);
|
||||
}
|
||||
if (Ultra <= ball && ball <= Premier) // Don't worry, Safari was already checked.
|
||||
{
|
||||
if (!Legal.Ban_Gen3Ball_7.Contains(species))
|
||||
if (!BallBreedLegality.Ban_Gen3Ball_7.Contains(species))
|
||||
return GetValid(LBallSpeciesPass);
|
||||
return GetInvalid(LBallSpecies);
|
||||
}
|
||||
|
@ -235,15 +236,15 @@ namespace PKHeX.Core
|
|||
return GetInvalid(LBallAbility); // Can't obtain Flabébé-Blue with Hidden Ability in wild
|
||||
if (species == (int)Species.Voltorb && IsHiddenAndNotPossible(pkm))
|
||||
return GetInvalid(LBallAbility); // Can't obtain with Hidden Ability in wild (can only breed with Ditto)
|
||||
if (((int)Species.Pikipek <= species && species <= (int)Species.Kommoo) || (Legal.AlolanCaptureOffspring.Contains(species) && !Legal.PastGenAlolanNativesUncapturable.Contains(species)))
|
||||
if (((int)Species.Pikipek <= species && species <= (int)Species.Kommoo) || (BallBreedLegality.AlolanCaptureOffspring.Contains(species) && !BallBreedLegality.PastGenAlolanNativesUncapturable.Contains(species)))
|
||||
return GetValid(LBallSpeciesPass);
|
||||
if (Legal.PastGenAlolanScans.Contains(species))
|
||||
if (BallBreedLegality.PastGenAlolanScans.Contains(species))
|
||||
return GetValid(LBallSpeciesPass);
|
||||
// next statement catches all new alolans
|
||||
}
|
||||
|
||||
if (species > (int)Species.Volcanion)
|
||||
return VerifyBallEquals(data, Legal.WildPokeballs7);
|
||||
return VerifyBallEquals(data, BallUseLegality.WildPokeballs7);
|
||||
|
||||
if (ball > Beast)
|
||||
return GetInvalid(LBallUnavailable);
|
||||
|
@ -262,7 +263,7 @@ namespace PKHeX.Core
|
|||
|
||||
if (IsGalarCatchAndBreed(species))
|
||||
{
|
||||
if (Legal.WildPokeballs8.Contains(pkm.Ball))
|
||||
if (BallUseLegality.WildPokeballs8.Contains(pkm.Ball))
|
||||
return GetValid(LBallSpeciesPass);
|
||||
if (species >= (int)Species.Grookey)
|
||||
return GetInvalid(LBallSpecies);
|
||||
|
@ -272,23 +273,23 @@ namespace PKHeX.Core
|
|||
|
||||
if (ball == Safari)
|
||||
{
|
||||
if (!(Legal.Inherit_Safari.Contains(species) || Legal.Inherit_SafariMale.Contains(species)))
|
||||
if (!(BallBreedLegality.Inherit_Safari.Contains(species) || BallBreedLegality.Inherit_SafariMale.Contains(species)))
|
||||
return GetInvalid(LBallSpecies);
|
||||
if (Legal.Ban_SafariBallHidden_7.Contains(species) && IsHiddenAndNotPossible(pkm))
|
||||
if (BallBreedLegality.Ban_SafariBallHidden_7.Contains(species) && IsHiddenAndNotPossible(pkm))
|
||||
return GetInvalid(LBallAbility);
|
||||
return GetValid(LBallSpeciesPass);
|
||||
}
|
||||
if (ball.IsApricornBall()) // Apricorn Ball
|
||||
{
|
||||
if (!Legal.Inherit_Apricorn7.Contains(species))
|
||||
if (!BallBreedLegality.Inherit_Apricorn7.Contains(species))
|
||||
return GetInvalid(LBallSpecies);
|
||||
if (Legal.Ban_NoHidden8Apricorn.Contains(species | pkm.Form << 11) && IsHiddenAndNotPossible(pkm)) // lineage is 3->2->origin
|
||||
if (BallBreedLegality.Ban_NoHidden8Apricorn.Contains(species | pkm.Form << 11) && IsHiddenAndNotPossible(pkm)) // lineage is 3->2->origin
|
||||
return GetInvalid(LBallAbility);
|
||||
return GetValid(LBallSpeciesPass);
|
||||
}
|
||||
if (ball == Sport) // Sport Ball
|
||||
{
|
||||
if (!Legal.Inherit_Sport.Contains(species))
|
||||
if (!BallBreedLegality.Inherit_Sport.Contains(species))
|
||||
return GetInvalid(LBallSpecies);
|
||||
if ((species is (int)Species.Volbeat or (int)Species.Illumise) && IsHiddenAndNotPossible(pkm)) // Volbeat/Illumise
|
||||
return GetInvalid(LBallAbility);
|
||||
|
@ -296,19 +297,19 @@ namespace PKHeX.Core
|
|||
}
|
||||
if (ball == Dream) // Dream Ball
|
||||
{
|
||||
if (Legal.Inherit_Dream.Contains(species) || Legal.Inherit_DreamMale.Contains(species))
|
||||
if (BallBreedLegality.Inherit_Dream.Contains(species) || BallBreedLegality.Inherit_DreamMale.Contains(species))
|
||||
return GetValid(LBallSpeciesPass);
|
||||
return GetInvalid(LBallSpecies);
|
||||
}
|
||||
if (Dusk <= ball && ball <= Quick) // Dusk Heal Quick
|
||||
{
|
||||
if (!Legal.Ban_Gen4Ball_7.Contains(species))
|
||||
if (!BallBreedLegality.Ban_Gen4Ball_7.Contains(species))
|
||||
return GetValid(LBallSpeciesPass);
|
||||
return GetInvalid(LBallSpecies);
|
||||
}
|
||||
if (Ultra <= ball && ball <= Premier) // Don't worry, Safari was already checked.
|
||||
{
|
||||
if (!Legal.Ban_Gen3Ball_7.Contains(species))
|
||||
if (!BallBreedLegality.Ban_Gen3Ball_7.Contains(species))
|
||||
return GetValid(LBallSpeciesPass);
|
||||
return GetInvalid(LBallSpecies);
|
||||
}
|
||||
|
@ -317,18 +318,18 @@ namespace PKHeX.Core
|
|||
{
|
||||
if (species == (int)Species.Flabébé && pkm.Form == 3 && IsHiddenAndNotPossible(pkm))
|
||||
return GetInvalid(LBallAbility); // Can't obtain Flabébé-Blue with Hidden Ability in wild
|
||||
if (((int)Species.Pikipek <= species && species <= (int)Species.Kommoo) || (Legal.AlolanCaptureOffspring.Contains(species) && !Legal.PastGenAlolanNativesUncapturable.Contains(species)))
|
||||
if (((int)Species.Pikipek <= species && species <= (int)Species.Kommoo) || (BallBreedLegality.AlolanCaptureOffspring.Contains(species) && !BallBreedLegality.PastGenAlolanNativesUncapturable.Contains(species)))
|
||||
return GetValid(LBallSpeciesPass);
|
||||
if (Legal.PastGenAlolanScans.Contains(species))
|
||||
if (BallBreedLegality.PastGenAlolanScans.Contains(species))
|
||||
return GetValid(LBallSpeciesPass);
|
||||
// next statement catches all new alolans
|
||||
}
|
||||
|
||||
if (species > Legal.MaxSpeciesID_7_USUM)
|
||||
return VerifyBallEquals(data, Legal.WildPokeballs8);
|
||||
return VerifyBallEquals(data, BallUseLegality.WildPokeballs8);
|
||||
|
||||
if (species > (int)Species.Volcanion)
|
||||
return VerifyBallEquals(data, Legal.WildPokeballs7);
|
||||
return VerifyBallEquals(data, BallUseLegality.WildPokeballs7);
|
||||
|
||||
if (ball > Beast)
|
||||
return GetInvalid(LBallUnavailable);
|
|
@ -201,9 +201,7 @@ namespace PKHeX.Core
|
|||
break;
|
||||
}
|
||||
|
||||
int abil = 2; // Hidden
|
||||
if (Legal.TransferSpeciesDefaultAbility_1.Contains(Species))
|
||||
abil = 0; // Reset
|
||||
int abil = Legal.TransferSpeciesDefaultAbilityGen1(Species) ? 0 : 2; // Hidden
|
||||
pk7.RefreshAbility(abil); // 0/1/2 (not 1/2/4)
|
||||
|
||||
if (Species == (int)Core.Species.Mew) // Mew gets special treatment.
|
||||
|
|
|
@ -191,9 +191,7 @@ namespace PKHeX.Core
|
|||
break;
|
||||
}
|
||||
|
||||
int abil = 2; // Hidden
|
||||
if (Legal.TransferSpeciesDefaultAbility_2.Contains(Species))
|
||||
abil = 0; // Reset
|
||||
int abil = Legal.TransferSpeciesDefaultAbilityGen2(Species) ? 0 : 2; // Hidden
|
||||
pk7.RefreshAbility(abil); // 0/1/2 (not 1/2/4)
|
||||
|
||||
if (special)
|
||||
|
|
Loading…
Add table
Reference in a new issue