@firestone-hs/simulate-bgs-battle 1.1.136 → 1.1.141

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.
Files changed (35) hide show
  1. package/dist/bgs-battle-info.d.ts +6 -0
  2. package/dist/bgs-battle-info.js.map +1 -1
  3. package/dist/bgs-battle-options.d.ts +1 -0
  4. package/dist/bgs-battle-options.js.map +1 -1
  5. package/dist/bgs-player-entity.d.ts +2 -0
  6. package/dist/bgs-player-entity.js.map +1 -1
  7. package/dist/board-entity.d.ts +1 -0
  8. package/dist/board-entity.js.map +1 -1
  9. package/dist/cards/cards-data.d.ts +2 -0
  10. package/dist/cards/cards-data.js +21 -4
  11. package/dist/cards/cards-data.js.map +1 -1
  12. package/dist/simulate-bgs-battle.js +12 -6
  13. package/dist/simulate-bgs-battle.js.map +1 -1
  14. package/dist/simulation/attack.d.ts +2 -2
  15. package/dist/simulation/attack.js +38 -24
  16. package/dist/simulation/attack.js.map +1 -1
  17. package/dist/simulation/auras.js +22 -0
  18. package/dist/simulation/auras.js.map +1 -1
  19. package/dist/simulation/deathrattle-effects.d.ts +7 -2
  20. package/dist/simulation/deathrattle-effects.js +176 -17
  21. package/dist/simulation/deathrattle-effects.js.map +1 -1
  22. package/dist/simulation/deathrattle-spawns.js +26 -4
  23. package/dist/simulation/deathrattle-spawns.js.map +1 -1
  24. package/dist/simulation/frenzy.js +1 -1
  25. package/dist/simulation/frenzy.js.map +1 -1
  26. package/dist/simulation/simulator.d.ts +2 -1
  27. package/dist/simulation/simulator.js +2 -2
  28. package/dist/simulation/simulator.js.map +1 -1
  29. package/dist/simulation/start-of-combat.d.ts +3 -2
  30. package/dist/simulation/start-of-combat.js +62 -6
  31. package/dist/simulation/start-of-combat.js.map +1 -1
  32. package/dist/utils.d.ts +3 -1
  33. package/dist/utils.js +81 -22
  34. package/dist/utils.js.map +1 -1
  35. package/package.json +4 -4
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.rememberDeathrattles = exports.addCardsInHand = exports.dealDamageToAllMinions = exports.applyMinionDeathEffect = exports.addStatsToBoard = exports.handleDeathrattleEffects = void 0;
3
+ exports.rememberDeathrattles = exports.applyMonstrosity = exports.addCardsInHand = exports.dealDamageToAllMinions = exports.applyMinionDeathEffect = exports.addStatsToBoard = exports.applyEarthInvocationEnchantment = exports.applyFireInvocationEnchantment = exports.applyWaterInvocationEnchantment = exports.applyLightningInvocationEnchantment = exports.handleDeathrattleEffects = void 0;
4
4
  const reference_data_1 = require("@firestone-hs/reference-data");
5
5
  const utils_1 = require("../services/utils");
6
6
  const utils_2 = require("../utils");
@@ -24,6 +24,35 @@ const handleDeathrattleEffects = (boardWithDeadEntity, boardWithDeadEntityHero,
24
24
  grantRandomDivineShield(deadEntity, boardWithDeadEntity, spectator);
25
25
  }
26
26
  break;
27
+ case "TB_BaconShop_HERO_76_Buddy":
28
+ for (let i = 0; i < multiplier; i++) {
29
+ const target = utils_1.pickRandom(boardWithDeadEntity);
30
+ if (target) {
31
+ target.divineShield = true;
32
+ target.taunt = true;
33
+ target.windfury = true;
34
+ spectator.registerPowerTarget(deadEntity, target, boardWithDeadEntity);
35
+ }
36
+ }
37
+ break;
38
+ case "TB_BaconShop_HERO_76_Buddy_G":
39
+ for (let i = 0; i < multiplier; i++) {
40
+ const target = utils_1.pickRandom(boardWithDeadEntity);
41
+ if (target) {
42
+ target.divineShield = true;
43
+ target.taunt = true;
44
+ target.windfury = true;
45
+ spectator.registerPowerTarget(deadEntity, target, boardWithDeadEntity);
46
+ const target2 = utils_1.pickRandom(boardWithDeadEntity.filter((e) => e.entityId !== target.entityId));
47
+ if (target2) {
48
+ target2.divineShield = true;
49
+ target2.taunt = true;
50
+ target2.windfury = true;
51
+ spectator.registerPowerTarget(deadEntity, target, boardWithDeadEntity);
52
+ }
53
+ }
54
+ }
55
+ break;
27
56
  case "BGS_040":
28
57
  case "TB_BaconUps_154":
29
58
  for (let i = 0; i < multiplier; i++) {
@@ -101,6 +130,26 @@ const handleDeathrattleEffects = (boardWithDeadEntity, boardWithDeadEntityHero,
101
130
  applyLeapFroggerEffect(boardWithDeadEntity, deadEntity, true, allCards, spectator);
102
131
  }
103
132
  break;
133
+ case "TB_BaconShop_HERO_17_Buddy":
134
+ for (let i = 0; i < multiplier; i++) {
135
+ const numberOfDeadMechsThisCombat = sharedState.deaths
136
+ .filter((entity) => entity.friendly === deadEntity.friendly)
137
+ .filter((entity) => { var _a; return utils_2.isCorrectTribe((_a = allCards.getCard(entity.cardId)) === null || _a === void 0 ? void 0 : _a.race, reference_data_1.Race.MECH); }).length;
138
+ for (let j = 0; j < numberOfDeadMechsThisCombat + 1; j++) {
139
+ attack_1.dealDamageToRandomEnemy(otherBoard, otherBoardHero, deadEntity, 4, boardWithDeadEntity, boardWithDeadEntityHero, allCards, cardsData, sharedState, spectator);
140
+ }
141
+ }
142
+ break;
143
+ case "TB_BaconShop_HERO_17_Buddy_G":
144
+ for (let i = 0; i < multiplier; i++) {
145
+ const numberOfDeadMechsThisCombat = sharedState.deaths
146
+ .filter((entity) => entity.friendly === deadEntity.friendly)
147
+ .filter((entity) => { var _a; return utils_2.isCorrectTribe((_a = allCards.getCard(entity.cardId)) === null || _a === void 0 ? void 0 : _a.race, reference_data_1.Race.MECH); }).length;
148
+ for (let j = 0; j < numberOfDeadMechsThisCombat + 1; j++) {
149
+ attack_1.dealDamageToRandomEnemy(otherBoard, otherBoardHero, deadEntity, 8, boardWithDeadEntity, boardWithDeadEntityHero, allCards, cardsData, sharedState, spectator);
150
+ }
151
+ }
152
+ break;
104
153
  case "BOT_606":
105
154
  for (let i = 0; i < multiplier; i++) {
106
155
  attack_1.dealDamageToRandomEnemy(otherBoard, otherBoardHero, deadEntity, 4, boardWithDeadEntity, boardWithDeadEntityHero, allCards, cardsData, sharedState, spectator);
@@ -112,6 +161,34 @@ const handleDeathrattleEffects = (boardWithDeadEntity, boardWithDeadEntityHero,
112
161
  attack_1.dealDamageToRandomEnemy(otherBoard, otherBoardHero, deadEntity, 4, boardWithDeadEntity, boardWithDeadEntityHero, allCards, cardsData, sharedState, spectator);
113
162
  }
114
163
  break;
164
+ case "TB_BaconShop_HERO_41_Buddy":
165
+ for (let i = 0; i < Math.min(1, boardWithDeadEntity.length); i++) {
166
+ const rightMostMinion = boardWithDeadEntity[boardWithDeadEntity.length - i];
167
+ if (rightMostMinion) {
168
+ const refCard = allCards.getCard(rightMostMinion.cardId);
169
+ const goldenCard = allCards.getCardFromDbfId(refCard.battlegroundsPremiumDbfId);
170
+ rightMostMinion.cardId = goldenCard.id;
171
+ utils_2.modifyAttack(rightMostMinion, refCard.attack, boardWithDeadEntity, allCards);
172
+ utils_2.modifyHealth(rightMostMinion, refCard.health, boardWithDeadEntity, allCards);
173
+ utils_2.afterStatsUpdate(rightMostMinion, boardWithDeadEntity, allCards);
174
+ spectator.registerPowerTarget(deadEntity, rightMostMinion, boardWithDeadEntity);
175
+ }
176
+ break;
177
+ }
178
+ case "TB_BaconShop_HERO_41_Buddy_G":
179
+ for (let i = 0; i < Math.min(2, boardWithDeadEntity.length); i++) {
180
+ const rightMostMinion = boardWithDeadEntity[boardWithDeadEntity.length - i];
181
+ if (rightMostMinion) {
182
+ const refCard = allCards.getCard(rightMostMinion.cardId);
183
+ const goldenCard = allCards.getCardFromDbfId(refCard.battlegroundsPremiumDbfId);
184
+ rightMostMinion.cardId = goldenCard.id;
185
+ utils_2.modifyAttack(rightMostMinion, refCard.attack, boardWithDeadEntity, allCards);
186
+ utils_2.modifyHealth(rightMostMinion, refCard.health, boardWithDeadEntity, allCards);
187
+ utils_2.afterStatsUpdate(rightMostMinion, boardWithDeadEntity, allCards);
188
+ spectator.registerPowerTarget(deadEntity, rightMostMinion, boardWithDeadEntity);
189
+ }
190
+ break;
191
+ }
115
192
  }
116
193
  let enchantments = [...((_a = deadEntity.enchantments) !== null && _a !== void 0 ? _a : [])];
117
194
  const threshold = 20;
@@ -144,10 +221,68 @@ const handleDeathrattleEffects = (boardWithDeadEntity, boardWithDeadEntityHero,
144
221
  }
145
222
  }
146
223
  break;
224
+ case "BG22_HERO_001_Buddy_e1":
225
+ exports.applyEarthInvocationEnchantment(boardWithDeadEntity, deadEntity, allCards, spectator);
226
+ break;
227
+ case "BG22_HERO_001_Buddy_e2":
228
+ exports.applyFireInvocationEnchantment(boardWithDeadEntity, deadEntity, allCards, spectator);
229
+ break;
230
+ case "BG22_HERO_001_Buddy_e3":
231
+ exports.applyWaterInvocationEnchantment(boardWithDeadEntity, deadEntity, allCards, spectator);
232
+ break;
233
+ case "BG22_HERO_001_Buddy_e4":
234
+ exports.applyLightningInvocationEnchantment(boardWithDeadEntity, boardWithDeadEntityHero, deadEntity, otherBoard, otherBoardHero, allCards, cardsData, sharedState, spectator);
235
+ break;
147
236
  }
148
237
  }
149
238
  };
150
239
  exports.handleDeathrattleEffects = handleDeathrattleEffects;
240
+ const applyLightningInvocationEnchantment = (boardWithDeadEntity, boardWithDeadEntityHero, deadEntity, otherBoard, otherBoardHero, allCards, cardsData, sharedState, spectator) => {
241
+ const multiplier = (deadEntity === null || deadEntity === void 0 ? void 0 : deadEntity.cardId) === "BG22_HERO_001_Buddy_G" ? 2 : 1;
242
+ for (let i = 0; i < multiplier; i++) {
243
+ const targets = utils_2.pickMultipleRandomDifferent(otherBoard, 5);
244
+ for (const target of targets) {
245
+ attack_1.dealDamageToEnemy(target, otherBoard, otherBoardHero, deadEntity, 1, boardWithDeadEntity, boardWithDeadEntityHero, allCards, cardsData, sharedState, spectator);
246
+ }
247
+ }
248
+ };
249
+ exports.applyLightningInvocationEnchantment = applyLightningInvocationEnchantment;
250
+ const applyWaterInvocationEnchantment = (boardWithDeadEntity, deadEntity, allCards, spectator) => {
251
+ const multiplier = (deadEntity === null || deadEntity === void 0 ? void 0 : deadEntity.cardId) === "BG22_HERO_001_Buddy_G" ? 2 : 1;
252
+ for (let i = 0; i < multiplier; i++) {
253
+ const target = boardWithDeadEntity[boardWithDeadEntity.length - 1];
254
+ if (!!target) {
255
+ utils_2.modifyHealth(target, 3, boardWithDeadEntity, allCards);
256
+ target.taunt = true;
257
+ utils_2.afterStatsUpdate(target, boardWithDeadEntity, allCards);
258
+ }
259
+ }
260
+ };
261
+ exports.applyWaterInvocationEnchantment = applyWaterInvocationEnchantment;
262
+ const applyFireInvocationEnchantment = (boardWithDeadEntity, deadEntity, allCards, spectator) => {
263
+ const multiplier = (deadEntity === null || deadEntity === void 0 ? void 0 : deadEntity.cardId) === "BG22_HERO_001_Buddy_G" ? 2 : 1;
264
+ for (let i = 0; i < multiplier; i++) {
265
+ const target = boardWithDeadEntity[0];
266
+ if (!!target) {
267
+ utils_2.modifyAttack(target, target.attack, boardWithDeadEntity, allCards);
268
+ utils_2.afterStatsUpdate(target, boardWithDeadEntity, allCards);
269
+ }
270
+ }
271
+ };
272
+ exports.applyFireInvocationEnchantment = applyFireInvocationEnchantment;
273
+ const applyEarthInvocationEnchantment = (boardWithDeadEntity, deadEntity, allCards, spectator) => {
274
+ const multiplier = (deadEntity === null || deadEntity === void 0 ? void 0 : deadEntity.cardId) === "BG22_HERO_001_Buddy_G" ? 2 : 1;
275
+ for (let i = 0; i < multiplier; i++) {
276
+ const minionsGrantedDeathrattle = utils_2.pickMultipleRandomDifferent(boardWithDeadEntity, 4);
277
+ minionsGrantedDeathrattle.forEach((minion) => {
278
+ minion.enchantments.push({
279
+ cardId: "BG22_HERO_001p_t1e",
280
+ originEntityId: deadEntity === null || deadEntity === void 0 ? void 0 : deadEntity.entityId,
281
+ });
282
+ });
283
+ }
284
+ };
285
+ exports.applyEarthInvocationEnchantment = applyEarthInvocationEnchantment;
151
286
  const applyLeapFroggerEffect = (boardWithDeadEntity, deadEntity, isPremium, allCards, spectator, multiplier = 1) => {
152
287
  var _a;
153
288
  multiplier = multiplier || 1;
@@ -180,7 +315,7 @@ const addStatsToBoard = (sourceEntity, board, attack, health, allCards, spectato
180
315
  for (const entity of board) {
181
316
  if (!tribe || utils_2.isCorrectTribe(allCards.getCard(entity.cardId).race, reference_data_1.Race[tribe])) {
182
317
  utils_2.modifyAttack(entity, attack, board, allCards);
183
- utils_2.modifyHealth(entity, health);
318
+ utils_2.modifyHealth(entity, health, board, allCards);
184
319
  utils_2.afterStatsUpdate(entity, board, allCards);
185
320
  spectator.registerPowerTarget(sourceEntity, entity, board);
186
321
  }
@@ -249,7 +384,7 @@ const applyMinionDeathEffect = (deadEntity, deadEntityIndex, boardWithDeadEntity
249
384
  .filter((entity) => entity.entityId !== deadEntity.lastAffectedByEntity.entityId);
250
385
  otherPirates.forEach((pirate) => {
251
386
  utils_2.modifyAttack(pirate, 2, boardWithDeadEntity, allCards);
252
- utils_2.modifyHealth(pirate, 2);
387
+ utils_2.modifyHealth(pirate, 2, boardWithDeadEntity, allCards);
253
388
  utils_2.afterStatsUpdate(pirate, boardWithDeadEntity, allCards);
254
389
  spectator.registerPowerTarget(deadEntity.lastAffectedByEntity, pirate, otherBoard);
255
390
  });
@@ -260,7 +395,7 @@ const applyMinionDeathEffect = (deadEntity, deadEntityIndex, boardWithDeadEntity
260
395
  .filter((entity) => entity.entityId !== deadEntity.lastAffectedByEntity.entityId);
261
396
  otherPirates.forEach((pirate) => {
262
397
  utils_2.modifyAttack(pirate, 4, boardWithDeadEntity, allCards);
263
- utils_2.modifyHealth(pirate, 4);
398
+ utils_2.modifyHealth(pirate, 4, boardWithDeadEntity, allCards);
264
399
  utils_2.afterStatsUpdate(pirate, boardWithDeadEntity, allCards);
265
400
  spectator.registerPowerTarget(deadEntity.lastAffectedByEntity, pirate, otherBoard);
266
401
  });
@@ -306,11 +441,19 @@ const handleAvenge = (boardWithDeadEntity, boardWithDeadEntityHero, avenger, oth
306
441
  const neighbours = attack_1.getNeighbours(boardWithDeadEntity, avenger);
307
442
  neighbours.forEach((entity) => {
308
443
  utils_2.modifyAttack(entity, avenger.cardId === "BG21_030_G" ? 4 : 2, boardWithDeadEntity, allCards);
309
- utils_2.modifyHealth(entity, avenger.cardId === "BG21_030_G" ? 2 : 1);
444
+ utils_2.modifyHealth(entity, avenger.cardId === "BG21_030_G" ? 2 : 1, boardWithDeadEntity, allCards);
310
445
  utils_2.afterStatsUpdate(entity, boardWithDeadEntity, allCards);
311
446
  spectator.registerPowerTarget(avenger, entity, boardWithDeadEntity);
312
447
  });
313
448
  break;
449
+ case "BG22_HERO_002_Buddy":
450
+ case "BG22_HERO_002_Buddy_G":
451
+ exports.addStatsToBoard(avenger, boardWithDeadEntity, avenger.cardId === "BG22_HERO_002_Buddy_G" ? 2 : 1, 0, allCards, spectator);
452
+ break;
453
+ case "BG22_HERO_003_Buddy":
454
+ case "BG22_HERO_003_Buddy_G":
455
+ exports.addStatsToBoard(avenger, boardWithDeadEntity, 0, avenger.cardId === "BG22_HERO_003_Buddy_G" ? 2 : 1, allCards, spectator);
456
+ break;
314
457
  case "BG21_001":
315
458
  const target1 = grantRandomStats(avenger, boardWithDeadEntity, 6, 6, reference_data_1.Race.BEAST, allCards, spectator);
316
459
  if (!!target1) {
@@ -339,7 +482,7 @@ const handleAvenge = (boardWithDeadEntity, boardWithDeadEntityHero, avenger, oth
339
482
  exports.addCardsInHand(boardWithDeadEntityHero, 1, boardWithDeadEntity, allCards, spectator);
340
483
  break;
341
484
  case "BG20_105_G":
342
- exports.addCardsInHand(boardWithDeadEntityHero, 2, boardWithDeadEntity, allCards, spectator);
485
+ exports.addCardsInHand(boardWithDeadEntityHero, 2, boardWithDeadEntity, allCards, spectator, "BG20_GEM");
343
486
  break;
344
487
  case "BG21_009":
345
488
  const murloc = getRandomMinion(boardWithDeadEntity, reference_data_1.Race.MURLOC, allCards);
@@ -382,7 +525,7 @@ const handleAvenge = (boardWithDeadEntity, boardWithDeadEntityHero, avenger, oth
382
525
  const goldenCard = allCards.getCardFromDbfId(refCard.battlegroundsPremiumDbfId);
383
526
  pirate.cardId = goldenCard.id;
384
527
  utils_2.modifyAttack(pirate, refCard.attack, boardWithDeadEntity, allCards);
385
- utils_2.modifyHealth(pirate, refCard.health);
528
+ utils_2.modifyHealth(pirate, refCard.health, boardWithDeadEntity, allCards);
386
529
  utils_2.afterStatsUpdate(pirate, boardWithDeadEntity, allCards);
387
530
  spectator.registerPowerTarget(avenger, pirate, boardWithDeadEntity);
388
531
  }
@@ -398,7 +541,7 @@ const handleAvenge = (boardWithDeadEntity, boardWithDeadEntityHero, avenger, oth
398
541
  const refCard = allCards.getCard(pirate.cardId);
399
542
  pirate.cardId = refCard.id;
400
543
  utils_2.modifyAttack(pirate, refCard.attack, boardWithDeadEntity, allCards);
401
- utils_2.modifyHealth(pirate, refCard.health);
544
+ utils_2.modifyHealth(pirate, refCard.health, boardWithDeadEntity, allCards);
402
545
  utils_2.afterStatsUpdate(pirate, boardWithDeadEntity, allCards);
403
546
  spectator.registerPowerTarget(avenger, pirate, boardWithDeadEntity);
404
547
  }
@@ -438,13 +581,13 @@ const applyScavengingHyenaEffect = (board, allCards, spectator) => {
438
581
  for (let i = 0; i < board.length; i++) {
439
582
  if (board[i].cardId === "EX1_531") {
440
583
  utils_2.modifyAttack(board[i], 2, board, allCards);
441
- utils_2.modifyHealth(board[i], 1);
584
+ utils_2.modifyHealth(board[i], 1, board, allCards);
442
585
  utils_2.afterStatsUpdate(board[i], board, allCards);
443
586
  spectator.registerPowerTarget(board[i], board[i], board);
444
587
  }
445
588
  else if (board[i].cardId === "TB_BaconUps_043") {
446
589
  utils_2.modifyAttack(board[i], 4, board, allCards);
447
- utils_2.modifyHealth(board[i], 2);
590
+ utils_2.modifyHealth(board[i], 2, board, allCards);
448
591
  utils_2.afterStatsUpdate(board[i], board, allCards);
449
592
  spectator.registerPowerTarget(board[i], board[i], board);
450
593
  }
@@ -454,13 +597,13 @@ const applyJunkbotEffect = (board, allCards, spectator) => {
454
597
  for (let i = 0; i < board.length; i++) {
455
598
  if (board[i].cardId === "GVG_106") {
456
599
  utils_2.modifyAttack(board[i], 2, board, allCards);
457
- utils_2.modifyHealth(board[i], 2);
600
+ utils_2.modifyHealth(board[i], 2, board, allCards);
458
601
  utils_2.afterStatsUpdate(board[i], board, allCards);
459
602
  spectator.registerPowerTarget(board[i], board[i], board);
460
603
  }
461
604
  else if (board[i].cardId === "TB_BaconUps_046") {
462
605
  utils_2.modifyAttack(board[i], 4, board, allCards);
463
- utils_2.modifyHealth(board[i], 4);
606
+ utils_2.modifyHealth(board[i], 4, board, allCards);
464
607
  utils_2.afterStatsUpdate(board[i], board, allCards);
465
608
  spectator.registerPowerTarget(board[i], board[i], board);
466
609
  }
@@ -478,7 +621,7 @@ const grantRandomHealth = (source, board, health, allCards, spectator, excludeSo
478
621
  const candidateBoard = board.filter((e) => !excludeSource || e.entityId !== source.entityId);
479
622
  if (candidateBoard.length > 0) {
480
623
  const target = candidateBoard[Math.floor(Math.random() * candidateBoard.length)];
481
- utils_2.modifyHealth(target, health);
624
+ utils_2.modifyHealth(target, health, board, allCards);
482
625
  utils_2.afterStatsUpdate(target, board, allCards);
483
626
  spectator.registerPowerTarget(source, target, board);
484
627
  }
@@ -488,7 +631,7 @@ const grantRandomStats = (source, board, attack, health, race, allCards, spectat
488
631
  const validBeast = getRandomMinion(board, race, allCards);
489
632
  if (validBeast) {
490
633
  utils_2.modifyAttack(validBeast, attack, board, allCards);
491
- utils_2.modifyHealth(validBeast, health);
634
+ utils_2.modifyHealth(validBeast, health, board, allCards);
492
635
  utils_2.afterStatsUpdate(validBeast, board, allCards);
493
636
  spectator.registerPowerTarget(source, validBeast, board);
494
637
  return validBeast;
@@ -496,15 +639,18 @@ const grantRandomStats = (source, board, attack, health, race, allCards, spectat
496
639
  }
497
640
  return null;
498
641
  };
499
- const addCardsInHand = (playerEntity, cards, board, allCards, spectator) => {
642
+ const addCardsInHand = (playerEntity, cards, board, allCards, spectator, cardAdded = null) => {
500
643
  var _a;
501
- playerEntity.cardsInHand = Math.min(10, ((_a = playerEntity.cardsInHand) !== null && _a !== void 0 ? _a : 0) + cards);
644
+ const sages = board.filter((e) => e.cardId === "BG20_HERO_103_Buddy");
645
+ const sagesGolden = board.filter((e) => e.cardId === "BG20_HERO_103_Buddy_G");
646
+ const multiplier = 1 + (cardAdded === "BG20_GEM" ? sages.length + 2 * sagesGolden.length : 0);
647
+ playerEntity.cardsInHand = Math.min(10, ((_a = playerEntity.cardsInHand) !== null && _a !== void 0 ? _a : 0) + multiplier * cards);
502
648
  const peggys = board.filter((e) => e.cardId === "BG21_016" || e.cardId === "BG21_016_G");
503
649
  peggys.forEach((peggy) => {
504
650
  const pirate = getRandomMinion(board.filter((e) => e.entityId !== peggy.entityId), reference_data_1.Race.PIRATE, allCards);
505
651
  if (pirate) {
506
652
  utils_2.modifyAttack(pirate, peggy.cardId === "BG21_016_G" ? 2 : 1, board, allCards);
507
- utils_2.modifyHealth(pirate, peggy.cardId === "BG21_016_G" ? 2 : 1);
653
+ utils_2.modifyHealth(pirate, peggy.cardId === "BG21_016_G" ? 2 : 1, board, allCards);
508
654
  utils_2.afterStatsUpdate(pirate, board, allCards);
509
655
  spectator.registerPowerTarget(peggy, pirate, board);
510
656
  }
@@ -527,6 +673,15 @@ const grantAllDivineShield = (board, tribe, cards) => {
527
673
  entity.divineShield = true;
528
674
  }
529
675
  };
676
+ const applyMonstrosity = (monstrosity, deadEntities, boardWithDeadEntities, allCards) => {
677
+ for (const deadEntity of deadEntities) {
678
+ utils_2.modifyAttack(monstrosity, deadEntity.attack, boardWithDeadEntities, allCards);
679
+ if (monstrosity.cardId === "BG20_HERO_282_Buddy_G") {
680
+ utils_2.modifyAttack(monstrosity, deadEntity.attack, boardWithDeadEntities, allCards);
681
+ }
682
+ }
683
+ };
684
+ exports.applyMonstrosity = applyMonstrosity;
530
685
  const rememberDeathrattles = (fish, deadEntities, cardsData) => {
531
686
  const validDeathrattles = deadEntities
532
687
  .filter((entity) => cardsData.validDeathrattles.includes(entity.cardId))
@@ -541,6 +696,10 @@ const rememberDeathrattles = (fish, deadEntities, cardsData) => {
541
696
  "TB_BaconUps_032e",
542
697
  "UNG_999t2e",
543
698
  "BG21_HERO_030pe",
699
+ "BG22_HERO_001p_t1e",
700
+ "BG22_HERO_001p_t2e",
701
+ "BG22_HERO_001p_t3e",
702
+ "BG22_HERO_001p_t4_s",
544
703
  ].includes(enchantmentId));
545
704
  const newDeathrattles = [...validDeathrattles, ...validEnchantments];
546
705
  if (fish.cardId === "TB_BaconUps_307") {