Make moveflags of gen 7 plugin shared statically

This commit is contained in:
2025-07-26 14:36:47 +02:00
parent 77d7b86a3c
commit 6eba332096
33 changed files with 223 additions and 146 deletions

View File

@@ -1,3 +1,5 @@
using PkmnLib.Plugin.Gen7.Common;
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
/// <summary>
@@ -12,7 +14,7 @@ public class Bulletproof : Script, IScriptFailIncomingMove
/// <inheritdoc />
public void FailIncomingMove(IExecutingMove move, IPokemon target, ref bool fail)
{
if (move.UseMove.HasFlag("ballistics"))
if (move.UseMove.HasFlag(MoveFlags.Ballistics))
fail = true;
}
}

View File

@@ -11,7 +11,7 @@ public class IronFist : Script, IScriptChangeBasePower
/// <inheritdoc />
public void ChangeBasePower(IExecutingMove move, IPokemon target, byte hit, ref ushort basePower)
{
if (move.UseMove.HasFlag("punch"))
if (move.UseMove.HasFlag(MoveFlags.Punch))
basePower = basePower.MultiplyOrMax(1.2f);
}
}

View File

@@ -11,7 +11,7 @@ public class LiquidVoice : Script, IScriptChangeMoveType
/// <inheritdoc />
public void ChangeMoveType(IExecutingMove move, IPokemon target, byte hit, ref TypeIdentifier? typeIdentifier)
{
if (move.UseMove.HasFlag("sound") &&
if (move.UseMove.HasFlag(MoveFlags.Sound) &&
move.Battle.Library.StaticLibrary.Types.TryGetTypeIdentifier("water", out var waterType))
{
typeIdentifier = waterType;

View File

@@ -11,7 +11,7 @@ public class MagicBounce : Script, IScriptChangeIncomingTargets
/// <inheritdoc />
public void ChangeIncomingTargets(IMoveChoice moveChoice, ref IReadOnlyList<IPokemon?> targets)
{
if (moveChoice.ChosenMove.MoveData.HasFlag("reflectable"))
if (moveChoice.ChosenMove.MoveData.HasFlag(MoveFlags.Reflectable))
{
var target = targets[0];
target?.BattleData?.Battle.EventHook.Invoke(new AbilityTriggerEvent(target));

View File

@@ -11,7 +11,7 @@ public class MegaLauncher : Script, IScriptChangeBasePower, IScriptCustomTrigger
/// <inheritdoc />
public void ChangeBasePower(IExecutingMove move, IPokemon target, byte hit, ref ushort basePower)
{
if (move.UseMove.HasFlag("pulse"))
if (move.UseMove.HasFlag(MoveFlags.Pulse))
{
basePower = basePower.MultiplyOrMax(1.5f);
}
@@ -23,7 +23,7 @@ public class MegaLauncher : Script, IScriptChangeBasePower, IScriptCustomTrigger
if (eventName != CustomTriggers.ModifyHealPercent || args is not CustomTriggers.ModifyHealPercentArgs healArgs)
return;
if (healArgs.Move.UseMove.HasFlag("pulse"))
if (healArgs.Move.UseMove.HasFlag(MoveFlags.Pulse))
healArgs.HealPercent *= 1.5f;
}
}

View File

@@ -25,7 +25,7 @@ public class Overcoat : Script, IScriptIsInvulnerableToMove, IScriptCustomTrigge
/// <inheritdoc />
public void IsInvulnerableToMove(IExecutingMove move, IPokemon target, ref bool invulnerable)
{
if (move.UseMove.HasFlag("powder"))
if (move.UseMove.HasFlag(MoveFlags.Powder))
{
invulnerable = true;
}

View File

@@ -11,7 +11,7 @@ public class Reckless : Script, IScriptChangeBasePower
/// <inheritdoc />
public void ChangeBasePower(IExecutingMove move, IPokemon target, byte hit, ref ushort basePower)
{
if (move.UseMove.HasFlag("recoil"))
if (move.UseMove.HasFlag(MoveFlags.Recoil))
{
basePower = basePower.MultiplyOrMax(1.2f);
}

View File

@@ -11,7 +11,7 @@ public class Soundproof : Script, IScriptIsInvulnerableToMove
/// <inheritdoc />
public void IsInvulnerableToMove(IExecutingMove move, IPokemon target, ref bool invulnerable)
{
if (move.UseMove.HasFlag("sound"))
if (move.UseMove.HasFlag(MoveFlags.Sound))
invulnerable = true;
}
}

View File

@@ -1,3 +1,5 @@
using PkmnLib.Plugin.Gen7.Common;
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
/// <summary>
@@ -11,7 +13,7 @@ public class StrongJaw : Script, IScriptChangeBasePower
/// <inheritdoc />
public void ChangeBasePower(IExecutingMove move, IPokemon target, byte hit, ref ushort basePower)
{
if (move.UseMove.HasFlag("bite"))
if (move.UseMove.HasFlag(MoveFlags.Bite))
{
basePower = basePower.MultiplyOrMax(1.5f);
}

View File

@@ -11,7 +11,7 @@ public class Triage : Script, IScriptChangePriority
/// <inheritdoc />
public void ChangePriority(IMoveChoice choice, ref sbyte priority)
{
if (!choice.ChosenMove.MoveData.HasFlag("heal"))
if (!choice.ChosenMove.MoveData.HasFlag(MoveFlags.Heal))
return;
if (priority == sbyte.MaxValue)
return;