mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-10 06:34:19 +00:00
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:
parent
560320e2cc
commit
6d2de333bf
6 changed files with 18 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in a new issue