mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-09-07 01:06:25 -05:00
Handle banned form eggs with more flexibility
Closes #2519 better to not generate the encounter as opposed to flagging it after generation
This commit is contained in:
@@ -24,8 +24,8 @@ public static IEnumerable<EncounterEgg> GenerateEggs(PKM pkm, IReadOnlyList<EvoC
|
||||
int gen = pkm.GenNumber;
|
||||
if (gen <= 1)
|
||||
yield break; // can't get eggs
|
||||
if (FormConverter.IsTotemForm(species, pkm.AltForm, gen))
|
||||
yield break; // no totem eggs
|
||||
if (NoHatchFromEggForm(species, pkm.AltForm, gen))
|
||||
yield break; // can't originate from eggs
|
||||
|
||||
// version is a true indicator for all generation 3-5 origins
|
||||
var ver = (GameVersion)pkm.Version;
|
||||
@@ -52,6 +52,15 @@ public static IEnumerable<EncounterEgg> GenerateEggs(PKM pkm, IReadOnlyList<EvoC
|
||||
}
|
||||
}
|
||||
|
||||
private static bool NoHatchFromEggForm(int species, int form, int gen)
|
||||
{
|
||||
if (FormConverter.IsTotemForm(species, form, gen))
|
||||
return true;
|
||||
if ((species == (int) Species.Sinistea || species == (int) Species.Polteageist) && form != 0) // Chipped = impossible
|
||||
return true; // can't get Chipped eggs
|
||||
return false;
|
||||
}
|
||||
|
||||
// Gen6+ update the origin game when hatched. Quick manip for X.Y<->A.O | S.M<->US.UM, ie X->A
|
||||
private static GameVersion GetOtherTradePair(GameVersion ver)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user