"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.StompingStegodon = exports.stompingStegodonHealth = exports.stompingStegodonAttack = void 0;
const reference_data_1 = require("@firestone-hs/reference-data");
const stats_1 = require("../../../simulation/stats");
const utils_1 = require("../../../utils");
exports.stompingStegodonAttack = 3;
exports.stompingStegodonHealth = 0;
exports.StompingStegodon = {
    cardIds: ["BG33_840", "BG33_840_G"],
    rally: (minion, input) => {
        var _a;
        const mult = minion.cardId === "BG33_840_G" ? 2 : 1;
        const candidates = input.attackingBoard.filter((e) => e !== input.attacker &&
            (0, utils_1.hasCorrectTribe)(e, input.attackingHero, reference_data_1.Race.BEAST, input.gameState.anomalies, input.gameState.allCards));
        const enchantmentCardIdToAdd = minion.cardId === "BG33_840_G"
            ? "BG33_840_Ge2"
            : "BG33_840e2";
        for (const candidate of candidates) {
            (0, stats_1.modifyStats)(candidate, input.attacker, exports.stompingStegodonAttack * mult, exports.stompingStegodonHealth * mult, input.attackingBoard, input.attackingHero, input.gameState);
            let existingEnchantment = candidate.enchantments.find((e) => e.cardId === enchantmentCardIdToAdd);
            if (!existingEnchantment) {
                existingEnchantment = {
                    cardId: enchantmentCardIdToAdd,
                    originEntityId: input.attacker.entityId,
                    timing: input.gameState.sharedState.currentEntityId++,
                    repeats: 0,
                };
                candidate.enchantments.push(existingEnchantment);
            }
            existingEnchantment.repeats = ((_a = existingEnchantment.repeats) !== null && _a !== void 0 ? _a : 0) + 1;
        }
        return { dmgDoneByAttacker: 0, dmgDoneByDefender: 0 };
    },
};
//# sourceMappingURL=stomping-stegodon.js.map