"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SoulFermenter = void 0;
const add_minion_to_board_1 = require("../../../simulation/add-minion-to-board");
const deathrattle_spawns_1 = require("../../../simulation/deathrattle-spawns");
const utils_1 = require("../../../utils");
exports.SoulFermenter = {
    cardIds: ["BG35_MagicItem_732"],
    startOfCombatTiming: 'start-of-combat',
    startOfCombat: (trinket, input) => {
        const targets = input.playerBoard.slice(0, 3);
        trinket.rememberedMinions = [];
        for (const target of targets) {
            const copy = (0, utils_1.copyEntity)(target);
            (0, add_minion_to_board_1.removeAurasFromSelf)(copy, input.playerBoard, input.playerEntity, input.gameState);
            trinket.rememberedMinions.push(copy);
            target.definitelyDead = true;
        }
        return true;
    },
    onAfterFriendlyMinionDeath: (trinket, input) => {
        var _a;
        if (input.board.length > 0 || ((_a = trinket.rememberedMinions) === null || _a === void 0 ? void 0 : _a.length) === 0) {
            return;
        }
        for (const minion of trinket.rememberedMinions) {
            (0, deathrattle_spawns_1.simplifiedSpawnEntitiesWithAddToBoard)(minion.cardId, 1, {
                boardWithDeadEntity: input.board,
                boardWithDeadEntityHero: input.hero,
                otherBoard: input.otherBoard,
                otherBoardHero: input.otherHero,
                gameState: input.gameState,
                deadEntity: minion,
            }, trinket, 0, minion);
        }
        trinket.rememberedMinions = [];
    },
};
//# sourceMappingURL=soul-fermenter.js.map