From 5e6b2f43c2e4599f04f42a1f2d3d6adfca7dd077 Mon Sep 17 00:00:00 2001 From: Kurt Date: Tue, 14 Nov 2017 08:43:04 -0800 Subject: [PATCH] Update wild/egg generators for totem cases so wonky edge cases --- PKHeX.Core/Legality/Encounters/EncounterGenerator.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/PKHeX.Core/Legality/Encounters/EncounterGenerator.cs b/PKHeX.Core/Legality/Encounters/EncounterGenerator.cs index 12e545e24..89ceee034 100644 --- a/PKHeX.Core/Legality/Encounters/EncounterGenerator.cs +++ b/PKHeX.Core/Legality/Encounters/EncounterGenerator.cs @@ -626,7 +626,7 @@ private static IEnumerable GetFilteredSlots67(PKM pkm, IReadOnlyC if (AlolanVariantEvolutions12.Contains(species)) // match form if same species, else form 0. slotdata = encounterSlots.Where(slot => species == slot.Species ? slot.Form == form : slot.Form == 0); - else if (WildForms.Contains(species) || AlolanOriginForms.Contains(species)) // match slot form + else if (ShouldMatchSlotForm()) // match slot form slotdata = encounterSlots.Where(slot => slot.Form == form); else slotdata = encounterSlots; // no form checking @@ -645,13 +645,15 @@ private static IEnumerable GetFilteredSlots67(PKM pkm, IReadOnlyC if (species == slotMax.Species ? slotMax.Form == form : slotMax.Form == 0) yield return GetPressureSlot(slotMax, pkm); } - else if (WildForms.Contains(species) || AlolanOriginForms.Contains(species)) // match slot form + else if (ShouldMatchSlotForm()) // match slot form { if (slotMax.Form == form) yield return GetPressureSlot(slotMax, pkm); } else yield return GetPressureSlot(slotMax, pkm); + + bool ShouldMatchSlotForm() => WildForms.Contains(species) || AlolanOriginForms.Contains(species) || FormConverter.IsTotemForm(species, form); } private static IEnumerable GetFilteredSlots6DexNav(PKM pkm, int lvl, IReadOnlyCollection encounterSlots, int fluteBoost) { @@ -1351,6 +1353,8 @@ private static IEnumerable GenerateEggs(PKM pkm) { if (NoHatchFromEgg.Contains(pkm.Species)) yield break; + if (FormConverter.IsTotemForm(pkm.Species, pkm.AltForm, pkm.GenNumber)) + yield break; // no totem eggs int gen = pkm.GenNumber; // version is a true indicator for all generation 3-5 origins