Move all battle state from IPokemon to an ephemeral IBattlePokemon wrapper

This commit is contained in:
2026-08-28 15:20:26 +02:00
parent 942be8eaeb
commit 8a2733a0a9
859 changed files with 4408 additions and 5331 deletions

View File

@@ -5,11 +5,11 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Side;
[Script(ScriptCategory.Side, "aroma_veil")]
public class AromaVeilEffect : Script, IScriptFailIncomingMove, IScriptPreventIncomingSecondaryEffect
{
private HashSet<IPokemon> _placers = new();
private HashSet<IBattlePokemon> _placers = new();
public void PlacerActivated(IPokemon placer) => _placers.Add(placer);
public void PlacerActivated(IBattlePokemon placer) => _placers.Add(placer);
public void PlacerDeactivated(IPokemon placer)
public void PlacerDeactivated(IBattlePokemon placer)
{
_placers.Remove(placer);
if (_placers.Count == 0)
@@ -17,14 +17,14 @@ public class AromaVeilEffect : Script, IScriptFailIncomingMove, IScriptPreventIn
}
/// <inheritdoc />
public void FailIncomingMove(IExecutingMove move, IPokemon target, ref bool fail)
public void FailIncomingMove(IExecutingMove move, IBattlePokemon target, ref bool fail)
{
if (move.UseMove.HasFlag(MoveFlags.Mental) && move.UseMove.Category == MoveCategory.Status)
fail = true;
}
/// <inheritdoc />
public void PreventIncomingSecondaryEffect(IExecutingMove move, IPokemon target, byte hit, ref bool prevent)
public void PreventIncomingSecondaryEffect(IExecutingMove move, IBattlePokemon target, byte hit, ref bool prevent)
{
if (move.UseMove.HasFlag(MoveFlags.Mental))
prevent = true;