using PkmnLib.Plugin.Gen7.Scripts.Pokemon;

namespace PkmnLib.Plugin.Gen7.Scripts.Moves;

[Script(ScriptCategory.Move, "freeze_shock")]
public class FreezeShock : BaseChargeMove<RequireChargeEffect>
{
    /// <inheritdoc />
    public override RequireChargeEffect CreateVolatile(IPokemon user) => new(user, "freeze_shock");

    /// <inheritdoc />
    public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
    {
        var battleData = target.BattleData;
        if (battleData == null)
            return;

        if (battleData.Battle.Random.EffectChance(30, move, target, hit))
        {
            target.SetStatus("paralyzed", move.User);
        }
    }
}