"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FallingSkyGolem = void 0;
const divine_shield_1 = require("../../../keywords/divine-shield");
exports.FallingSkyGolem = {
    cardIds: ["BG35_342", "BG35_342_G"],
    onSpawned: (minion, input) => {
        var _a;
        const mult = minion.cardId === "BG35_342_G" ? 2 : 1;
        const n = (_a = input.hero.globalInfo.DeathrattlesTriggeredThisGame) !== null && _a !== void 0 ? _a : 0;
        const atk = 4 * mult * n;
        const hp = 2 * mult * n;
        minion.attack += atk;
        minion.health += hp;
        minion.maxAttack = minion.attack;
        minion.maxHealth = Math.max(minion.maxHealth, minion.health);
        const otherHero = input.gameState.gameState.player.player === input.hero
            ? input.gameState.gameState.opponent.player
            : input.gameState.gameState.player.player;
        (0, divine_shield_1.updateDivineShield)(minion, input.board, input.hero, otherHero, true, input.gameState);
    },
    onDespawned: (minion, input) => {
        var _a;
        const mult = minion.cardId === "BG35_342_G" ? 2 : 1;
        const n = (_a = input.hero.globalInfo.DeathrattlesTriggeredThisGame) !== null && _a !== void 0 ? _a : 0;
        const atk = 4 * mult * n;
        const hp = 2 * mult * n;
        minion.attack = Math.max(0, minion.attack - atk);
        minion.health = Math.max(1, minion.health - hp);
    },
};
//# sourceMappingURL=falling-sky-golem.js.map