@firestone-hs/simulate-bgs-battle 1.1.302 → 1.1.303

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.
@@ -16,7 +16,7 @@ const computeBattlecryMultiplier = (board, boardHero, sharedState) => {
16
16
  };
17
17
  exports.computeBattlecryMultiplier = computeBattlecryMultiplier;
18
18
  const triggerBattlecry = (board, hero, entity, otherBoard, otherHero, allCards, cardsData, sharedState, spectator) => {
19
- var _a, _b, _c, _d, _e, _f, _g, _h;
19
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
20
20
  const allMinions = [...board, ...otherBoard];
21
21
  const totalTriggers = (0, exports.computeBattlecryMultiplier)(board, hero, sharedState);
22
22
  for (let z = 0; z < totalTriggers; z++) {
@@ -285,6 +285,67 @@ const triggerBattlecry = (board, hero, entity, otherBoard, otherHero, allCards,
285
285
  (0, utils_2.modifyHealth)(murkyTarget, murkyStats, board, allCards);
286
286
  (0, utils_2.afterStatsUpdate)(murkyTarget, board, allCards);
287
287
  break;
288
+ case "BGS_069":
289
+ case "TB_BaconUps_121":
290
+ const numberOfTribes = extractUniqueTribes(board, allCards).length;
291
+ const amalgadonMultiplier = entity.cardId === "BGS_069" ? 1 : 2;
292
+ const totalAdapts = amalgadonMultiplier * numberOfTribes;
293
+ for (let i = 0; i < totalAdapts; i++) {
294
+ const adapts = [
295
+ "UNG_999t3",
296
+ "UNG_999t2",
297
+ "UNG_999t14",
298
+ "UNG_999t4",
299
+ ];
300
+ if (!entity.divineShield) {
301
+ adapts.push("UNG_999t8");
302
+ }
303
+ if (!entity.windfury) {
304
+ adapts.push("UNG_999t7");
305
+ }
306
+ if (!entity.taunt) {
307
+ adapts.push("UNG_999t6");
308
+ }
309
+ if (!entity.venomous && !entity.poisonous) {
310
+ adapts.push("UNG_999t13");
311
+ }
312
+ const adapt = (0, utils_1.pickRandom)(adapts);
313
+ switch (adapt) {
314
+ case "UNG_999t3":
315
+ (0, utils_2.modifyAttack)(entity, 3, board, allCards);
316
+ (0, utils_2.afterStatsUpdate)(entity, board, allCards);
317
+ break;
318
+ case "UNG_999t2":
319
+ entity.enchantments = (_j = entity.enchantments) !== null && _j !== void 0 ? _j : [];
320
+ entity.enchantments.push({
321
+ cardId: "UNG_999t2e",
322
+ timing: 0,
323
+ });
324
+ break;
325
+ case "UNG_999t7":
326
+ entity.windfury = true;
327
+ break;
328
+ case "UNG_999t6":
329
+ entity.taunt = true;
330
+ break;
331
+ case "UNG_999t13":
332
+ entity.poisonous = true;
333
+ break;
334
+ case "UNG_999t4":
335
+ (0, utils_2.modifyHealth)(entity, 3, board, allCards);
336
+ (0, utils_2.afterStatsUpdate)(entity, board, allCards);
337
+ break;
338
+ case "UNG_999t8":
339
+ entity.divineShield = true;
340
+ break;
341
+ case "UNG_999t14":
342
+ (0, utils_2.modifyAttack)(entity, 1, board, allCards);
343
+ (0, utils_2.modifyHealth)(entity, 1, board, allCards);
344
+ (0, utils_2.afterStatsUpdate)(entity, board, allCards);
345
+ break;
346
+ }
347
+ }
348
+ break;
288
349
  default:
289
350
  hasTriggered = false;
290
351
  break;
@@ -1 +1 @@
1
- {"version":3,"file":"battlecries.js","sourceRoot":"","sources":["../../src/simulation/battlecries.ts"],"names":[],"mappings":";;;AAAA,iEAA8E;AAI9E,6CAA+C;AAC/C,oCAWkB;AAClB,6CAA+C;AAIxC,MAAM,0BAA0B,GAAG,CACzC,KAAoB,EACpB,SAA0B,EAC1B,WAAwB,EACf,EAAE;IACX,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CACvB,CAAC,MAAM,EAAE,EAAE,CACV,MAAM,CAAC,MAAM,iBAAwC;QACrD,MAAM,CAAC,MAAM,eAAsC,CACpD,CAAC;IACF,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAC7B,CAAC,MAAM,EAAE,EAAE,CACV,MAAM,CAAC,MAAM,sBAA6C;QAC1D,MAAM,CAAC,MAAM,iBAAwC,CACtD,CAAC;IACF,MAAM,a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SAED;KACD;IAED,YAAY,CAAC,IAAI,CAChB,GAAG,uBAAuB;SACxB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,qBAAI,CAAC,qBAAI,CAAC,GAAG,CAAC,CAAC,CAAC;SAC/C,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;SACvB,GAAG,CAAC,CAAC,CAAS,EAAE,EAAE,CAAC,qBAAI,CAAC,CAAC,CAAC,CAAC,CAC7B,CAAC;IACF,OAAO,YAAY,CAAC;AACrB,CAAC,CAAC","sourcesContent":["import { AllCardsService, CardIds, Race } from '@firestone-hs/reference-data';\r\nimport { BgsPlayerEntity } from '../bgs-player-entity';\r\nimport { BoardEntity } from '../board-entity';\r\nimport { CardsData } from '../cards/cards-data';\r\nimport { pickRandom } from '../services/utils';\r\nimport {\r\n\taddCardsInHand,\r\n\taddStatsToBoard,\r\n\tafterStatsUpdate,\r\n\tgetRandomAliveMinion,\r\n\tgrantStatsToMinionsOfEachType,\r\n\thasCorrectTribe,\r\n\tisMinionGolden,\r\n\tmakeMinionGolden,\r\n\tmodifyAttack,\r\n\tmodifyHealth,\r\n} from '../utils';\r\nimport { playBloodGemsOn } from './blood-gems';\r\nimport { SharedState } from './shared-state';\r\nimport { Spectator } from './spectator/spectator';\r\n\r\nexport const computeBattlecryMultiplier = (\r\n\tboard: BoardEntity[],\r\n\tboardHero: BgsPlayerEntity,\r\n\tsharedState: SharedState,\r\n): number => {\r\n\tconst brann = board.find(\r\n\t\t(entity) =>\r\n\t\t\tentity.cardId === CardIds.BrannBronzebeard_BG_LOE_077 ||\r\n\t\t\tentity.cardId === CardIds.MoiraBronzebeard_BG27_518,\r\n\t);\r\n\tconst goldenBrann = board.find(\r\n\t\t(entity) =>\r\n\t\t\tentity.cardId === CardIds.BrannBronzebeard_TB_BaconUps_045 ||\r\n\t\t\tentity.cardId === CardIds.MoiraBronzebeard_BG27_518_G,\r\n\t);\r\n\tconst echoesOfArgus = sharedState.anomalies.includes(CardIds.EchoesOfArgus_BG27_Anomaly_802) ? 1 : 0;\r\n\tconst multiplier = echoesOfArgus + (goldenBrann ? 3 : brann ? 2 : 1);\r\n\treturn multiplier;\r\n};\r\n\r\nexport const triggerBattlecry = (\r\n\tboard: BoardEntity[],\r\n\thero: BgsPlayerEntity,\r\n\tentity: BoardEntity,\r\n\totherBoard: BoardEntity[],\r\n\totherHero: BgsPlayerEntity,\r\n\tallCards: AllCardsService,\r\n\tcardsData: CardsData,\r\n\tsharedState: SharedState,\r\n\tspectator: Spectator,\r\n) => {\r\n\tconst allMinions = [...board, ...otherBoard];\r\n\tconst totalTriggers = computeBattlecryMultiplier(board, hero, sharedState);\r\n\tfor (let z = 0; z < totalTriggers; z++) {\r\n\t\tlet hasTriggered = true;\r\n\t\tswitch (entity.cardId) {\r\n\t\t\tcase CardIds.RazorfenGeomancer_BG20_100:\r\n\t\t\tcase CardIds.RazorfenGeomancer_BG20_100_G:\r\n\t\t\t\tconst razorFenCardsToAdd =\r\n\t\t\t\t\tentity.cardId === CardIds.RazorfenGeomancer_BG20_100\r\n\t\t\t\t\t\t? [CardIds.BloodGem]\r\n\t\t\t\t\t\t: [CardIds.BloodGem, CardIds.BloodGem];\r\n\t\t\t\taddCardsInHand(hero, board, allCards, spectator, razorFenCardsToAdd);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.RockpoolHunter_BG_UNG_073:\r\n\t\t\tcase CardIds.RockpoolHunter_TB_BaconUps_061:\r\n\t\t\t\tconst rockPoolTarget = getRandomAliveMinion(board, Race.MURLOC, allCards);\r\n\t\t\t\tconst rockpoolStats = entity.cardId === CardIds.RockpoolHunter_BG_UNG_073 ? 1 : 2;\r\n\t\t\t\tmodifyAttack(rockPoolTarget, rockpoolStats, board, allCards);\r\n\t\t\t\tmodifyHealth(rockPoolTarget, rockpoolStats, board, allCards);\r\n\t\t\t\tafterStatsUpdate(rockPoolTarget, board, allCards);\r\n\t\t\t\tspectator.registerPowerTarget(entity, rockPoolTarget, board);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.ShellCollector_BG23_002:\r\n\t\t\tcase CardIds.ShellCollector_BG23_002_G:\r\n\t\t\t\tconst shellCollectorCardsToAdd =\r\n\t\t\t\t\tentity.cardId === CardIds.ShellCollector_BG23_002\r\n\t\t\t\t\t\t? [CardIds.TheCoinCore]\r\n\t\t\t\t\t\t: [CardIds.TheCoinCore, CardIds.TheCoinCore];\r\n\t\t\t\taddCardsInHand(hero, board, allCards, spectator, shellCollectorCardsToAdd);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.MenagerieMug_BGS_082:\r\n\t\t\tcase CardIds.MenagerieMug_TB_BaconUps_144:\r\n\t\t\t\tconst menagerieMugStats = entity.cardId === CardIds.MenagerieMug_BGS_082 ? 1 : 2;\r\n\t\t\t\tgrantStatsToMinionsOfEachType(\r\n\t\t\t\t\tentity,\r\n\t\t\t\t\tboard,\r\n\t\t\t\t\tmenagerieMugStats,\r\n\t\t\t\t\tmenagerieMugStats,\r\n\t\t\t\t\tallCards,\r\n\t\t\t\t\tspectator,\r\n\t\t\t\t\t3,\r\n\t\t\t\t);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.MenagerieJug_BGS_083:\r\n\t\t\tcase CardIds.MenagerieJug_TB_BaconUps_145:\r\n\t\t\t\tconst menagerieJugStats = entity.cardId === CardIds.MenagerieJug_BGS_083 ? 2 : 4;\r\n\t\t\t\tgrantStatsToMinionsOfEachType(\r\n\t\t\t\t\tentity,\r\n\t\t\t\t\tboard,\r\n\t\t\t\t\tmenagerieJugStats,\r\n\t\t\t\t\tmenagerieJugStats,\r\n\t\t\t\t\tallCards,\r\n\t\t\t\t\tspectator,\r\n\t\t\t\t\t3,\r\n\t\t\t\t);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.NerubianDeathswarmer_BG25_011:\r\n\t\t\tcase CardIds.NerubianDeathswarmer_BG25_011_G:\r\n\t\t\t\tconst nerubianDeathswarmerStats = entity.cardId === CardIds.NerubianDeathswarmer_BG25_011 ? 1 : 2;\r\n\t\t\t\thero.globalInfo.UndeadAttackBonus =\r\n\t\t\t\t\t(hero.globalInfo?.UndeadAttackBonus ?? 0) + nerubianDeathswarmerStats;\r\n\t\t\t\taddStatsToBoard(entity, board, nerubianDeathswarmerStats, 0, allCards, spectator, Race[Race.UNDEAD]);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.SparringPartner_BG_AT_069:\r\n\t\t\tcase CardIds.SparringPartner_BG_AT_069_G:\r\n\t\t\t\tconst sparringPartnersTargets = allMinions.filter((e) => !e.taunt);\r\n\t\t\t\tconst sparringPartnersTarget = pickRandom(sparringPartnersTargets);\r\n\t\t\t\tif (sparringPartnersTarget) {\r\n\t\t\t\t\tsparringPartnersTarget.taunt = true;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.TwilightEmissary_BGS_038:\r\n\t\t\tcase CardIds.TwilightEmissary_TB_BaconUps_108:\r\n\t\t\t\tconst twilightEmissaryTarget = getRandomAliveMinion(board, Race.DRAGON, allCards);\r\n\t\t\t\tconst twilightEmissaryStats = entity.cardId === CardIds.TwilightEmissary_BGS_038 ? 2 : 4;\r\n\t\t\t\tmodifyAttack(twilightEmissaryTarget, twilightEmissaryStats, board, allCards);\r\n\t\t\t\tmodifyHealth(twilightEmissaryTarget, twilightEmissaryStats, board, allCards);\r\n\t\t\t\tafterStatsUpdate(twilightEmissaryTarget, board, allCards);\r\n\t\t\t\tspectator.registerPowerTarget(entity, twilightEmissaryTarget, board);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.BloodsailCannoneer_BGS_053:\r\n\t\t\tcase CardIds.BloodsailCannoneer_TB_BaconUps_138:\r\n\t\t\t\taddStatsToBoard(\r\n\t\t\t\t\tentity,\r\n\t\t\t\t\tboard.filter((e) => e.entityId != entity.entityId),\r\n\t\t\t\t\tentity.cardId === CardIds.BloodsailCannoneer_BGS_053 ? 3 : 6,\r\n\t\t\t\t\t0,\r\n\t\t\t\t\tallCards,\r\n\t\t\t\t\tspectator,\r\n\t\t\t\t\tRace[Race.PIRATE],\r\n\t\t\t\t);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.ColdlightSeerLegacy_BG_EX1_103:\r\n\t\t\tcase CardIds.ColdlightSeerLegacy_TB_BaconUps_064:\r\n\t\t\t\taddStatsToBoard(\r\n\t\t\t\t\tentity,\r\n\t\t\t\t\tboard.filter((e) => e.entityId != entity.entityId),\r\n\t\t\t\t\t0,\r\n\t\t\t\t\tentity.cardId === CardIds.ColdlightSeerLegacy_BG_EX1_103 ? 2 : 4,\r\n\t\t\t\t\tallCards,\r\n\t\t\t\t\tspectator,\r\n\t\t\t\t\tRace[Race.MURLOC],\r\n\t\t\t\t);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.KeyboardIgniter_BG26_522:\r\n\t\t\tcase CardIds.KeyboardIgniter_BG26_522_G:\r\n\t\t\t\taddStatsToBoard(\r\n\t\t\t\t\tentity,\r\n\t\t\t\t\tboard.filter((e) => e.entityId != entity.entityId),\r\n\t\t\t\t\tentity.cardId === CardIds.KeyboardIgniter_BG26_522 ? 2 : 4,\r\n\t\t\t\t\tentity.cardId === CardIds.KeyboardIgniter_BG26_522 ? 2 : 4,\r\n\t\t\t\t\tallCards,\r\n\t\t\t\t\tspectator,\r\n\t\t\t\t\tRace[Race.DEMON],\r\n\t\t\t\t);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.MoonBaconJazzer_BG26_159:\r\n\t\t\tcase CardIds.MoonBaconJazzer_BG26_159_G:\r\n\t\t\t\tconst moonBaconJazzerStats = entity.cardId === CardIds.MoonBaconJazzer_BG26_159 ? 1 : 2;\r\n\t\t\t\thero.globalInfo.BloodGemHealthBonus =\r\n\t\t\t\t\t(hero.globalInfo?.BloodGemHealthBonus ?? 0) + moonBaconJazzerStats;\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.Smogger_BG21_021:\r\n\t\t\tcase CardIds.Smogger_BG21_021_G:\r\n\t\t\t\tconst smoggerLoops = entity.cardId === CardIds.Smogger_BG21_021 ? 1 : 2;\r\n\t\t\t\tfor (let i = 0; i < smoggerLoops; i++) {\r\n\t\t\t\t\tconst smoggerTarget = getRandomAliveMinion(board, Race.ELEMENTAL, allCards);\r\n\t\t\t\t\tconst smoggerStats = hero.tavernTier ?? 3;\r\n\t\t\t\t\tmodifyAttack(smoggerTarget, smoggerStats, board, allCards);\r\n\t\t\t\t\tmodifyHealth(smoggerTarget, smoggerStats, board, allCards);\r\n\t\t\t\t\tafterStatsUpdate(smoggerTarget, board, allCards);\r\n\t\t\t\t\tspectator.registerPowerTarget(entity, smoggerTarget, board);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.AnnihilanBattlemaster_BGS_010:\r\n\t\t\tcase CardIds.AnnihilanBattlemaster_TB_BaconUps_083:\r\n\t\t\t\t// TODO: pass damage taken info\r\n\t\t\t\tconst startingHp = hero.cardId === CardIds.Patchwerk_TB_BaconShop_HERO_34 ? 60 : 30;\r\n\t\t\t\tconst hpMissing = startingHp - hero.hpLeft;\r\n\t\t\t\tconst annihilanStats = (entity.cardId === CardIds.AnnihilanBattlemaster_BGS_010 ? 2 : 4) * hpMissing;\r\n\t\t\t\tmodifyHealth(entity, annihilanStats, board, allCards);\r\n\t\t\t\tafterStatsUpdate(entity, board, allCards);\r\n\t\t\t\tspectator.registerPowerTarget(entity, entity, board);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.ElectricSynthesizer_BG26_963:\r\n\t\t\tcase CardIds.ElectricSynthesizer_BG26_963_G:\r\n\t\t\t\taddStatsToBoard(\r\n\t\t\t\t\tentity,\r\n\t\t\t\t\tboard.filter((e) => e.entityId != entity.entityId),\r\n\t\t\t\t\tentity.cardId === CardIds.ElectricSynthesizer_BG26_963 ? 3 : 6,\r\n\t\t\t\t\tentity.cardId === CardIds.ElectricSynthesizer_BG26_963 ? 1 : 2,\r\n\t\t\t\t\tallCards,\r\n\t\t\t\t\tspectator,\r\n\t\t\t\t\tRace[Race.DRAGON],\r\n\t\t\t\t);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.Necrolyte_BG20_202:\r\n\t\t\tcase CardIds.Necrolyte_BG20_202_G:\r\n\t\t\t\tconst necrolyteBloodGems = entity.cardId === CardIds.Necrolyte_BG20_202 ? 2 : 4;\r\n\t\t\t\tconst necrolyteTarget = pickRandom(board);\r\n\t\t\t\tplayBloodGemsOn(necrolyteTarget, necrolyteBloodGems, board, hero, allCards, spectator);\r\n\t\t\t\tspectator.registerPowerTarget(entity, necrolyteTarget, board);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.PrimalfinLookout_BGS_020:\r\n\t\t\tcase CardIds.PrimalfinLookout_TB_BaconUps_089:\r\n\t\t\t\tconst primalfinLookoutCardsToAdd =\r\n\t\t\t\t\tentity.cardId === CardIds.PrimalfinLookout_BGS_020\r\n\t\t\t\t\t\t? [cardsData.getRandomMinionForTribe(Race.MURLOC, hero.tavernTier ?? 1)]\r\n\t\t\t\t\t\t: [\r\n\t\t\t\t\t\t\t\tcardsData.getRandomMinionForTribe(Race.MURLOC, hero.tavernTier ?? 1),\r\n\t\t\t\t\t\t\t\tcardsData.getRandomMinionForTribe(Race.MURLOC, hero.tavernTier ?? 1),\r\n\t\t\t\t\t\t ];\r\n\t\t\t\taddCardsInHand(hero, board, allCards, spectator, primalfinLookoutCardsToAdd);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.StrongshellScavenger_BG_ICC_807:\r\n\t\t\tcase CardIds.StrongshellScavenger_TB_BaconUps_072:\r\n\t\t\t\tconst strongshellScavengerStats = entity.cardId === CardIds.StrongshellScavenger_BG_ICC_807 ? 2 : 4;\r\n\t\t\t\tconst strongshellScavengerTargets = board\r\n\t\t\t\t\t.filter((e) => e.entityId != entity.entityId)\r\n\t\t\t\t\t.filter((e) => e.taunt);\r\n\t\t\t\tstrongshellScavengerTargets.forEach((target) => {\r\n\t\t\t\t\tmodifyAttack(target, strongshellScavengerStats, board, allCards);\r\n\t\t\t\t\tmodifyHealth(target, strongshellScavengerStats, board, allCards);\r\n\t\t\t\t\tafterStatsUpdate(target, board, allCards);\r\n\t\t\t\t\tspectator.registerPowerTarget(entity, target, board);\r\n\t\t\t\t});\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.VigilantStoneborn_BG24_023:\r\n\t\t\tcase CardIds.VigilantStoneborn_BG24_023_G:\r\n\t\t\t\tconst vigilantStonebornTarget = pickRandom(board);\r\n\t\t\t\tconst vigilantStonebornStats = entity.cardId === CardIds.VigilantStoneborn_BG24_023 ? 6 : 12;\r\n\t\t\t\tvigilantStonebornTarget.taunt = true;\r\n\t\t\t\tmodifyHealth(vigilantStonebornTarget, vigilantStonebornStats, board, allCards);\r\n\t\t\t\tafterStatsUpdate(vigilantStonebornTarget, board, allCards);\r\n\t\t\t\tspectator.registerPowerTarget(entity, vigilantStonebornTarget, board);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.Bonemare_BG26_ICC_705:\r\n\t\t\tcase CardIds.Bonemare_BG26_ICC_705_G:\r\n\t\t\t\tconst bonemareTarget = pickRandom(board);\r\n\t\t\t\tconst bonemareStats = entity.cardId === CardIds.Bonemare_BG26_ICC_705 ? 4 : 8;\r\n\t\t\t\tbonemareTarget.taunt = true;\r\n\t\t\t\tmodifyAttack(bonemareTarget, bonemareStats, board, allCards);\r\n\t\t\t\tmodifyHealth(bonemareTarget, bonemareStats, board, allCards);\r\n\t\t\t\tafterStatsUpdate(bonemareTarget, board, allCards);\r\n\t\t\t\tspectator.registerPowerTarget(entity, bonemareTarget, board);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.GeneralDrakkisath_BG25_309:\r\n\t\t\tcase CardIds.GeneralDrakkisath_BG25_309_G:\r\n\t\t\t\tconst generalDrakkisathCardsToAdd =\r\n\t\t\t\t\tentity.cardId === CardIds.GeneralDrakkisath_BG25_309\r\n\t\t\t\t\t\t? [CardIds.GeneralDrakkisath_SmolderwingToken_BG25_309t]\r\n\t\t\t\t\t\t: [\r\n\t\t\t\t\t\t\t\tCardIds.GeneralDrakkisath_SmolderwingToken_BG25_309t,\r\n\t\t\t\t\t\t\t\tCardIds.GeneralDrakkisath_SmolderwingToken_BG25_309t,\r\n\t\t\t\t\t\t ];\r\n\t\t\t\taddCardsInHand(hero, board, allCards, spectator, generalDrakkisathCardsToAdd);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.KingBagurgle_BGS_030:\r\n\t\t\tcase CardIds.KingBagurgle_TB_BaconUps_100:\r\n\t\t\t\taddStatsToBoard(\r\n\t\t\t\t\tentity,\r\n\t\t\t\t\tboard.filter((e) => e.entityId != entity.entityId),\r\n\t\t\t\t\tentity.cardId === CardIds.KingBagurgle_BGS_030 ? 2 : 4,\r\n\t\t\t\t\tentity.cardId === CardIds.KingBagurgle_BGS_030 ? 3 : 6,\r\n\t\t\t\t\tallCards,\r\n\t\t\t\t\tspectator,\r\n\t\t\t\t\tRace[Race.MURLOC],\r\n\t\t\t\t);\r\n\t\t\t\tbreak;\r\n\t\t\t// Not correct, but only used to trigger the \"add cards in hand\" effect\r\n\t\t\tcase CardIds.Murozond_BGS_043:\r\n\t\t\tcase CardIds.Murozond_TB_BaconUps_110:\r\n\t\t\t\tconst murozondCardsToAdd =\r\n\t\t\t\t\tentity.cardId === CardIds.Murozond_BGS_043\r\n\t\t\t\t\t\t? [CardIds.TheCoinCore]\r\n\t\t\t\t\t\t: [CardIds.TheCoinCore, CardIds.TheCoinCore];\r\n\t\t\t\taddCardsInHand(hero, board, allCards, spectator, murozondCardsToAdd);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.TavernTempest_BGS_123:\r\n\t\t\tcase CardIds.TavernTempest_TB_BaconUps_162:\r\n\t\t\t\tconst tavernTempestCardsToAdd =\r\n\t\t\t\t\tentity.cardId === CardIds.TavernTempest_BGS_123\r\n\t\t\t\t\t\t? [CardIds.TheCoinCore]\r\n\t\t\t\t\t\t: [CardIds.TheCoinCore, CardIds.TheCoinCore];\r\n\t\t\t\taddCardsInHand(hero, board, allCards, spectator, tavernTempestCardsToAdd);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.MechaJaraxxus_BG25_807:\r\n\t\t\tcase CardIds.MechaJaraxxus_BG25_807_G:\r\n\t\t\t\tconst mechaJaraxxusCardsToAdd =\r\n\t\t\t\t\tentity.cardId === CardIds.MechaJaraxxus_BG25_807\r\n\t\t\t\t\t\t? [CardIds.TheCoinCore]\r\n\t\t\t\t\t\t: [CardIds.TheCoinCore, CardIds.TheCoinCore];\r\n\t\t\t\taddCardsInHand(hero, board, allCards, spectator, mechaJaraxxusCardsToAdd);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.OozelingGladiator_BG27_002:\r\n\t\t\tcase CardIds.OozelingGladiator_BG27_002_G:\r\n\t\t\t\tconst oozelingCardsToAdd =\r\n\t\t\t\t\tentity.cardId === CardIds.OozelingGladiator_BG27_002\r\n\t\t\t\t\t\t? [CardIds.TheCoinCore, CardIds.TheCoinCore]\r\n\t\t\t\t\t\t: [CardIds.TheCoinCore, CardIds.TheCoinCore, CardIds.TheCoinCore, CardIds.TheCoinCore];\r\n\t\t\t\taddCardsInHand(hero, board, allCards, spectator, oozelingCardsToAdd);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.UtherTheLightbringer_BG23_190:\r\n\t\t\tcase CardIds.UtherTheLightbringer_BG23_190_G:\r\n\t\t\t\tconst utherTarget = pickRandom(allMinions);\r\n\t\t\t\tconst utherStats = entity.cardId === CardIds.UtherTheLightbringer_BG23_190 ? 15 : 30;\r\n\t\t\t\tutherTarget.attack = utherStats;\r\n\t\t\t\tutherTarget.health = utherStats;\r\n\t\t\t\tutherTarget.maxHealth = utherStats;\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.IronGroundskeeper_BG27_000:\r\n\t\t\tcase CardIds.IronGroundskeeper_BG27_000_G:\r\n\t\t\t\tconst ironGroundskeeperTargets = allMinions;\r\n\t\t\t\tconst ironGroundskeeperTarget = pickRandom(ironGroundskeeperTargets);\r\n\t\t\t\tironGroundskeeperTarget.taunt = !ironGroundskeeperTarget.taunt;\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.LivingConstellation_BG27_001:\r\n\t\t\tcase CardIds.LivingConstellation_BG27_001_G:\r\n\t\t\t\tconst differentTypes = extractUniqueTribes(board, allCards);\r\n\t\t\t\tconst livingConstellationStats =\r\n\t\t\t\t\t(entity.cardId === CardIds.LivingConstellation_BG27_001 ? 1 : 2) * differentTypes.length;\r\n\t\t\t\tconst livingConstellationTarget = pickRandom(board);\r\n\t\t\t\tmodifyAttack(livingConstellationTarget, livingConstellationStats, board, allCards);\r\n\t\t\t\tmodifyHealth(livingConstellationTarget, livingConstellationStats, board, allCards);\r\n\t\t\t\tafterStatsUpdate(livingConstellationTarget, board, allCards);\r\n\t\t\t\tspectator.registerPowerTarget(entity, livingConstellationTarget, board);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.FairyTaleCaroler_BG26_001:\r\n\t\t\tcase CardIds.FairyTaleCaroler_BG26_001_G:\r\n\t\t\t\taddStatsToBoard(\r\n\t\t\t\t\tentity,\r\n\t\t\t\t\tboard.filter((e) => e.entityId != entity.entityId),\r\n\t\t\t\t\tentity.cardId === CardIds.FairyTaleCaroler_BG26_001 ? 2 : 4,\r\n\t\t\t\t\tentity.cardId === CardIds.FairyTaleCaroler_BG26_001 ? 2 : 4,\r\n\t\t\t\t\tallCards,\r\n\t\t\t\t\tspectator,\r\n\t\t\t\t);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.SparkLing_BG27_019:\r\n\t\t\tcase CardIds.SparkLing_BG27_019_G:\r\n\t\t\t\taddStatsToBoard(\r\n\t\t\t\t\tentity,\r\n\t\t\t\t\tboard.filter((e) => e.entityId != entity.entityId),\r\n\t\t\t\t\tentity.cardId === CardIds.SparkLing_BG27_019 ? 1 : 2,\r\n\t\t\t\t\tentity.cardId === CardIds.SparkLing_BG27_019 ? 1 : 2,\r\n\t\t\t\t\tallCards,\r\n\t\t\t\t\tspectator,\r\n\t\t\t\t);\r\n\t\t\t\taddStatsToBoard(\r\n\t\t\t\t\tentity,\r\n\t\t\t\t\totherBoard,\r\n\t\t\t\t\tentity.cardId === CardIds.SparkLing_BG27_019 ? 1 : 2,\r\n\t\t\t\t\tentity.cardId === CardIds.SparkLing_BG27_019 ? 1 : 2,\r\n\t\t\t\t\tallCards,\r\n\t\t\t\t\tspectator,\r\n\t\t\t\t);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.EmergentFlame_BG27_018:\r\n\t\t\tcase CardIds.EmergentFlame_BG27_018_G:\r\n\t\t\t\tconst emergentFlameTarget = pickRandom(\r\n\t\t\t\t\tboard.filter((e) => hasCorrectTribe(e, Race.ELEMENTAL, allCards)),\r\n\t\t\t\t);\r\n\t\t\t\tconst emergentFlameStats = entity.cardId === CardIds.EmergentFlame_BG27_018 ? 1 : 2;\r\n\t\t\t\tmodifyAttack(emergentFlameTarget, emergentFlameStats, board, allCards);\r\n\t\t\t\tmodifyHealth(emergentFlameTarget, emergentFlameStats, board, allCards);\r\n\t\t\t\tafterStatsUpdate(emergentFlameTarget, board, allCards);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.ArgentBraggart_BG_SCH_149:\r\n\t\t\tcase CardIds.ArgentBraggart_TB_BaconUps_308:\r\n\t\t\t\tconst highestAttack = Math.max(...allMinions.map((minion) => minion.attack));\r\n\t\t\t\tconst highestHealth = Math.max(...allMinions.map((minion) => minion.health));\r\n\t\t\t\tconst argentBraggartMultiplier = entity.cardId === CardIds.ArgentBraggart_BG_SCH_149 ? 1 : 2;\r\n\t\t\t\tentity.attack = argentBraggartMultiplier * highestAttack;\r\n\t\t\t\tentity.health = argentBraggartMultiplier * highestHealth;\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.CaptainSanders_BG25_034:\r\n\t\t\tcase CardIds.CaptainSanders_BG25_034_G:\r\n\t\t\t\tconst captainSandersTarget = pickRandom(board.filter((e) => !isMinionGolden(e, allCards)));\r\n\t\t\t\tif (captainSandersTarget) {\r\n\t\t\t\t\tmakeMinionGolden(captainSandersTarget, entity, board, allCards, spectator);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.SanguineChampion_BG23_017:\r\n\t\t\tcase CardIds.SanguineChampion_BG23_017_G:\r\n\t\t\t\tconst sanguineChampionStats = entity.cardId === CardIds.SanguineChampion_BG23_017 ? 1 : 2;\r\n\t\t\t\thero.globalInfo.BloodGemAttackBonus += sanguineChampionStats;\r\n\t\t\t\thero.globalInfo.BloodGemHealthBonus += sanguineChampionStats;\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.Murky_BG24_012:\r\n\t\t\tcase CardIds.Murky_BG24_012_G:\r\n\t\t\t\tconst murkyScale = entity.cardId === CardIds.Murky_BG24_012 ? 1 : 2;\r\n\t\t\t\tconst murkyBattlecriesPlayed = entity.scriptDataNum1 > 0 ? entity.scriptDataNum1 / murkyScale - 1 : 0;\r\n\t\t\t\tconst murkyStats = murkyScale * (1 + murkyBattlecriesPlayed);\r\n\t\t\t\tconst murkyTarget = pickRandom(board.filter((e) => hasCorrectTribe(e, Race.MURLOC, allCards)));\r\n\t\t\t\tmodifyAttack(murkyTarget, murkyStats, board, allCards);\r\n\t\t\t\tmodifyHealth(murkyTarget, murkyStats, board, allCards);\r\n\t\t\t\tafterStatsUpdate(murkyTarget, board, allCards);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\thasTriggered = false;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\tif (hasTriggered) {\r\n\t\t\tafterBattlecryTriggered(entity, board, hero, otherBoard, otherHero, allCards, cardsData, spectator);\r\n\t\t}\r\n\t}\r\n};\r\n\r\nconst afterBattlecryTriggered = (\r\n\tentity: BoardEntity,\r\n\tboard: BoardEntity[],\r\n\thero: BgsPlayerEntity,\r\n\totherBoard: BoardEntity[],\r\n\totherHero: BgsPlayerEntity,\r\n\tallCards: AllCardsService,\r\n\tcardsData: CardsData,\r\n\tspectator: Spectator,\r\n) => {\r\n\tboard\r\n\t\t.filter((e) => e.cardId === CardIds.KalecgosArcaneAspect_BGS_041)\r\n\t\t.forEach((e) => {\r\n\t\t\taddStatsToBoard(entity, board, 1, 1, allCards, spectator, Race[Race.DRAGON]);\r\n\t\t});\r\n\tboard\r\n\t\t.filter((e) => e.cardId === CardIds.KalecgosArcaneAspect_TB_BaconUps_109)\r\n\t\t.forEach((e) => {\r\n\t\t\taddStatsToBoard(entity, board, 2, 2, allCards, spectator, Race[Race.DRAGON]);\r\n\t\t});\r\n};\r\n\r\n// TODO: this is probably too slow\r\nconst extractUniqueTribes = (board: BoardEntity[], allCards: AllCardsService): readonly Race[] => {\r\n\tconst boardReferenceCards = board.map((m) => allCards.getCard(m.cardId));\r\n\tconst minionsPlayedWithTribes = boardReferenceCards.filter((c) => !!c.races?.length);\r\n\tconst minionsToProcess: /*Mutable<ReferenceCard & { picked?: boolean }>*/ any[] = [\r\n\t\t...minionsPlayedWithTribes\r\n\t\t\t.filter((c) => !c.races.includes(Race[Race.ALL]))\r\n\t\t\t.map((c) => ({ ...c, races: [...c.races] })),\r\n\t];\r\n\r\n\tconst uniqueTribes: Race[] = [];\r\n\tconst maxTribesPerMinion = 2;\r\n\tfor (let i = 1; i <= maxTribesPerMinion; i++) {\r\n\t\tlet dirty = true;\r\n\t\twhile (dirty) {\r\n\t\t\tdirty = false;\r\n\t\t\tfor (let j = 0; j < minionsToProcess.length; j++) {\r\n\t\t\t\tconst minion = minionsToProcess[j];\r\n\t\t\t\t// console.debug('considering minion', minion.name, minion.races);\r\n\t\t\t\tif (!minion.picked && minion.races.length > 0 && minion.races.length <= i) {\r\n\t\t\t\t\tconst raceToAdd: string = minion.races[0];\r\n\t\t\t\t\tuniqueTribes.push(Race[raceToAdd]);\r\n\t\t\t\t\t// console.debug('added', raceToAdd, uniqueTribes);\r\n\t\t\t\t\tfor (const m of minionsToProcess) {\r\n\t\t\t\t\t\tm.races = m.races.filter((r) => r !== raceToAdd);\r\n\t\t\t\t\t\t// console.debug('updates races', m.name, m.races, raceToAdd);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tminion.picked = true;\r\n\t\t\t\t\tdirty = true;\r\n\t\t\t\t\t// Restart the loop, so we're not dependant on the order in which we process things\r\n\t\t\t\t\tj = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// minionsToProcess = minionsToProcess.filter((c) => !c.picked);\r\n\t\t}\r\n\t}\r\n\r\n\tuniqueTribes.push(\r\n\t\t...minionsPlayedWithTribes\r\n\t\t\t.filter((m) => m.races.includes(Race[Race.ALL]))\r\n\t\t\t.flatMap((m) => m.races)\r\n\t\t\t.map((r: string) => Race[r]),\r\n\t);\r\n\treturn uniqueTribes;\r\n};\r\n"]}
1
+ {"version":3,"file":"battlecries.js","sourceRoot":"","sources":["../../src/simulation/battlecries.ts"],"names":[],"mappings":";;;AAAA,iEAA8E;AAI9E,6CAA+C;AAC/C,oCAWkB;AAClB,6CAA+C;AAIxC,MAAM,0BAA0B,GAAG,CACzC,KAAoB,EACpB,SAA0B,EAC1B,WAAwB,EACf,EAAE;IACX,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CACvB,CAAC,MAAM,EAAE,EAAE,CACV,MAAM,CAAC,MAAM,iBAAwC;QACrD,MAAM,CAAC,MAAM,eAAsC,CACpD,CAAC;IACF,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAC7B,CAAC,MAAM,EAAE,EAAE,CACV,MAAM,CAAC,MAAM,sBAA6C;QAC1D,MAAM,CAAC,MAAM,iBAAwC,CACtD,CAAC;IACF,MAAM,aAAa,GAAG,WAAW,CAAC,SAAS,CAAC,QAAQ,oBAAwC,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,EAAE,EAAE;gBACjD,MAAM,MAAM,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;gBAEnC,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,EAAE;oBAC1E,MAAM,SAAS,GAAW,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;oBAC1C,YAAY,CAAC,IAAI,CAAC,qBAAI,CAAC,SAAS,CAAC,CAAC,CAAC;oBAEnC,KAAK,MAAM,CAAC,IAAI,gBAAgB,EAAE;wBACjC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC;qBAEjD;oBACD,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC;oBACrB,KAAK,GAAG,IAAI,CAAC;oBAEb,CAAC,GAAG,CAAC,CAAC;iBACN;aACD;SAED;KACD;IAED,YAAY,CAAC,IAAI,CAChB,GAAG,uBAAuB;SACxB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,qBAAI,CAAC,qBAAI,CAAC,GAAG,CAAC,CAAC,CAAC;SAC/C,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;SACvB,GAAG,CAAC,CAAC,CAAS,EAAE,EAAE,CAAC,qBAAI,CAAC,CAAC,CAAC,CAAC,CAC7B,CAAC;IACF,OAAO,YAAY,CAAC;AACrB,CAAC,CAAC","sourcesContent":["import { AllCardsService, CardIds, Race } from '@firestone-hs/reference-data';\r\nimport { BgsPlayerEntity } from '../bgs-player-entity';\r\nimport { BoardEntity } from '../board-entity';\r\nimport { CardsData } from '../cards/cards-data';\r\nimport { pickRandom } from '../services/utils';\r\nimport {\r\n\taddCardsInHand,\r\n\taddStatsToBoard,\r\n\tafterStatsUpdate,\r\n\tgetRandomAliveMinion,\r\n\tgrantStatsToMinionsOfEachType,\r\n\thasCorrectTribe,\r\n\tisMinionGolden,\r\n\tmakeMinionGolden,\r\n\tmodifyAttack,\r\n\tmodifyHealth,\r\n} from '../utils';\r\nimport { playBloodGemsOn } from './blood-gems';\r\nimport { SharedState } from './shared-state';\r\nimport { Spectator } from './spectator/spectator';\r\n\r\nexport const computeBattlecryMultiplier = (\r\n\tboard: BoardEntity[],\r\n\tboardHero: BgsPlayerEntity,\r\n\tsharedState: SharedState,\r\n): number => {\r\n\tconst brann = board.find(\r\n\t\t(entity) =>\r\n\t\t\tentity.cardId === CardIds.BrannBronzebeard_BG_LOE_077 ||\r\n\t\t\tentity.cardId === CardIds.MoiraBronzebeard_BG27_518,\r\n\t);\r\n\tconst goldenBrann = board.find(\r\n\t\t(entity) =>\r\n\t\t\tentity.cardId === CardIds.BrannBronzebeard_TB_BaconUps_045 ||\r\n\t\t\tentity.cardId === CardIds.MoiraBronzebeard_BG27_518_G,\r\n\t);\r\n\tconst echoesOfArgus = sharedState.anomalies.includes(CardIds.EchoesOfArgus_BG27_Anomaly_802) ? 1 : 0;\r\n\tconst multiplier = echoesOfArgus + (goldenBrann ? 3 : brann ? 2 : 1);\r\n\treturn multiplier;\r\n};\r\n\r\nexport const triggerBattlecry = (\r\n\tboard: BoardEntity[],\r\n\thero: BgsPlayerEntity,\r\n\tentity: BoardEntity,\r\n\totherBoard: BoardEntity[],\r\n\totherHero: BgsPlayerEntity,\r\n\tallCards: AllCardsService,\r\n\tcardsData: CardsData,\r\n\tsharedState: SharedState,\r\n\tspectator: Spectator,\r\n) => {\r\n\tconst allMinions = [...board, ...otherBoard];\r\n\tconst totalTriggers = computeBattlecryMultiplier(board, hero, sharedState);\r\n\tfor (let z = 0; z < totalTriggers; z++) {\r\n\t\tlet hasTriggered = true;\r\n\t\tswitch (entity.cardId) {\r\n\t\t\tcase CardIds.RazorfenGeomancer_BG20_100:\r\n\t\t\tcase CardIds.RazorfenGeomancer_BG20_100_G:\r\n\t\t\t\tconst razorFenCardsToAdd =\r\n\t\t\t\t\tentity.cardId === CardIds.RazorfenGeomancer_BG20_100\r\n\t\t\t\t\t\t? [CardIds.BloodGem]\r\n\t\t\t\t\t\t: [CardIds.BloodGem, CardIds.BloodGem];\r\n\t\t\t\taddCardsInHand(hero, board, allCards, spectator, razorFenCardsToAdd);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.RockpoolHunter_BG_UNG_073:\r\n\t\t\tcase CardIds.RockpoolHunter_TB_BaconUps_061:\r\n\t\t\t\tconst rockPoolTarget = getRandomAliveMinion(board, Race.MURLOC, allCards);\r\n\t\t\t\tconst rockpoolStats = entity.cardId === CardIds.RockpoolHunter_BG_UNG_073 ? 1 : 2;\r\n\t\t\t\tmodifyAttack(rockPoolTarget, rockpoolStats, board, allCards);\r\n\t\t\t\tmodifyHealth(rockPoolTarget, rockpoolStats, board, allCards);\r\n\t\t\t\tafterStatsUpdate(rockPoolTarget, board, allCards);\r\n\t\t\t\tspectator.registerPowerTarget(entity, rockPoolTarget, board);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.ShellCollector_BG23_002:\r\n\t\t\tcase CardIds.ShellCollector_BG23_002_G:\r\n\t\t\t\tconst shellCollectorCardsToAdd =\r\n\t\t\t\t\tentity.cardId === CardIds.ShellCollector_BG23_002\r\n\t\t\t\t\t\t? [CardIds.TheCoinCore]\r\n\t\t\t\t\t\t: [CardIds.TheCoinCore, CardIds.TheCoinCore];\r\n\t\t\t\taddCardsInHand(hero, board, allCards, spectator, shellCollectorCardsToAdd);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.MenagerieMug_BGS_082:\r\n\t\t\tcase CardIds.MenagerieMug_TB_BaconUps_144:\r\n\t\t\t\tconst menagerieMugStats = entity.cardId === CardIds.MenagerieMug_BGS_082 ? 1 : 2;\r\n\t\t\t\tgrantStatsToMinionsOfEachType(\r\n\t\t\t\t\tentity,\r\n\t\t\t\t\tboard,\r\n\t\t\t\t\tmenagerieMugStats,\r\n\t\t\t\t\tmenagerieMugStats,\r\n\t\t\t\t\tallCards,\r\n\t\t\t\t\tspectator,\r\n\t\t\t\t\t3,\r\n\t\t\t\t);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.MenagerieJug_BGS_083:\r\n\t\t\tcase CardIds.MenagerieJug_TB_BaconUps_145:\r\n\t\t\t\tconst menagerieJugStats = entity.cardId === CardIds.MenagerieJug_BGS_083 ? 2 : 4;\r\n\t\t\t\tgrantStatsToMinionsOfEachType(\r\n\t\t\t\t\tentity,\r\n\t\t\t\t\tboard,\r\n\t\t\t\t\tmenagerieJugStats,\r\n\t\t\t\t\tmenagerieJugStats,\r\n\t\t\t\t\tallCards,\r\n\t\t\t\t\tspectator,\r\n\t\t\t\t\t3,\r\n\t\t\t\t);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.NerubianDeathswarmer_BG25_011:\r\n\t\t\tcase CardIds.NerubianDeathswarmer_BG25_011_G:\r\n\t\t\t\tconst nerubianDeathswarmerStats = entity.cardId === CardIds.NerubianDeathswarmer_BG25_011 ? 1 : 2;\r\n\t\t\t\thero.globalInfo.UndeadAttackBonus =\r\n\t\t\t\t\t(hero.globalInfo?.UndeadAttackBonus ?? 0) + nerubianDeathswarmerStats;\r\n\t\t\t\taddStatsToBoard(entity, board, nerubianDeathswarmerStats, 0, allCards, spectator, Race[Race.UNDEAD]);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.SparringPartner_BG_AT_069:\r\n\t\t\tcase CardIds.SparringPartner_BG_AT_069_G:\r\n\t\t\t\tconst sparringPartnersTargets = allMinions.filter((e) => !e.taunt);\r\n\t\t\t\tconst sparringPartnersTarget = pickRandom(sparringPartnersTargets);\r\n\t\t\t\tif (sparringPartnersTarget) {\r\n\t\t\t\t\tsparringPartnersTarget.taunt = true;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.TwilightEmissary_BGS_038:\r\n\t\t\tcase CardIds.TwilightEmissary_TB_BaconUps_108:\r\n\t\t\t\tconst twilightEmissaryTarget = getRandomAliveMinion(board, Race.DRAGON, allCards);\r\n\t\t\t\tconst twilightEmissaryStats = entity.cardId === CardIds.TwilightEmissary_BGS_038 ? 2 : 4;\r\n\t\t\t\tmodifyAttack(twilightEmissaryTarget, twilightEmissaryStats, board, allCards);\r\n\t\t\t\tmodifyHealth(twilightEmissaryTarget, twilightEmissaryStats, board, allCards);\r\n\t\t\t\tafterStatsUpdate(twilightEmissaryTarget, board, allCards);\r\n\t\t\t\tspectator.registerPowerTarget(entity, twilightEmissaryTarget, board);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.BloodsailCannoneer_BGS_053:\r\n\t\t\tcase CardIds.BloodsailCannoneer_TB_BaconUps_138:\r\n\t\t\t\taddStatsToBoard(\r\n\t\t\t\t\tentity,\r\n\t\t\t\t\tboard.filter((e) => e.entityId != entity.entityId),\r\n\t\t\t\t\tentity.cardId === CardIds.BloodsailCannoneer_BGS_053 ? 3 : 6,\r\n\t\t\t\t\t0,\r\n\t\t\t\t\tallCards,\r\n\t\t\t\t\tspectator,\r\n\t\t\t\t\tRace[Race.PIRATE],\r\n\t\t\t\t);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.ColdlightSeerLegacy_BG_EX1_103:\r\n\t\t\tcase CardIds.ColdlightSeerLegacy_TB_BaconUps_064:\r\n\t\t\t\taddStatsToBoard(\r\n\t\t\t\t\tentity,\r\n\t\t\t\t\tboard.filter((e) => e.entityId != entity.entityId),\r\n\t\t\t\t\t0,\r\n\t\t\t\t\tentity.cardId === CardIds.ColdlightSeerLegacy_BG_EX1_103 ? 2 : 4,\r\n\t\t\t\t\tallCards,\r\n\t\t\t\t\tspectator,\r\n\t\t\t\t\tRace[Race.MURLOC],\r\n\t\t\t\t);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.KeyboardIgniter_BG26_522:\r\n\t\t\tcase CardIds.KeyboardIgniter_BG26_522_G:\r\n\t\t\t\taddStatsToBoard(\r\n\t\t\t\t\tentity,\r\n\t\t\t\t\tboard.filter((e) => e.entityId != entity.entityId),\r\n\t\t\t\t\tentity.cardId === CardIds.KeyboardIgniter_BG26_522 ? 2 : 4,\r\n\t\t\t\t\tentity.cardId === CardIds.KeyboardIgniter_BG26_522 ? 2 : 4,\r\n\t\t\t\t\tallCards,\r\n\t\t\t\t\tspectator,\r\n\t\t\t\t\tRace[Race.DEMON],\r\n\t\t\t\t);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.MoonBaconJazzer_BG26_159:\r\n\t\t\tcase CardIds.MoonBaconJazzer_BG26_159_G:\r\n\t\t\t\tconst moonBaconJazzerStats = entity.cardId === CardIds.MoonBaconJazzer_BG26_159 ? 1 : 2;\r\n\t\t\t\thero.globalInfo.BloodGemHealthBonus =\r\n\t\t\t\t\t(hero.globalInfo?.BloodGemHealthBonus ?? 0) + moonBaconJazzerStats;\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.Smogger_BG21_021:\r\n\t\t\tcase CardIds.Smogger_BG21_021_G:\r\n\t\t\t\tconst smoggerLoops = entity.cardId === CardIds.Smogger_BG21_021 ? 1 : 2;\r\n\t\t\t\tfor (let i = 0; i < smoggerLoops; i++) {\r\n\t\t\t\t\tconst smoggerTarget = getRandomAliveMinion(board, Race.ELEMENTAL, allCards);\r\n\t\t\t\t\tconst smoggerStats = hero.tavernTier ?? 3;\r\n\t\t\t\t\tmodifyAttack(smoggerTarget, smoggerStats, board, allCards);\r\n\t\t\t\t\tmodifyHealth(smoggerTarget, smoggerStats, board, allCards);\r\n\t\t\t\t\tafterStatsUpdate(smoggerTarget, board, allCards);\r\n\t\t\t\t\tspectator.registerPowerTarget(entity, smoggerTarget, board);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.AnnihilanBattlemaster_BGS_010:\r\n\t\t\tcase CardIds.AnnihilanBattlemaster_TB_BaconUps_083:\r\n\t\t\t\t// TODO: pass damage taken info\r\n\t\t\t\tconst startingHp = hero.cardId === CardIds.Patchwerk_TB_BaconShop_HERO_34 ? 60 : 30;\r\n\t\t\t\tconst hpMissing = startingHp - hero.hpLeft;\r\n\t\t\t\tconst annihilanStats = (entity.cardId === CardIds.AnnihilanBattlemaster_BGS_010 ? 2 : 4) * hpMissing;\r\n\t\t\t\tmodifyHealth(entity, annihilanStats, board, allCards);\r\n\t\t\t\tafterStatsUpdate(entity, board, allCards);\r\n\t\t\t\tspectator.registerPowerTarget(entity, entity, board);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.ElectricSynthesizer_BG26_963:\r\n\t\t\tcase CardIds.ElectricSynthesizer_BG26_963_G:\r\n\t\t\t\taddStatsToBoard(\r\n\t\t\t\t\tentity,\r\n\t\t\t\t\tboard.filter((e) => e.entityId != entity.entityId),\r\n\t\t\t\t\tentity.cardId === CardIds.ElectricSynthesizer_BG26_963 ? 3 : 6,\r\n\t\t\t\t\tentity.cardId === CardIds.ElectricSynthesizer_BG26_963 ? 1 : 2,\r\n\t\t\t\t\tallCards,\r\n\t\t\t\t\tspectator,\r\n\t\t\t\t\tRace[Race.DRAGON],\r\n\t\t\t\t);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.Necrolyte_BG20_202:\r\n\t\t\tcase CardIds.Necrolyte_BG20_202_G:\r\n\t\t\t\tconst necrolyteBloodGems = entity.cardId === CardIds.Necrolyte_BG20_202 ? 2 : 4;\r\n\t\t\t\tconst necrolyteTarget = pickRandom(board);\r\n\t\t\t\tplayBloodGemsOn(necrolyteTarget, necrolyteBloodGems, board, hero, allCards, spectator);\r\n\t\t\t\tspectator.registerPowerTarget(entity, necrolyteTarget, board);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.PrimalfinLookout_BGS_020:\r\n\t\t\tcase CardIds.PrimalfinLookout_TB_BaconUps_089:\r\n\t\t\t\tconst primalfinLookoutCardsToAdd =\r\n\t\t\t\t\tentity.cardId === CardIds.PrimalfinLookout_BGS_020\r\n\t\t\t\t\t\t? [cardsData.getRandomMinionForTribe(Race.MURLOC, hero.tavernTier ?? 1)]\r\n\t\t\t\t\t\t: [\r\n\t\t\t\t\t\t\t\tcardsData.getRandomMinionForTribe(Race.MURLOC, hero.tavernTier ?? 1),\r\n\t\t\t\t\t\t\t\tcardsData.getRandomMinionForTribe(Race.MURLOC, hero.tavernTier ?? 1),\r\n\t\t\t\t\t\t ];\r\n\t\t\t\taddCardsInHand(hero, board, allCards, spectator, primalfinLookoutCardsToAdd);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.StrongshellScavenger_BG_ICC_807:\r\n\t\t\tcase CardIds.StrongshellScavenger_TB_BaconUps_072:\r\n\t\t\t\tconst strongshellScavengerStats = entity.cardId === CardIds.StrongshellScavenger_BG_ICC_807 ? 2 : 4;\r\n\t\t\t\tconst strongshellScavengerTargets = board\r\n\t\t\t\t\t.filter((e) => e.entityId != entity.entityId)\r\n\t\t\t\t\t.filter((e) => e.taunt);\r\n\t\t\t\tstrongshellScavengerTargets.forEach((target) => {\r\n\t\t\t\t\tmodifyAttack(target, strongshellScavengerStats, board, allCards);\r\n\t\t\t\t\tmodifyHealth(target, strongshellScavengerStats, board, allCards);\r\n\t\t\t\t\tafterStatsUpdate(target, board, allCards);\r\n\t\t\t\t\tspectator.registerPowerTarget(entity, target, board);\r\n\t\t\t\t});\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.VigilantStoneborn_BG24_023:\r\n\t\t\tcase CardIds.VigilantStoneborn_BG24_023_G:\r\n\t\t\t\tconst vigilantStonebornTarget = pickRandom(board);\r\n\t\t\t\tconst vigilantStonebornStats = entity.cardId === CardIds.VigilantStoneborn_BG24_023 ? 6 : 12;\r\n\t\t\t\tvigilantStonebornTarget.taunt = true;\r\n\t\t\t\tmodifyHealth(vigilantStonebornTarget, vigilantStonebornStats, board, allCards);\r\n\t\t\t\tafterStatsUpdate(vigilantStonebornTarget, board, allCards);\r\n\t\t\t\tspectator.registerPowerTarget(entity, vigilantStonebornTarget, board);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.Bonemare_BG26_ICC_705:\r\n\t\t\tcase CardIds.Bonemare_BG26_ICC_705_G:\r\n\t\t\t\tconst bonemareTarget = pickRandom(board);\r\n\t\t\t\tconst bonemareStats = entity.cardId === CardIds.Bonemare_BG26_ICC_705 ? 4 : 8;\r\n\t\t\t\tbonemareTarget.taunt = true;\r\n\t\t\t\tmodifyAttack(bonemareTarget, bonemareStats, board, allCards);\r\n\t\t\t\tmodifyHealth(bonemareTarget, bonemareStats, board, allCards);\r\n\t\t\t\tafterStatsUpdate(bonemareTarget, board, allCards);\r\n\t\t\t\tspectator.registerPowerTarget(entity, bonemareTarget, board);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.GeneralDrakkisath_BG25_309:\r\n\t\t\tcase CardIds.GeneralDrakkisath_BG25_309_G:\r\n\t\t\t\tconst generalDrakkisathCardsToAdd =\r\n\t\t\t\t\tentity.cardId === CardIds.GeneralDrakkisath_BG25_309\r\n\t\t\t\t\t\t? [CardIds.GeneralDrakkisath_SmolderwingToken_BG25_309t]\r\n\t\t\t\t\t\t: [\r\n\t\t\t\t\t\t\t\tCardIds.GeneralDrakkisath_SmolderwingToken_BG25_309t,\r\n\t\t\t\t\t\t\t\tCardIds.GeneralDrakkisath_SmolderwingToken_BG25_309t,\r\n\t\t\t\t\t\t ];\r\n\t\t\t\taddCardsInHand(hero, board, allCards, spectator, generalDrakkisathCardsToAdd);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.KingBagurgle_BGS_030:\r\n\t\t\tcase CardIds.KingBagurgle_TB_BaconUps_100:\r\n\t\t\t\taddStatsToBoard(\r\n\t\t\t\t\tentity,\r\n\t\t\t\t\tboard.filter((e) => e.entityId != entity.entityId),\r\n\t\t\t\t\tentity.cardId === CardIds.KingBagurgle_BGS_030 ? 2 : 4,\r\n\t\t\t\t\tentity.cardId === CardIds.KingBagurgle_BGS_030 ? 3 : 6,\r\n\t\t\t\t\tallCards,\r\n\t\t\t\t\tspectator,\r\n\t\t\t\t\tRace[Race.MURLOC],\r\n\t\t\t\t);\r\n\t\t\t\tbreak;\r\n\t\t\t// Not correct, but only used to trigger the \"add cards in hand\" effect\r\n\t\t\tcase CardIds.Murozond_BGS_043:\r\n\t\t\tcase CardIds.Murozond_TB_BaconUps_110:\r\n\t\t\t\tconst murozondCardsToAdd =\r\n\t\t\t\t\tentity.cardId === CardIds.Murozond_BGS_043\r\n\t\t\t\t\t\t? [CardIds.TheCoinCore]\r\n\t\t\t\t\t\t: [CardIds.TheCoinCore, CardIds.TheCoinCore];\r\n\t\t\t\taddCardsInHand(hero, board, allCards, spectator, murozondCardsToAdd);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.TavernTempest_BGS_123:\r\n\t\t\tcase CardIds.TavernTempest_TB_BaconUps_162:\r\n\t\t\t\tconst tavernTempestCardsToAdd =\r\n\t\t\t\t\tentity.cardId === CardIds.TavernTempest_BGS_123\r\n\t\t\t\t\t\t? [CardIds.TheCoinCore]\r\n\t\t\t\t\t\t: [CardIds.TheCoinCore, CardIds.TheCoinCore];\r\n\t\t\t\taddCardsInHand(hero, board, allCards, spectator, tavernTempestCardsToAdd);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.MechaJaraxxus_BG25_807:\r\n\t\t\tcase CardIds.MechaJaraxxus_BG25_807_G:\r\n\t\t\t\tconst mechaJaraxxusCardsToAdd =\r\n\t\t\t\t\tentity.cardId === CardIds.MechaJaraxxus_BG25_807\r\n\t\t\t\t\t\t? [CardIds.TheCoinCore]\r\n\t\t\t\t\t\t: [CardIds.TheCoinCore, CardIds.TheCoinCore];\r\n\t\t\t\taddCardsInHand(hero, board, allCards, spectator, mechaJaraxxusCardsToAdd);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.OozelingGladiator_BG27_002:\r\n\t\t\tcase CardIds.OozelingGladiator_BG27_002_G:\r\n\t\t\t\tconst oozelingCardsToAdd =\r\n\t\t\t\t\tentity.cardId === CardIds.OozelingGladiator_BG27_002\r\n\t\t\t\t\t\t? [CardIds.TheCoinCore, CardIds.TheCoinCore]\r\n\t\t\t\t\t\t: [CardIds.TheCoinCore, CardIds.TheCoinCore, CardIds.TheCoinCore, CardIds.TheCoinCore];\r\n\t\t\t\taddCardsInHand(hero, board, allCards, spectator, oozelingCardsToAdd);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.UtherTheLightbringer_BG23_190:\r\n\t\t\tcase CardIds.UtherTheLightbringer_BG23_190_G:\r\n\t\t\t\tconst utherTarget = pickRandom(allMinions);\r\n\t\t\t\tconst utherStats = entity.cardId === CardIds.UtherTheLightbringer_BG23_190 ? 15 : 30;\r\n\t\t\t\tutherTarget.attack = utherStats;\r\n\t\t\t\tutherTarget.health = utherStats;\r\n\t\t\t\tutherTarget.maxHealth = utherStats;\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.IronGroundskeeper_BG27_000:\r\n\t\t\tcase CardIds.IronGroundskeeper_BG27_000_G:\r\n\t\t\t\tconst ironGroundskeeperTargets = allMinions;\r\n\t\t\t\tconst ironGroundskeeperTarget = pickRandom(ironGroundskeeperTargets);\r\n\t\t\t\tironGroundskeeperTarget.taunt = !ironGroundskeeperTarget.taunt;\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.LivingConstellation_BG27_001:\r\n\t\t\tcase CardIds.LivingConstellation_BG27_001_G:\r\n\t\t\t\tconst differentTypes = extractUniqueTribes(board, allCards);\r\n\t\t\t\tconst livingConstellationStats =\r\n\t\t\t\t\t(entity.cardId === CardIds.LivingConstellation_BG27_001 ? 1 : 2) * differentTypes.length;\r\n\t\t\t\tconst livingConstellationTarget = pickRandom(board);\r\n\t\t\t\tmodifyAttack(livingConstellationTarget, livingConstellationStats, board, allCards);\r\n\t\t\t\tmodifyHealth(livingConstellationTarget, livingConstellationStats, board, allCards);\r\n\t\t\t\tafterStatsUpdate(livingConstellationTarget, board, allCards);\r\n\t\t\t\tspectator.registerPowerTarget(entity, livingConstellationTarget, board);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.FairyTaleCaroler_BG26_001:\r\n\t\t\tcase CardIds.FairyTaleCaroler_BG26_001_G:\r\n\t\t\t\taddStatsToBoard(\r\n\t\t\t\t\tentity,\r\n\t\t\t\t\tboard.filter((e) => e.entityId != entity.entityId),\r\n\t\t\t\t\tentity.cardId === CardIds.FairyTaleCaroler_BG26_001 ? 2 : 4,\r\n\t\t\t\t\tentity.cardId === CardIds.FairyTaleCaroler_BG26_001 ? 2 : 4,\r\n\t\t\t\t\tallCards,\r\n\t\t\t\t\tspectator,\r\n\t\t\t\t);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.SparkLing_BG27_019:\r\n\t\t\tcase CardIds.SparkLing_BG27_019_G:\r\n\t\t\t\taddStatsToBoard(\r\n\t\t\t\t\tentity,\r\n\t\t\t\t\tboard.filter((e) => e.entityId != entity.entityId),\r\n\t\t\t\t\tentity.cardId === CardIds.SparkLing_BG27_019 ? 1 : 2,\r\n\t\t\t\t\tentity.cardId === CardIds.SparkLing_BG27_019 ? 1 : 2,\r\n\t\t\t\t\tallCards,\r\n\t\t\t\t\tspectator,\r\n\t\t\t\t);\r\n\t\t\t\taddStatsToBoard(\r\n\t\t\t\t\tentity,\r\n\t\t\t\t\totherBoard,\r\n\t\t\t\t\tentity.cardId === CardIds.SparkLing_BG27_019 ? 1 : 2,\r\n\t\t\t\t\tentity.cardId === CardIds.SparkLing_BG27_019 ? 1 : 2,\r\n\t\t\t\t\tallCards,\r\n\t\t\t\t\tspectator,\r\n\t\t\t\t);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.EmergentFlame_BG27_018:\r\n\t\t\tcase CardIds.EmergentFlame_BG27_018_G:\r\n\t\t\t\tconst emergentFlameTarget = pickRandom(\r\n\t\t\t\t\tboard.filter((e) => hasCorrectTribe(e, Race.ELEMENTAL, allCards)),\r\n\t\t\t\t);\r\n\t\t\t\tconst emergentFlameStats = entity.cardId === CardIds.EmergentFlame_BG27_018 ? 1 : 2;\r\n\t\t\t\tmodifyAttack(emergentFlameTarget, emergentFlameStats, board, allCards);\r\n\t\t\t\tmodifyHealth(emergentFlameTarget, emergentFlameStats, board, allCards);\r\n\t\t\t\tafterStatsUpdate(emergentFlameTarget, board, allCards);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.ArgentBraggart_BG_SCH_149:\r\n\t\t\tcase CardIds.ArgentBraggart_TB_BaconUps_308:\r\n\t\t\t\tconst highestAttack = Math.max(...allMinions.map((minion) => minion.attack));\r\n\t\t\t\tconst highestHealth = Math.max(...allMinions.map((minion) => minion.health));\r\n\t\t\t\tconst argentBraggartMultiplier = entity.cardId === CardIds.ArgentBraggart_BG_SCH_149 ? 1 : 2;\r\n\t\t\t\tentity.attack = argentBraggartMultiplier * highestAttack;\r\n\t\t\t\tentity.health = argentBraggartMultiplier * highestHealth;\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.CaptainSanders_BG25_034:\r\n\t\t\tcase CardIds.CaptainSanders_BG25_034_G:\r\n\t\t\t\tconst captainSandersTarget = pickRandom(board.filter((e) => !isMinionGolden(e, allCards)));\r\n\t\t\t\tif (captainSandersTarget) {\r\n\t\t\t\t\tmakeMinionGolden(captainSandersTarget, entity, board, allCards, spectator);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.SanguineChampion_BG23_017:\r\n\t\t\tcase CardIds.SanguineChampion_BG23_017_G:\r\n\t\t\t\tconst sanguineChampionStats = entity.cardId === CardIds.SanguineChampion_BG23_017 ? 1 : 2;\r\n\t\t\t\thero.globalInfo.BloodGemAttackBonus += sanguineChampionStats;\r\n\t\t\t\thero.globalInfo.BloodGemHealthBonus += sanguineChampionStats;\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.Murky_BG24_012:\r\n\t\t\tcase CardIds.Murky_BG24_012_G:\r\n\t\t\t\tconst murkyScale = entity.cardId === CardIds.Murky_BG24_012 ? 1 : 2;\r\n\t\t\t\tconst murkyBattlecriesPlayed = entity.scriptDataNum1 > 0 ? entity.scriptDataNum1 / murkyScale - 1 : 0;\r\n\t\t\t\tconst murkyStats = murkyScale * (1 + murkyBattlecriesPlayed);\r\n\t\t\t\tconst murkyTarget = pickRandom(board.filter((e) => hasCorrectTribe(e, Race.MURLOC, allCards)));\r\n\t\t\t\tmodifyAttack(murkyTarget, murkyStats, board, allCards);\r\n\t\t\t\tmodifyHealth(murkyTarget, murkyStats, board, allCards);\r\n\t\t\t\tafterStatsUpdate(murkyTarget, board, allCards);\r\n\t\t\t\tbreak;\r\n\t\t\tcase CardIds.Amalgadon_BGS_069:\r\n\t\t\tcase CardIds.Amalgadon_TB_BaconUps_121:\r\n\t\t\t\tconst numberOfTribes = extractUniqueTribes(board, allCards).length;\r\n\t\t\t\tconst amalgadonMultiplier = entity.cardId === CardIds.Amalgadon_BGS_069 ? 1 : 2;\r\n\t\t\t\tconst totalAdapts = amalgadonMultiplier * numberOfTribes;\r\n\t\t\t\tfor (let i = 0; i < totalAdapts; i++) {\r\n\t\t\t\t\tconst adapts = [\r\n\t\t\t\t\t\tCardIds.FlamingClawsToken,\r\n\t\t\t\t\t\tCardIds.LivingSporesToken,\r\n\t\t\t\t\t\tCardIds.VolcanicMightToken,\r\n\t\t\t\t\t\tCardIds.RockyCarapaceToken,\r\n\t\t\t\t\t];\r\n\t\t\t\t\tif (!entity.divineShield) {\r\n\t\t\t\t\t\tadapts.push(CardIds.CracklingShieldToken);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!entity.windfury) {\r\n\t\t\t\t\t\tadapts.push(CardIds.LightningSpeedToken);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!entity.taunt) {\r\n\t\t\t\t\t\tadapts.push(CardIds.MassiveToken);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!entity.venomous && !entity.poisonous) {\r\n\t\t\t\t\t\tadapts.push(CardIds.PoisonSpitToken);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tconst adapt = pickRandom(adapts);\r\n\t\t\t\t\tswitch (adapt) {\r\n\t\t\t\t\t\tcase CardIds.FlamingClawsToken:\r\n\t\t\t\t\t\t\tmodifyAttack(entity, 3, board, allCards);\r\n\t\t\t\t\t\t\tafterStatsUpdate(entity, board, allCards);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase CardIds.LivingSporesToken:\r\n\t\t\t\t\t\t\tentity.enchantments = entity.enchantments ?? [];\r\n\t\t\t\t\t\t\tentity.enchantments.push({\r\n\t\t\t\t\t\t\t\tcardId: CardIds.LivingSpores_LivingSporesEnchantment,\r\n\t\t\t\t\t\t\t\ttiming: 0,\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase CardIds.LightningSpeedToken:\r\n\t\t\t\t\t\t\tentity.windfury = true;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase CardIds.MassiveToken:\r\n\t\t\t\t\t\t\tentity.taunt = true;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase CardIds.PoisonSpitToken:\r\n\t\t\t\t\t\t\tentity.poisonous = true;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase CardIds.RockyCarapaceToken:\r\n\t\t\t\t\t\t\tmodifyHealth(entity, 3, board, allCards);\r\n\t\t\t\t\t\t\tafterStatsUpdate(entity, board, allCards);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase CardIds.CracklingShieldToken:\r\n\t\t\t\t\t\t\tentity.divineShield = true;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase CardIds.VolcanicMightToken:\r\n\t\t\t\t\t\t\tmodifyAttack(entity, 1, board, allCards);\r\n\t\t\t\t\t\t\tmodifyHealth(entity, 1, board, allCards);\r\n\t\t\t\t\t\t\tafterStatsUpdate(entity, board, allCards);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\thasTriggered = false;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\tif (hasTriggered) {\r\n\t\t\tafterBattlecryTriggered(entity, board, hero, otherBoard, otherHero, allCards, cardsData, spectator);\r\n\t\t}\r\n\t}\r\n};\r\n\r\nconst afterBattlecryTriggered = (\r\n\tentity: BoardEntity,\r\n\tboard: BoardEntity[],\r\n\thero: BgsPlayerEntity,\r\n\totherBoard: BoardEntity[],\r\n\totherHero: BgsPlayerEntity,\r\n\tallCards: AllCardsService,\r\n\tcardsData: CardsData,\r\n\tspectator: Spectator,\r\n) => {\r\n\tboard\r\n\t\t.filter((e) => e.cardId === CardIds.KalecgosArcaneAspect_BGS_041)\r\n\t\t.forEach((e) => {\r\n\t\t\taddStatsToBoard(entity, board, 1, 1, allCards, spectator, Race[Race.DRAGON]);\r\n\t\t});\r\n\tboard\r\n\t\t.filter((e) => e.cardId === CardIds.KalecgosArcaneAspect_TB_BaconUps_109)\r\n\t\t.forEach((e) => {\r\n\t\t\taddStatsToBoard(entity, board, 2, 2, allCards, spectator, Race[Race.DRAGON]);\r\n\t\t});\r\n};\r\n\r\n// TODO: this is probably too slow\r\nconst extractUniqueTribes = (board: BoardEntity[], allCards: AllCardsService): readonly Race[] => {\r\n\tconst boardReferenceCards = board.map((m) => allCards.getCard(m.cardId));\r\n\tconst minionsPlayedWithTribes = boardReferenceCards.filter((c) => !!c.races?.length);\r\n\tconst minionsToProcess: /*Mutable<ReferenceCard & { picked?: boolean }>*/ any[] = [\r\n\t\t...minionsPlayedWithTribes\r\n\t\t\t.filter((c) => !c.races.includes(Race[Race.ALL]))\r\n\t\t\t.map((c) => ({ ...c, races: [...c.races] })),\r\n\t];\r\n\r\n\tconst uniqueTribes: Race[] = [];\r\n\tconst maxTribesPerMinion = 2;\r\n\tfor (let i = 1; i <= maxTribesPerMinion; i++) {\r\n\t\tlet dirty = true;\r\n\t\twhile (dirty) {\r\n\t\t\tdirty = false;\r\n\t\t\tfor (let j = 0; j < minionsToProcess.length; j++) {\r\n\t\t\t\tconst minion = minionsToProcess[j];\r\n\t\t\t\t// console.debug('considering minion', minion.name, minion.races);\r\n\t\t\t\tif (!minion.picked && minion.races.length > 0 && minion.races.length <= i) {\r\n\t\t\t\t\tconst raceToAdd: string = minion.races[0];\r\n\t\t\t\t\tuniqueTribes.push(Race[raceToAdd]);\r\n\t\t\t\t\t// console.debug('added', raceToAdd, uniqueTribes);\r\n\t\t\t\t\tfor (const m of minionsToProcess) {\r\n\t\t\t\t\t\tm.races = m.races.filter((r) => r !== raceToAdd);\r\n\t\t\t\t\t\t// console.debug('updates races', m.name, m.races, raceToAdd);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tminion.picked = true;\r\n\t\t\t\t\tdirty = true;\r\n\t\t\t\t\t// Restart the loop, so we're not dependant on the order in which we process things\r\n\t\t\t\t\tj = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// minionsToProcess = minionsToProcess.filter((c) => !c.picked);\r\n\t\t}\r\n\t}\r\n\r\n\tuniqueTribes.push(\r\n\t\t...minionsPlayedWithTribes\r\n\t\t\t.filter((m) => m.races.includes(Race[Race.ALL]))\r\n\t\t\t.flatMap((m) => m.races)\r\n\t\t\t.map((r: string) => Race[r]),\r\n\t);\r\n\treturn uniqueTribes;\r\n};\r\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firestone-hs/simulate-bgs-battle",
3
- "version": "1.1.302",
3
+ "version": "1.1.303",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "lint": "eslint --color --fix --ext .ts .",