using PkmnLib.Plugin.Gen7.Scripts.Utils; namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon; [Script(ScriptCategory.Pokemon, "bide")] public class BideEffect : Script, IScriptForceTurnSelection, IScriptOnIncomingHit, IScriptOnDamage { private readonly IBattlePokemon? _owner; public byte Turns; public uint DamageTaken; public readonly List HitBy = []; private BideEffect() { } public BideEffect(IBattlePokemon owner) { _owner = owner; } /// public void OnIncomingHit(IExecutingMove move, IBattlePokemon target, byte hit) { HitBy.Add(move.User); } /// public void OnDamage(IBattlePokemon pokemon, DamageSource source, uint oldHealth, uint newHealth) { DamageTaken += oldHealth - newHealth; } private ITurnChoice? _choice; /// public void ForceTurnSelection(IBattle battle, byte sideIndex, byte position, ref ITurnChoice? choice) { if (_owner == null) return; if (_owner == null) return; if (_owner.SideIndex != sideIndex || _owner.Position != position) return; if (_choice != null) { choice = _choice; return; } choice = _choice = TurnChoiceHelper.CreateMoveChoice(_owner, "bide", _owner.SideIndex, position); } }