Move all battle state from IPokemon to an ephemeral IBattlePokemon wrapper
This commit is contained in:
@@ -4,10 +4,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
|
||||
public abstract class BaseChargeEffect : Script, IScriptForceTurnSelection
|
||||
{
|
||||
private readonly IPokemon _owner;
|
||||
private readonly IBattlePokemon _owner;
|
||||
private readonly StringKey _moveName;
|
||||
|
||||
public BaseChargeEffect(IPokemon owner, StringKey moveName)
|
||||
public BaseChargeEffect(IBattlePokemon owner, StringKey moveName)
|
||||
{
|
||||
_owner = owner;
|
||||
_moveName = moveName;
|
||||
@@ -16,7 +16,7 @@ public abstract class BaseChargeEffect : Script, IScriptForceTurnSelection
|
||||
/// <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, _moveName, opposingSideIndex, position);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user