33 lines
847 B
C#
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();
|
|
}
|
|
}
|
|
} |