"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Mummifier = void 0;
const reference_data_1 = require("@firestone-hs/reference-data");
const reborn_1 = require("../../../keywords/reborn");
const utils_1 = require("../../../services/utils");
const utils_2 = require("../../../utils");
exports.Mummifier = {
    cardIds: ["BG28_309", "BG28_309_G"],
    deathrattleSpawn: (minion, input) => {
        const mummifierBuff = minion.cardId === "BG28_309_G" ? 2 : 1;
        for (let j = 0; j < mummifierBuff; j++) {
            const targets = input.boardWithDeadEntity
                .filter((e) => e.cardId !== "BG28_309" && e.cardId !== "BG28_309_G")
                .filter((e) => !e.reborn)
                .filter((e) => (0, utils_2.hasCorrectTribe)(e, input.boardWithDeadEntityHero, reference_data_1.Race.UNDEAD, input.gameState.anomalies, input.gameState.allCards));
            const target = (0, utils_1.pickRandom)(targets, minion);
            if (target) {
                (0, reborn_1.updateReborn)(target, true, input.boardWithDeadEntity, input.boardWithDeadEntityHero, input.otherBoardHero, input.gameState);
                input.gameState.spectator.registerPowerTarget(minion, target, input.boardWithDeadEntity, input.boardWithDeadEntityHero, input.otherBoardHero);
            }
        }
        return [];
    },
};
//# sourceMappingURL=mummifier.js.map