Deukhoofd 7c270a6d52
All checks were successful
Build / Build (push) Successful in 1m1s
Finish script interface refactor
2025-07-06 10:27:56 +02:00

21 lines
829 B
C#

namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
/// <summary>
/// Early Bird is an ability that allows the Pokémon to wake up from sleep twice as fast.
/// This means the number of turns the Pokémon stays asleep is halved, rounded down.
/// This ability is commonly associated with Kangaskhan and Dodrio.
///
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Early_Bird_(Ability)">Bulbapedia - Early Bird</see>
/// </summary>
[Script(ScriptCategory.Ability, "early_bird")]
public class EarlyBird : Script, IScriptCustomTrigger
{
/// <inheritdoc />
public void CustomTrigger(StringKey eventName, ICustomTriggerArgs args)
{
if (eventName != CustomTriggers.ModifySleepTurns)
return;
if (args is CustomTriggers.ModifySleepTurnsArgs sleepArgs)
sleepArgs.Turns /= 2;
}
}