"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DisguisedGraverobber = void 0;
const reference_data_1 = require("@firestone-hs/reference-data");
const cards_in_hand_1 = require("../../../simulation/cards-in-hand");
const utils_1 = require("../../../services/utils");
const utils_2 = require("../../../utils");
exports.DisguisedGraverobber = {
    cardIds: ["BG28_303", "BG28_303_G"],
    battlecry: (entity, input) => {
        const { board, hero, gameState } = input;
        const disguisedGraverobberTarget = (0, utils_1.pickRandomAlive)(board.filter((e) => (0, utils_2.hasCorrectTribe)(e, hero, reference_data_1.Race.UNDEAD, gameState.anomalies, gameState.allCards)));
        if (disguisedGraverobberTarget) {
            const disguisedGraverobberNumberOfCopies = entity.cardId === "BG28_303" ? 1 : 2;
            disguisedGraverobberTarget.definitelyDead = true;
            const copies = Array.from({ length: disguisedGraverobberNumberOfCopies }).map((_) => disguisedGraverobberTarget.cardId);
            (0, cards_in_hand_1.addCardsInHand)(hero, board, copies, gameState);
        }
        return true;
    },
};
//# sourceMappingURL=disguised-graverobber.js.map