namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
///
/// Aura Break is an ability that reverses the effects of Dark Aura and Fairy Aura.
/// When this ability is present, Dark-type and Fairy-type moves are reduced in power by 25% instead of being boosted.
///
/// Bulbapedia - Aura Break
///
[Script(ScriptCategory.Ability, "aura_break")]
public class AuraBreak : Script
{
///
public override void CustomTrigger(StringKey eventName, IDictionary? parameters)
{
if (eventName != CustomTriggers.ModifyAuraEffect || parameters == null)
return;
if (!parameters.TryGetValue("aura_type", out var auraTypeObj) || auraTypeObj is not string auraType)
return;
if (auraType is "dark" or "fairy")
{
if (parameters.TryGetValue("modifier", out var modifierObj) && modifierObj is float)
{
// Reverse the aura effect by reducing power by 25%
parameters["modifier"] = 0.75f;
}
}
}
}