"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BluesySiren = void 0;
const reference_data_1 = require("@firestone-hs/reference-data");
const cast_tavern_spell_1 = require("../../../mechanics/cast-tavern-spell");
const utils_1 = require("../../../utils");
exports.BluesySiren = {
    cardIds: ["BG34_931", "BG34_931_G"],
    defaultCharges: (entity) => 3,
    onWheneverAnotherMinionAttacks: (minion, input) => {
        return process(minion, input);
    },
    rally: (minion, input) => {
        return process(minion, input);
    },
};
const process = (minion, input) => {
    if (minion.abiityChargesLeft <= 0) {
        return { dmgDoneByAttacker: 0, dmgDoneByDefender: 0 };
    }
    if (!(0, utils_1.hasCorrectTribe)(input.attacker, input.attackingHero, reference_data_1.Race.NAGA, input.gameState.anomalies, input.gameState.allCards)) {
        return { dmgDoneByAttacker: 0, dmgDoneByDefender: 0 };
    }
    minion.abiityChargesLeft = minion.abiityChargesLeft - 1;
    const mult = minion.cardId === "BG34_931_G" ? 2 : 1;
    for (let i = 0; i < mult; i++) {
        const spellCast = "BG26_502t";
        (0, cast_tavern_spell_1.castTavernSpell)(spellCast, {
            spellCardId: spellCast,
            source: input.attackingHero,
            target: input.attacker,
            board: input.attackingBoard,
            hero: input.attackingHero,
            otherBoard: input.defendingBoard,
            otherHero: input.defendingHero,
            gameState: input.gameState,
        });
    }
    return { dmgDoneByAttacker: 0, dmgDoneByDefender: 0 };
};
//# sourceMappingURL=bluesy-siren.js.map