using PkmnLib.Plugin.Gen7.Scripts.Side;

namespace PkmnLib.Plugin.Gen7.Scripts.Moves;

[Script(ScriptCategory.Move, "healing_wish")]
public class HealingWish : Script, IScriptOnSecondaryEffect
{
    /// <inheritdoc />
    public void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
    {
        var battleData = move.User.BattleData;
        if (battleData == null)
            return;

        var side = battleData.Battle.Sides[battleData.SideIndex];
        side.VolatileScripts.Add(new HealingWishEffect(battleData.Position));

        move.User.Faint(DamageSource.Misc);
    }
}