From 1959eb34a57cf5b56700e292d6dc3f7d886d94eb Mon Sep 17 00:00:00 2001 From: Lusamine <30205550+Lusamine@users.noreply.github.com> Date: Tue, 12 Nov 2024 18:42:08 -0600 Subject: [PATCH 1/3] Further refine memory 29 restrictions in SWSH --- .../Restrictions/Memories/MemoryContext.cs | 2 +- .../Restrictions/Memories/MemoryContext6.cs | 2 +- .../Restrictions/Memories/MemoryContext8.cs | 36 ++++++++++++++++--- .../Legality/Verifiers/MemoryVerifier.cs | 2 +- 4 files changed, 35 insertions(+), 7 deletions(-) diff --git a/PKHeX.Core/Legality/Restrictions/Memories/MemoryContext.cs b/PKHeX.Core/Legality/Restrictions/Memories/MemoryContext.cs index fd5c71d6a..e7d9c9710 100644 --- a/PKHeX.Core/Legality/Restrictions/Memories/MemoryContext.cs +++ b/PKHeX.Core/Legality/Restrictions/Memories/MemoryContext.cs @@ -21,7 +21,7 @@ public abstract class MemoryContext public abstract bool HasPokeCenter(GameVersion version, ushort location); public abstract bool IsInvalidGeneralLocationMemoryValue(byte memory, ushort variable, IEncounterTemplate enc, PKM pk); - public abstract bool IsInvalidMiscMemory(byte memory, ushort variable); + public abstract bool IsInvalidMiscMemory(byte memory, ushort variable, Species species, GameVersion version, int handler); public abstract bool CanHaveIntensity(byte memory, byte intensity); public abstract bool CanHaveFeeling(byte memory, byte feeling, ushort argument); diff --git a/PKHeX.Core/Legality/Restrictions/Memories/MemoryContext6.cs b/PKHeX.Core/Legality/Restrictions/Memories/MemoryContext6.cs index bfac88b47..7207fe108 100644 --- a/PKHeX.Core/Legality/Restrictions/Memories/MemoryContext6.cs +++ b/PKHeX.Core/Legality/Restrictions/Memories/MemoryContext6.cs @@ -91,7 +91,7 @@ public override bool IsInvalidGeneralLocationMemoryValue(byte memory, ushort var return false; // todo } - public override bool IsInvalidMiscMemory(byte memory, ushort variable) + public override bool IsInvalidMiscMemory(byte memory, ushort variable, Species species, GameVersion version, int handler) { return false; // todo } diff --git a/PKHeX.Core/Legality/Restrictions/Memories/MemoryContext8.cs b/PKHeX.Core/Legality/Restrictions/Memories/MemoryContext8.cs index d3a245184..016178faa 100644 --- a/PKHeX.Core/Legality/Restrictions/Memories/MemoryContext8.cs +++ b/PKHeX.Core/Legality/Restrictions/Memories/MemoryContext8.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using static PKHeX.Core.Species; namespace PKHeX.Core; @@ -68,16 +69,43 @@ public override bool IsInvalidGeneralLocationMemoryValue(byte memory, ushort var return IsInvalidGenLoc8Other(memory, variable); } - public override bool IsInvalidMiscMemory(byte memory, ushort variable) + public override bool IsInvalidMiscMemory(byte memory, ushort variable, Species species, GameVersion version, int handler) { return memory switch { // {0} encountered {2} when it was with {1}. {4} that {3}. - 29 when variable is not (888 or 889 or 890 or 898) => true, // Zacian, Zamazenta, Eternatus, Calyrex + 29 when !IsValidMemory29((Species)variable, species, version, handler) => true, _ => false, }; } + private static bool IsValidMemory29(Species encountered, Species species, GameVersion version, int handler) + { + // {0} encountered {2} when it was with {1}. {4} that {3}. + // Restrictions for this memory are based on game progress and version. + // These Pokémon are allowed to meet themselves if caught to an empty party slot. + + // Only these 4 species can appear in this memory. + if (encountered is not (Zacian or Zamazenta or Eternatus or Calyrex)) + return false; + + // If this is HT memory, it's possible to meet them in another game, so story progress doesn't matter. + if (handler == 1) + return true; + + // OT Memory checks from here on. + // Zacian and Zamazenta being in an OT memory need to match the Pokemon's version. + if (version == GameVersion.SW && encountered == Zamazenta) + return false; + if (version == GameVersion.SH && encountered == Zacian) + return false; + + // These legends can't meet Eternatus as OT memory since they require Eternatus to be caught. + if (species is (Zacian or Zamazenta or Glastrier or Spectrier or Calyrex)) + return encountered != Eternatus; + return true; + } + private static bool CanObtainMemorySWSH(byte memory) => memory <= MAX_MEMORY_ID_SWSH && !Memory_NotSWSH.Contains(memory); public override bool CanWinLotoID(int item) => item < byte.MaxValue && LotoPrizeSWSH.Contains((byte)item); @@ -131,7 +159,7 @@ private static bool IsWildEncounter(PKM pk, IEncounterTemplate enc) return false; if (pk is IRibbonSetMark8 { RibbonMarkCurry: true }) return false; - if (pk.Species == (int)Species.Shedinja && pk is IRibbonSetAffixed { AffixedRibbon: (int)RibbonIndex.MarkCurry }) + if (pk.Species == (int)Shedinja && pk is IRibbonSetAffixed { AffixedRibbon: (int)RibbonIndex.MarkCurry }) return false; return true; } @@ -140,7 +168,7 @@ private static bool IsCurryEncounter(PKM pk, IEncounterTemplate enc) { if (enc is not EncounterSlot8) return false; - return pk is IRibbonSetMark8 { RibbonMarkCurry: true } || pk.Species == (int)Species.Shedinja; + return pk is IRibbonSetMark8 { RibbonMarkCurry: true } || pk.Species == (int)Shedinja; } private static bool IsInvalidGenLoc8Other(byte memory, ushort variable) diff --git a/PKHeX.Core/Legality/Verifiers/MemoryVerifier.cs b/PKHeX.Core/Legality/Verifiers/MemoryVerifier.cs index ec011c069..2c47ba396 100644 --- a/PKHeX.Core/Legality/Verifiers/MemoryVerifier.cs +++ b/PKHeX.Core/Legality/Verifiers/MemoryVerifier.cs @@ -144,7 +144,7 @@ private CheckResult VerifyCommonMemory(PKM pk, int handler, LegalInfo info, Memo if (mem.IsInvalidGeneralLocationMemoryValue(memory.MemoryID, memory.Variable, info.EncounterMatch, pk)) return GetInvalid(string.Format(LMemoryArgBadLocation, memory.Handler)); - if (mem.IsInvalidMiscMemory(memory.MemoryID, memory.Variable)) + if (mem.IsInvalidMiscMemory(memory.MemoryID, memory.Variable, (Species)pk.Species, pk.Version, handler)) return GetInvalid(string.Format(LMemoryArgBadID, memory.Handler)); switch (memory.MemoryID) From d028cb0aed3feabf908954e1f45f16aa6edc1ce3 Mon Sep 17 00:00:00 2001 From: sora10pls <17801814+sora10pls@users.noreply.github.com> Date: Thu, 14 Nov 2024 19:03:08 -0500 Subject: [PATCH 2/3] =?UTF-8?q?Add=20latest=20distribution=20raid=20data?= =?UTF-8?q?=20=F0=9F=90=A2=F0=9F=8C=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wild/Gen9/encounter_might_paldea.pkl | Bin 2046 -> 2108 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/PKHeX.Core/Resources/legality/wild/Gen9/encounter_might_paldea.pkl b/PKHeX.Core/Resources/legality/wild/Gen9/encounter_might_paldea.pkl index b744160c76cf87c9597266840b536bbaf612a940..aca71df980dc47ad1fffa9d6ec381bfd3cca836e 100644 GIT binary patch delta 34 qcmeyzzeixhB4)u>Mg~R}2F8>~h9ivk8Rs#wO@7F#yLl0F3=06Zj|wpW delta 12 TcmdlZ@Q;7PBIeBxm}6J~CBp?J From 46739891e7e44271413c1e6c6f8ea4bcdb1ec324 Mon Sep 17 00:00:00 2001 From: 9Bitdo <157295620+9Bitdo@users.noreply.github.com> Date: Sat, 16 Nov 2024 00:25:05 +0800 Subject: [PATCH 3/3] Add Patrick's Pelipper date (#4389) --- PKHeX.Core/Legality/Encounters/Data/Live/EncounterServerDate.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/PKHeX.Core/Legality/Encounters/Data/Live/EncounterServerDate.cs b/PKHeX.Core/Legality/Encounters/Data/Live/EncounterServerDate.cs index 211efb641..7e225f978 100644 --- a/PKHeX.Core/Legality/Encounters/Data/Live/EncounterServerDate.cs +++ b/PKHeX.Core/Legality/Encounters/Data/Live/EncounterServerDate.cs @@ -209,6 +209,7 @@ public static bool IsValidDateWC9(WC9 card, DateOnly obtained) => (WC9Gifts.TryG {0511, (new(2024, 08, 15), new(2024, 08, 31))}, // WCS 2024 Steenee {0512, (new(2024, 08, 16), new(2024, 08, 20))}, // Tomoya's Sylveon {0062, (new(2024, 10, 31), new(2026, 02, 01))}, // PokéCenter Birthday Tandemaus + {0513, (new(2024, 11, 15), new(2024, 11, 23))}, // Patrick's Pelipper {9021, HOME3_ML}, // Hidden Ability Sprigatito {9022, HOME3_ML}, // Hidden Ability Fuecoco