namespace PkmnLib.Plugin.Gen7.Scripts.Abilities; /// /// Shadow Shield is an ability that reduces damage taken when at full HP. /// /// Bulbapedia - Shadow Shield /// [Script(ScriptCategory.Ability, "shadow_shield")] public class ShadowShield : Script { /// public override void ChangeIncomingMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage) { if (target.CurrentHealth == target.BoostedStats.Hp) { damage = (uint)(damage * 0.5); } } /// public override void OnBeforeAnyHookInvoked(ref List? suppressedCategories) { // Shadow Shield can not be suppressed by any other script, so we remove it from the list of suppressed categories // if it was added. if (suppressedCategories != null && suppressedCategories.Contains(ScriptCategory.Ability)) suppressedCategories.Remove(ScriptCategory.Ability); } }