"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SilentEnforcer = void 0;
const reference_data_1 = require("@firestone-hs/reference-data");
const attack_1 = require("../../../simulation/attack");
const utils_1 = require("../../../utils");
exports.SilentEnforcer = {
    cardIds: ["BG33_156", "BG33_156_G"],
    deathrattleSpawn: (minion, input) => {
        const mult = minion.cardId === "BG33_156_G" ? 2 : 1;
        const friendlyMinionsAliveAtStart = input.boardWithDeadEntity.filter((e) => e.health > 0 && !e.definitelyDead);
        const opponentMinionsAliveAtStart = input.otherBoard.filter((e) => e.health > 0 && !e.definitelyDead);
        for (let i = 0; i < mult; i++) {
            const targets = [
                ...friendlyMinionsAliveAtStart.filter((e) => !(0, utils_1.hasCorrectTribe)(e, input.boardWithDeadEntityHero, reference_data_1.Race.DEMON, input.gameState.anomalies, input.gameState.allCards)),
                ...opponentMinionsAliveAtStart,
            ];
            for (const target of targets) {
                input.gameState.spectator.registerPowerTarget(minion, target, input.boardWithDeadEntity, input.boardWithDeadEntityHero, input.otherBoardHero);
                (0, attack_1.dealDamageToMinion)(target, input.otherBoard, input.otherBoardHero, minion, 2, input.boardWithDeadEntity, input.boardWithDeadEntityHero, input.gameState);
            }
        }
        return [];
    },
};
//# sourceMappingURL=silent-enforcer.js.map