namespace PkmnLib.Plugin.Gen7.Scripts.Abilities; /// /// Fairy Aura is an ability that increases the power of Fairy-type moves by 33% for all Pokémon on the field. /// The effect can be modified by other abilities (such as Aura Break) via a custom script hook. /// This ability is exclusive to Xerneas. /// /// Bulbapedia - Fairy Aura /// [Script(ScriptCategory.Ability, "fairy_aura")] public class FairyAura : Script, IScriptChangeDamageModifier { /// public void ChangeDamageModifier(IExecutingMove move, IPokemon target, byte hit, ref float modifier) { if (move.GetHitData(target, hit).Type?.Name == "fairy") { var auraModifier = 5448f / 4096f; var args = new CustomTriggers.ModifyAuraEffectArgs(move, target, hit, auraModifier); move.Battle.Sides.SelectMany(side => side.Pokemon).WhereNotNull() .RunScriptHook(x => x.CustomTrigger(CustomTriggers.ModifyAuraEffect, args)); auraModifier = args.AuraEffect; modifier *= auraModifier; move.Battle.EventHook.Invoke(new AbilityTriggerEvent(move.User)); } } }