namespace PkmnLib.Plugin.Gen7.Scripts.Moves;

[Script(ScriptCategory.Move, "volt_tackle")]
public class VoltTackle : Script, IScriptOnSecondaryEffect
{
    /// <inheritdoc />
    public void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
    {
        var hitData = move.GetHitData(target, hit);
        var recoilDamage = (uint)(hitData.Damage * (1f / 3f));
        move.User.Damage(recoilDamage, DamageSource.Misc);

        if (move.Battle.Random.EffectChance(10, move, target, hit))
        {
            target.SetStatus(ScriptUtils.ResolveName<Status.Paralyzed>(), move.User);
        }
    }
}