using PkmnLib.Plugin.Gen7.Scripts.Pokemon;

namespace PkmnLib.Plugin.Gen7.Scripts.Moves;

[Script(ScriptCategory.Move, "fury_cutter")]
public class FuryCutter : Script, IScriptChangeBasePower
{
    /// <inheritdoc />
    public void ChangeBasePower(IExecutingMove move, IPokemon target, byte hit, ref ushort basePower)
    {
        var userEffect = move.User.Volatile.Get<FuryCutterEffect>();
        if (userEffect == null)
        {
            move.User.Volatile.Add(new FuryCutterEffect());
            return;
        }

        if (userEffect.TurnCount < 5)
            userEffect.TurnCount++;
        basePower = basePower.MultiplyOrMax((byte)Math.Pow(2, userEffect.TurnCount));
    }
}