@firestone-hs/simulate-bgs-battle 1.1.478 → 1.1.480
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/cards-data.js +2 -2
- package/dist/cards/cards-data.js.map +1 -1
- package/dist/debug-state.d.ts +9 -34
- package/dist/debug-state.js +5 -15
- package/dist/debug-state.js.map +1 -1
- package/dist/simulate-bgs-battle.js +2 -0
- package/dist/simulate-bgs-battle.js.map +1 -1
- package/dist/simulation/add-minion-to-board.js +14 -14
- package/dist/simulation/add-minion-to-board.js.map +1 -1
- package/dist/simulation/after-attack.js +2 -1
- package/dist/simulation/after-attack.js.map +1 -1
- package/dist/simulation/attack.js +1 -0
- package/dist/simulation/attack.js.map +1 -1
- package/dist/simulation/avenge.js +4 -3
- package/dist/simulation/avenge.js.map +1 -1
- package/dist/simulation/battlecries.js +1 -1
- package/dist/simulation/battlecries.js.map +1 -1
- package/dist/simulation/deathrattle-effects.js +24 -17
- package/dist/simulation/deathrattle-effects.js.map +1 -1
- package/dist/simulation/deathrattle-orchestration.js +3 -1
- package/dist/simulation/deathrattle-orchestration.js.map +1 -1
- package/dist/simulation/minion-death.js +21 -12
- package/dist/simulation/minion-death.js.map +1 -1
- package/dist/simulation/minion-kill.js +2 -4
- package/dist/simulation/minion-kill.js.map +1 -1
- package/dist/simulation/remembered-deathrattle.d.ts +9 -0
- package/dist/simulation/remembered-deathrattle.js +34 -0
- package/dist/simulation/remembered-deathrattle.js.map +1 -0
- package/dist/simulation/simulator.js +3 -0
- package/dist/simulation/simulator.js.map +1 -1
- package/dist/simulation/spawn-fail.js +3 -3
- package/dist/simulation/spawn-fail.js.map +1 -1
- package/dist/simulation/start-of-combat.js +41 -8
- package/dist/simulation/start-of-combat.js.map +1 -1
- package/dist/simulation/stats.js +3 -1
- package/dist/simulation/stats.js.map +1 -1
- package/dist/simulation/summon-when-space.js +1 -1
- package/dist/simulation/summon-when-space.js.map +1 -1
- package/dist/utils.js +2 -2
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
|
@@ -41,6 +41,9 @@ const handleStartOfCombat = (playerEntity, playerBoard, opponentEntity, opponent
|
|
|
41
41
|
};
|
|
42
42
|
exports.handleStartOfCombat = handleStartOfCombat;
|
|
43
43
|
const handlePreCombatHeroPowers = (playerEntity, playerBoard, opponentEntity, opponentBoard, currentAttacker, gameState) => {
|
|
44
|
+
const initialPlayerBoardSize0 = playerBoard.length;
|
|
45
|
+
const initialOpponentBoardSize0 = opponentBoard.length;
|
|
46
|
+
const initialCurrentAttacker = currentAttacker;
|
|
44
47
|
if (Math.random() < 0.5) {
|
|
45
48
|
currentAttacker = handlePreCombatHeroPowersForPlayer(playerEntity, playerBoard, opponentEntity, opponentBoard, currentAttacker, true, gameState);
|
|
46
49
|
currentAttacker = handlePreCombatHeroPowersForPlayer(opponentEntity, opponentBoard, playerEntity, playerBoard, currentAttacker, false, gameState);
|
|
@@ -49,7 +52,17 @@ const handlePreCombatHeroPowers = (playerEntity, playerBoard, opponentEntity, op
|
|
|
49
52
|
currentAttacker = handlePreCombatHeroPowersForPlayer(opponentEntity, opponentBoard, playerEntity, playerBoard, currentAttacker, false, gameState);
|
|
50
53
|
currentAttacker = handlePreCombatHeroPowersForPlayer(playerEntity, playerBoard, opponentEntity, opponentBoard, currentAttacker, true, gameState);
|
|
51
54
|
}
|
|
55
|
+
const initialPlayerBoardSize = playerBoard.length;
|
|
56
|
+
const initialOpponentBoardSize = opponentBoard.length;
|
|
52
57
|
(0, summon_when_space_1.handleSummonsWhenSpace)(playerBoard, playerEntity, opponentBoard, opponentEntity, gameState);
|
|
58
|
+
if (playerBoard.length !== initialPlayerBoardSize || opponentBoard.length !== initialOpponentBoardSize) {
|
|
59
|
+
currentAttacker =
|
|
60
|
+
playerBoard.length > opponentBoard.length
|
|
61
|
+
? 0
|
|
62
|
+
: opponentBoard.length > playerBoard.length
|
|
63
|
+
? 1
|
|
64
|
+
: Math.round(Math.random());
|
|
65
|
+
}
|
|
53
66
|
return currentAttacker;
|
|
54
67
|
};
|
|
55
68
|
const handlePreCombatHeroPowersForPlayer = (playerEntity, playerBoard, opponentEntity, opponentBoard, currentAttacker, friendly, gameState) => {
|
|
@@ -81,6 +94,10 @@ const handlePreCombatHeroPowersForPlayer = (playerEntity, playerBoard, opponentE
|
|
|
81
94
|
handleEmbraceYourRageForPlayer(playerBoard, playerEntity, opponentBoard, opponentEntity, gameState);
|
|
82
95
|
shouldRecomputeCurrentAttacker = true;
|
|
83
96
|
}
|
|
97
|
+
else if (playerEntity.heroPowerUsed && playerHeroPowerId === "BG23_HERO_201p") {
|
|
98
|
+
playerEntity.heroPowerActivated = false;
|
|
99
|
+
shouldRecomputeCurrentAttacker = true;
|
|
100
|
+
}
|
|
84
101
|
else if (playerEntity.heroPowerUsed && playerHeroPowerId === "TB_BaconShop_HP_024") {
|
|
85
102
|
handleRebornRitesForPlayer(playerBoard, playerEntity, opponentBoard, opponentEntity, gameState);
|
|
86
103
|
}
|
|
@@ -282,15 +299,17 @@ const handleStartOfCombatSpellsForPlayer = (playerEntity, playerBoard, opponentE
|
|
|
282
299
|
const minionsByAttack = [...playerBoard].sort((a, b) => a.attack - b.attack);
|
|
283
300
|
const firstTarget = minionsByAttack[0];
|
|
284
301
|
(0, stats_1.setEntityStats)(firstTarget, 2 * firstTarget.maxAttack, 2 * firstTarget.maxHealth, playerBoard, playerEntity, gameState);
|
|
302
|
+
gameState.spectator.registerPowerTarget(trinket, firstTarget, playerBoard, null, null);
|
|
285
303
|
if (playerBoard.length > 1) {
|
|
286
304
|
const secondTarget = minionsByAttack[1];
|
|
287
305
|
(0, stats_1.setEntityStats)(secondTarget, 2 * secondTarget.maxAttack, 2 * secondTarget.maxHealth, playerBoard, playerEntity, gameState);
|
|
306
|
+
gameState.spectator.registerPowerTarget(trinket, secondTarget, playerBoard, null, null);
|
|
288
307
|
}
|
|
289
308
|
}
|
|
290
309
|
break;
|
|
291
310
|
case "BG30_MagicItem_970":
|
|
292
311
|
case "BG30_MagicItem_970t":
|
|
293
|
-
const medallionBuff = trinket.cardId === "BG30_MagicItem_970" ? 2 :
|
|
312
|
+
const medallionBuff = trinket.cardId === "BG30_MagicItem_970" ? 2 : 6;
|
|
294
313
|
(0, utils_2.addStatsToBoard)(trinket, playerBoard, playerEntity, medallionBuff, medallionBuff, gameState);
|
|
295
314
|
break;
|
|
296
315
|
case "BG30_MagicItem_542":
|
|
@@ -371,19 +390,25 @@ const handleStartOfCombatSpellsForPlayer = (playerEntity, playerBoard, opponentE
|
|
|
371
390
|
break;
|
|
372
391
|
case "BG30_MagicItem_822":
|
|
373
392
|
case "BG30_MagicItem_822t2":
|
|
374
|
-
trinket.rememberedMinion = null;
|
|
375
393
|
break;
|
|
376
394
|
case "BG30_MagicItem_989":
|
|
377
395
|
case "BG30_MagicItem_989t":
|
|
378
|
-
const artisanalUrnBuff = trinket.cardId === "BG30_MagicItem_989" ? 3 :
|
|
396
|
+
const artisanalUrnBuff = trinket.cardId === "BG30_MagicItem_989" ? 3 : 8;
|
|
379
397
|
playerEntity.globalInfo.UndeadAttackBonus =
|
|
380
398
|
((_b = playerEntity.globalInfo.UndeadAttackBonus) !== null && _b !== void 0 ? _b : 0) + artisanalUrnBuff;
|
|
381
399
|
break;
|
|
382
400
|
case "BG30_MagicItem_310":
|
|
383
|
-
|
|
384
|
-
.filter((
|
|
385
|
-
|
|
386
|
-
|
|
401
|
+
if (trinket.scriptDataNum1 != 99) {
|
|
402
|
+
const buffBonus = playerEntity.trinkets.filter((t) => t.cardId === "BG30_MagicItem_310").length;
|
|
403
|
+
playerBoard
|
|
404
|
+
.filter((e) => e.cardId === "BG25_354" ||
|
|
405
|
+
e.cardId === "BG25_354_G")
|
|
406
|
+
.forEach((e) => {
|
|
407
|
+
(0, stats_1.modifyStats)(e, 0, buffBonus * e.health, playerBoard, playerEntity, gameState);
|
|
408
|
+
gameState.spectator.registerPowerTarget(trinket, e, playerBoard, null, null);
|
|
409
|
+
});
|
|
410
|
+
playerEntity.trinkets.forEach((t) => (t.scriptDataNum1 = 99));
|
|
411
|
+
}
|
|
387
412
|
break;
|
|
388
413
|
case "BG30_MagicItem_441":
|
|
389
414
|
const highestHealthMinionInHand = (_c = playerEntity.hand) === null || _c === void 0 ? void 0 : _c.sort((a, b) => b.health - a.health)[0];
|
|
@@ -403,7 +428,10 @@ const handleStartOfCombatSpellsForPlayer = (playerEntity, playerBoard, opponentE
|
|
|
403
428
|
case "BG30_MagicItem_403":
|
|
404
429
|
if (playerBoard.length > 0) {
|
|
405
430
|
playerBoard
|
|
406
|
-
.filter((e) =>
|
|
431
|
+
.filter((e) => {
|
|
432
|
+
const tribes = (0, utils_2.getEffectiveTribesForEntity)(e, playerEntity, gameState.allCards);
|
|
433
|
+
return tribes.length === 0;
|
|
434
|
+
})
|
|
407
435
|
.forEach((entity) => {
|
|
408
436
|
(0, stats_1.setEntityStats)(entity, 3 * entity.attack, 3 * entity.health, playerBoard, playerEntity, gameState);
|
|
409
437
|
gameState.spectator.registerPowerTarget(trinket, entity, playerBoard, null, null);
|
|
@@ -412,13 +440,18 @@ const handleStartOfCombatSpellsForPlayer = (playerEntity, playerBoard, opponentE
|
|
|
412
440
|
break;
|
|
413
441
|
case "BG30_MagicItem_972":
|
|
414
442
|
if (playerBoard.length > 0) {
|
|
443
|
+
let minionsToCopy = 2;
|
|
415
444
|
for (let i = 0; i < Math.min(playerBoard.length, 7); i++) {
|
|
445
|
+
if (minionsToCopy <= 0) {
|
|
446
|
+
break;
|
|
447
|
+
}
|
|
416
448
|
const entityToCoy = playerBoard[i];
|
|
417
449
|
const copy = (0, utils_2.copyEntity)(entityToCoy);
|
|
418
450
|
(0, add_minion_to_board_1.removeAurasFromSelf)(copy, playerBoard, playerEntity, gameState);
|
|
419
451
|
const newMinions = (0, deathrattle_spawns_1.spawnEntities)(copy.cardId, 1, playerBoard, playerEntity, opponentBoard, opponentEntity, gameState.allCards, gameState.cardsData, gameState.sharedState, gameState.spectator, playerEntity.friendly, false, false, false, copy);
|
|
420
452
|
const spawns = (0, spawns_1.performEntitySpawns)(newMinions, playerBoard, playerEntity, playerEntity, playerBoard.length - i - 1, opponentBoard, opponentEntity, gameState);
|
|
421
453
|
i += spawns.length;
|
|
454
|
+
minionsToCopy--;
|
|
422
455
|
}
|
|
423
456
|
}
|
|
424
457
|
currentAttacker =
|