Deukhoofd 8363b955af
All checks were successful
Build / Build (push) Successful in 49s
More abilities, implemented support for form inheritance
2025-06-13 12:24:03 +02:00

20 lines
765 B
C#

namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
/// <summary>
/// Motor Drive is an ability that grants immunity to Electric-type moves and raises Speed when hit by one.
///
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Motor_Drive_(Ability)">Bulbapedia - Motor Drive</see>
/// </summary>
[Script(ScriptCategory.Ability, "motor_drive")]
public class MotorDrive : Script
{
/// <inheritdoc />
public override void IsInvulnerableToMove(IExecutingMove move, IPokemon target, ref bool invulnerable)
{
if (move.UseMove.MoveType.Name != "electric")
return;
invulnerable = true;
move.Battle.EventHook.Invoke(new AbilityTriggerEvent(target));
target.ChangeStatBoost(Statistic.Speed, 1, true, false);
}
}