using PkmnLib.Plugin.Gen7.Scripts.Utils; using PkmnLib.Static.Utils; namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon; [Script(ScriptCategory.Pokemon, "ice_ball")] public class IceBallEffect : Script { private readonly IPokemon _owner; private readonly StringKey _moveName; public int TurnCount { get; set; } public IceBallEffect(IPokemon owner, StringKey moveName) { _owner = owner; _moveName = moveName; TurnCount = 0; } /// public override void ForceTurnSelection(byte sideIndex, byte position, ref ITurnChoice? choice) { var opposingSideIndex = (byte)(_owner.BattleData?.SideIndex == 0 ? 1 : 0); choice = TurnChoiceHelper.CreateMoveChoice(_owner, _moveName, opposingSideIndex, position); } /// public override void OnMoveMiss(IExecutingMove move, IPokemon target) { RemoveSelf(); } /// public override void OnEndTurn(IBattle battle) { if (TurnCount < 5) TurnCount++; else RemoveSelf(); } }