From 311e110f6b78ed4e8a33c56610dfe03bdf208bfe Mon Sep 17 00:00:00 2001 From: Kurt Date: Fri, 17 Nov 2017 20:02:01 -0800 Subject: [PATCH] Block wild dusk rockruff closes #1627 adds test cases --- .../Legality/Encounters/EncounterGenerator.cs | 8 ++++++++ .../Wild/744-01 - Rockruff - BEBC85FF60E2.pk7 | Bin 0 -> 232 bytes .../Wild/745-02 - Lycanroc - 047385FF60E2.pk7 | Bin 0 -> 232 bytes .../080 - Slowbro - A0935F4796B1.pk7 | Bin 0 -> 232 bytes .../744 - Rockruff - B6F085FF60E2.pk7 | Bin 0 -> 232 bytes .../745 - Lycanroc - F45085FF60E2.pk7 | Bin 0 -> 232 bytes Tests/PKHeX.Tests/Legality/LegalityTests.cs | 1 + 7 files changed, 9 insertions(+) create mode 100644 Tests/PKHeX.Tests/Legality/Illegal/Wild/744-01 - Rockruff - BEBC85FF60E2.pk7 create mode 100644 Tests/PKHeX.Tests/Legality/Illegal/Wild/745-02 - Lycanroc - 047385FF60E2.pk7 create mode 100644 Tests/PKHeX.Tests/Legality/Legal/Generation 7 Wild/080 - Slowbro - A0935F4796B1.pk7 create mode 100644 Tests/PKHeX.Tests/Legality/Legal/Generation 7 Wild/744 - Rockruff - B6F085FF60E2.pk7 create mode 100644 Tests/PKHeX.Tests/Legality/Legal/Generation 7 Wild/745 - Lycanroc - F45085FF60E2.pk7 diff --git a/PKHeX.Core/Legality/Encounters/EncounterGenerator.cs b/PKHeX.Core/Legality/Encounters/EncounterGenerator.cs index 79af11657..a74ecbc97 100644 --- a/PKHeX.Core/Legality/Encounters/EncounterGenerator.cs +++ b/PKHeX.Core/Legality/Encounters/EncounterGenerator.cs @@ -624,6 +624,14 @@ private static IEnumerable GetFilteredSlots67(PKM pkm, IReadOnlyC int species = pkm.Species; int form = pkm.AltForm; + // Edge Case Handling + switch (species) + { + case 744 when form == 1: + case 745 when form == 2: + yield break; + } + 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 (ShouldMatchSlotForm()) // match slot form diff --git a/Tests/PKHeX.Tests/Legality/Illegal/Wild/744-01 - Rockruff - BEBC85FF60E2.pk7 b/Tests/PKHeX.Tests/Legality/Illegal/Wild/744-01 - Rockruff - BEBC85FF60E2.pk7 new file mode 100644 index 0000000000000000000000000000000000000000..570c215300348c95a0af38cd24a0bb7073c9c7e9 GIT binary patch literal 232 zcmaEq@V}LTVb8u7ObiV69G6&(Ss55afNZ6ws{)ug7zlzOhJ1!(hHQo+hEj$!AY@=j zgz8ab&}NWf&|y%PLnT8pLn1>SLlHwhki`IG zLx3WKHiHa<4ui5Bza*+LQP)aEP(_I61u%Fscrc_gL||xXgo_C9Z~@tD3{2b%3Wgkv JK;JMh003Y45vl+H literal 0 HcmV?d00001 diff --git a/Tests/PKHeX.Tests/Legality/Legal/Generation 7 Wild/080 - Slowbro - A0935F4796B1.pk7 b/Tests/PKHeX.Tests/Legality/Legal/Generation 7 Wild/080 - Slowbro - A0935F4796B1.pk7 new file mode 100644 index 0000000000000000000000000000000000000000..bbe9944237c7e7d888900ae5f41b9eb09ff51fbc GIT binary patch literal 232 zcmdlu%{`uhVe*0i1}F(Y=$C+Qie1jWMD{y zYEop-W{_dfVNjOimqaxu>RPD?stEDC00wUc4~A5R2n;Qaa1j9>E+CtYfr*<{9 literal 0 HcmV?d00001 diff --git a/Tests/PKHeX.Tests/Legality/Legal/Generation 7 Wild/745 - Lycanroc - F45085FF60E2.pk7 b/Tests/PKHeX.Tests/Legality/Legal/Generation 7 Wild/745 - Lycanroc - F45085FF60E2.pk7 new file mode 100644 index 0000000000000000000000000000000000000000..a2ec54075d9b8ec97c043869653a4865b7f71586 GIT binary patch literal 232 zcmaEq@V}LTA>hkPCI$w3j!P^KPW%j$fNZ6ws{)uA2m>F6N`_>HM20+uB8Ge*ivh@n z07V9E1{nq&24y*ZNmO&9u9b?QiV)8WVDM(}U`S<%z|hhN7ZKp$0