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,12 +5,12 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
[Script(ScriptCategory.Pokemon, "phantom_force")]
public class PhantomForceCharge : Script, IScriptForceTurnSelection, IScriptBlockIncomingHit, IScriptOnAfterMoveChoice
{
private readonly IPokemon _owner;
private readonly IBattlePokemon _owner;
/// <inheritdoc />
public override bool IsSemiInvulnerableTurn => true;
public PhantomForceCharge(IPokemon owner)
public PhantomForceCharge(IBattlePokemon owner)
{
_owner = owner;
}
@@ -18,12 +18,12 @@ public class PhantomForceCharge : Script, IScriptForceTurnSelection, IScriptBloc
/// <inheritdoc />
public void ForceTurnSelection(IBattle battle, byte sideIndex, byte position, ref ITurnChoice? choice)
{
var opposingSideIndex = (byte)(_owner.BattleData?.SideIndex == 0 ? 1 : 0);
var opposingSideIndex = (byte)(_owner.SideIndex == 0 ? 1 : 0);
choice = TurnChoiceHelper.CreateMoveChoice(_owner, "phantom_force", opposingSideIndex, position);
}
/// <inheritdoc />
public void BlockIncomingHit(IExecutingMove executingMove, IPokemon target, byte hitIndex, ref bool block)
public void BlockIncomingHit(IExecutingMove executingMove, IBattlePokemon target, byte hitIndex, ref bool block)
{
block = true;
}