namespace PkmnLib.Plugin.Gen7.Scripts.Moves;

[Script(ScriptCategory.Move, "endeavor")]
public class Endeavor : Script, IScriptChangeMoveDamage
{
    /// <inheritdoc />
    public void ChangeMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
    {
        var user = move.User;
        var userHealth = user.CurrentHealth;
        var targetHealth = target.CurrentHealth;
        if (userHealth >= targetHealth)
        {
            return;
        }
        damage = targetHealth - userHealth;
    }
}