"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.WhelpWatcher = void 0;
const deathrattle_spawns_1 = require("../../../simulation/deathrattle-spawns");
const spawns_1 = require("../../../simulation/spawns");
exports.WhelpWatcher = {
    cardIds: ["BG34_631", "BG34_631_G"],
    rally: (minion, input) => {
        if (!input.defendingEntity) {
            return { dmgDoneByAttacker: 0, dmgDoneByDefender: 0 };
        }
        const spawnInput = {
            boardWithDeadEntity: input.attackingBoard,
            boardWithDeadEntityHero: input.attackingHero,
            gameState: input.gameState,
            deadEntity: input.attacker,
            otherBoard: input.defendingBoard,
            otherBoardHero: input.defendingHero,
        };
        const spawnCardId = minion.cardId === "BG34_631_G"
            ? "BG34_630_Gt"
            : "BG34_630t";
        const spawns = (0, deathrattle_spawns_1.simplifiedSpawnEntities)(spawnCardId, 1, spawnInput);
        spawns.forEach((e) => {
            e.attackImmediately = true;
        });
        const spawned = (0, spawns_1.performEntitySpawns)(spawns, spawnInput.boardWithDeadEntity, spawnInput.boardWithDeadEntityHero, minion, input.attackingBoard.length - input.attackingBoard.indexOf(input.attacker) - 1, spawnInput.otherBoard, spawnInput.otherBoardHero, spawnInput.gameState, true, input.defendingEntity);
        spawned.forEach((e) => {
            e.hasAttacked = 0;
        });
        return {
            dmgDoneByAttacker: 0,
            dmgDoneByDefender: 0,
        };
    },
};
//# sourceMappingURL=whelp-watcher.js.map