"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getTavernSpellEffectRepeatCount = void 0;
const getTavernSpellEffectRepeatCount = (input) => {
    var _a;
    if (input.source !== input.hero) {
        return 1;
    }
    let repeats = 1;
    const hasGoldenBalinda = input.board.some((e) => e.cardId === "BG35_883_G");
    const hasNormalBalinda = input.board.some((e) => e.cardId === "BG35_883");
    if ((hasGoldenBalinda || hasNormalBalinda) &&
        input.target &&
        input.board.some((e) => e.entityId === input.target.entityId)) {
        repeats = hasGoldenBalinda ? 3 : 2;
    }
    const maelstromExtra = input.board.filter((e) => e.cardId === "BG34_922").length +
        2 * input.board.filter((e) => e.cardId === "BG34_922_G").length;
    repeats += maelstromExtra;
    const spellCard = input.gameState.allCards.getCard(input.spellCardId);
    const isBountySpell = (_a = spellCard === null || spellCard === void 0 ? void 0 : spellCard.mechanics) === null || _a === void 0 ? void 0 : _a.includes('BACON_BOUNTY');
    if (isBountySpell && input.source === input.hero) {
        const proudPrivateerExtra = input.board.filter((e) => e.cardId === "BG33_825").length +
            2 * input.board.filter((e) => e.cardId === "BG33_825_G").length;
        repeats += proudPrivateerExtra;
    }
    return repeats;
};
exports.getTavernSpellEffectRepeatCount = getTavernSpellEffectRepeatCount;
//# sourceMappingURL=tavern-spell-repeat.js.map