Implements a bunch more moves

This commit is contained in:
2025-03-08 14:39:50 +01:00
parent 8f262cb4a6
commit 77f1ab243b
33 changed files with 935 additions and 57 deletions

View File

@@ -0,0 +1,33 @@
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;
}
/// <inheritdoc />
public override void PreventSelfSwitch(ISwitchChoice choice, ref bool prevent) => prevent = true;
/// <inheritdoc />
public override void PreventSelfRunAway(IFleeChoice choice, ref bool prevent) => prevent = true;
/// <inheritdoc />
public override void OnEndTurn(IBattle battle)
{
var damage = _owner.BoostedStats.Hp / 8;
_owner.Damage(damage, DamageSource.Misc);
_turns--;
if (_turns <= 0)
{
RemoveSelf();
}
}
}