Move all battle state from IPokemon to an ephemeral IBattlePokemon wrapper
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user