Deukhoofd 6d71de375e
All checks were successful
Build / Build (push) Successful in 48s
More abilities, refactor custom triggers to be typed.
2025-06-13 11:15:48 +02:00

25 lines
976 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
{
/// <inheritdoc />
public override 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;
}
}
}