Inline form changeable species lists

This commit is contained in:
Kurt 2021-09-07 15:35:36 -07:00
parent 1d00e17217
commit 91c7c28c6f
5 changed files with 19 additions and 9 deletions

View File

@ -77,8 +77,12 @@ private IEnumerable<EncounterSlot4> GetSlotsMatching(IReadOnlyList<EvoCriteria>
if (slot.Species != evo.Species)
continue;
if (slot.Form != evo.Form && !FormInfo.WildChangeFormAfter.Contains(slot.Species) && slot.Species != (int)Species.Unown)
break;
if (slot.Form != evo.Form && slot.Species is not (int)Species.Burmy)
{
// Unown forms are random, not specific form IDs
if (!slot.IsRandomUnspecificForm)
break;
}
if (!slot.IsLevelWithinRange(lvl))
break;
@ -88,6 +92,7 @@ private IEnumerable<EncounterSlot4> GetSlotsMatching(IReadOnlyList<EvoCriteria>
}
}
// original met level cannot be inferred
private IEnumerable<EncounterSlot4> GetSlotsFuzzy(IReadOnlyList<EvoCriteria> chain)
{
foreach (var slot in Slots)
@ -97,8 +102,12 @@ private IEnumerable<EncounterSlot4> GetSlotsFuzzy(IReadOnlyList<EvoCriteria> cha
if (slot.Species != evo.Species)
continue;
if (slot.Form != evo.Form && !FormInfo.WildChangeFormAfter.Contains(slot.Species) && slot.Species != (int)Species.Unown)
break;
if (slot.Form != evo.Form && slot.Species is not (int)Species.Burmy)
{
// Unown forms are random, not specific form IDs
if (!slot.IsRandomUnspecificForm)
break;
}
if (slot.LevelMin > evo.Level)
break;

View File

@ -60,7 +60,7 @@ public override IEnumerable<EncounterSlot> GetMatchingSlots(PKM pkm, IReadOnlyLi
if (!slot.IsLevelWithinRange(pkm.Met_Level))
break;
if (slot.Form != evo.Form && !FormInfo.WildChangeFormAfter.Contains(slot.Species))
if (slot.Form != evo.Form) // no wild forms can change
break;
yield return slot;

View File

@ -113,8 +113,9 @@ public override IEnumerable<EncounterSlot> GetMatchingSlots(PKM pkm, IReadOnlyLi
if (!slot.IsLevelWithinRange(pkm.Met_Level))
break;
if (slot.Form != evo.Form && !slot.IsRandomUnspecificForm && !FormInfo.WildChangeFormAfter.Contains(slot.Species))
if (slot.Form != evo.Form && !slot.IsRandomUnspecificForm && slot.Species is not ((int)Species.Burmy or (int)Species.Furfrou))
{
// Only slot that can be form-mismatched via Pressure is Flabébé
if (slot.Species != (int)Species.Flabébé)
break;

View File

@ -60,7 +60,7 @@ public override IEnumerable<EncounterSlot> GetMatchingSlots(PKM pkm, IReadOnlyLi
if (!slot.IsLevelWithinRange(pkm.Met_Level))
break;
if (slot.Form != evo.Form && !FormInfo.WildChangeFormAfter.Contains(slot.Species))
if (slot.Form != evo.Form && slot.Species is not ((int)Species.Furfrou or (int)Species.Oricorio))
{
if (!slot.IsRandomUnspecificForm) // Minior, etc
break;

View File

@ -62,7 +62,7 @@ private IEnumerable<EncounterSlot8> GetUnboostedMatches(IReadOnlyList<EvoCriteri
if (!slot.IsLevelWithinRange(metLevel))
break;
if (slot.Form != evo.Form && !FormInfo.WildChangeFormAfter.Contains(evo.Species))
if (slot.Form != evo.Form && slot.Species is not (int)Species.Rotom)
break;
if (slot.Weather is Heavy_Fog && IsWildArea8(Location))
@ -90,7 +90,7 @@ private IEnumerable<EncounterSlot8> GetBoostedMatches(IReadOnlyList<EvoCriteria>
if (slot.LevelMin > BoostLevel)
break; // Can't downlevel, only boost to 60.
if (slot.Form != evo.Form && !FormInfo.WildChangeFormAfter.Contains(evo.Species))
if (slot.Form != evo.Form && slot.Species is not (int)Species.Rotom)
break;
if (Location != metLocation && !CanCrossoverTo(Location, metLocation, slot.SlotType))