namespace PkmnLib.Plugin.Gen7.Scripts.Moves;

[Script(ScriptCategory.Move, "tri_attack")]
public class TriAttack : Script, IScriptOnSecondaryEffect
{
    /// <inheritdoc />
    public void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
    {
        var random = move.Battle.Random;
        if (!random.EffectChance(20, move, target, hit))
            return;
        var status = random.OneOf([
            ScriptUtils.ResolveName<Status.Burned>(),
            ScriptUtils.ResolveName<Status.Paralyzed>(),
            ScriptUtils.ResolveName<Status.Frozen>(),
        ]);
        target.SetStatus(status, move.User);
    }
}