Deukhoofd 7c270a6d52
All checks were successful
Build / Build (push) Successful in 1m1s
Finish script interface refactor
2025-07-06 10:27:56 +02:00

25 lines
989 B
C#

namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
/// <summary>
/// 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.
///
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Aura_Break_(Ability)">Bulbapedia - Aura Break</see>
/// </summary>
[Script(ScriptCategory.Ability, "aura_break")]
public class AuraBreak : Script, IScriptCustomTrigger
{
/// <inheritdoc />
public void CustomTrigger(StringKey eventName, ICustomTriggerArgs args)
{
if (eventName != CustomTriggers.ModifyAuraEffect || args is not CustomTriggers.ModifyAuraEffectArgs auraArgs)
return;
var typeName = auraArgs.Move.UseMove.MoveType.Name;
if (typeName == "dark" || typeName == "fairy")
{
// Reverse the aura effect by reducing power by 25%
auraArgs.AuraEffect *= 0.75f;
}
}
}