Add formarg deferral for wild annihilape/kingambit

Closes #4167
Also add form bypass for Gen6 Deerling slot that changed form in SV.
This commit is contained in:
Kurt 2024-01-22 18:51:55 -08:00
parent 560320e2cc
commit 6d2de333bf
6 changed files with 18 additions and 1 deletions

View file

@ -127,7 +127,14 @@ public sealed record EncounterSlot6AO(EncounterArea6AO Parent, ushort Species, b
return false;
if (evo.Form != Form && !IsRandomUnspecificForm)
return false;
{
if (Species is not ((ushort)Core.Species.Deerling or (ushort)Core.Species.Sawsbuck))
return false;
// Deerling can change between forms if imported to a future Gen8+ game.
if (pk.Format < 8 || evo.Form >= 4)
return false;
}
return true;
}

View file

@ -238,7 +238,17 @@ public sealed record EncounterSlot9(EncounterArea9 Parent, ushort Species, byte
if (m.RibbonMarkDawn && !CanSpawnAtTime(RibbonIndex.MarkDawn))
return EncounterMatchRating.DeferredErrors;
}
if (IsFormArgDeferralRelevant(pk.Species) && pk is IFormArgument f)
{
bool isFormArg0 = f.FormArgument == 0;
bool mustBeZero = IsFormArgDeferralRelevant(Species);
if (isFormArg0 != mustBeZero)
return EncounterMatchRating.DeferredErrors;
}
return EncounterMatchRating.Match;
static bool IsFormArgDeferralRelevant(ushort species) => species is (ushort)Core.Species.Kingambit or (ushort)Core.Species.Annihilape;
}
#endregion
}