diff --git a/PKHeX.Core/Legality/Encounters/Templates/Gen6/EncounterSlot6AO.cs b/PKHeX.Core/Legality/Encounters/Templates/Gen6/EncounterSlot6AO.cs index 320ef92c0..0c863964e 100644 --- a/PKHeX.Core/Legality/Encounters/Templates/Gen6/EncounterSlot6AO.cs +++ b/PKHeX.Core/Legality/Encounters/Templates/Gen6/EncounterSlot6AO.cs @@ -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; } diff --git a/PKHeX.Core/Legality/Encounters/Templates/Gen9/EncounterSlot9.cs b/PKHeX.Core/Legality/Encounters/Templates/Gen9/EncounterSlot9.cs index ebc974a4b..c3a053a85 100644 --- a/PKHeX.Core/Legality/Encounters/Templates/Gen9/EncounterSlot9.cs +++ b/PKHeX.Core/Legality/Encounters/Templates/Gen9/EncounterSlot9.cs @@ -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 } diff --git a/Tests/PKHeX.Core.Tests/Legality/Legal/Generation 9/0585-01 ★ - Deerling - 11D0C90A7F2F pk6 formchange.pk9 b/Tests/PKHeX.Core.Tests/Legality/Legal/Generation 9/0585-01 ★ - Deerling - 11D0C90A7F2F pk6 formchange.pk9 new file mode 100644 index 000000000..7944c585a Binary files /dev/null and b/Tests/PKHeX.Core.Tests/Legality/Legal/Generation 9/0585-01 ★ - Deerling - 11D0C90A7F2F pk6 formchange.pk9 differ diff --git a/Tests/PKHeX.Core.Tests/Legality/Legal/Generation 9/FormArg/0979 - Second Wind - F595DB8A1056.pk9 b/Tests/PKHeX.Core.Tests/Legality/Legal/Generation 9/FormArg/0979 - Second Wind - F595DB8A1056.pk9 new file mode 100644 index 000000000..dd7f47cc1 Binary files /dev/null and b/Tests/PKHeX.Core.Tests/Legality/Legal/Generation 9/FormArg/0979 - Second Wind - F595DB8A1056.pk9 differ diff --git a/Tests/PKHeX.Core.Tests/Legality/Legal/Generation 9/FormArg/0983 - Kingambit - 6BE42E9A9EF4 0 asKing.pk9 b/Tests/PKHeX.Core.Tests/Legality/Legal/Generation 9/FormArg/0983 - Kingambit - 6BE42E9A9EF4 0 asKing.pk9 new file mode 100644 index 000000000..f47ccf53b Binary files /dev/null and b/Tests/PKHeX.Core.Tests/Legality/Legal/Generation 9/FormArg/0983 - Kingambit - 6BE42E9A9EF4 0 asKing.pk9 differ diff --git a/Tests/PKHeX.Core.Tests/Legality/Legal/Generation 9/FormArg/0983 - Kingambit - 6BE72E9A9EF4 3 asBisharp.pk9 b/Tests/PKHeX.Core.Tests/Legality/Legal/Generation 9/FormArg/0983 - Kingambit - 6BE72E9A9EF4 3 asBisharp.pk9 new file mode 100644 index 000000000..a015b8df5 Binary files /dev/null and b/Tests/PKHeX.Core.Tests/Legality/Legal/Generation 9/FormArg/0983 - Kingambit - 6BE72E9A9EF4 3 asBisharp.pk9 differ