More abilities, refactor custom triggers to be typed.
All checks were successful
Build / Build (push) Successful in 48s
All checks were successful
Build / Build (push) Successful in 48s
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
|
||||
/// <summary>
|
||||
/// Mega Launcher is an ability that boosts the power of aura and pulse moves.
|
||||
///
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Mega_Launcher_(Ability)">Bulbapedia - Mega Launcher</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "mega_launcher")]
|
||||
public class MegaLauncher : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeBasePower(IExecutingMove move, IPokemon target, byte hit, ref ushort basePower)
|
||||
{
|
||||
if (move.UseMove.HasFlag("pulse"))
|
||||
{
|
||||
basePower = basePower.MultiplyOrMax(1.5f);
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void CustomTrigger(StringKey eventName, ICustomTriggerArgs args)
|
||||
{
|
||||
if (eventName != CustomTriggers.ModifyHealPercent || args is not CustomTriggers.ModifyHealPercentArgs healArgs)
|
||||
return;
|
||||
|
||||
if (healArgs.Move.UseMove.HasFlag("pulse"))
|
||||
healArgs.HealPercent *= 1.5f;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user