"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Butchering = void 0;
const reference_data_1 = require("@firestone-hs/reference-data");
const utils_1 = require("../../../services/utils");
const global_info_helpers_1 = require("../../../simulation/global-info-helpers");
const utils_2 = require("../../../utils");
exports.Butchering = {
    cardIds: ["BG28_604"],
    castTavernSpell: (_spellCardId, input) => {
        const undeadTargets = input.board.filter((e) => e.health > 0 &&
            !e.definitelyDead &&
            (0, utils_2.hasCorrectTribe)(e, input.hero, reference_data_1.Race.UNDEAD, input.gameState.anomalies, input.gameState.allCards));
        const target = input.target && undeadTargets.includes(input.target) ? input.target : (0, utils_1.pickRandom)(undeadTargets);
        if (!target) {
            return;
        }
        target.health = 0;
        target.definitelyDead = true;
        (0, global_info_helpers_1.increaseUndeadAttackBonus)(input.hero, input.board, input.hero, 3, input.gameState);
    },
};
//# sourceMappingURL=butchering.js.map