@firestone-hs/simulate-bgs-battle 1.1.702 → 1.1.704
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/board-entity.d.ts +1 -0
- package/dist/board-entity.js.map +1 -1
- package/dist/cards/impl/minion/abyssal-bruiser.js +14 -6
- package/dist/cards/impl/minion/abyssal-bruiser.js.map +1 -1
- package/dist/cards/impl/minion/banana-slamma.js +1 -1
- package/dist/cards/impl/minion/banana-slamma.js.map +1 -1
- package/dist/cards/impl/minion/beetle.js +7 -3
- package/dist/cards/impl/minion/beetle.js.map +1 -1
- package/dist/cards/impl/minion/bellowing-tyrant.js +7 -3
- package/dist/cards/impl/minion/bellowing-tyrant.js.map +1 -1
- package/dist/cards/impl/minion/diremuck-forager.js +5 -2
- package/dist/cards/impl/minion/diremuck-forager.js.map +1 -1
- package/dist/cards/impl/minion/falling-sky-golem.js +14 -6
- package/dist/cards/impl/minion/falling-sky-golem.js.map +1 -1
- package/dist/cards/impl/minion/karmic-chameleon.js +2 -0
- package/dist/cards/impl/minion/karmic-chameleon.js.map +1 -1
- package/dist/cards/impl/minion/malorne.js +12 -4
- package/dist/cards/impl/minion/malorne.js.map +1 -1
- package/dist/cards/impl/minion/raptor-elder.js +12 -4
- package/dist/cards/impl/minion/raptor-elder.js.map +1 -1
- package/dist/cards/impl/minion/reckless-cliffdiver.js +6 -2
- package/dist/cards/impl/minion/reckless-cliffdiver.js.map +1 -1
- package/dist/cards/impl/minion/ride-or-die.js +6 -2
- package/dist/cards/impl/minion/ride-or-die.js.map +1 -1
- package/dist/cards/impl/minion/ruthless-queensguard.js +1 -8
- package/dist/cards/impl/minion/ruthless-queensguard.js.map +1 -1
- package/dist/cards/impl/minion/sanlayn-scribe.js +1 -1
- package/dist/cards/impl/minion/sanlayn-scribe.js.map +1 -1
- package/dist/cards/impl/minion/scarlet-survivor.js +11 -7
- package/dist/cards/impl/minion/scarlet-survivor.js.map +1 -1
- package/dist/cards/impl/minion/spellbound-soul.js +12 -4
- package/dist/cards/impl/minion/spellbound-soul.js.map +1 -1
- package/dist/cards/impl/minion/stomping-stegodon-enchantment.js +2 -2
- package/dist/cards/impl/minion/stomping-stegodon-enchantment.js.map +1 -1
- package/dist/cards/impl/minion/stomping-stegodon.js +2 -1
- package/dist/cards/impl/minion/stomping-stegodon.js.map +1 -1
- package/dist/cards/impl/minion/timewarped-chameleon.js +2 -0
- package/dist/cards/impl/minion/timewarped-chameleon.js.map +1 -1
- package/dist/cards/impl/minion/timewarped-magnanimoose.js +5 -2
- package/dist/cards/impl/minion/timewarped-magnanimoose.js.map +1 -1
- package/dist/cards/impl/trinket/slamma-sticker.js +1 -1
- package/dist/cards/impl/trinket/slamma-sticker.js.map +1 -1
- package/dist/simulation/add-minion-to-board.d.ts +10 -2
- package/dist/simulation/add-minion-to-board.js +231 -81
- package/dist/simulation/add-minion-to-board.js.map +1 -1
- package/dist/simulation/after-attack.js +2 -0
- package/dist/simulation/after-attack.js.map +1 -1
- package/dist/simulation/attack.js +2 -0
- package/dist/simulation/attack.js.map +1 -1
- package/dist/simulation/pending-effects.d.ts +4 -0
- package/dist/simulation/pending-effects.js +23 -0
- package/dist/simulation/pending-effects.js.map +1 -0
- package/dist/simulation/remove-minion-from-board.d.ts +1 -1
- package/dist/simulation/remove-minion-from-board.js +5 -3
- package/dist/simulation/remove-minion-from-board.js.map +1 -1
- package/dist/simulation/simulator.js +2 -0
- package/dist/simulation/simulator.js.map +1 -1
- package/dist/simulation/start-of-combat/start-of-combat.js +2 -0
- package/dist/simulation/start-of-combat/start-of-combat.js.map +1 -1
- package/dist/simulation/stats.d.ts +1 -1
- package/dist/simulation/stats.js +3 -3
- package/dist/simulation/stats.js.map +1 -1
- package/package.json +1 -1
|
@@ -45,6 +45,8 @@ const handleSpawnEffect = (board, boardHero, otherBoard, otherHero, spawned, gam
|
|
|
45
45
|
otherBoard: otherBoard,
|
|
46
46
|
otherHero: otherHero,
|
|
47
47
|
applySelfAuras,
|
|
48
|
+
applyAttackAuras: true,
|
|
49
|
+
applyHealthAuras: true,
|
|
48
50
|
gameState,
|
|
49
51
|
});
|
|
50
52
|
}
|
|
@@ -86,6 +88,8 @@ const handleSpawnEffect = (board, boardHero, otherBoard, otherHero, spawned, gam
|
|
|
86
88
|
otherBoard: otherBoard,
|
|
87
89
|
otherHero: otherHero,
|
|
88
90
|
applySelfAuras,
|
|
91
|
+
applyAttackAuras: true,
|
|
92
|
+
applyHealthAuras: true,
|
|
89
93
|
gameState,
|
|
90
94
|
});
|
|
91
95
|
}
|
|
@@ -157,15 +161,21 @@ const handleAddedMinionAuraEffect = (board, boardHero, otherBoard, otherHero, sp
|
|
|
157
161
|
}
|
|
158
162
|
};
|
|
159
163
|
exports.handleAddedMinionAuraEffect = handleAddedMinionAuraEffect;
|
|
160
|
-
const applyAurasToSelf = (spawned, board, boardHero, gameState) => {
|
|
164
|
+
const applyAurasToSelf = (spawned, board, boardHero, gameState, applyAttackAuras = true, applyHealthAuras = true) => {
|
|
161
165
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
162
|
-
|
|
166
|
+
if (applyAttackAuras) {
|
|
167
|
+
spawned.attack += boardHero.globalInfo.AdditionalAttack;
|
|
168
|
+
}
|
|
163
169
|
if (!!((_a = boardHero.questRewards) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
164
170
|
for (const quest of boardHero.questRewards) {
|
|
165
171
|
switch (quest) {
|
|
166
172
|
case "BG24_Reward_364":
|
|
167
|
-
|
|
168
|
-
|
|
173
|
+
if (applyAttackAuras) {
|
|
174
|
+
spawned.attack += 7;
|
|
175
|
+
}
|
|
176
|
+
if (applyHealthAuras) {
|
|
177
|
+
spawned.health += 7;
|
|
178
|
+
}
|
|
169
179
|
spawned.enchantments.push({
|
|
170
180
|
cardId: "BG24_Reward_364e",
|
|
171
181
|
originEntityId: undefined,
|
|
@@ -182,67 +192,97 @@ const applyAurasToSelf = (spawned, board, boardHero, gameState) => {
|
|
|
182
192
|
for (const trinket of boardHero.trinkets) {
|
|
183
193
|
switch (trinket.cardId) {
|
|
184
194
|
case "BG30_MagicItem_880":
|
|
185
|
-
|
|
186
|
-
|
|
195
|
+
if (applyAttackAuras) {
|
|
196
|
+
spawned.attack += 2;
|
|
197
|
+
}
|
|
198
|
+
if (applyHealthAuras) {
|
|
199
|
+
spawned.health += 1;
|
|
200
|
+
}
|
|
187
201
|
break;
|
|
188
202
|
case "BG30_MagicItem_880t":
|
|
189
|
-
|
|
190
|
-
|
|
203
|
+
if (applyAttackAuras) {
|
|
204
|
+
spawned.attack += 8;
|
|
205
|
+
}
|
|
206
|
+
if (applyHealthAuras) {
|
|
207
|
+
spawned.health += 5;
|
|
208
|
+
}
|
|
191
209
|
break;
|
|
192
210
|
case "BG32_MagicItem_934":
|
|
193
|
-
|
|
211
|
+
if (applyAttackAuras) {
|
|
212
|
+
spawned.attack += trinket.scriptDataNum1 || 1;
|
|
213
|
+
}
|
|
194
214
|
break;
|
|
195
215
|
case "BG30_MagicItem_843t":
|
|
196
216
|
if (gameState.cardsData.getTavernLevel(spawned.cardId) <= 3) {
|
|
197
|
-
|
|
198
|
-
|
|
217
|
+
if (applyAttackAuras) {
|
|
218
|
+
spawned.attack += 7;
|
|
219
|
+
}
|
|
220
|
+
if (applyHealthAuras) {
|
|
221
|
+
spawned.health += 5;
|
|
222
|
+
}
|
|
199
223
|
}
|
|
200
224
|
break;
|
|
201
225
|
case "BG30_MagicItem_921":
|
|
202
226
|
if (spawned.cardId === "BGS_061t" ||
|
|
203
227
|
spawned.cardId === "TB_BaconUps_141t") {
|
|
204
|
-
|
|
228
|
+
if (applyAttackAuras) {
|
|
229
|
+
spawned.attack += 6;
|
|
230
|
+
}
|
|
205
231
|
}
|
|
206
232
|
break;
|
|
207
233
|
}
|
|
208
234
|
}
|
|
209
235
|
}
|
|
210
236
|
if (boardHero.globalInfo.HauntedCarapaceAttackBonus > 0) {
|
|
211
|
-
(
|
|
237
|
+
if (applyAttackAuras) {
|
|
238
|
+
(0, stats_1.modifyStats)(spawned, spawned, boardHero.globalInfo.HauntedCarapaceAttackBonus, 0, board, boardHero, gameState, false);
|
|
239
|
+
}
|
|
212
240
|
}
|
|
213
241
|
if (boardHero.globalInfo.HauntedCarapaceHealthBonus > 0) {
|
|
214
|
-
(
|
|
242
|
+
if (applyHealthAuras) {
|
|
243
|
+
(0, stats_1.modifyStats)(spawned, spawned, 0, boardHero.globalInfo.HauntedCarapaceHealthBonus, board, boardHero, gameState, false);
|
|
244
|
+
}
|
|
215
245
|
}
|
|
216
246
|
if ((0, utils_2.hasCorrectTribe)(spawned, boardHero, reference_data_1.Race.UNDEAD, gameState.anomalies, gameState.allCards)) {
|
|
217
247
|
if (boardHero.globalInfo.UndeadAttackBonus > 0) {
|
|
218
|
-
(
|
|
248
|
+
if (applyAttackAuras) {
|
|
249
|
+
(0, stats_1.modifyStats)(spawned, spawned, boardHero.globalInfo.UndeadAttackBonus, 0, board, boardHero, gameState, false);
|
|
250
|
+
}
|
|
219
251
|
}
|
|
220
252
|
}
|
|
221
253
|
if ((0, utils_2.hasCorrectTribe)(spawned, boardHero, reference_data_1.Race.PIRATE, gameState.anomalies, gameState.allCards)) {
|
|
222
254
|
if (boardHero.globalInfo.PirateAttackBonus > 0) {
|
|
223
|
-
(
|
|
255
|
+
if (applyAttackAuras) {
|
|
256
|
+
(0, stats_1.modifyStats)(spawned, spawned, boardHero.globalInfo.PirateAttackBonus, 0, board, boardHero, gameState, false);
|
|
257
|
+
}
|
|
224
258
|
}
|
|
225
259
|
}
|
|
226
260
|
if ((0, utils_2.hasCorrectTribe)(spawned, boardHero, reference_data_1.Race.BEAST, gameState.anomalies, gameState.allCards)) {
|
|
227
261
|
if (boardHero.globalInfo.GoldrinnBuffAtk > 0) {
|
|
228
|
-
|
|
262
|
+
const attackBuff = applyAttackAuras ? boardHero.globalInfo.GoldrinnBuffAtk : 0;
|
|
263
|
+
const healthBuff = applyHealthAuras ? boardHero.globalInfo.GoldrinnBuffHealth : 0;
|
|
264
|
+
(0, stats_1.modifyStats)(spawned, spawned, attackBuff, healthBuff, board, boardHero, gameState, false);
|
|
229
265
|
gameState.spectator.registerPowerTarget(boardHero, spawned, board, null, null);
|
|
230
266
|
}
|
|
231
267
|
}
|
|
232
268
|
if ((0, cards_data_1.isWhelp)(spawned.cardId, gameState.allCards)) {
|
|
233
|
-
|
|
269
|
+
const attackBuff = applyAttackAuras ? (_c = boardHero.globalInfo.WhelpAttackBuff) !== null && _c !== void 0 ? _c : 0 : 0;
|
|
270
|
+
const healthBuff = applyHealthAuras ? (_d = boardHero.globalInfo.WhelpHealthBuff) !== null && _d !== void 0 ? _d : 0 : 0;
|
|
271
|
+
(0, stats_1.modifyStats)(spawned, spawned, attackBuff, healthBuff, board, boardHero, gameState, false);
|
|
234
272
|
gameState.spectator.registerPowerTarget(boardHero, spawned, board, null, null);
|
|
235
273
|
}
|
|
236
274
|
if ((0, utils_2.isVolumizer)(spawned.cardId, boardHero, gameState.anomalies, gameState.allCards) &&
|
|
237
275
|
!(0, utils_2.alreadyHasVolumizerBuff)(spawned, boardHero, gameState)) {
|
|
238
276
|
if (boardHero.globalInfo.VolumizerAttackBuff > 0 || boardHero.globalInfo.VolumizerHealthBuff > 0) {
|
|
239
|
-
|
|
277
|
+
const attackBuff = applyAttackAuras ? (_e = boardHero.globalInfo.VolumizerAttackBuff) !== null && _e !== void 0 ? _e : 0 : 0;
|
|
278
|
+
const healthBuff = applyHealthAuras ? (_f = boardHero.globalInfo.VolumizerHealthBuff) !== null && _f !== void 0 ? _f : 0 : 0;
|
|
279
|
+
(0, stats_1.modifyStats)(spawned, spawned, attackBuff, healthBuff, board, boardHero, gameState, false);
|
|
240
280
|
gameState.spectator.registerPowerTarget(boardHero, spawned, board, null, null);
|
|
241
281
|
}
|
|
242
282
|
}
|
|
243
283
|
if (gameState.cardsData.getTavernLevel(spawned.cardId) % 2 === 1) {
|
|
244
|
-
const atkBuff = (_g = boardHero.globalInfo.MutatedLasherAttackBuff) !== null && _g !== void 0 ? _g : 0;
|
|
245
|
-
const healthBuff = (_h = boardHero.globalInfo.MutatedLasherHealthBuff) !== null && _h !== void 0 ? _h : 0;
|
|
284
|
+
const atkBuff = applyAttackAuras ? (_g = boardHero.globalInfo.MutatedLasherAttackBuff) !== null && _g !== void 0 ? _g : 0 : 0;
|
|
285
|
+
const healthBuff = applyHealthAuras ? (_h = boardHero.globalInfo.MutatedLasherHealthBuff) !== null && _h !== void 0 ? _h : 0 : 0;
|
|
246
286
|
(0, stats_1.modifyStats)(spawned, spawned, atkBuff, healthBuff, board, boardHero, gameState, false);
|
|
247
287
|
}
|
|
248
288
|
for (const entity of board) {
|
|
@@ -253,6 +293,8 @@ const applyAurasToSelf = (spawned, board, boardHero, gameState) => {
|
|
|
253
293
|
hero: boardHero,
|
|
254
294
|
board: board,
|
|
255
295
|
gameState,
|
|
296
|
+
applyAttackAuras,
|
|
297
|
+
applyHealthAuras,
|
|
256
298
|
});
|
|
257
299
|
}
|
|
258
300
|
switch (entity.cardId) {
|
|
@@ -260,28 +302,39 @@ const applyAurasToSelf = (spawned, board, boardHero, gameState) => {
|
|
|
260
302
|
case "TB_BaconUps_008":
|
|
261
303
|
if ((0, utils_2.hasCorrectTribe)(spawned, boardHero, reference_data_1.Race.MURLOC, gameState.anomalies, gameState.allCards) &&
|
|
262
304
|
entity.entityId !== spawned.entityId) {
|
|
263
|
-
|
|
305
|
+
if (applyAttackAuras) {
|
|
306
|
+
spawned.attack += entity.cardId === "TB_BaconUps_008" ? 4 : 2;
|
|
307
|
+
}
|
|
264
308
|
}
|
|
265
309
|
break;
|
|
266
310
|
case "BG_NEW1_027":
|
|
267
311
|
case "TB_BaconUps_136":
|
|
268
312
|
if ((0, utils_2.hasCorrectTribe)(spawned, boardHero, reference_data_1.Race.PIRATE, gameState.anomalies, gameState.allCards) &&
|
|
269
313
|
entity.entityId !== spawned.entityId) {
|
|
270
|
-
|
|
271
|
-
|
|
314
|
+
if (applyAttackAuras) {
|
|
315
|
+
spawned.attack += entity.cardId === "TB_BaconUps_136" ? 2 : 1;
|
|
316
|
+
}
|
|
317
|
+
if (applyHealthAuras) {
|
|
318
|
+
spawned.health += entity.cardId === "TB_BaconUps_136" ? 2 : 1;
|
|
319
|
+
}
|
|
272
320
|
}
|
|
273
321
|
break;
|
|
274
322
|
case "BG25_043":
|
|
275
323
|
case "BG25_043_G":
|
|
276
324
|
if (spawned.divineShield) {
|
|
277
|
-
|
|
325
|
+
if (applyAttackAuras) {
|
|
326
|
+
spawned.attack += entity.cardId === "BG25_043_G" ? 12 : 6;
|
|
327
|
+
}
|
|
278
328
|
}
|
|
279
329
|
break;
|
|
280
330
|
case "BG27_030":
|
|
281
331
|
case "BG27_030_G":
|
|
282
332
|
if ((0, utils_2.hasCorrectTribe)(spawned, boardHero, reference_data_1.Race.UNDEAD, gameState.anomalies, gameState.allCards) &&
|
|
283
333
|
entity.entityId !== spawned.entityId) {
|
|
284
|
-
|
|
334
|
+
if (applyAttackAuras) {
|
|
335
|
+
spawned.attack +=
|
|
336
|
+
(entity.cardId === "BG27_030_G" ? 2 : 1) * boardHero.tavernTier;
|
|
337
|
+
}
|
|
285
338
|
}
|
|
286
339
|
break;
|
|
287
340
|
}
|
|
@@ -292,6 +345,8 @@ const applyAurasToSelf = (spawned, board, boardHero, gameState) => {
|
|
|
292
345
|
hero: boardHero,
|
|
293
346
|
board: board,
|
|
294
347
|
gameState: gameState,
|
|
348
|
+
applyAttackAuras,
|
|
349
|
+
applyHealthAuras,
|
|
295
350
|
});
|
|
296
351
|
}
|
|
297
352
|
switch (spawned.cardId) {
|
|
@@ -299,67 +354,84 @@ const applyAurasToSelf = (spawned, board, boardHero, gameState) => {
|
|
|
299
354
|
case "BG25_008_G":
|
|
300
355
|
const multiplierKnight = spawned.cardId === "BG25_008_G" ? 2 : 1;
|
|
301
356
|
const statsBonusKnight = multiplierKnight * boardHero.globalInfo.EternalKnightsDeadThisGame;
|
|
302
|
-
(0, stats_1.modifyStats)(spawned, null, eternal_portrait_1.eternalKnightAttack * statsBonusKnight, eternal_portrait_1.eternalKnightHealth * statsBonusKnight, board, boardHero, gameState, false);
|
|
357
|
+
(0, stats_1.modifyStats)(spawned, null, applyAttackAuras ? eternal_portrait_1.eternalKnightAttack * statsBonusKnight : 0, applyHealthAuras ? eternal_portrait_1.eternalKnightHealth * statsBonusKnight : 0, board, boardHero, gameState, false);
|
|
303
358
|
break;
|
|
304
359
|
case "BG28_555":
|
|
305
360
|
case "BG28_555_G":
|
|
306
361
|
const multiplierFungus = spawned.cardId === "BG28_555_G" ? 2 : 1;
|
|
307
362
|
const statsBonusFungus = multiplierFungus * boardHero.globalInfo.TavernSpellsCastThisGame;
|
|
308
|
-
(0, stats_1.modifyStats)(spawned, null, statsBonusFungus, 2 * statsBonusFungus, board, boardHero, gameState, false);
|
|
363
|
+
(0, stats_1.modifyStats)(spawned, null, applyAttackAuras ? statsBonusFungus : 0, applyHealthAuras ? 2 * statsBonusFungus : 0, board, boardHero, gameState, false);
|
|
309
364
|
break;
|
|
310
365
|
case "BG26_537":
|
|
311
366
|
case "BG26_537_G":
|
|
312
367
|
const multiplierFrostling = spawned.cardId === "BG26_537_G" ? 2 : 1;
|
|
313
368
|
const statsBonusFrostling = multiplierFrostling * boardHero.globalInfo.FrostlingBonus;
|
|
314
|
-
(0, stats_1.modifyStats)(spawned, null, 2 * statsBonusFrostling, statsBonusFrostling, board, boardHero, gameState, false);
|
|
369
|
+
(0, stats_1.modifyStats)(spawned, null, applyAttackAuras ? 2 * statsBonusFrostling : 0, applyHealthAuras ? statsBonusFrostling : 0, board, boardHero, gameState, false);
|
|
315
370
|
break;
|
|
316
371
|
case "BGS_081":
|
|
317
372
|
case "TB_BaconUps_143":
|
|
318
373
|
const multiplierLooter = spawned.cardId === "TB_BaconUps_143" ? 2 : 1;
|
|
319
374
|
const statsBonusLooter = multiplierLooter * boardHero.globalInfo.PiratesSummonedThisGame;
|
|
320
|
-
(0, stats_1.modifyStats)(spawned, null, 2 * statsBonusLooter, 2 * multiplierLooter, board, boardHero, gameState, false);
|
|
375
|
+
(0, stats_1.modifyStats)(spawned, null, applyAttackAuras ? 2 * statsBonusLooter : 0, applyHealthAuras ? 2 * multiplierLooter : 0, board, boardHero, gameState, false);
|
|
321
376
|
break;
|
|
322
377
|
case "BG_TTN_401":
|
|
323
378
|
case "BG_TTN_401_G":
|
|
324
379
|
const multiplierAstral = spawned.cardId === "BG_TTN_401_G" ? 2 : 1;
|
|
325
380
|
const statsBonusAstral = multiplierAstral * (boardHero.globalInfo.AstralAutomatonsSummonedThisGame - 1);
|
|
326
|
-
(0, stats_1.modifyStats)(spawned, null, 3 * statsBonusAstral, 2 * statsBonusAstral, board, boardHero, gameState, false);
|
|
381
|
+
(0, stats_1.modifyStats)(spawned, null, applyAttackAuras ? 3 * statsBonusAstral : 0, applyHealthAuras ? 2 * statsBonusAstral : 0, board, boardHero, gameState, false);
|
|
327
382
|
break;
|
|
328
383
|
case "BG25_013":
|
|
329
384
|
case "BG25_013_G":
|
|
330
385
|
const multiplierGnoll = spawned.cardId === "BG25_013_G" ? 2 : 1;
|
|
331
386
|
const statsBonusGnoll = multiplierGnoll * gameState.sharedState.deaths.filter((e) => e.friendly === spawned.friendly).length;
|
|
332
|
-
(0, stats_1.modifyStats)(spawned, null, statsBonusGnoll, 0, board, boardHero, gameState, false);
|
|
387
|
+
(0, stats_1.modifyStats)(spawned, null, applyAttackAuras ? statsBonusGnoll : 0, applyHealthAuras ? 0 : 0, board, boardHero, gameState, false);
|
|
333
388
|
break;
|
|
334
389
|
}
|
|
335
390
|
};
|
|
336
391
|
exports.applyAurasToSelf = applyAurasToSelf;
|
|
337
|
-
const removeAurasFromSelf = (entity, board, boardHero, gameState) => {
|
|
392
|
+
const removeAurasFromSelf = (entity, board, boardHero, gameState, applyAttackAuras = true, applyHealthAuras = true) => {
|
|
338
393
|
var _a, _b;
|
|
339
|
-
|
|
394
|
+
if (applyAttackAuras) {
|
|
395
|
+
entity.attack -= Math.max(0, boardHero.globalInfo.AdditionalAttack);
|
|
396
|
+
entity.maxAttack -= Math.max(0, boardHero.globalInfo.AdditionalAttack);
|
|
397
|
+
}
|
|
340
398
|
const onDespawnedImpl = _card_mappings_1.cardMappings[entity.cardId];
|
|
341
399
|
if ((0, card_interface_1.hasOnDespawned)(onDespawnedImpl)) {
|
|
342
400
|
onDespawnedImpl.onDespawned(entity, {
|
|
343
401
|
hero: boardHero,
|
|
344
402
|
board: board,
|
|
345
403
|
gameState,
|
|
404
|
+
applyAttackAuras,
|
|
405
|
+
applyHealthAuras,
|
|
346
406
|
});
|
|
347
407
|
}
|
|
348
408
|
if (!!((_a = boardHero.questRewards) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
349
409
|
for (const quest of boardHero.questRewards) {
|
|
350
410
|
switch (quest) {
|
|
351
411
|
case "BG24_Reward_364":
|
|
352
|
-
|
|
353
|
-
|
|
412
|
+
if (applyAttackAuras) {
|
|
413
|
+
entity.attack = Math.max(0, entity.attack - 7);
|
|
414
|
+
entity.maxAttack = Math.max(0, entity.maxAttack - 7);
|
|
415
|
+
}
|
|
416
|
+
if (applyHealthAuras) {
|
|
417
|
+
entity.health = Math.max(1, entity.health - 7);
|
|
418
|
+
entity.maxHealth = Math.max(1, entity.health - 7);
|
|
419
|
+
}
|
|
354
420
|
entity.enchantments = entity.enchantments.filter((e) => e.cardId !== "BG24_Reward_364e");
|
|
355
421
|
break;
|
|
356
422
|
case "BG24_Reward_125":
|
|
357
|
-
|
|
423
|
+
if (applyAttackAuras) {
|
|
424
|
+
entity.attack = Math.max(0, entity.attack - 7);
|
|
425
|
+
entity.maxAttack = Math.max(0, entity.maxAttack - 7);
|
|
426
|
+
}
|
|
358
427
|
break;
|
|
359
428
|
case "BG30_MagicItem_921":
|
|
360
429
|
if (entity.cardId === "BG30_119" ||
|
|
361
430
|
entity.cardId === "BG30_119_G") {
|
|
362
|
-
|
|
431
|
+
if (applyAttackAuras) {
|
|
432
|
+
entity.attack = Math.max(0, entity.attack - 8);
|
|
433
|
+
entity.maxAttack = Math.max(0, entity.maxAttack - 8);
|
|
434
|
+
}
|
|
363
435
|
}
|
|
364
436
|
break;
|
|
365
437
|
}
|
|
@@ -369,40 +441,76 @@ const removeAurasFromSelf = (entity, board, boardHero, gameState) => {
|
|
|
369
441
|
for (const trinket of boardHero.trinkets) {
|
|
370
442
|
switch (trinket.cardId) {
|
|
371
443
|
case "BG30_MagicItem_880":
|
|
372
|
-
|
|
373
|
-
|
|
444
|
+
if (applyAttackAuras) {
|
|
445
|
+
entity.attack = Math.max(0, entity.attack - 2);
|
|
446
|
+
entity.maxAttack = Math.max(0, entity.maxAttack - 2);
|
|
447
|
+
}
|
|
448
|
+
if (applyHealthAuras) {
|
|
449
|
+
entity.health = Math.max(1, entity.health - 1);
|
|
450
|
+
entity.maxHealth = Math.max(1, entity.maxHealth - 1);
|
|
451
|
+
}
|
|
374
452
|
break;
|
|
375
453
|
case "BG30_MagicItem_880t":
|
|
376
|
-
|
|
377
|
-
|
|
454
|
+
if (applyAttackAuras) {
|
|
455
|
+
entity.attack = Math.max(0, entity.attack - 8);
|
|
456
|
+
entity.maxAttack = Math.max(0, entity.maxAttack - 8);
|
|
457
|
+
}
|
|
458
|
+
if (applyHealthAuras) {
|
|
459
|
+
entity.health = Math.max(1, entity.health - 5);
|
|
460
|
+
entity.maxHealth = Math.max(1, entity.maxHealth - 5);
|
|
461
|
+
}
|
|
378
462
|
break;
|
|
379
463
|
case "BG32_MagicItem_934":
|
|
380
|
-
|
|
464
|
+
if (applyAttackAuras) {
|
|
465
|
+
entity.attack = Math.max(0, entity.attack - (trinket.scriptDataNum1 || 1));
|
|
466
|
+
entity.maxAttack = Math.max(0, entity.maxAttack - (trinket.scriptDataNum1 || 1));
|
|
467
|
+
}
|
|
381
468
|
break;
|
|
382
469
|
case "BG30_MagicItem_843t":
|
|
383
470
|
if (gameState.cardsData.getTavernLevel(entity.cardId) <= 3) {
|
|
384
|
-
|
|
385
|
-
|
|
471
|
+
if (applyAttackAuras) {
|
|
472
|
+
entity.attack = Math.max(0, entity.attack - 7);
|
|
473
|
+
entity.maxAttack = Math.max(0, entity.maxAttack - 7);
|
|
474
|
+
}
|
|
475
|
+
if (applyHealthAuras) {
|
|
476
|
+
entity.health = Math.max(1, entity.health - 5);
|
|
477
|
+
entity.maxHealth = Math.max(1, entity.maxHealth - 5);
|
|
478
|
+
}
|
|
386
479
|
}
|
|
387
480
|
break;
|
|
388
481
|
}
|
|
389
482
|
}
|
|
390
483
|
}
|
|
391
484
|
if (boardHero.globalInfo.HauntedCarapaceAttackBonus > 0) {
|
|
392
|
-
|
|
485
|
+
if (applyAttackAuras) {
|
|
486
|
+
entity.attack = Math.max(0, entity.attack - boardHero.globalInfo.HauntedCarapaceAttackBonus);
|
|
487
|
+
entity.maxAttack = Math.max(0, entity.maxAttack - boardHero.globalInfo.HauntedCarapaceAttackBonus);
|
|
488
|
+
}
|
|
393
489
|
}
|
|
394
490
|
if (boardHero.globalInfo.HauntedCarapaceHealthBonus > 0) {
|
|
395
|
-
|
|
491
|
+
if (applyHealthAuras) {
|
|
492
|
+
entity.health = Math.max(1, entity.health - boardHero.globalInfo.HauntedCarapaceHealthBonus);
|
|
493
|
+
entity.maxHealth = Math.max(1, entity.maxHealth - boardHero.globalInfo.HauntedCarapaceHealthBonus);
|
|
494
|
+
}
|
|
396
495
|
}
|
|
397
496
|
if ((0, utils_2.hasCorrectTribe)(entity, boardHero, reference_data_1.Race.UNDEAD, gameState.anomalies, gameState.allCards)) {
|
|
398
497
|
if (boardHero.globalInfo.UndeadAttackBonus > 0) {
|
|
399
|
-
|
|
498
|
+
if (applyAttackAuras) {
|
|
499
|
+
entity.attack = Math.max(0, entity.attack - boardHero.globalInfo.UndeadAttackBonus);
|
|
500
|
+
entity.maxAttack = Math.max(0, entity.maxAttack - boardHero.globalInfo.UndeadAttackBonus);
|
|
501
|
+
}
|
|
400
502
|
}
|
|
401
503
|
}
|
|
402
504
|
if ((0, utils_2.hasCorrectTribe)(entity, boardHero, reference_data_1.Race.BEAST, gameState.anomalies, gameState.allCards)) {
|
|
403
505
|
if (boardHero.globalInfo.GoldrinnBuffAtk > 0) {
|
|
404
|
-
|
|
405
|
-
|
|
506
|
+
if (applyAttackAuras) {
|
|
507
|
+
entity.attack = Math.max(0, entity.attack - boardHero.globalInfo.GoldrinnBuffAtk);
|
|
508
|
+
entity.maxAttack = Math.max(0, entity.maxAttack - boardHero.globalInfo.GoldrinnBuffAtk);
|
|
509
|
+
}
|
|
510
|
+
if (applyHealthAuras) {
|
|
511
|
+
entity.health = Math.max(1, entity.health - boardHero.globalInfo.GoldrinnBuffHealth);
|
|
512
|
+
entity.maxHealth = Math.max(1, entity.maxHealth - boardHero.globalInfo.GoldrinnBuffHealth);
|
|
513
|
+
}
|
|
406
514
|
}
|
|
407
515
|
}
|
|
408
516
|
for (const boardEntity of board) {
|
|
@@ -411,29 +519,51 @@ const removeAurasFromSelf = (entity, board, boardHero, gameState) => {
|
|
|
411
519
|
case "TB_BaconUps_008":
|
|
412
520
|
if ((0, utils_2.hasCorrectTribe)(entity, boardHero, reference_data_1.Race.MURLOC, gameState.anomalies, gameState.allCards) &&
|
|
413
521
|
entity.entityId !== boardEntity.entityId) {
|
|
414
|
-
|
|
522
|
+
if (applyAttackAuras) {
|
|
523
|
+
entity.attack = Math.max(0, entity.attack -
|
|
524
|
+
(boardEntity.cardId === "TB_BaconUps_008" ? 4 : 2));
|
|
525
|
+
entity.maxAttack = Math.max(0, entity.maxAttack -
|
|
526
|
+
(boardEntity.cardId === "TB_BaconUps_008" ? 4 : 2));
|
|
527
|
+
}
|
|
415
528
|
}
|
|
416
529
|
break;
|
|
417
530
|
case "BG_NEW1_027":
|
|
418
531
|
case "TB_BaconUps_136":
|
|
419
532
|
if ((0, utils_2.hasCorrectTribe)(entity, boardHero, reference_data_1.Race.PIRATE, gameState.anomalies, gameState.allCards) &&
|
|
420
533
|
entity.entityId !== boardEntity.entityId) {
|
|
421
|
-
|
|
422
|
-
|
|
534
|
+
if (applyAttackAuras) {
|
|
535
|
+
entity.attack = Math.max(0, entity.attack -
|
|
536
|
+
(boardEntity.cardId === "TB_BaconUps_136" ? 2 : 1));
|
|
537
|
+
entity.maxAttack = Math.max(0, entity.maxAttack -
|
|
538
|
+
(boardEntity.cardId === "TB_BaconUps_136" ? 2 : 1));
|
|
539
|
+
}
|
|
540
|
+
if (applyHealthAuras) {
|
|
541
|
+
entity.health = Math.max(1, entity.health -
|
|
542
|
+
(boardEntity.cardId === "TB_BaconUps_136" ? 2 : 1));
|
|
543
|
+
entity.maxHealth = Math.max(1, entity.maxHealth -
|
|
544
|
+
(boardEntity.cardId === "TB_BaconUps_136" ? 2 : 1));
|
|
545
|
+
}
|
|
423
546
|
}
|
|
424
547
|
break;
|
|
425
548
|
case "BG25_043":
|
|
426
549
|
case "BG25_043_G":
|
|
427
550
|
if (entity.divineShield) {
|
|
428
|
-
|
|
551
|
+
if (applyAttackAuras) {
|
|
552
|
+
entity.attack = Math.max(0, entity.attack - (boardEntity.cardId === "BG25_043_G" ? 12 : 6));
|
|
553
|
+
entity.maxAttack = Math.max(0, entity.maxAttack - (boardEntity.cardId === "BG25_043_G" ? 12 : 6));
|
|
554
|
+
}
|
|
429
555
|
}
|
|
430
556
|
break;
|
|
431
557
|
case "BG27_030":
|
|
432
558
|
case "BG27_030_G":
|
|
433
559
|
if ((0, utils_2.hasCorrectTribe)(entity, boardHero, reference_data_1.Race.UNDEAD, gameState.anomalies, gameState.allCards) &&
|
|
434
560
|
entity.entityId !== boardEntity.entityId) {
|
|
435
|
-
|
|
436
|
-
|
|
561
|
+
if (applyAttackAuras) {
|
|
562
|
+
entity.attack = Math.max(0, entity.attack -
|
|
563
|
+
(boardEntity.cardId === "BG27_030_G" ? 2 : 1) * boardHero.tavernTier);
|
|
564
|
+
entity.maxAttack = Math.max(0, entity.maxAttack -
|
|
565
|
+
(boardEntity.cardId === "BG27_030_G" ? 2 : 1) * boardHero.tavernTier);
|
|
566
|
+
}
|
|
437
567
|
}
|
|
438
568
|
break;
|
|
439
569
|
}
|
|
@@ -443,41 +573,71 @@ const removeAurasFromSelf = (entity, board, boardHero, gameState) => {
|
|
|
443
573
|
case "BG25_008_G":
|
|
444
574
|
const multiplierKnight = entity.cardId === "BG25_008_G" ? 2 : 1;
|
|
445
575
|
const statsBonusKnight = multiplierKnight * boardHero.globalInfo.EternalKnightsDeadThisGame;
|
|
446
|
-
|
|
447
|
-
|
|
576
|
+
if (applyAttackAuras) {
|
|
577
|
+
entity.attack = Math.max(0, entity.attack - eternal_portrait_1.eternalKnightAttack * statsBonusKnight);
|
|
578
|
+
entity.maxAttack = Math.max(0, entity.maxAttack - eternal_portrait_1.eternalKnightAttack * statsBonusKnight);
|
|
579
|
+
}
|
|
580
|
+
if (applyHealthAuras) {
|
|
581
|
+
entity.health = Math.max(1, entity.health - eternal_portrait_1.eternalKnightHealth * statsBonusKnight);
|
|
582
|
+
entity.maxHealth = Math.max(1, entity.maxHealth - eternal_portrait_1.eternalKnightHealth * statsBonusKnight);
|
|
583
|
+
}
|
|
448
584
|
break;
|
|
449
585
|
case "BG28_555":
|
|
450
586
|
case "BG28_555_G":
|
|
451
587
|
const multiplierFungus = entity.cardId === "BG28_555_G" ? 2 : 1;
|
|
452
588
|
const statsBonusFungus = multiplierFungus * boardHero.globalInfo.TavernSpellsCastThisGame;
|
|
453
|
-
|
|
454
|
-
|
|
589
|
+
if (applyAttackAuras) {
|
|
590
|
+
entity.attack = Math.max(0, entity.attack - statsBonusFungus);
|
|
591
|
+
entity.maxAttack = Math.max(0, entity.maxAttack - statsBonusFungus);
|
|
592
|
+
}
|
|
593
|
+
if (applyHealthAuras) {
|
|
594
|
+
entity.health = Math.max(1, entity.health - 2 * statsBonusFungus);
|
|
595
|
+
entity.maxHealth = Math.max(1, entity.maxHealth - 2 * statsBonusFungus);
|
|
596
|
+
}
|
|
455
597
|
break;
|
|
456
598
|
case "BG26_537":
|
|
457
599
|
case "BG26_537_G":
|
|
458
600
|
const multiplierFrostling = entity.cardId === "BG26_537_G" ? 2 : 1;
|
|
459
601
|
const statsBonusFrostling = multiplierFrostling * boardHero.globalInfo.FrostlingBonus;
|
|
460
|
-
|
|
461
|
-
|
|
602
|
+
if (applyAttackAuras) {
|
|
603
|
+
entity.attack = Math.max(0, entity.attack - statsBonusFrostling);
|
|
604
|
+
entity.maxAttack = Math.max(0, entity.maxAttack - statsBonusFrostling);
|
|
605
|
+
}
|
|
606
|
+
if (applyHealthAuras) {
|
|
607
|
+
entity.health = Math.max(1, entity.health - statsBonusFrostling);
|
|
608
|
+
entity.maxHealth = Math.max(1, entity.maxHealth - statsBonusFrostling);
|
|
609
|
+
}
|
|
462
610
|
break;
|
|
463
611
|
case "BG_TTN_401":
|
|
464
612
|
case "BG_TTN_401_G":
|
|
465
613
|
const multiplierAstral = entity.cardId === "BG_TTN_401_G" ? 2 : 1;
|
|
466
614
|
const statsBonusAstral = multiplierAstral * (boardHero.globalInfo.AstralAutomatonsSummonedThisGame - 1);
|
|
467
|
-
|
|
468
|
-
|
|
615
|
+
if (applyAttackAuras) {
|
|
616
|
+
entity.attack = Math.max(0, entity.attack - 3 * statsBonusAstral);
|
|
617
|
+
entity.maxAttack = Math.max(0, entity.maxAttack - 3 * statsBonusAstral);
|
|
618
|
+
}
|
|
619
|
+
if (applyHealthAuras) {
|
|
620
|
+
entity.health = Math.max(1, entity.health - 2 * statsBonusAstral);
|
|
621
|
+
entity.maxHealth = Math.max(1, entity.maxHealth - 2 * statsBonusAstral);
|
|
622
|
+
}
|
|
469
623
|
break;
|
|
470
624
|
case "BG25_013":
|
|
471
625
|
case "BG25_013_G":
|
|
472
626
|
const multiplierGnoll = entity.cardId === "BG25_013_G" ? 2 : 1;
|
|
473
627
|
const statsBonusGnoll = multiplierGnoll * gameState.sharedState.deaths.filter((e) => e.friendly === entity.friendly).length;
|
|
474
|
-
|
|
628
|
+
if (applyAttackAuras) {
|
|
629
|
+
entity.attack = Math.max(0, entity.attack - statsBonusGnoll);
|
|
630
|
+
entity.maxAttack = Math.max(0, entity.maxAttack - statsBonusGnoll);
|
|
631
|
+
}
|
|
475
632
|
break;
|
|
476
633
|
}
|
|
477
634
|
for (const enchantment of entity.enchantments) {
|
|
478
635
|
switch (enchantment === null || enchantment === void 0 ? void 0 : enchantment.cardId) {
|
|
479
636
|
case "TB_BaconShop_HP_085e":
|
|
480
|
-
|
|
637
|
+
if (applyAttackAuras) {
|
|
638
|
+
entity.attack = Math.max(0, entity.attack - enchantment.tagScriptDataNum1);
|
|
639
|
+
entity.maxAttack = Math.max(0, entity.maxAttack - enchantment.tagScriptDataNum1);
|
|
640
|
+
}
|
|
481
641
|
break;
|
|
482
642
|
}
|
|
483
643
|
}
|
|
@@ -564,7 +724,7 @@ const onMinionSummoned = (hero, board, gameState) => {
|
|
|
564
724
|
};
|
|
565
725
|
exports.onMinionSummoned = onMinionSummoned;
|
|
566
726
|
const handleAfterSpawnEffect = (board, hero, otherBoard, otherHero, spawned, gameState) => {
|
|
567
|
-
var _a, _b
|
|
727
|
+
var _a, _b;
|
|
568
728
|
const initialBoard = [...board];
|
|
569
729
|
for (const trinket of (_a = hero.trinkets) !== null && _a !== void 0 ? _a : []) {
|
|
570
730
|
const onAfterSpawnedImpl = _card_mappings_1.cardMappings[trinket.cardId];
|
|
@@ -577,6 +737,8 @@ const handleAfterSpawnEffect = (board, hero, otherBoard, otherHero, spawned, gam
|
|
|
577
737
|
otherBoard: otherBoard,
|
|
578
738
|
gameState,
|
|
579
739
|
applySelfAuras: false,
|
|
740
|
+
applyAttackAuras: true,
|
|
741
|
+
applyHealthAuras: true,
|
|
580
742
|
});
|
|
581
743
|
}
|
|
582
744
|
}
|
|
@@ -594,6 +756,8 @@ const handleAfterSpawnEffect = (board, hero, otherBoard, otherHero, spawned, gam
|
|
|
594
756
|
otherBoard: otherBoard,
|
|
595
757
|
gameState,
|
|
596
758
|
applySelfAuras: false,
|
|
759
|
+
applyAttackAuras: true,
|
|
760
|
+
applyHealthAuras: true,
|
|
597
761
|
});
|
|
598
762
|
}
|
|
599
763
|
switch (entity.cardId) {
|
|
@@ -630,19 +794,5 @@ const handleAfterSpawnEffect = (board, hero, otherBoard, otherHero, spawned, gam
|
|
|
630
794
|
break;
|
|
631
795
|
}
|
|
632
796
|
}
|
|
633
|
-
for (const trinket of (_c = hero.trinkets) !== null && _c !== void 0 ? _c : []) {
|
|
634
|
-
const resolvedImpl = _card_mappings_1.cardMappings[trinket.cardId];
|
|
635
|
-
if ((0, card_interface_1.hasAfterOtherSpawned)(resolvedImpl)) {
|
|
636
|
-
resolvedImpl.afterOtherSpawned(trinket, {
|
|
637
|
-
spawned,
|
|
638
|
-
hero,
|
|
639
|
-
board,
|
|
640
|
-
otherHero,
|
|
641
|
-
otherBoard,
|
|
642
|
-
gameState,
|
|
643
|
-
applySelfAuras: false,
|
|
644
|
-
});
|
|
645
|
-
}
|
|
646
|
-
}
|
|
647
797
|
};
|
|
648
798
|
//# sourceMappingURL=add-minion-to-board.js.map
|