More abilities
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
|
||||
/// <summary>
|
||||
/// Tangling Hair is an ability that lowers the Speed of attackers making contact.
|
||||
///
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Tangling_Hair_(Ability)">Bulbapedia - Tangling Hair</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "tangling_hair")]
|
||||
public class TanglingHair : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnIncomingHit(IExecutingMove move, IPokemon target, byte hit)
|
||||
{
|
||||
if (!move.GetHitData(target, hit).IsContact)
|
||||
return;
|
||||
|
||||
EventBatchId batchId = new();
|
||||
move.Battle.EventHook.Invoke(new AbilityTriggerEvent(target)
|
||||
{
|
||||
BatchId = batchId,
|
||||
});
|
||||
move.User.ChangeStatBoost(Statistic.Speed, -1, false, false, batchId);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user