More abilities, implemented support for form inheritance
All checks were successful
Build / Build (push) Successful in 49s
All checks were successful
Build / Build (push) Successful in 49s
This commit is contained in:
20
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/MotorDrive.cs
Normal file
20
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/MotorDrive.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user