Adds more abilities
This commit is contained in:
@@ -1,7 +1,32 @@
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
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
|
||||
{
|
||||
// FIXME: Implement together with Dark Aura and Fairy Aura.
|
||||
/// <inheritdoc />
|
||||
public override void CustomTrigger(StringKey eventName, IDictionary<StringKey, object?>? 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user