Make moveflags of gen 7 plugin shared statically
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user