namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon; [Script(ScriptCategory.Pokemon, "infestation")] public class InfestationEffect : Script { private readonly IPokemon _owner; private int _turns; public InfestationEffect(IPokemon owner, int turns) { _owner = owner; _turns = turns; } /// public override void PreventSelfSwitch(ISwitchChoice choice, ref bool prevent) => prevent = true; /// public override void PreventSelfRunAway(IFleeChoice choice, ref bool prevent) => prevent = true; /// public override void OnEndTurn(IBattle battle) { var damage = _owner.BoostedStats.Hp / 8; _owner.Damage(damage, DamageSource.Misc); _turns--; if (_turns <= 0) { RemoveSelf(); } } }