namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
///
/// Sand Rush is an ability that doubles the Pokémon's Speed during a sandstorm.
///
/// Bulbapedia - Sand Rush
///
[Script(ScriptCategory.Ability, "sand_rush")]
public class SandRush : Script, IScriptChangeSpeed
{
///
public void ChangeSpeed(ITurnChoice choice, ref uint speed)
{
if (choice.User.BattleData?.Battle.WeatherName == ScriptUtils.ResolveName())
{
speed = speed.MultiplyOrMax(2);
}
}
///
public override void CustomTrigger(StringKey eventName, ICustomTriggerArgs args)
{
if (eventName == CustomTriggers.BypassSandstormDamage &&
args is CustomTriggers.BypassSandstormDamageArgs bypassArgs)
{
bypassArgs.Bypass = true;
}
}
}