diff --git a/PKHeX.Core/Legality/RNG/Frame/Frame.cs b/PKHeX.Core/Legality/RNG/Frame/Frame.cs index b239e3f0d..57c054f67 100644 --- a/PKHeX.Core/Legality/RNG/Frame/Frame.cs +++ b/PKHeX.Core/Legality/RNG/Frame/Frame.cs @@ -12,7 +12,7 @@ public class Frame public uint RandESV { get; set; } public uint OriginSeed { get; set; } - public bool LevelSlotModified => Lead > LeadRequired.SynchronizeFail; + public bool LevelSlotModified => Lead.IsLevelOrSlotModified(); public Frame(uint seed, FrameType type, RNG rng, LeadRequired lead) { diff --git a/PKHeX.Core/Legality/RNG/Frame/FrameFinder.cs b/PKHeX.Core/Legality/RNG/Frame/FrameFinder.cs index ffdec03a3..3afb9348b 100644 --- a/PKHeX.Core/Legality/RNG/Frame/FrameFinder.cs +++ b/PKHeX.Core/Legality/RNG/Frame/FrameFinder.cs @@ -58,7 +58,8 @@ private static IEnumerable RefineFrames3(IEnumerable frames, Frame var rand = prev >> 16; f.RandESV = rand; f.RandLevel = f.Seed >> 16; - yield return f; + if (f.Lead != LeadRequired.CuteCharm) // needs proc checking + yield return f; // Generate frames for other slots after the regular slots if (info.AllowLeads && (f.Lead == LeadRequired.CuteCharm || f.Lead == LeadRequired.None)) diff --git a/PKHeX.Core/Legality/RNG/Frame/LeadRequired.cs b/PKHeX.Core/Legality/RNG/Frame/LeadRequired.cs index 9a089ad70..562937e05 100644 --- a/PKHeX.Core/Legality/RNG/Frame/LeadRequired.cs +++ b/PKHeX.Core/Legality/RNG/Frame/LeadRequired.cs @@ -1,20 +1,37 @@ -namespace PKHeX.Core +using System; + +namespace PKHeX.Core { + [Flags] public enum LeadRequired { - None, - CuteCharm, - CuteCharmFail, - Synchronize, - SynchronizeFail, + None = 0, + CuteCharm = 1 << 0, + Synchronize = 1 << 1, // Slot Modifiers - StaticMagnet, - StaticMagnetFail, + StaticMagnet = 1 << 2, // Level Modifiers - IntimidateKeenEye, // Keen Eye - PressureHustleSpirit, - PressureHustleSpiritFail, + IntimidateKeenEye = 1 << 3, + PressureHustleSpirit = 1 << 4, + SuctionCups = 1 << 5, + + NoLevelCall = 1 << 6, + Fail = 1 << 7, + + CuteCharmFail = CuteCharm | Fail, + SynchronizeFail = Synchronize | Fail, + StaticMagnetFail = StaticMagnet | Fail, + PressureHustleSpiritFail = PressureHustleSpirit | Fail, + + AllFlags = NoLevelCall | Fail, + NoFlags = ~AllFlags, + } + + public static partial class Extensions + { + internal static bool IsLevelOrSlotModified(this LeadRequired Lead) => Lead.RemoveFlags() > LeadRequired.Synchronize; + internal static LeadRequired RemoveFlags(this LeadRequired Lead) => Lead & LeadRequired.NoFlags; } }