Deukhoofd e305cfaef6
All checks were successful
Build / Build (push) Successful in 50s
Support for changing turn choice when executing
2025-06-15 14:23:28 +02:00

27 lines
866 B
C#

using PkmnLib.Plugin.Gen7.Scripts.Utils;
using PkmnLib.Static.Utils;
namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
[Script(ScriptCategory.Pokemon, "charge_move_effect")]
public class ChargeMoveEffect : Script
{
public readonly StringKey MoveName;
private readonly IPokemon _user;
private readonly byte _targetSide;
private readonly byte _targetPosition;
public ChargeMoveEffect(StringKey moveName, IPokemon user, byte targetSide, byte targetPosition)
{
MoveName = moveName;
_user = user;
_targetSide = targetSide;
_targetPosition = targetPosition;
}
/// <inheritdoc />
public override void ForceTurnSelection(IBattle battle, byte sideIndex, byte position, ref ITurnChoice? choice)
{
choice = TurnChoiceHelper.CreateMoveChoice(_user, MoveName, _targetSide, _targetPosition);
}
}