Add location to gen 3 gift egg, legal analysis adapted to ignore gen 3 gift eggs encounters if the pokemon is hatched

Is impossible to differentiated gen 3 normal eggs to gift eggs after hatched, assume normal egg.
In the case of pokemon box eggs with special moves those moves should be analyzed separately and check the pokemon legal moves with both possible origins: normal egg and box egg
This commit is contained in:
javierhimura
2017-03-20 12:45:28 +01:00
parent 6eb7e1b195
commit d4fb002f11
2 changed files with 11 additions and 3 deletions

View File

@@ -579,7 +579,15 @@ internal static EncounterStatic getValidStaticEncounter(PKM pkm, GameVersion gam
{
if (e.Nature != Nature.Random && pkm.Nature != (int)e.Nature)
continue;
if (e.EggLocation != pkm.Egg_Location)
if(pkm.Gen3 && e.EggLocation != 0)
{
//Hartched gen 3 gift egg can not be differentiated form normal eggs
if (!pkm.IsEgg || pkm.Format > 3)
continue;
if (e.EggLocation != pkm.Met_Location)
continue;
}
else if (e.EggLocation != pkm.Egg_Location)
continue;
if (pkm.HasOriginalMetLocation)
{

View File

@@ -160,7 +160,7 @@ public static partial class Legal
//Gift
new EncounterStatic { Gift = true, Species = 351, Level = 25, Location = 034, }, // Castform @ Weather Institute
new EncounterStatic { Gift = true, Species = 374, Level = 5, Location = 013, }, // Beldum @ Mossdeep City
new EncounterStatic { Gift = true, Species = 360, Level = 5, }, // Wynaut Egg
new EncounterStatic { Gift = true, Species = 360, Level = 5, EggLocation = 253}, // Wynaut Egg
//Stationary
new EncounterStatic { Species = 352, Level = 30, Location = 034, }, //Kecleon @ Route 119
@@ -213,7 +213,7 @@ public static partial class Legal
new EncounterStatic { Gift = true, Species = 129, Level = 5, Location = 099, }, // Magikarp @ Route 4
new EncounterStatic { Gift = true, Species = 131, Level = 25, Location = 134, }, // Lapras @ Silph Co.
new EncounterStatic { Gift = true, Species = 133, Level = 25, Location = 094, }, // Eevee @ Celadon City
new EncounterStatic { Gift = true, Species = 175, Level = 5, }, // Togepi Egg
new EncounterStatic { Gift = true, Species = 175, Level = 5, EggLocation = 253 }, // Togepi Egg
//Stationary
new EncounterStatic { Species = 143, Level = 30, Location = 112, }, //Snorlax @ Route 12