PKHeX/PKHeX.Core/Legality/RNG/Frame/LeadRequired.cs

38 lines
981 B
C#
Raw Normal View History

2017-12-02 01:27:09 +00:00
using System;
namespace PKHeX.Core
{
2017-12-02 01:27:09 +00:00
[Flags]
public enum LeadRequired
{
2017-12-02 01:27:09 +00:00
None = 0,
CuteCharm = 1 << 0,
Synchronize = 1 << 1,
// Slot Modifiers
2017-12-02 01:27:09 +00:00
StaticMagnet = 1 << 2,
// Level Modifiers
2017-12-02 01:27:09 +00:00
IntimidateKeenEye = 1 << 3,
PressureHustleSpirit = 1 << 4,
SuctionCups = 1 << 5,
// Compatibility Flags
UsesLevelCall = 1 << 6,
2017-12-02 01:27:09 +00:00
Fail = 1 << 7,
CuteCharmFail = CuteCharm | Fail,
SynchronizeFail = Synchronize | Fail,
StaticMagnetFail = StaticMagnet | Fail,
PressureHustleSpiritFail = PressureHustleSpirit | Fail,
AllFlags = UsesLevelCall | Fail,
2017-12-02 01:27:09 +00:00
}
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.AllFlags;
}
}