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; /// public override void OnInitialize(IReadOnlyDictionary? parameters) { if (parameters?.TryGetValue("healPercent", out var variable) == true && variable is float healPercent) { _healPercent = healPercent; } } /// public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit) { target.Heal((uint)(move.User.BoostedStats.Hp * _healPercent)); } }