mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-27 06:20:25 +00:00
Revise rotom form check
This commit is contained in:
parent
98707b466c
commit
84be9da49d
3 changed files with 7 additions and 6 deletions
|
@ -139,13 +139,14 @@ public static class Breeding
|
|||
/// <param name="game">Game of origin</param>
|
||||
public static bool CanHatchAsEgg(ushort species, byte form, GameVersion game)
|
||||
{
|
||||
// Sanity check form for origin
|
||||
// If form cannot change, then it must be able to originate in the game.
|
||||
var pt = GameData.GetPersonal(game);
|
||||
if (!pt.IsPresentInGame(species, form))
|
||||
return false;
|
||||
if (pt.IsPresentInGame(species, form))
|
||||
return true;
|
||||
|
||||
var entry = pt.GetFormEntry(species, form);
|
||||
return form < entry.FormCount || (species == (int)Rotom && form <= 5);
|
||||
// Only way it can not exist is if it can change form.
|
||||
// The only species that can do this is D/P Rotom, being changed in a future game.
|
||||
return species is (int)Rotom && form <= 5 && game is D or P;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Binary file not shown.
Loading…
Reference in a new issue