namespace PkmnLib.Plugin.Gen7.Scripts.Moves;

[Script(ScriptCategory.Move, "psywave")]
public class Psywave : Script, IScriptChangeMoveDamage
{
    /// <inheritdoc />
    public void ChangeMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
    {
        if (move.User.BattleData == null)
            return;

        var random = move.User.BattleData.Battle.Random.GetInt(0, 10);
        var level = (uint)move.User.Level;
        var power = level.MultiplyOrMax(0.5f + 0.1f * random);
        damage = power;
    }
}