Implements a bunch more moves
This commit is contained in:
25
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/HealPercent.cs
Normal file
25
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/HealPercent.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System.Collections.Generic;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "heal_percent")]
|
||||
public class HealPercent : Script
|
||||
{
|
||||
private float _healPercent = 0.5f;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnInitialize(IReadOnlyDictionary<StringKey, object?>? parameters)
|
||||
{
|
||||
if (parameters?.TryGetValue("healPercent", out var variable) == true && variable is float healPercent)
|
||||
{
|
||||
_healPercent = healPercent;
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
||||
{
|
||||
target.Heal((uint)(move.User.BoostedStats.Hp * _healPercent));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user