"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ApexisGuardian = void 0;
const reference_data_1 = require("@firestone-hs/reference-data");
const utils_1 = require("../../../services/utils");
const magnetize_1 = require("../../../simulation/magnetize");
const utils_2 = require("../../../utils");
exports.ApexisGuardian = {
    cardIds: ["BG34_173", "BG34_173_G"],
    deathrattleSpawn: (minion, input) => {
        const loops = minion.cardId === "BG34_173_G" ? 2 : 1;
        const cardsToMagnetize = [];
        const possibleTargets = input.boardWithDeadEntity.filter((e) => e.health > 0 &&
            !e.definitelyDead &&
            e !== minion &&
            (0, utils_2.hasCorrectTribe)(e, input.boardWithDeadEntityHero, reference_data_1.Race.MECH, input.gameState.anomalies, input.gameState.allCards));
        const targets = (0, utils_1.pickMultipleRandomDifferent)(possibleTargets, 2);
        for (let i = 0; i < loops; i++) {
            const cardIdToMagnetize = input.gameState.cardsData.getRandomMagneticVolumizer(input.boardWithDeadEntityHero, input.gameState.anomalies, 6);
            const cardToMagnetize = {
                ...input.gameState.allCards.getCard(cardIdToMagnetize),
            };
            cardsToMagnetize.push(cardToMagnetize);
        }
        (0, magnetize_1.magnetizeToTarget)(targets, minion, cardsToMagnetize, input.boardWithDeadEntity, input.boardWithDeadEntityHero, input.otherBoard, input.otherBoardHero, input.gameState);
        return [];
    },
};
//# sourceMappingURL=apexis-guardian.js.map