More abilities
This commit is contained in:
22
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Rattled.cs
Normal file
22
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Rattled.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
|
||||
/// <summary>
|
||||
/// Rattled is an ability that raises Speed when hit by a Bug-, Ghost-, or Dark-type move.
|
||||
///
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Rattled_(Ability)">Bulbapedia - Rattled</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "rattled")]
|
||||
public class Rattled : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnIncomingHit(IExecutingMove move, IPokemon target, byte hit)
|
||||
{
|
||||
var type = move.GetHitData(target, hit).Type;
|
||||
if (type is null)
|
||||
return;
|
||||
if (type.Value.Name != "bug" && type.Value.Name != "ghost" && type.Value.Name != "dark")
|
||||
return;
|
||||
target.BattleData?.Battle.EventHook.Invoke(new AbilityTriggerEvent(target));
|
||||
target.ChangeStatBoost(Statistic.Speed, 1, true, false);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user