2017-12-02 01:27:09 +00:00
|
|
|
|
using System;
|
|
|
|
|
|
2022-06-18 18:04:24 +00:00
|
|
|
|
namespace PKHeX.Core;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Indicates the requirement of the player's lead Pokémon, first sent out when starting a battle.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Flags]
|
|
|
|
|
public enum LeadRequired
|
|
|
|
|
{
|
|
|
|
|
/// <summary> No Lead ability effect is present, or is not checked for this type of frame. </summary>
|
|
|
|
|
None = 0,
|
|
|
|
|
|
|
|
|
|
/// <summary> <see cref="Ability.CuteCharm"/> </summary>
|
|
|
|
|
CuteCharm = 1 << 0,
|
|
|
|
|
/// <summary> <see cref="Ability.Synchronize"/> </summary>
|
|
|
|
|
Synchronize = 1 << 1,
|
|
|
|
|
|
|
|
|
|
// Slot Modifiers
|
|
|
|
|
/// <summary> <see cref="Ability.Static"/> or <see cref="Ability.MagnetPull"/> </summary>
|
|
|
|
|
StaticMagnet = 1 << 2,
|
|
|
|
|
|
|
|
|
|
// Level Modifiers
|
|
|
|
|
/// <summary> <see cref="Ability.Intimidate"/> or <see cref="Ability.KeenEye"/> </summary>
|
|
|
|
|
IntimidateKeenEye = 1 << 3,
|
|
|
|
|
/// <summary> <see cref="Ability.Pressure"/> or <see cref="Ability.Hustle"/> or <see cref="Ability.VitalSpirit"/> </summary>
|
|
|
|
|
PressureHustleSpirit = 1 << 4,
|
|
|
|
|
/// <summary> <see cref="Ability.SuctionCups"/> </summary>
|
|
|
|
|
SuctionCups = 1 << 5,
|
|
|
|
|
|
|
|
|
|
// Compatibility Flags
|
|
|
|
|
UsesLevelCall = 1 << 6,
|
|
|
|
|
Fail = 1 << 7,
|
|
|
|
|
|
|
|
|
|
/// <summary> <inheritdoc cref="CuteCharm"/> </summary>
|
|
|
|
|
CuteCharmFail = CuteCharm | Fail,
|
|
|
|
|
/// <summary> <inheritdoc cref="Synchronize"/> </summary>
|
|
|
|
|
SynchronizeFail = Synchronize | Fail,
|
|
|
|
|
/// <summary> <inheritdoc cref="StaticMagnet"/> </summary>
|
|
|
|
|
StaticMagnetFail = StaticMagnet | Fail,
|
|
|
|
|
/// <summary> <inheritdoc cref="PressureHustleSpirit"/> </summary>
|
|
|
|
|
PressureHustleSpiritFail = PressureHustleSpirit | Fail,
|
|
|
|
|
|
|
|
|
|
AllFlags = UsesLevelCall | Fail,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static partial class Extensions
|
2017-05-14 21:42:18 +00:00
|
|
|
|
{
|
2022-06-18 18:04:24 +00:00
|
|
|
|
internal static bool IsLevelOrSlotModified(this LeadRequired lead) => lead.RemoveFlags() > LeadRequired.Synchronize;
|
|
|
|
|
internal static LeadRequired RemoveFlags(this LeadRequired lead) => lead & ~LeadRequired.AllFlags;
|
|
|
|
|
internal static bool NeedsLevelCall(this LeadRequired lead) => (lead & LeadRequired.UsesLevelCall) != 0;
|
2017-05-14 21:42:18 +00:00
|
|
|
|
}
|