namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
///
/// Motor Drive is an ability that grants immunity to Electric-type moves and raises Speed when hit by one.
///
/// Bulbapedia - Motor Drive
///
[Script(ScriptCategory.Ability, "motor_drive")]
public class MotorDrive : Script
{
///
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);
}
}