Deukhoofd 5961bb746e
All checks were successful
Build / Build (push) Successful in 51s
Even more abilities
2025-06-14 13:24:38 +02:00

33 lines
847 B
C#

namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
[Script(ScriptCategory.Pokemon, "slow_start")]
public class SlowStartEffect : Script
{
private int _turnsRemaining = 5;
/// <inheritdoc />
public override void ChangeSpeed(ITurnChoice choice, ref uint speed)
{
speed /= 2;
}
/// <inheritdoc />
public override void ChangeOffensiveStatValue(IExecutingMove move, IPokemon target, byte hit, uint defensiveStat,
ImmutableStatisticSet<uint> targetStats, Statistic stat, ref uint value)
{
if (stat == Statistic.Attack)
value /= 2;
}
/// <inheritdoc />
public override void OnEndTurn(IBattle battle)
{
if (_turnsRemaining <= 0)
return;
_turnsRemaining--;
if (_turnsRemaining == 0)
{
RemoveSelf();
}
}
}