Implements a bunch more moves
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user