"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Dramaloc = void 0;
const reference_data_1 = require("@firestone-hs/reference-data");
const utils_1 = require("../../../services/utils");
const stats_1 = require("../../../simulation/stats");
const utils_2 = require("../../../utils");
exports.Dramaloc = {
    cardIds: ["BG34_143", "BG34_143_G"],
    deathrattleSpawn: (minion, input) => {
        const mult = minion.cardId === "BG34_143_G" ? 2 : 1;
        const statsSource = input.boardWithDeadEntityHero.hand
            .filter((e) => e.attack != null && !!e.cardId)
            .sort((a, b) => b.attack - a.attack)[0];
        if (!!statsSource) {
            for (let i = 0; i < mult; i++) {
                const candidates = input.boardWithDeadEntity.filter((e) => e !== minion &&
                    (0, utils_2.hasCorrectTribe)(e, input.boardWithDeadEntityHero, reference_data_1.Race.MURLOC, input.gameState.anomalies, input.gameState.allCards));
                const targets = (0, utils_1.pickMultipleRandom)(candidates, 2);
                for (const target of targets) {
                    (0, stats_1.modifyStats)(target, minion, statsSource.attack, 0, input.boardWithDeadEntity, input.boardWithDeadEntityHero, input.gameState);
                }
            }
        }
        return [];
    },
};
//# sourceMappingURL=dramaloc.js.map