namespace PkmnLib.Plugin.Gen7.Scripts.Abilities; /// /// Tangling Hair is an ability that lowers the Speed of attackers making contact. /// /// Bulbapedia - Tangling Hair /// [Script(ScriptCategory.Ability, "tangling_hair")] public class TanglingHair : Script, IScriptOnIncomingHit { /// public 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); } }