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)
This commit is contained in:
Kurt 2018-10-21 21:07:33 -05:00
parent 8c4a17335f
commit 3d0d8fa649
2 changed files with 19 additions and 2 deletions

View file

@ -61,8 +61,20 @@ namespace PKHeX.Core
var deferred = new List<IEncounterable>();
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

View file

@ -23,6 +23,11 @@
public static Severity NicknamedMysteryGift { get; set; } = Severity.Fishy;
public static Severity RNGFrameNotFound { get; set; } = Severity.Fishy;
/// <summary>
/// Setting to specify if an analysis should flag a shadow encounter that does not match the first lock.
/// </summary>
public static bool FlagCXDShadowFirstLockMismatch { get; set; }
/// <summary>
/// Checks to see if Crystal is available to visit/originate from.
/// </summary>