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

@@ -12,7 +12,7 @@ public class MetalBurst : Script, IScriptOnBeforeTurnStart, IScriptChangeTargets
}
/// <inheritdoc />
public void ChangeTargets(IMoveChoice moveChoice, ref IReadOnlyList<IPokemon?> targets)
public void ChangeTargets(IMoveChoice moveChoice, ref IReadOnlyList<IBattlePokemon?> targets)
{
var helper = moveChoice.User.Volatile.Get<MetalBurstHelper>();
var lastAttacker = helper?.LastAttacker;
@@ -25,7 +25,7 @@ public class MetalBurst : Script, IScriptOnBeforeTurnStart, IScriptChangeTargets
}
/// <inheritdoc />
public void ChangeMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
public void ChangeMoveDamage(IExecutingMove move, IBattlePokemon target, byte hit, ref uint damage)
{
var helper = move.User.Volatile.Get<MetalBurstHelper>();
@@ -41,11 +41,11 @@ public class MetalBurst : Script, IScriptOnBeforeTurnStart, IScriptChangeTargets
[Script(ScriptCategory.Pokemon, "metal_burst_helper")]
private class MetalBurstHelper : Script, IScriptOnIncomingHit, IScriptOnEndTurn
{
public IPokemon? LastAttacker { get; set; }
public IBattlePokemon? LastAttacker { get; set; }
public uint LastDamage { get; set; }
/// <inheritdoc />
public void OnIncomingHit(IExecutingMove move, IPokemon target, byte hit)
public void OnIncomingHit(IExecutingMove move, IBattlePokemon target, byte hit)
{
if (move.UseMove.Category == MoveCategory.Status)
return;