"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.increaseWhelpBuff = exports.increaseGoldrinnBuff = exports.increaseMechAttackBonus = exports.increasePirateAttackBonus = exports.increaseUndeadHealthBonus = exports.increaseUndeadAttackBonus = void 0;
const reference_data_1 = require("@firestone-hs/reference-data");
const cards_data_1 = require("../cards/cards-data");
const utils_1 = require("../utils");
const stats_1 = require("./stats");
const increaseUndeadAttackBonus = (source, board, hero, amount, gameState, countsAsStatsGain = true) => {
    var _a;
    hero.globalInfo.UndeadAttackBonus = ((_a = hero.globalInfo.UndeadAttackBonus) !== null && _a !== void 0 ? _a : 0) + amount;
    (0, utils_1.addStatsToBoard)(source, board, hero, amount, 0, gameState, reference_data_1.Race[reference_data_1.Race.UNDEAD], countsAsStatsGain);
};
exports.increaseUndeadAttackBonus = increaseUndeadAttackBonus;
const increaseUndeadHealthBonus = (source, board, hero, amount, gameState) => {
    var _a;
    hero.globalInfo.UndeadHealthBonus = ((_a = hero.globalInfo.UndeadHealthBonus) !== null && _a !== void 0 ? _a : 0) + amount;
    (0, utils_1.addStatsToBoard)(source, board, hero, 0, amount, gameState, reference_data_1.Race[reference_data_1.Race.UNDEAD], false);
};
exports.increaseUndeadHealthBonus = increaseUndeadHealthBonus;
const increasePirateAttackBonus = (source, board, hero, amount, gameState) => {
    var _a;
    hero.globalInfo.PirateAttackBonus = ((_a = hero.globalInfo.PirateAttackBonus) !== null && _a !== void 0 ? _a : 0) + amount;
    (0, utils_1.addStatsToBoard)(source, board, hero, amount, 0, gameState, reference_data_1.Race[reference_data_1.Race.PIRATE], false);
};
exports.increasePirateAttackBonus = increasePirateAttackBonus;
const increaseMechAttackBonus = (source, board, hero, amount, gameState) => {
    var _a;
    hero.globalInfo.MechAttackBonus = ((_a = hero.globalInfo.MechAttackBonus) !== null && _a !== void 0 ? _a : 0) + amount;
    (0, utils_1.addStatsToBoard)(source, board, hero, amount, 0, gameState, reference_data_1.Race[reference_data_1.Race.MECH], false);
};
exports.increaseMechAttackBonus = increaseMechAttackBonus;
const increaseGoldrinnBuff = (source, board, hero, attack, health, gameState) => {
    var _a, _b;
    hero.globalInfo.GoldrinnBuffAtk = ((_a = hero.globalInfo.GoldrinnBuffAtk) !== null && _a !== void 0 ? _a : 0) + attack;
    hero.globalInfo.GoldrinnBuffHealth = ((_b = hero.globalInfo.GoldrinnBuffHealth) !== null && _b !== void 0 ? _b : 0) + health;
    (0, utils_1.addStatsToBoard)(source, board, hero, attack, health, gameState, reference_data_1.Race[reference_data_1.Race.BEAST]);
};
exports.increaseGoldrinnBuff = increaseGoldrinnBuff;
const increaseWhelpBuff = (source, board, hero, attack, health, gameState) => {
    var _a, _b;
    hero.globalInfo.WhelpAttackBuff = ((_a = hero.globalInfo.WhelpAttackBuff) !== null && _a !== void 0 ? _a : 0) + attack;
    hero.globalInfo.WhelpHealthBuff = ((_b = hero.globalInfo.WhelpHealthBuff) !== null && _b !== void 0 ? _b : 0) + health;
    const targets = board.filter((entity) => (0, cards_data_1.isWhelp)(entity.cardId, gameState.allCards));
    targets.forEach((target) => {
        (0, stats_1.modifyStats)(target, target, attack, health, board, hero, gameState, false);
    });
};
exports.increaseWhelpBuff = increaseWhelpBuff;
//# sourceMappingURL=global-info-helpers.js.map