"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ShiftingTide = void 0;
const reference_data_1 = require("@firestone-hs/reference-data");
const stats_1 = require("../../../simulation/stats");
const utils_1 = require("../../../utils");
const applyShiftingTideToTarget = (target, input) => {
    const isNaga = (0, utils_1.hasCorrectTribe)(target, input.hero, reference_data_1.Race.NAGA, input.gameState.anomalies, input.gameState.allCards);
    const rounds = isNaga ? 2 : 1;
    const { attack, health } = (0, utils_1.withTavernSpellStatBuff)(input.hero, 1, 1, input.gameState.allCards, input.spellCardId);
    for (let r = 0; r < rounds; r++) {
        (0, stats_1.modifyStats)(target, input.source, attack, health, input.board, input.hero, input.gameState);
        (0, stats_1.modifyStats)(target, input.source, attack, health, input.board, input.hero, input.gameState);
    }
};
exports.ShiftingTide = {
    cardIds: ["BG32_815"],
    castTavernSpell: (_spellCardId, input) => {
        var _a;
        const target = (_a = input.target) !== null && _a !== void 0 ? _a : input.board.find((e) => e.health > 0 && !e.definitelyDead);
        if (target) {
            applyShiftingTideToTarget(target, input);
        }
    },
};
//# sourceMappingURL=shifting-tide.js.map