@firestone-hs/simulate-bgs-battle 1.1.395 → 1.1.397

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.
@@ -435,18 +435,20 @@ const bumpEntities = (entity, bumpInto, entityBoard, entityBoardHero, otherBoard
435
435
  (entity.cardId === "BG28_404" || entity.cardId === "BG28_404_G")) {
436
436
  entity.abiityChargesLeft--;
437
437
  const newTarget = (0, utils_1.pickRandom)(otherBoard);
438
- gameState.spectator.registerPowerTarget(entity, newTarget, otherBoard, entityBoardHero, otherHero);
439
- const newSource = {
440
- ...entity,
441
- attack: bumpInto.attack,
442
- attacking: true,
443
- };
444
- const defenderHadDivineShield = newTarget.divineShield;
445
- const damageDone = (0, exports.bumpEntities)(newTarget, newSource, otherBoard, otherHero, entityBoard, entityBoardHero, gameState, false);
446
- if (newSource.attack > 0 && defenderHadDivineShield) {
447
- (0, utils_2.updateDivineShield)(newTarget, otherBoard, false, gameState.allCards);
448
- }
449
- return damageDone;
438
+ if (newTarget) {
439
+ gameState.spectator.registerPowerTarget(entity, newTarget, otherBoard, entityBoardHero, otherHero);
440
+ const newSource = {
441
+ ...entity,
442
+ attack: bumpInto.attack,
443
+ attacking: true,
444
+ };
445
+ const defenderHadDivineShield = newTarget.divineShield;
446
+ const damageDone = (0, exports.bumpEntities)(newTarget, newSource, otherBoard, otherHero, entityBoard, entityBoardHero, gameState, false);
447
+ if (newSource.attack > 0 && defenderHadDivineShield) {
448
+ (0, utils_2.updateDivineShield)(newTarget, otherBoard, false, gameState.allCards);
449
+ }
450
+ return damageDone;
451
+ }
450
452
  }
451
453
  if (entity.divineShield) {
452
454
  for (let i = 0; i < entityBoard.length; i++) {
@@ -487,7 +489,7 @@ const bumpEntities = (entity, bumpInto, entityBoard, entityBoardHero, otherBoard
487
489
  entityBoard[i].cardId === "BG24_008_G") {
488
490
  if ((_a = entityBoard[i]) === null || _a === void 0 ? void 0 : _a.friendly) {
489
491
  const buff = entityBoard[i].cardId === "BG24_008_G" ? 2 : 1;
490
- (0, utils_2.grantRandomStats)(entityBoard[i], entityBoardHero.hand, entityBoardHero, buff, buff, null, true, gameState);
492
+ (0, utils_2.grantRandomStats)(entityBoard[i], entityBoardHero.hand.filter((e) => { var _a; return ((_a = gameState.allCards.getCard(e.cardId).type) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === reference_data_1.CardType[reference_data_1.CardType.MINION]; }), entityBoardHero, buff, buff, null, true, gameState);
491
493
  }
492
494
  }
493
495
  }