From 3d0d8fa6497a1a800a19affbbac5cf0945dc5dc2 Mon Sep 17 00:00:00 2001 From: Kurt Date: Sun, 21 Oct 2018 21:07:33 -0500 Subject: [PATCH] Add first shadow lock check Currently toggled off, can be optionally toggled on (I'm not sure that it's perfect? Random save files have stuff flagged since they don't match the lock; will have to investigate later) --- .../Encounters/Generator/EncounterGenerator.cs | 16 ++++++++++++++-- PKHeX.Core/Legality/Verifiers/ParseSettings.cs | 5 +++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/PKHeX.Core/Legality/Encounters/Generator/EncounterGenerator.cs b/PKHeX.Core/Legality/Encounters/Generator/EncounterGenerator.cs index cb61274be..b36881411 100644 --- a/PKHeX.Core/Legality/Encounters/Generator/EncounterGenerator.cs +++ b/PKHeX.Core/Legality/Encounters/Generator/EncounterGenerator.cs @@ -61,8 +61,20 @@ private static IEnumerable GetEncounters3(PKM pkm, LegalInfo inf var deferred = new List(); foreach (var z in GenerateRawEncounters3(pkm, info)) { - if (z is EncounterSlot w && pkm.Version == 15) - info.PIDIV = MethodFinder.GetPokeSpotSeeds(pkm, w.SlotNumber).FirstOrDefault() ?? info.PIDIV; + if (pkm.Version == 15) + { + if (z is EncounterSlot w) + { + var seeds = MethodFinder.GetPokeSpotSeeds(pkm, w.SlotNumber).FirstOrDefault(); + info.PIDIV = seeds ?? info.PIDIV; + } + else if (ParseSettings.FlagCXDShadowFirstLockMismatch + && z is EncounterStaticShadow s && !LockFinder.IsFirstShadowLockValid(s, info.PIDIV)) + { + deferred.Add(s); + continue; + } + } if (info.PIDIV.Type.IsCompatible3(z, pkm)) yield return z; else diff --git a/PKHeX.Core/Legality/Verifiers/ParseSettings.cs b/PKHeX.Core/Legality/Verifiers/ParseSettings.cs index 1eaef079b..5d5a1512d 100644 --- a/PKHeX.Core/Legality/Verifiers/ParseSettings.cs +++ b/PKHeX.Core/Legality/Verifiers/ParseSettings.cs @@ -23,6 +23,11 @@ public static class ParseSettings public static Severity NicknamedMysteryGift { get; set; } = Severity.Fishy; public static Severity RNGFrameNotFound { get; set; } = Severity.Fishy; + /// + /// Setting to specify if an analysis should flag a shadow encounter that does not match the first lock. + /// + public static bool FlagCXDShadowFirstLockMismatch { get; set; } + /// /// Checks to see if Crystal is available to visit/originate from. ///