"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RideOrDie = void 0;
const reference_data_1 = require("@firestone-hs/reference-data");
const utils_1 = require("../../../utils");
const attackBuff = 1;
exports.RideOrDie = {
    cardIds: ["BG33_115", "BG33_115_G"],
    onSpawned: (minion, input) => {
        const mult = minion.cardId === "BG33_115_G" ? 2 : 1;
        const targets = input.board
            .filter((e) => e !== minion)
            .filter((e) => (0, utils_1.hasCorrectTribe)(e, input.hero, reference_data_1.Race.UNDEAD, input.gameState.anomalies, input.gameState.allCards));
        for (const target of targets) {
            if (input.applyAttackAuras) {
                target.attack += attackBuff * mult;
            }
        }
    },
    onDespawned: (minion, input) => {
        const mult = minion.cardId === "BG33_115_G" ? 2 : 1;
        const targets = input.board
            .filter((e) => e !== minion)
            .filter((e) => (0, utils_1.hasCorrectTribe)(e, input.hero, reference_data_1.Race.UNDEAD, input.gameState.anomalies, input.gameState.allCards));
        for (const target of targets) {
            if (input.applyAttackAuras) {
                target.attack = Math.max(0, target.attack - attackBuff * mult);
            }
        }
    },
    onOtherSpawned: (minion, input) => {
        const debug = true;
        if (!(0, utils_1.hasCorrectTribe)(input.spawned, input.hero, reference_data_1.Race.UNDEAD, input.gameState.anomalies, input.gameState.allCards)) {
            return;
        }
        const mult = minion.cardId === "BG33_115_G" ? 2 : 1;
        input.spawned.attack += attackBuff * mult;
    },
};
//# sourceMappingURL=ride-or-die.js.map