More abilities

This commit is contained in:
Deukhoofd committed 2025-06-15 13:05:52 +02:00
1 parent 85d97cb9e6
commit ec8681eaa9
17 files changed
+294 -59

No files matched your search

@@ -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);
}
}