@firestone-hs/simulate-bgs-battle 1.1.645 → 1.1.647

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 (286) hide show
  1. package/dist/cards/impl/bg-spell/sharing-is-caring.js.map +1 -1
  2. package/dist/cards/impl/bg-spell/shiny-ring.js.map +1 -1
  3. package/dist/cards/impl/bg-spell/toxic-tumbleweed.js.map +1 -1
  4. package/dist/cards/impl/hero-power/aim-high.js.map +1 -1
  5. package/dist/cards/impl/hero-power/aim-left.js.map +1 -1
  6. package/dist/cards/impl/hero-power/aim-low.js.map +1 -1
  7. package/dist/cards/impl/hero-power/aim-right.js.map +1 -1
  8. package/dist/cards/impl/hero-power/earth-invocation.js.map +1 -1
  9. package/dist/cards/impl/hero-power/embrace-your-rage.js.map +1 -1
  10. package/dist/cards/impl/hero-power/fire-invocation.js.map +1 -1
  11. package/dist/cards/impl/hero-power/lightning-invocation.js.map +1 -1
  12. package/dist/cards/impl/hero-power/rapid-reanimation.js.map +1 -1
  13. package/dist/cards/impl/hero-power/reborn-rites.js.map +1 -1
  14. package/dist/cards/impl/hero-power/water-invocation.js.map +1 -1
  15. package/dist/cards/impl/minion/all-seeing-elder.js.map +1 -1
  16. package/dist/cards/impl/minion/alleycat.js.map +1 -1
  17. package/dist/cards/impl/minion/amber-guardian.js.map +1 -1
  18. package/dist/cards/impl/minion/amplifying-lightspawn.js.map +1 -1
  19. package/dist/cards/impl/minion/apprentice-of-sefin.js.map +1 -1
  20. package/dist/cards/impl/minion/archimonde.js.map +1 -1
  21. package/dist/cards/impl/minion/arid-atrocity.js.map +1 -1
  22. package/dist/cards/impl/minion/ashen-corruptor.js.map +1 -1
  23. package/dist/cards/impl/minion/assistant-guard.js.map +1 -1
  24. package/dist/cards/impl/minion/audacious-anchor.js.map +1 -1
  25. package/dist/cards/impl/minion/auto-assembler.js.map +1 -1
  26. package/dist/cards/impl/minion/avalanche-caller.js.map +1 -1
  27. package/dist/cards/impl/minion/baneling.js.map +1 -1
  28. package/dist/cards/impl/minion/bannerboar.js.map +1 -1
  29. package/dist/cards/impl/minion/beetle.js.map +1 -1
  30. package/dist/cards/impl/minion/bellowing-tyrant.js.map +1 -1
  31. package/dist/cards/impl/minion/bigwig-bandit.js.map +1 -1
  32. package/dist/cards/impl/minion/bird-buddy.js.map +1 -1
  33. package/dist/cards/impl/minion/blazing-skyfin.js.map +1 -1
  34. package/dist/cards/impl/minion/bloodsnout-warlord.js.map +1 -1
  35. package/dist/cards/impl/minion/blue-whelp.js.map +1 -1
  36. package/dist/cards/impl/minion/boar-gamer.js.map +1 -1
  37. package/dist/cards/impl/minion/bongo-bopper.js.map +1 -1
  38. package/dist/cards/impl/minion/briarback-bookie.js.map +1 -1
  39. package/dist/cards/impl/minion/bronze-steward.js.map +1 -1
  40. package/dist/cards/impl/minion/bubble-gunner.js.map +1 -1
  41. package/dist/cards/impl/minion/buzzing-vermin.js.map +1 -1
  42. package/dist/cards/impl/minion/cadaver-caretaker.js.map +1 -1
  43. package/dist/cards/impl/minion/campfire-shadow.js.map +1 -1
  44. package/dist/cards/impl/minion/canopy-swinger.js.map +1 -1
  45. package/dist/cards/impl/minion/captain-bonerender.js.map +1 -1
  46. package/dist/cards/impl/minion/carapace-raiser.js.map +1 -1
  47. package/dist/cards/impl/minion/carbonic-copy.js.map +1 -1
  48. package/dist/cards/impl/minion/carrier.js.map +1 -1
  49. package/dist/cards/impl/minion/champion-of-the-primus.js.map +1 -1
  50. package/dist/cards/impl/minion/charlga.js.map +1 -1
  51. package/dist/cards/impl/minion/choral-mrrrglr.js.map +1 -1
  52. package/dist/cards/impl/minion/clunker-junker.js.map +1 -1
  53. package/dist/cards/impl/minion/coilskar-sapper.js.map +1 -1
  54. package/dist/cards/impl/minion/coldlight-diver.js.map +1 -1
  55. package/dist/cards/impl/minion/corrupted-myrmidon.js.map +1 -1
  56. package/dist/cards/impl/minion/cruise-controller.js.map +1 -1
  57. package/dist/cards/impl/minion/crystal-infuser-enchantment.js.map +1 -1
  58. package/dist/cards/impl/minion/cupcake-peddler.js.map +1 -1
  59. package/dist/cards/impl/minion/dastardly-drust.js.map +1 -1
  60. package/dist/cards/impl/minion/deadstomper.js.map +1 -1
  61. package/dist/cards/impl/minion/deathly-striker.js.map +1 -1
  62. package/dist/cards/impl/minion/defiant-shipwright.js.map +1 -1
  63. package/dist/cards/impl/minion/deflecto-bot.js.map +1 -1
  64. package/dist/cards/impl/minion/devout-hellcaller.js.map +1 -1
  65. package/dist/cards/impl/minion/diremuck-forager.js.map +1 -1
  66. package/dist/cards/impl/minion/drakkari-embalmer.js.map +1 -1
  67. package/dist/cards/impl/minion/dreaming-thornweaver.js.map +1 -1
  68. package/dist/cards/impl/minion/drustfallen-butcher.js.map +1 -1
  69. package/dist/cards/impl/minion/efficient-engineer.js.map +1 -1
  70. package/dist/cards/impl/minion/elder-taggawag.js.map +1 -1
  71. package/dist/cards/impl/minion/electric-synthesizer.js.map +1 -1
  72. package/dist/cards/impl/minion/elite-navigator.js.map +1 -1
  73. package/dist/cards/impl/minion/fairy-gillmother.js.map +1 -1
  74. package/dist/cards/impl/minion/fauna-whisperer.js.map +1 -1
  75. package/dist/cards/impl/minion/fire-forged-evoker.js.map +1 -1
  76. package/dist/cards/impl/minion/firescale-hoarder.js.map +1 -1
  77. package/dist/cards/impl/minion/fireworks-fanatic.js.map +1 -1
  78. package/dist/cards/impl/minion/floating-watcher.js.map +1 -1
  79. package/dist/cards/impl/minion/flotsam-flinger.js.map +1 -1
  80. package/dist/cards/impl/minion/forest-rover.js.map +1 -1
  81. package/dist/cards/impl/minion/fountain-chiller.js.map +1 -1
  82. package/dist/cards/impl/minion/friendly-geist.js.map +1 -1
  83. package/dist/cards/impl/minion/geared-guard.js.map +1 -1
  84. package/dist/cards/impl/minion/gem-rat.js.map +1 -1
  85. package/dist/cards/impl/minion/gem-smuggler.js.map +1 -1
  86. package/dist/cards/impl/minion/general-drakkisath.js.map +1 -1
  87. package/dist/cards/impl/minion/gentle-djinni.js.map +1 -1
  88. package/dist/cards/impl/minion/gentle-stag.js.map +1 -1
  89. package/dist/cards/impl/minion/gleaming-trader.js.map +1 -1
  90. package/dist/cards/impl/minion/glowgullet-warlord.js.map +1 -1
  91. package/dist/cards/impl/minion/glowing-cinder.js.map +1 -1
  92. package/dist/cards/impl/minion/goldgrubber.js.map +1 -1
  93. package/dist/cards/impl/minion/gormling-gourmet.js.map +1 -1
  94. package/dist/cards/impl/minion/grease-bot.js.map +1 -1
  95. package/dist/cards/impl/minion/greedy-snaketongue.js.map +1 -1
  96. package/dist/cards/impl/minion/grimscale-elegist.js.map +1 -1
  97. package/dist/cards/impl/minion/gritty-headhunter.js.map +1 -1
  98. package/dist/cards/impl/minion/hackerfin.js.map +1 -1
  99. package/dist/cards/impl/minion/handless-forsaken.js.map +1 -1
  100. package/dist/cards/impl/minion/harmless-bonehead.js.map +1 -1
  101. package/dist/cards/impl/minion/hawkstrider-herald.js.map +1 -1
  102. package/dist/cards/impl/minion/hog-watcher.js.map +1 -1
  103. package/dist/cards/impl/minion/holo-rover.js.map +1 -1
  104. package/dist/cards/impl/minion/hot-springer.js.map +1 -1
  105. package/dist/cards/impl/minion/humming-bird.js.map +1 -1
  106. package/dist/cards/impl/minion/humongozz.js.map +1 -1
  107. package/dist/cards/impl/minion/hungry-snapjaw.js.map +1 -1
  108. package/dist/cards/impl/minion/hunter-of-gatherers.js.map +1 -1
  109. package/dist/cards/impl/minion/ignition-specialist.js.map +1 -1
  110. package/dist/cards/impl/minion/immortal.js.map +1 -1
  111. package/dist/cards/impl/minion/implant-subject.js.map +1 -1
  112. package/dist/cards/impl/minion/imposing-percussionist.js.map +1 -1
  113. package/dist/cards/impl/minion/impulsive-trickster.js.map +1 -1
  114. package/dist/cards/impl/minion/indomitable-mount.js.map +1 -1
  115. package/dist/cards/impl/minion/inspiring-underdog.js.map +1 -1
  116. package/dist/cards/impl/minion/interrogator-whitemane.js.map +1 -1
  117. package/dist/cards/impl/minion/irate-rooster.js.map +1 -1
  118. package/dist/cards/impl/minion/kangors-apprentice.js.map +1 -1
  119. package/dist/cards/impl/minion/king-bagurgle.js.map +1 -1
  120. package/dist/cards/impl/minion/leeroy-the-reckless.js.map +1 -1
  121. package/dist/cards/impl/minion/lightfang-enforcer.js.map +1 -1
  122. package/dist/cards/impl/minion/lightfeather-screecher.js.map +1 -1
  123. package/dist/cards/impl/minion/lokholar-frostforger.js.map +1 -1
  124. package/dist/cards/impl/minion/lord-of-the-ruins.js.map +1 -1
  125. package/dist/cards/impl/minion/lost-city-looter.js.map +1 -1
  126. package/dist/cards/impl/minion/lovesick-balladist.js.map +1 -1
  127. package/dist/cards/impl/minion/low-flier.js.map +1 -1
  128. package/dist/cards/impl/minion/lurker.js.map +1 -1
  129. package/dist/cards/impl/minion/magicfin-apprentice.js.map +1 -1
  130. package/dist/cards/impl/minion/malorne.d.ts +2 -2
  131. package/dist/cards/impl/minion/malorne.js +14 -0
  132. package/dist/cards/impl/minion/malorne.js.map +1 -1
  133. package/dist/cards/impl/minion/manasaber.js.map +1 -1
  134. package/dist/cards/impl/minion/mantid-queen.js.map +1 -1
  135. package/dist/cards/impl/minion/marquee-ticker.js.map +1 -1
  136. package/dist/cards/impl/minion/maw-caster.js.map +1 -1
  137. package/dist/cards/impl/minion/mecha-jaraxxus.js.map +1 -1
  138. package/dist/cards/impl/minion/mechagnome-interpreter.js.map +1 -1
  139. package/dist/cards/impl/minion/mechanized-gift-horse.js.map +1 -1
  140. package/dist/cards/impl/minion/mechorse.js.map +1 -1
  141. package/dist/cards/impl/minion/menagerie-jug.js.map +1 -1
  142. package/dist/cards/impl/minion/metallic-hunter.js.map +1 -1
  143. package/dist/cards/impl/minion/misfit-dragonling.js.map +1 -1
  144. package/dist/cards/impl/minion/moonsteel-juggernaut.js.map +1 -1
  145. package/dist/cards/impl/minion/mothership.js.map +1 -1
  146. package/dist/cards/impl/minion/mummifier.js.map +1 -1
  147. package/dist/cards/impl/minion/murkbrine-expeditioner.js.map +1 -1
  148. package/dist/cards/impl/minion/murky.js.map +1 -1
  149. package/dist/cards/impl/minion/mutalisk.js.map +1 -1
  150. package/dist/cards/impl/minion/mutated-lasher.js.map +1 -1
  151. package/dist/cards/impl/minion/mythrax.js.map +1 -1
  152. package/dist/cards/impl/minion/neon-agent.js.map +1 -1
  153. package/dist/cards/impl/minion/nerubian-deathswarmer.js.map +1 -1
  154. package/dist/cards/impl/minion/nest-swarmer.js.map +1 -1
  155. package/dist/cards/impl/minion/nether-drake.js.map +1 -1
  156. package/dist/cards/impl/minion/nightmare-par-tea-guest.js.map +1 -1
  157. package/dist/cards/impl/minion/nimble-hatchling.js.map +1 -1
  158. package/dist/cards/impl/minion/noisul-of-the-many-faces.js.map +1 -1
  159. package/dist/cards/impl/minion/oozeling-gladiator.js.map +1 -1
  160. package/dist/cards/impl/minion/operatic-belcher.js.map +1 -1
  161. package/dist/cards/impl/minion/outback-smolderer.js.map +1 -1
  162. package/dist/cards/impl/minion/parched-wanderer.js.map +1 -1
  163. package/dist/cards/impl/minion/peggy-sturdybone.js.map +1 -1
  164. package/dist/cards/impl/minion/poultron.js +3 -0
  165. package/dist/cards/impl/minion/poultron.js.map +1 -1
  166. package/dist/cards/impl/minion/primalfin-lookout.js.map +1 -1
  167. package/dist/cards/impl/minion/prized-promo-drake.js.map +1 -1
  168. package/dist/cards/impl/minion/prodigious-tusker.js.map +1 -1
  169. package/dist/cards/impl/minion/rapscallion-recruiter.js.map +1 -1
  170. package/dist/cards/impl/minion/razorfen-geomancer.js.map +1 -1
  171. package/dist/cards/impl/minion/razorgore-the-untamed.js.map +1 -1
  172. package/dist/cards/impl/minion/reckless-cliffdiver.js.map +1 -1
  173. package/dist/cards/impl/minion/rickety-repairbot.js.map +1 -1
  174. package/dist/cards/impl/minion/ride-or-die.js.map +1 -1
  175. package/dist/cards/impl/minion/roach.js.map +1 -1
  176. package/dist/cards/impl/minion/roadboar.js.map +1 -1
  177. package/dist/cards/impl/minion/rodeo-performer.js.map +1 -1
  178. package/dist/cards/impl/minion/ruins-renovator.js.map +1 -1
  179. package/dist/cards/impl/minion/runed-progenitor.js.map +1 -1
  180. package/dist/cards/impl/minion/rylak-metalhead.js.map +1 -1
  181. package/dist/cards/impl/minion/salty-hog.js.map +1 -1
  182. package/dist/cards/impl/minion/sand-swirler.js.map +1 -1
  183. package/dist/cards/impl/minion/sandy.js.map +1 -1
  184. package/dist/cards/impl/minion/sanguine-refiner.js.map +1 -1
  185. package/dist/cards/impl/minion/sanlayn-scribe.js.map +1 -1
  186. package/dist/cards/impl/minion/scallywag.js.map +1 -1
  187. package/dist/cards/impl/minion/scourge-harvester.js.map +1 -1
  188. package/dist/cards/impl/minion/selfless-hero.js.map +1 -1
  189. package/dist/cards/impl/minion/shadowdancer.js.map +1 -1
  190. package/dist/cards/impl/minion/sharp-eyed-sabretooth.js.map +1 -1
  191. package/dist/cards/impl/minion/sharptooth-snapper.js.map +1 -1
  192. package/dist/cards/impl/minion/shell-collector.js.map +1 -1
  193. package/dist/cards/impl/minion/ship-master-eudora.js.map +1 -1
  194. package/dist/cards/impl/minion/shipwrecked-rascal.js.map +1 -1
  195. package/dist/cards/impl/minion/showy-cyclist.js.map +1 -1
  196. package/dist/cards/impl/minion/silithid-burrower.js.map +1 -1
  197. package/dist/cards/impl/minion/silky-shimmermoth.js.map +1 -1
  198. package/dist/cards/impl/minion/silver-handed-recruit.js.map +1 -1
  199. package/dist/cards/impl/minion/sinodorei-straight-shot.js.map +1 -1
  200. package/dist/cards/impl/minion/skulking-bristlemane.js.map +1 -1
  201. package/dist/cards/impl/minion/slumber-sorcerer.js.map +1 -1
  202. package/dist/cards/impl/minion/smolderwing.js.map +1 -1
  203. package/dist/cards/impl/minion/soul-rewinder.js.map +1 -1
  204. package/dist/cards/impl/minion/soulsplitter.js.map +1 -1
  205. package/dist/cards/impl/minion/spacefarer.js.map +1 -1
  206. package/dist/cards/impl/minion/spirited-whimsydrake.js.map +1 -1
  207. package/dist/cards/impl/minion/springy-spriggan.js.map +1 -1
  208. package/dist/cards/impl/minion/stitched-salvager.js.map +1 -1
  209. package/dist/cards/impl/minion/stomping-stegodon-enchantment.js.map +1 -1
  210. package/dist/cards/impl/minion/stray-satyr.js.map +1 -1
  211. package/dist/cards/impl/minion/sun-screener.js.map +1 -1
  212. package/dist/cards/impl/minion/surfing-slyvar.js.map +1 -1
  213. package/dist/cards/impl/minion/swampstriker.js.map +1 -1
  214. package/dist/cards/impl/minion/thorncaller.js.map +1 -1
  215. package/dist/cards/impl/minion/thousandth-paper-drake.js.map +1 -1
  216. package/dist/cards/impl/minion/three-lil-quilboar.js.map +1 -1
  217. package/dist/cards/impl/minion/thundering-abomination.js.map +1 -1
  218. package/dist/cards/impl/minion/tichondrius.js.map +1 -1
  219. package/dist/cards/impl/minion/tunnel-blaster.js.map +1 -1
  220. package/dist/cards/impl/minion/turquoise-skitterer.js.map +1 -1
  221. package/dist/cards/impl/minion/twilight-primordium.js.map +1 -1
  222. package/dist/cards/impl/minion/ultralisk.js.map +1 -1
  223. package/dist/cards/impl/minion/ultraviolet-ascendant.js.map +1 -1
  224. package/dist/cards/impl/minion/valiant-tiger.js.map +1 -1
  225. package/dist/cards/impl/minion/void-earl.js.map +1 -1
  226. package/dist/cards/impl/minion/vorkai-guardian.js.map +1 -1
  227. package/dist/cards/impl/minion/wandering-wight.js.map +1 -1
  228. package/dist/cards/impl/minion/whelp-smuggler.js.map +1 -1
  229. package/dist/cards/impl/minion/whirring-protector-enchantment.js.map +1 -1
  230. package/dist/cards/impl/minion/wildfire-elemental.js.map +1 -1
  231. package/dist/cards/impl/minion/wisp-in-the-shell.js.map +1 -1
  232. package/dist/cards/impl/minion/yorik-smite.js.map +1 -1
  233. package/dist/cards/impl/minion/young-murk-eye.js.map +1 -1
  234. package/dist/cards/impl/minion/yrel.js.map +1 -1
  235. package/dist/cards/impl/minion/yulon-fortune-granter.js.map +1 -1
  236. package/dist/cards/impl/minion/zergling.js.map +1 -1
  237. package/dist/cards/impl/quest-reward/righteous-charge.js.map +1 -1
  238. package/dist/cards/impl/trinket/all-purpose-kibble.js.map +1 -1
  239. package/dist/cards/impl/trinket/arm-of-the-empire.js.map +1 -1
  240. package/dist/cards/impl/trinket/artisanal-urn.js.map +1 -1
  241. package/dist/cards/impl/trinket/automaton-portrait.js.map +1 -1
  242. package/dist/cards/impl/trinket/baleful-incense.js.map +1 -1
  243. package/dist/cards/impl/trinket/bassgill-portrait.js.map +1 -1
  244. package/dist/cards/impl/trinket/battle-horn.js.map +1 -1
  245. package/dist/cards/impl/trinket/beetle-band.js.map +1 -1
  246. package/dist/cards/impl/trinket/bird-feeder.js.map +1 -1
  247. package/dist/cards/impl/trinket/crocheted-sungill.js.map +1 -1
  248. package/dist/cards/impl/trinket/divine-signet.js.map +1 -1
  249. package/dist/cards/impl/trinket/eclectic-shrine.js.map +1 -1
  250. package/dist/cards/impl/trinket/eternal-portrait.js.map +1 -1
  251. package/dist/cards/impl/trinket/faerie-dragon-scale.js.map +1 -1
  252. package/dist/cards/impl/trinket/fishy-sticker.js.map +1 -1
  253. package/dist/cards/impl/trinket/herald-sticker.js.map +1 -1
  254. package/dist/cards/impl/trinket/hogwash-basin.js.map +1 -1
  255. package/dist/cards/impl/trinket/karazhan-chess-set.js.map +1 -1
  256. package/dist/cards/impl/trinket/rivendare-portrait.js.map +1 -1
  257. package/dist/cards/impl/trinket/sthara-sticker.js.map +1 -1
  258. package/dist/cards/impl/trinket/unholy-sanctum.js.map +1 -1
  259. package/dist/cards/impl/trinket/valorous-medaillion.js.map +1 -1
  260. package/dist/cards/impl/trinket/vashjir-anemone.js.map +1 -1
  261. package/dist/cards/impl/trinket/yulon-sticker.js.map +1 -1
  262. package/dist/debug-state.js.map +1 -1
  263. package/dist/keywords/venomous.js.map +1 -1
  264. package/dist/simulation/after-attack.js.map +1 -1
  265. package/dist/simulation/cards-in-hand.js.map +1 -1
  266. package/dist/simulation/damage-effects.js.map +1 -1
  267. package/dist/simulation/deathrattle-on-trigger.js.map +1 -1
  268. package/dist/simulation/deathrattle-orchestration.js +3 -35
  269. package/dist/simulation/deathrattle-orchestration.js.map +1 -1
  270. package/dist/simulation/deathrattle-spawns.d.ts +0 -1
  271. package/dist/simulation/deathrattle-spawns.js +606 -611
  272. package/dist/simulation/deathrattle-spawns.js.map +1 -1
  273. package/dist/simulation/deathrattle-utils.js.map +1 -1
  274. package/dist/simulation/discover.js.map +1 -1
  275. package/dist/simulation/frenzy.js.map +1 -1
  276. package/dist/simulation/magnetize.js.map +1 -1
  277. package/dist/simulation/minion-kill.js.map +1 -1
  278. package/dist/simulation/quest.js.map +1 -1
  279. package/dist/simulation/reborn.js.map +1 -1
  280. package/dist/simulation/remembered-deathrattle.js.map +1 -1
  281. package/dist/simulation/remove-minion-from-board.js.map +1 -1
  282. package/dist/simulation/spectator/game-action.js.map +1 -1
  283. package/dist/simulation/start-of-combat/soc-pre-combat-hero-power.js.map +1 -1
  284. package/dist/simulation/utils/golden.js +1 -0
  285. package/dist/simulation/utils/golden.js.map +1 -1
  286. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.spawnEntitiesFromEnchantments = exports.spawnEntitiesFromDeathrattle = exports.spawnEntities = exports.simplifiedSpawnEntitiesWithAddToBoard = exports.simplifiedSpawnEntities = void 0;
3
+ exports.spawnEntitiesFromDeathrattle = exports.spawnEntities = exports.simplifiedSpawnEntitiesWithAddToBoard = exports.simplifiedSpawnEntities = void 0;
4
4
  const reference_data_1 = require("@firestone-hs/reference-data");
5
5
  const card_interface_1 = require("../cards/card.interface");
6
6
  const _card_mappings_1 = require("../cards/impl/_card-mappings");
@@ -57,7 +57,7 @@ const spawnEntities = (cardId, quantity, boardToSpawnInto, boardToSpawnIntoHero,
57
57
  };
58
58
  exports.spawnEntities = spawnEntities;
59
59
  const spawnEntitiesFromDeathrattle = (deadEntity, deadEntityIndexFromRight, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, entitiesDeadThisAttack, gameState) => {
60
- var _a, _b, _c, _d, _e, _f;
60
+ var _a, _b, _c, _d, _e, _f, _g;
61
61
  const finalSpawns = [];
62
62
  const multiplier = (0, deathrattle_effects_1.computeDeathrattleMultiplier)([...boardWithDeadEntity], boardWithDeadEntityHero, deadEntity, gameState.sharedState);
63
63
  const deathrattleTriggeredInput = {
@@ -72,629 +72,624 @@ const spawnEntitiesFromDeathrattle = (deadEntity, deadEntityIndexFromRight, boar
72
72
  const enchantments = [
73
73
  ...deadEntity.enchantments,
74
74
  ].sort((a, b) => a.timing - b.timing);
75
- const cardIds = [deadEntity.cardId, ...((_a = deadEntity.additionalCards) !== null && _a !== void 0 ? _a : []), ...enchantments.map((e) => e.cardId)];
76
- for (const deadEntityCardId of cardIds) {
77
- for (let i = 0; i < multiplier; i++) {
75
+ const cards = [deadEntity, ...enchantments]
76
+ .sort((a, b) => {
77
+ var _a, _b, _c, _d;
78
+ return ((_b = (_a = a.entityId) !== null && _a !== void 0 ? _a : a.timing) !== null && _b !== void 0 ? _b : 0) -
79
+ ((_d = (_c = b.entityId) !== null && _c !== void 0 ? _c : b.timing) !== null && _d !== void 0 ? _d : 0);
80
+ });
81
+ for (let i = 0; i < multiplier; i++) {
82
+ let hasTriggered = false;
83
+ for (const card of cards) {
78
84
  const spawnedEntities = [];
79
- let hasTriggered = true;
80
- const spawnEntityImpl = _card_mappings_1.cardMappings[deadEntityCardId];
81
- if ((0, card_interface_1.hasDeathrattleSpawn)(spawnEntityImpl)) {
82
- const spawned = spawnEntityImpl.deathrattleSpawn(deadEntity, deathrattleTriggeredInput);
83
- if (spawned === null || spawned === void 0 ? void 0 : spawned.length) {
84
- spawnedEntities.push(...spawned);
85
- }
86
- }
87
- else {
88
- switch (deadEntityCardId) {
89
- case "BOT_445":
90
- spawnedEntities.push(...(0, exports.spawnEntities)("BOT_445t", 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
91
- break;
92
- case "TB_BaconUps_002":
93
- spawnedEntities.push(...(0, exports.spawnEntities)("TB_BaconUps_002t", 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
94
- break;
95
- case "BG29_611":
96
- case "BG29_611_G":
97
- spawnedEntities.push(...(0, exports.spawnEntities)(deadEntity.cardId === "BG29_611"
98
- ? "BG_BOT_312t"
99
- : "TB_BaconUps_032t", 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
100
- break;
101
- case "BG_AV_309":
102
- case "BG_AV_309_G":
103
- spawnedEntities.push(...(0, exports.spawnEntities)("AV_309t", deadEntityCardId === "BG_AV_309_G" ? 2 : 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
104
- break;
105
- case "BG25_009":
106
- case "BG25_009_G":
107
- spawnedEntities.push(...(0, exports.spawnEntities)(deadEntityCardId === "BG25_009_G"
108
- ? "BG25_008_G"
109
- : "BG25_008", 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
110
- break;
111
- case "BG21_029":
112
- spawnedEntities.push(...(0, exports.spawnEntities)("BRM_006t", 2, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
113
- break;
114
- case "BG21_029_G":
115
- spawnedEntities.push(...(0, exports.spawnEntities)("BRM_006t", 4, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
116
- break;
117
- case "BG_EX1_556":
118
- spawnedEntities.push(...(0, exports.spawnEntities)("skele21", 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
119
- break;
120
- case "TB_BaconUps_006":
121
- spawnedEntities.push(...(0, exports.spawnEntities)("TB_BaconUps_006t", 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
122
- break;
123
- case "BG19_010":
124
- spawnedEntities.push(...(0, exports.spawnEntities)("BG19_010t", 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
125
- break;
126
- case "BG19_010_G":
127
- spawnedEntities.push(...(0, exports.spawnEntities)("BG19_010_Gt", 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
128
- break;
129
- case "TB_BaconShop_HERO_702_Buddy":
130
- case "TB_BaconShop_HERO_702_Buddy_G":
131
- const minionsToSpawnMawsworn = deadEntityCardId === "TB_BaconShop_HERO_702_Buddy_G" ? 4 : 2;
132
- for (let i = 0; i < minionsToSpawnMawsworn; i++) {
133
- const minionCardId = gameState.cardsData.getRandomMinionForTribe(reference_data_1.Race.UNDEAD, boardWithDeadEntityHero.tavernTier);
134
- spawnedEntities.push(...(0, exports.spawnEntities)(minionCardId, 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
135
- }
136
- break;
137
- case "BG25_HERO_100_Buddy":
138
- case "BG25_HERO_100_Buddy_G":
139
- const minionsToSpawnFestergut = deadEntityCardId === "BG25_HERO_100_Buddy_G" ? 2 : 1;
140
- for (let i = 0; i < minionsToSpawnFestergut; i++) {
141
- const randomUndeadCreation = (0, utils_2.buildRandomUndeadCreation)(boardWithDeadEntityHero, boardWithDeadEntity, gameState.allCards, deadEntity.friendly, gameState.cardsData, gameState.sharedState);
142
- spawnedEntities.push(...(0, exports.spawnEntities)(randomUndeadCreation.cardId, 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false, false, true, randomUndeadCreation));
143
- (0, cards_in_hand_1.addCardsInHand)(boardWithDeadEntityHero, boardWithDeadEntity, [randomUndeadCreation], gameState);
144
- }
145
- break;
146
- case "BG_KAR_005":
147
- spawnedEntities.push(...(0, exports.spawnEntities)("BG_KAR_005a", 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
148
- break;
149
- case "TB_BaconUps_004":
150
- spawnedEntities.push(...(0, exports.spawnEntities)("TB_BaconUps_004t", 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
151
- break;
152
- case "BG_CFM_316":
153
- spawnedEntities.push(...(0, exports.spawnEntities)("BG_CFM_316t", Math.min(7, deadEntity.attack), boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
154
- break;
155
- case "TB_BaconUps_027":
156
- spawnedEntities.push(...(0, exports.spawnEntities)("TB_BaconUps_027t", Math.min(7, deadEntity.attack), boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
157
- break;
158
- case "BGS_014":
159
- spawnedEntities.push(...(0, exports.spawnEntities)("BRM_006t", 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
160
- break;
161
- case "TB_BaconUps_113":
162
- spawnedEntities.push(...(0, exports.spawnEntities)("TB_BaconUps_030t", 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
163
- break;
164
- case "OG_216":
165
- spawnedEntities.push(...(0, exports.spawnEntities)("OG_216a", 2, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
166
- break;
167
- case "BG_BOT_312":
168
- spawnedEntities.push(...(0, exports.spawnEntities)("BG_BOT_312t", 3, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
169
- break;
170
- case "TB_BaconUps_032":
171
- spawnedEntities.push(...(0, exports.spawnEntities)("TB_BaconUps_032t", 3, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
172
- break;
173
- case "BOT_537":
174
- spawnedEntities.push(...(0, exports.spawnEntities)("BOT_537t", 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
175
- break;
176
- case "TB_BaconUps_039":
177
- spawnedEntities.push(...(0, exports.spawnEntities)("TB_BaconUps_039t", 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
178
- break;
179
- case "BG_EX1_534":
180
- spawnedEntities.push(...(0, exports.spawnEntities)("BG_EX1_534t", 2, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
181
- break;
182
- case "TB_BaconUps_049":
183
- spawnedEntities.push(...(0, exports.spawnEntities)("TB_BaconUps_049t", 2, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
184
- break;
185
- case "BG_DMF_533":
186
- spawnedEntities.push(...(0, exports.spawnEntities)("BG_DMF_533t", 2, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
187
- break;
188
- case "TB_BaconUps_309":
189
- spawnedEntities.push(...(0, exports.spawnEntities)("TB_BaconUps_309t", 2, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
190
- break;
191
- case "UNG_010":
192
- spawnedEntities.push(...(0, exports.spawnEntities)("UNG_201t", 3, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
193
- break;
194
- case "BGS_008":
195
- spawnedEntities.push(...[
196
- ...(0, exports.spawnEntities)(gameState.cardsData.ghastcoilerSpawns[Math.floor(Math.random() * gameState.cardsData.ghastcoilerSpawns.length)], 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false),
197
- ...(0, exports.spawnEntities)(gameState.cardsData.ghastcoilerSpawns[Math.floor(Math.random() * gameState.cardsData.ghastcoilerSpawns.length)], 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false),
198
- ]);
199
- break;
200
- case "TB_BaconShop_HERO_37_Buddy":
201
- case "TB_BaconShop_HERO_37_Buddy_G":
202
- const kilrekCardsToAddQuantity = deadEntity.cardId === "TB_BaconShop_HERO_37_Buddy_G" ? 2 : 1;
203
- const kilrekCardsToAdd = [];
204
- for (let i = 0; i < kilrekCardsToAddQuantity; i++) {
205
- kilrekCardsToAdd.push((0, utils_1.pickRandom)(gameState.cardsData.demonSpawns));
85
+ if (card.health !== undefined) {
86
+ const cardIds = [card.cardId, ...((_a = card.additionalCards) !== null && _a !== void 0 ? _a : [])];
87
+ for (const deadEntityCardId of cardIds) {
88
+ let hasTriggeredThisLoop = true;
89
+ const spawnEntityImpl = _card_mappings_1.cardMappings[deadEntityCardId];
90
+ if ((0, card_interface_1.hasDeathrattleSpawn)(spawnEntityImpl)) {
91
+ const spawned = spawnEntityImpl.deathrattleSpawn(deadEntity, deathrattleTriggeredInput);
92
+ if (spawned === null || spawned === void 0 ? void 0 : spawned.length) {
93
+ spawnedEntities.push(...spawned);
206
94
  }
207
- (0, cards_in_hand_1.addCardsInHand)(boardWithDeadEntityHero, boardWithDeadEntity, kilrekCardsToAdd, gameState);
208
- break;
209
- case "TB_BaconShop_HERO_43_Buddy":
210
- case "TB_BaconShop_HERO_43_Buddy_G":
211
- const brannSpawns = [];
212
- const brannToSpawnQuandtity = deadEntity.cardId === "TB_BaconShop_HERO_43_Buddy_G" ? 2 : 1;
213
- for (let i = 0; i < brannToSpawnQuandtity; i++) {
214
- brannSpawns.push((0, utils_1.pickRandom)(gameState.cardsData.battlecryMinions));
215
- }
216
- for (const brannSpawn of brannSpawns) {
217
- spawnedEntities.push(...(0, exports.spawnEntities)(brannSpawn, 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
218
- }
219
- (0, cards_in_hand_1.addCardsInHand)(boardWithDeadEntityHero, boardWithDeadEntity, brannSpawns, gameState);
220
- break;
221
- case "TRLA_149":
222
- case "TB_BaconUps_057":
223
- const ghastcoilerLoop = deadEntity.cardId === "TB_BaconUps_057" ? 4 : 2;
224
- for (let i = 0; i < ghastcoilerLoop; i++) {
225
- spawnedEntities.push(...[
226
- ...(0, exports.spawnEntities)(gameState.cardsData.ghastcoilerSpawns[Math.floor(Math.random() * gameState.cardsData.ghastcoilerSpawns.length)], 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false),
227
- ]);
228
- }
229
- break;
230
- case "BG_LOOT_368":
231
- spawnedEntities.push(...(0, exports.spawnEntities)("BG_CS2_065", 3, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
232
- break;
233
- case "TB_BaconUps_059":
234
- spawnedEntities.push(...(0, exports.spawnEntities)("TB_BaconUps_059t", 3, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
235
- break;
236
- case "BG26_ETC_321":
237
- case "BG26_ETC_321_G":
238
- const annoyOTroupeSpawns = deadEntity.cardId === "BG26_ETC_321_G"
239
- ? "BG_GVG_085_G"
240
- : "BG_GVG_085";
241
- spawnedEntities.push(...(0, exports.spawnEntities)(annoyOTroupeSpawns, 3, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
242
- break;
243
- case "BG21_025":
244
- case "BG21_025_G":
245
- const cardParam = 6;
246
- const entitiesToSpawn = Math.max(0, Math.min(cardParam, 7 - boardWithDeadEntity.length - spawnedEntities.length));
247
- const buffAmount = (deadEntityCardId === "BG21_025_G" ? 2 : 1) *
248
- (cardParam - entitiesToSpawn);
249
- spawnedEntities.push(...(0, exports.spawnEntities)(deadEntityCardId === "BG21_025_G"
250
- ? "TB_BaconUps_032t"
251
- : "BG_BOT_312t", entitiesToSpawn, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, true));
252
- (0, utils_2.addStatsToBoard)(deadEntity, boardWithDeadEntity, boardWithDeadEntityHero, buffAmount, buffAmount, gameState, reference_data_1.Race[reference_data_1.Race.MECH]);
253
- (0, utils_2.addStatsToBoard)(deadEntity, spawnedEntities, boardWithDeadEntityHero, buffAmount, buffAmount, gameState, reference_data_1.Race[reference_data_1.Race.MECH]);
254
- break;
255
- case "BG26_804":
256
- case "BG26_804_G":
257
- const stats = deadEntity.scriptDataNum1 ||
258
- ((_b = gameState.sharedState.deaths.find((e) => e.friendly === deadEntity.friendly && e.cardId === deadEntity.cardId)) === null || _b === void 0 ? void 0 : _b.scriptDataNum1) ||
259
- 0;
260
- const octosariSpawn = deadEntity.cardId === "BG26_804_G"
261
- ? "BG26_803_Gt"
262
- : "BG26_803t";
263
- const octoSpawns = (0, exports.spawnEntities)(octosariSpawn, 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false);
264
- octoSpawns.forEach((b) => {
265
- b.attack = stats;
266
- b.health = stats;
267
- });
268
- spawnedEntities.push(...octoSpawns);
269
- break;
270
- case "BG26_350":
271
- case "BG26_350_G":
272
- const bassgillIterations = deadEntity.cardId === "BG26_350_G" ? 2 : 1;
273
- for (let i = 0; i < bassgillIterations; i++) {
274
- const hand = (_d = (_c = boardWithDeadEntityHero.hand) === null || _c === void 0 ? void 0 : _c.filter((e) => (0, utils_2.hasCorrectTribe)(e, boardWithDeadEntityHero, reference_data_1.Race.MURLOC, gameState.anomalies, gameState.allCards)).filter((e) => !!(e === null || e === void 0 ? void 0 : e.cardId)).filter((e) => !e.locked)) !== null && _d !== void 0 ? _d : [];
275
- const highestHealth = Math.max(...hand.filter((c) => c.health).map((c) => c.health));
276
- const highestHealthMinions = highestHealth
277
- ? hand.filter((c) => c.health === highestHealth)
278
- : null;
279
- const spawn = !!(highestHealthMinions === null || highestHealthMinions === void 0 ? void 0 : highestHealthMinions.length)
280
- ? (0, utils_1.pickRandom)(highestHealthMinions)
281
- : hand.filter((c) => c.cardId).length
282
- ? (0, utils_1.pickRandom)(hand.filter((c) => c.cardId))
283
- : null;
284
- if (spawn) {
285
- spawn.locked = true;
286
- const bassgillSpawns = (0, exports.spawnEntities)(spawn.cardId, 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false, false, true, { ...spawn });
287
- for (const s of bassgillSpawns) {
288
- s.onCanceledSummon = () => (spawn.locked = false);
95
+ }
96
+ else {
97
+ switch (deadEntityCardId) {
98
+ case "BOT_445":
99
+ spawnedEntities.push(...(0, exports.spawnEntities)("BOT_445t", 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
100
+ break;
101
+ case "TB_BaconUps_002":
102
+ spawnedEntities.push(...(0, exports.spawnEntities)("TB_BaconUps_002t", 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
103
+ break;
104
+ case "BG29_611":
105
+ case "BG29_611_G":
106
+ spawnedEntities.push(...(0, exports.spawnEntities)(deadEntity.cardId === "BG29_611"
107
+ ? "BG_BOT_312t"
108
+ : "TB_BaconUps_032t", 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
109
+ break;
110
+ case "BG_AV_309":
111
+ case "BG_AV_309_G":
112
+ spawnedEntities.push(...(0, exports.spawnEntities)("AV_309t", deadEntityCardId === "BG_AV_309_G" ? 2 : 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
113
+ break;
114
+ case "BG25_009":
115
+ case "BG25_009_G":
116
+ spawnedEntities.push(...(0, exports.spawnEntities)(deadEntityCardId === "BG25_009_G"
117
+ ? "BG25_008_G"
118
+ : "BG25_008", 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
119
+ break;
120
+ case "BG21_029":
121
+ spawnedEntities.push(...(0, exports.spawnEntities)("BRM_006t", 2, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
122
+ break;
123
+ case "BG21_029_G":
124
+ spawnedEntities.push(...(0, exports.spawnEntities)("BRM_006t", 4, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
125
+ break;
126
+ case "BG_EX1_556":
127
+ spawnedEntities.push(...(0, exports.spawnEntities)("skele21", 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
128
+ break;
129
+ case "TB_BaconUps_006":
130
+ spawnedEntities.push(...(0, exports.spawnEntities)("TB_BaconUps_006t", 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
131
+ break;
132
+ case "BG19_010":
133
+ spawnedEntities.push(...(0, exports.spawnEntities)("BG19_010t", 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
134
+ break;
135
+ case "BG19_010_G":
136
+ spawnedEntities.push(...(0, exports.spawnEntities)("BG19_010_Gt", 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
137
+ break;
138
+ case "TB_BaconShop_HERO_702_Buddy":
139
+ case "TB_BaconShop_HERO_702_Buddy_G":
140
+ const minionsToSpawnMawsworn = deadEntityCardId === "TB_BaconShop_HERO_702_Buddy_G"
141
+ ? 4
142
+ : 2;
143
+ for (let i = 0; i < minionsToSpawnMawsworn; i++) {
144
+ const minionCardId = gameState.cardsData.getRandomMinionForTribe(reference_data_1.Race.UNDEAD, boardWithDeadEntityHero.tavernTier);
145
+ spawnedEntities.push(...(0, exports.spawnEntities)(minionCardId, 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
289
146
  }
290
- spawnedEntities.push(...bassgillSpawns);
291
- }
292
- }
293
- break;
294
- case "BG27_081":
295
- case "BG27_081_G":
296
- const cultistStharaSpawnNumber = deadEntity.cardId === "BG27_081_G" ? 2 : 1;
297
- const cultistStharaSpawnCandidates = gameState.sharedState.deaths
298
- .filter((entity) => entity.friendly === deadEntity.friendly)
299
- .filter((entity) => (0, utils_2.hasCorrectTribe)(entity, boardWithDeadEntityHero, reference_data_1.Race.DEMON, gameState.anomalies, gameState.allCards))
300
- .slice(0, cultistStharaSpawnNumber);
301
- cultistStharaSpawnCandidates.forEach((candidate) => {
302
- const spawns = (0, exports.spawnEntities)(candidate.cardId, 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false, false, true);
303
- spawns.forEach((spawn) => {
304
- var _a, _b;
305
- spawn.attack = (_a = candidate.maxAttack) !== null && _a !== void 0 ? _a : candidate.attack;
306
- spawn.health = (_b = candidate.maxHealth) !== null && _b !== void 0 ? _b : candidate.health;
307
- spawn.maxHealth = spawn.health;
308
- });
309
- spawnedEntities.push(...spawns);
310
- });
311
- break;
312
- case "BGDUO_105":
313
- case "BGDUO_105_G":
314
- const magnanimooseCopies = deadEntity.cardId === "BGDUO_105_G" ? 2 : 1;
315
- for (let i = 0; i < magnanimooseCopies; i++) {
316
- const teammateState = (0, utils_2.getTeammateInitialState)(gameState.gameState, boardWithDeadEntityHero);
317
- const teammateBoard = (_e = teammateState === null || teammateState === void 0 ? void 0 : teammateState.board) !== null && _e !== void 0 ? _e : [];
318
- const copied = [];
319
- const minionToCopy = (0, utils_1.pickRandom)(teammateBoard.filter((e) => !copied.includes(e.entityId)));
320
- if (minionToCopy) {
321
- const copy = {
322
- ...minionToCopy,
323
- health: 1,
324
- maxHealth: 1,
325
- enchantments: [...minionToCopy.enchantments],
326
- pendingAttackBuffs: [],
327
- };
328
- spawnedEntities.push(...(0, exports.spawnEntities)(copy.cardId, 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false, false, true, copy));
329
- copied.push(copy.entityId);
330
- }
331
- }
332
- break;
333
- case "BG26_RLK_833":
334
- spawnedEntities.push(...(0, exports.spawnEntities)("RLK_833t", 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
335
- break;
336
- case "TB_BaconShop_HERO_76_Buddy":
337
- case "TB_BaconShop_HERO_76_Buddy_G":
338
- const iterations = deadEntityCardId === "TB_BaconShop_HERO_76_Buddy_G" ? 2 : 1;
339
- for (let j = 0; j < iterations; j++) {
340
- let validTargets = boardWithDeadEntity.filter((entity) => !entity.divineShield);
341
- if (!(validTargets === null || validTargets === void 0 ? void 0 : validTargets.length)) {
342
- validTargets = boardWithDeadEntity.filter((entity) => !entity.taunt);
343
- if (!(validTargets === null || validTargets === void 0 ? void 0 : validTargets.length)) {
344
- validTargets = boardWithDeadEntity.filter((entity) => !entity.windfury);
147
+ break;
148
+ case "BG25_HERO_100_Buddy":
149
+ case "BG25_HERO_100_Buddy_G":
150
+ const minionsToSpawnFestergut = deadEntityCardId === "BG25_HERO_100_Buddy_G" ? 2 : 1;
151
+ for (let i = 0; i < minionsToSpawnFestergut; i++) {
152
+ const randomUndeadCreation = (0, utils_2.buildRandomUndeadCreation)(boardWithDeadEntityHero, boardWithDeadEntity, gameState.allCards, deadEntity.friendly, gameState.cardsData, gameState.sharedState);
153
+ spawnedEntities.push(...(0, exports.spawnEntities)(randomUndeadCreation.cardId, 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false, false, true, randomUndeadCreation));
154
+ (0, cards_in_hand_1.addCardsInHand)(boardWithDeadEntityHero, boardWithDeadEntity, [randomUndeadCreation], gameState);
345
155
  }
346
- }
347
- const target = (0, utils_1.pickRandom)(validTargets);
348
- if (target) {
349
- if (!target.divineShield) {
350
- (0, divine_shield_1.updateDivineShield)(target, boardWithDeadEntity, boardWithDeadEntityHero, otherBoardHero, true, gameState);
156
+ break;
157
+ case "BG_KAR_005":
158
+ spawnedEntities.push(...(0, exports.spawnEntities)("BG_KAR_005a", 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
159
+ break;
160
+ case "TB_BaconUps_004":
161
+ spawnedEntities.push(...(0, exports.spawnEntities)("TB_BaconUps_004t", 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
162
+ break;
163
+ case "BG_CFM_316":
164
+ spawnedEntities.push(...(0, exports.spawnEntities)("BG_CFM_316t", Math.min(7, deadEntity.attack), boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
165
+ break;
166
+ case "TB_BaconUps_027":
167
+ spawnedEntities.push(...(0, exports.spawnEntities)("TB_BaconUps_027t", Math.min(7, deadEntity.attack), boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
168
+ break;
169
+ case "BGS_014":
170
+ spawnedEntities.push(...(0, exports.spawnEntities)("BRM_006t", 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
171
+ break;
172
+ case "TB_BaconUps_113":
173
+ spawnedEntities.push(...(0, exports.spawnEntities)("TB_BaconUps_030t", 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
174
+ break;
175
+ case "OG_216":
176
+ spawnedEntities.push(...(0, exports.spawnEntities)("OG_216a", 2, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
177
+ break;
178
+ case "BG_BOT_312":
179
+ spawnedEntities.push(...(0, exports.spawnEntities)("BG_BOT_312t", 3, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
180
+ break;
181
+ case "TB_BaconUps_032":
182
+ spawnedEntities.push(...(0, exports.spawnEntities)("TB_BaconUps_032t", 3, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
183
+ break;
184
+ case "BOT_537":
185
+ spawnedEntities.push(...(0, exports.spawnEntities)("BOT_537t", 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
186
+ break;
187
+ case "TB_BaconUps_039":
188
+ spawnedEntities.push(...(0, exports.spawnEntities)("TB_BaconUps_039t", 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
189
+ break;
190
+ case "BG_EX1_534":
191
+ spawnedEntities.push(...(0, exports.spawnEntities)("BG_EX1_534t", 2, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
192
+ break;
193
+ case "TB_BaconUps_049":
194
+ spawnedEntities.push(...(0, exports.spawnEntities)("TB_BaconUps_049t", 2, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
195
+ break;
196
+ case "BG_DMF_533":
197
+ spawnedEntities.push(...(0, exports.spawnEntities)("BG_DMF_533t", 2, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
198
+ break;
199
+ case "TB_BaconUps_309":
200
+ spawnedEntities.push(...(0, exports.spawnEntities)("TB_BaconUps_309t", 2, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
201
+ break;
202
+ case "UNG_010":
203
+ spawnedEntities.push(...(0, exports.spawnEntities)("UNG_201t", 3, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
204
+ break;
205
+ case "BGS_008":
206
+ spawnedEntities.push(...[
207
+ ...(0, exports.spawnEntities)(gameState.cardsData.ghastcoilerSpawns[Math.floor(Math.random() * gameState.cardsData.ghastcoilerSpawns.length)], 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false),
208
+ ...(0, exports.spawnEntities)(gameState.cardsData.ghastcoilerSpawns[Math.floor(Math.random() * gameState.cardsData.ghastcoilerSpawns.length)], 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false),
209
+ ]);
210
+ break;
211
+ case "TB_BaconShop_HERO_37_Buddy":
212
+ case "TB_BaconShop_HERO_37_Buddy_G":
213
+ const kilrekCardsToAddQuantity = deadEntity.cardId === "TB_BaconShop_HERO_37_Buddy_G" ? 2 : 1;
214
+ const kilrekCardsToAdd = [];
215
+ for (let i = 0; i < kilrekCardsToAddQuantity; i++) {
216
+ kilrekCardsToAdd.push((0, utils_1.pickRandom)(gameState.cardsData.demonSpawns));
351
217
  }
352
- (0, taunt_1.updateTaunt)(target, true, boardWithDeadEntity, boardWithDeadEntityHero, otherBoardHero, gameState);
353
- (0, windfury_1.updateWindfury)(target, true, boardWithDeadEntity, boardWithDeadEntityHero, otherBoardHero, gameState);
354
- gameState.spectator.registerPowerTarget(deadEntity, target, boardWithDeadEntity, boardWithDeadEntityHero, otherBoardHero);
355
- }
356
- }
357
- break;
358
- case "BGS_040":
359
- case "TB_BaconUps_154":
360
- const nadinaMultiplier = deadEntityCardId === "TB_BaconUps_154" ? 6 : 3;
361
- for (let j = 0; j < nadinaMultiplier; j++) {
362
- const validTargets = boardWithDeadEntity
363
- .filter((e) => (0, utils_2.hasCorrectTribe)(e, boardWithDeadEntityHero, reference_data_1.Race.DRAGON, gameState.anomalies, gameState.allCards))
364
- .filter((entity) => !entity.divineShield);
365
- const target = (0, utils_1.pickRandom)(validTargets);
366
- if (target) {
367
- (0, divine_shield_1.updateDivineShield)(target, boardWithDeadEntity, boardWithDeadEntityHero, otherBoardHero, true, gameState);
368
- gameState.spectator.registerPowerTarget(deadEntity, target, boardWithDeadEntity, boardWithDeadEntityHero, otherBoardHero);
369
- }
370
- }
371
- break;
372
- case "BG_OG_256":
373
- (0, utils_2.addStatsToBoard)(deadEntity, boardWithDeadEntity, boardWithDeadEntityHero, 1, 1, gameState);
374
- break;
375
- case "TB_BaconUps_025":
376
- (0, utils_2.addStatsToBoard)(deadEntity, boardWithDeadEntity, boardWithDeadEntityHero, 2, 2, gameState);
377
- break;
378
- case "YOD_026":
379
- (0, utils_2.grantRandomAttack)(deadEntity, boardWithDeadEntity, boardWithDeadEntityHero, deadEntity.attack, gameState);
380
- break;
381
- case "TB_BaconUps_112":
382
- (0, utils_2.grantRandomAttack)(deadEntity, boardWithDeadEntity, boardWithDeadEntityHero, deadEntity.attack, gameState);
383
- (0, utils_2.grantRandomAttack)(deadEntity, boardWithDeadEntity, boardWithDeadEntityHero, deadEntity.attack, gameState);
384
- break;
385
- case "BG29_815":
386
- case "BG29_815_G":
387
- const nightbaneLoops = deadEntityCardId === "BG29_815_G" ? 2 : 1;
388
- for (let j = 0; j < nightbaneLoops; j++) {
389
- const pickedTargetEntityIds = [];
390
- for (let k = 0; k < 2; k++) {
391
- const target = (0, utils_1.pickRandomAlive)(boardWithDeadEntity
392
- .filter((e) => ![
393
- "BG29_815",
394
- "BG29_815_G",
395
- ].includes(e.cardId))
396
- .filter((e) => !pickedTargetEntityIds.includes(e.entityId)));
218
+ (0, cards_in_hand_1.addCardsInHand)(boardWithDeadEntityHero, boardWithDeadEntity, kilrekCardsToAdd, gameState);
219
+ break;
220
+ case "TB_BaconShop_HERO_43_Buddy":
221
+ case "TB_BaconShop_HERO_43_Buddy_G":
222
+ const brannSpawns = [];
223
+ const brannToSpawnQuandtity = deadEntity.cardId === "TB_BaconShop_HERO_43_Buddy_G" ? 2 : 1;
224
+ for (let i = 0; i < brannToSpawnQuandtity; i++) {
225
+ brannSpawns.push((0, utils_1.pickRandom)(gameState.cardsData.battlecryMinions));
226
+ }
227
+ for (const brannSpawn of brannSpawns) {
228
+ spawnedEntities.push(...(0, exports.spawnEntities)(brannSpawn, 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
229
+ }
230
+ (0, cards_in_hand_1.addCardsInHand)(boardWithDeadEntityHero, boardWithDeadEntity, brannSpawns, gameState);
231
+ break;
232
+ case "TRLA_149":
233
+ case "TB_BaconUps_057":
234
+ const ghastcoilerLoop = deadEntity.cardId === "TB_BaconUps_057" ? 4 : 2;
235
+ for (let i = 0; i < ghastcoilerLoop; i++) {
236
+ spawnedEntities.push(...[
237
+ ...(0, exports.spawnEntities)(gameState.cardsData.ghastcoilerSpawns[Math.floor(Math.random() * gameState.cardsData.ghastcoilerSpawns.length)], 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false),
238
+ ]);
239
+ }
240
+ break;
241
+ case "BG_LOOT_368":
242
+ spawnedEntities.push(...(0, exports.spawnEntities)("BG_CS2_065", 3, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
243
+ break;
244
+ case "TB_BaconUps_059":
245
+ spawnedEntities.push(...(0, exports.spawnEntities)("TB_BaconUps_059t", 3, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
246
+ break;
247
+ case "BG26_ETC_321":
248
+ case "BG26_ETC_321_G":
249
+ const annoyOTroupeSpawns = deadEntity.cardId === "BG26_ETC_321_G"
250
+ ? "BG_GVG_085_G"
251
+ : "BG_GVG_085";
252
+ spawnedEntities.push(...(0, exports.spawnEntities)(annoyOTroupeSpawns, 3, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
253
+ break;
254
+ case "BG21_025":
255
+ case "BG21_025_G":
256
+ const cardParam = 6;
257
+ const entitiesToSpawn = Math.max(0, Math.min(cardParam, 7 - boardWithDeadEntity.length - spawnedEntities.length));
258
+ const buffAmount = (deadEntityCardId === "BG21_025_G" ? 2 : 1) *
259
+ (cardParam - entitiesToSpawn);
260
+ spawnedEntities.push(...(0, exports.spawnEntities)(deadEntityCardId === "BG21_025_G"
261
+ ? "TB_BaconUps_032t"
262
+ : "BG_BOT_312t", entitiesToSpawn, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, true));
263
+ (0, utils_2.addStatsToBoard)(deadEntity, boardWithDeadEntity, boardWithDeadEntityHero, buffAmount, buffAmount, gameState, reference_data_1.Race[reference_data_1.Race.MECH]);
264
+ (0, utils_2.addStatsToBoard)(deadEntity, spawnedEntities, boardWithDeadEntityHero, buffAmount, buffAmount, gameState, reference_data_1.Race[reference_data_1.Race.MECH]);
265
+ break;
266
+ case "BG26_804":
267
+ case "BG26_804_G":
268
+ const stats = deadEntity.scriptDataNum1 ||
269
+ ((_b = gameState.sharedState.deaths.find((e) => e.friendly === deadEntity.friendly && e.cardId === deadEntity.cardId)) === null || _b === void 0 ? void 0 : _b.scriptDataNum1) ||
270
+ 0;
271
+ const octosariSpawn = deadEntity.cardId === "BG26_804_G"
272
+ ? "BG26_803_Gt"
273
+ : "BG26_803t";
274
+ const octoSpawns = (0, exports.spawnEntities)(octosariSpawn, 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false);
275
+ octoSpawns.forEach((b) => {
276
+ b.attack = stats;
277
+ b.health = stats;
278
+ });
279
+ spawnedEntities.push(...octoSpawns);
280
+ break;
281
+ case "BG26_350":
282
+ case "BG26_350_G":
283
+ const bassgillIterations = deadEntity.cardId === "BG26_350_G" ? 2 : 1;
284
+ for (let i = 0; i < bassgillIterations; i++) {
285
+ const hand = (_d = (_c = boardWithDeadEntityHero.hand) === null || _c === void 0 ? void 0 : _c.filter((e) => (0, utils_2.hasCorrectTribe)(e, boardWithDeadEntityHero, reference_data_1.Race.MURLOC, gameState.anomalies, gameState.allCards)).filter((e) => !!(e === null || e === void 0 ? void 0 : e.cardId)).filter((e) => !e.locked)) !== null && _d !== void 0 ? _d : [];
286
+ const highestHealth = Math.max(...hand.filter((c) => c.health).map((c) => c.health));
287
+ const highestHealthMinions = highestHealth
288
+ ? hand.filter((c) => c.health === highestHealth)
289
+ : null;
290
+ const spawn = !!(highestHealthMinions === null || highestHealthMinions === void 0 ? void 0 : highestHealthMinions.length)
291
+ ? (0, utils_1.pickRandom)(highestHealthMinions)
292
+ : hand.filter((c) => c.cardId).length
293
+ ? (0, utils_1.pickRandom)(hand.filter((c) => c.cardId))
294
+ : null;
295
+ if (spawn) {
296
+ spawn.locked = true;
297
+ const bassgillSpawns = (0, exports.spawnEntities)(spawn.cardId, 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false, false, true, { ...spawn });
298
+ for (const s of bassgillSpawns) {
299
+ s.onCanceledSummon = () => (spawn.locked = false);
300
+ }
301
+ spawnedEntities.push(...bassgillSpawns);
302
+ }
303
+ }
304
+ break;
305
+ case "BG27_081":
306
+ case "BG27_081_G":
307
+ const cultistStharaSpawnNumber = deadEntity.cardId === "BG27_081_G" ? 2 : 1;
308
+ const cultistStharaSpawnCandidates = gameState.sharedState.deaths
309
+ .filter((entity) => entity.friendly === deadEntity.friendly)
310
+ .filter((entity) => (0, utils_2.hasCorrectTribe)(entity, boardWithDeadEntityHero, reference_data_1.Race.DEMON, gameState.anomalies, gameState.allCards))
311
+ .slice(0, cultistStharaSpawnNumber);
312
+ cultistStharaSpawnCandidates.forEach((candidate) => {
313
+ const spawns = (0, exports.spawnEntities)(candidate.cardId, 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false, false, true);
314
+ spawns.forEach((spawn) => {
315
+ var _a, _b;
316
+ spawn.attack = (_a = candidate.maxAttack) !== null && _a !== void 0 ? _a : candidate.attack;
317
+ spawn.health = (_b = candidate.maxHealth) !== null && _b !== void 0 ? _b : candidate.health;
318
+ spawn.maxHealth = spawn.health;
319
+ });
320
+ spawnedEntities.push(...spawns);
321
+ });
322
+ break;
323
+ case "BGDUO_105":
324
+ case "BGDUO_105_G":
325
+ const magnanimooseCopies = deadEntity.cardId === "BGDUO_105_G" ? 2 : 1;
326
+ for (let i = 0; i < magnanimooseCopies; i++) {
327
+ const teammateState = (0, utils_2.getTeammateInitialState)(gameState.gameState, boardWithDeadEntityHero);
328
+ const teammateBoard = (_e = teammateState === null || teammateState === void 0 ? void 0 : teammateState.board) !== null && _e !== void 0 ? _e : [];
329
+ const copied = [];
330
+ const minionToCopy = (0, utils_1.pickRandom)(teammateBoard.filter((e) => !copied.includes(e.entityId)));
331
+ if (minionToCopy) {
332
+ const copy = {
333
+ ...minionToCopy,
334
+ health: 1,
335
+ maxHealth: 1,
336
+ enchantments: [...minionToCopy.enchantments],
337
+ pendingAttackBuffs: [],
338
+ };
339
+ spawnedEntities.push(...(0, exports.spawnEntities)(copy.cardId, 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false, false, true, copy));
340
+ copied.push(copy.entityId);
341
+ }
342
+ }
343
+ break;
344
+ case "BG26_RLK_833":
345
+ spawnedEntities.push(...(0, exports.spawnEntities)("RLK_833t", 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
346
+ break;
347
+ case "TB_BaconShop_HERO_76_Buddy":
348
+ case "TB_BaconShop_HERO_76_Buddy_G":
349
+ const iterations = deadEntityCardId === "TB_BaconShop_HERO_76_Buddy_G" ? 2 : 1;
350
+ for (let j = 0; j < iterations; j++) {
351
+ let validTargets = boardWithDeadEntity.filter((entity) => !entity.divineShield);
352
+ if (!(validTargets === null || validTargets === void 0 ? void 0 : validTargets.length)) {
353
+ validTargets = boardWithDeadEntity.filter((entity) => !entity.taunt);
354
+ if (!(validTargets === null || validTargets === void 0 ? void 0 : validTargets.length)) {
355
+ validTargets = boardWithDeadEntity.filter((entity) => !entity.windfury);
356
+ }
357
+ }
358
+ const target = (0, utils_1.pickRandom)(validTargets);
359
+ if (target) {
360
+ if (!target.divineShield) {
361
+ (0, divine_shield_1.updateDivineShield)(target, boardWithDeadEntity, boardWithDeadEntityHero, otherBoardHero, true, gameState);
362
+ }
363
+ (0, taunt_1.updateTaunt)(target, true, boardWithDeadEntity, boardWithDeadEntityHero, otherBoardHero, gameState);
364
+ (0, windfury_1.updateWindfury)(target, true, boardWithDeadEntity, boardWithDeadEntityHero, otherBoardHero, gameState);
365
+ gameState.spectator.registerPowerTarget(deadEntity, target, boardWithDeadEntity, boardWithDeadEntityHero, otherBoardHero);
366
+ }
367
+ }
368
+ break;
369
+ case "BGS_040":
370
+ case "TB_BaconUps_154":
371
+ const nadinaMultiplier = deadEntityCardId === "TB_BaconUps_154" ? 6 : 3;
372
+ for (let j = 0; j < nadinaMultiplier; j++) {
373
+ const validTargets = boardWithDeadEntity
374
+ .filter((e) => (0, utils_2.hasCorrectTribe)(e, boardWithDeadEntityHero, reference_data_1.Race.DRAGON, gameState.anomalies, gameState.allCards))
375
+ .filter((entity) => !entity.divineShield);
376
+ const target = (0, utils_1.pickRandom)(validTargets);
377
+ if (target) {
378
+ (0, divine_shield_1.updateDivineShield)(target, boardWithDeadEntity, boardWithDeadEntityHero, otherBoardHero, true, gameState);
379
+ gameState.spectator.registerPowerTarget(deadEntity, target, boardWithDeadEntity, boardWithDeadEntityHero, otherBoardHero);
380
+ }
381
+ }
382
+ break;
383
+ case "BG_OG_256":
384
+ (0, utils_2.addStatsToBoard)(deadEntity, boardWithDeadEntity, boardWithDeadEntityHero, 1, 1, gameState);
385
+ break;
386
+ case "TB_BaconUps_025":
387
+ (0, utils_2.addStatsToBoard)(deadEntity, boardWithDeadEntity, boardWithDeadEntityHero, 2, 2, gameState);
388
+ break;
389
+ case "YOD_026":
390
+ (0, utils_2.grantRandomAttack)(deadEntity, boardWithDeadEntity, boardWithDeadEntityHero, deadEntity.attack, gameState);
391
+ break;
392
+ case "TB_BaconUps_112":
393
+ (0, utils_2.grantRandomAttack)(deadEntity, boardWithDeadEntity, boardWithDeadEntityHero, deadEntity.attack, gameState);
394
+ (0, utils_2.grantRandomAttack)(deadEntity, boardWithDeadEntity, boardWithDeadEntityHero, deadEntity.attack, gameState);
395
+ break;
396
+ case "BG29_815":
397
+ case "BG29_815_G":
398
+ const nightbaneLoops = deadEntityCardId === "BG29_815_G" ? 2 : 1;
399
+ for (let j = 0; j < nightbaneLoops; j++) {
400
+ const pickedTargetEntityIds = [];
401
+ for (let k = 0; k < 2; k++) {
402
+ const target = (0, utils_1.pickRandomAlive)(boardWithDeadEntity
403
+ .filter((e) => ![
404
+ "BG29_815",
405
+ "BG29_815_G",
406
+ ].includes(e.cardId))
407
+ .filter((e) => !pickedTargetEntityIds.includes(e.entityId)));
408
+ if (!!target) {
409
+ pickedTargetEntityIds.push(target.entityId);
410
+ (0, stats_1.modifyStats)(target, deadEntity, deadEntity.attack, 0, boardWithDeadEntity, boardWithDeadEntityHero, gameState);
411
+ }
412
+ }
413
+ }
414
+ break;
415
+ case "BG21_000":
416
+ (0, deathrattle_effects_1.applyLeapFroggerEffect)(boardWithDeadEntity, boardWithDeadEntityHero, deadEntity, false, gameState, deadEntity.deathrattleRepeats);
417
+ break;
418
+ case "BG21_000_G":
419
+ (0, deathrattle_effects_1.applyLeapFroggerEffect)(boardWithDeadEntity, boardWithDeadEntityHero, deadEntity, true, gameState, deadEntity.deathrattleRepeats);
420
+ break;
421
+ case "BG21_001":
422
+ const target = (0, utils_2.grantRandomStats)(deadEntity, boardWithDeadEntity, boardWithDeadEntityHero, 6, 6, reference_data_1.Race.BEAST, true, gameState);
397
423
  if (!!target) {
398
- pickedTargetEntityIds.push(target.entityId);
399
- (0, stats_1.modifyStats)(target, deadEntity, deadEntity.attack, 0, boardWithDeadEntity, boardWithDeadEntityHero, gameState);
424
+ gameState.spectator.registerPowerTarget(deadEntity, target, boardWithDeadEntity, boardWithDeadEntityHero, otherBoardHero);
400
425
  }
401
- }
402
- }
403
- break;
404
- case "BG21_000":
405
- (0, deathrattle_effects_1.applyLeapFroggerEffect)(boardWithDeadEntity, boardWithDeadEntityHero, deadEntity, false, gameState, deadEntity.deathrattleRepeats);
406
- break;
407
- case "BG21_000_G":
408
- (0, deathrattle_effects_1.applyLeapFroggerEffect)(boardWithDeadEntity, boardWithDeadEntityHero, deadEntity, true, gameState, deadEntity.deathrattleRepeats);
409
- break;
410
- case "BG21_001":
411
- const target = (0, utils_2.grantRandomStats)(deadEntity, boardWithDeadEntity, boardWithDeadEntityHero, 6, 6, reference_data_1.Race.BEAST, true, gameState);
412
- if (!!target) {
413
- gameState.spectator.registerPowerTarget(deadEntity, target, boardWithDeadEntity, boardWithDeadEntityHero, otherBoardHero);
414
- }
415
- break;
416
- case "BG21_001_G":
417
- const crocTarget = (0, utils_2.grantRandomStats)(deadEntity, boardWithDeadEntity, boardWithDeadEntityHero, 12, 12, reference_data_1.Race.BEAST, true, gameState);
418
- if (!!crocTarget) {
419
- gameState.spectator.registerPowerTarget(deadEntity, crocTarget, boardWithDeadEntity, boardWithDeadEntityHero, otherBoardHero);
420
- }
421
- break;
422
- case "BG25_022":
423
- case "BG25_022_G":
424
- const scarletMultiplier = deadEntityCardId === "BG25_022_G" ? 2 : 1;
425
- const scarletTarget = (0, utils_2.grantRandomStats)(deadEntity, boardWithDeadEntity, boardWithDeadEntityHero, scarletMultiplier * 1, scarletMultiplier * 2, reference_data_1.Race.UNDEAD, false, gameState);
426
- if (!!scarletTarget) {
427
- gameState.spectator.registerPowerTarget(deadEntity, scarletTarget, boardWithDeadEntity, boardWithDeadEntityHero, otherBoardHero);
428
- }
429
- break;
430
- case "TB_BaconShop_HERO_17_Buddy":
431
- case "TB_BaconShop_HERO_17_Buddy_G":
432
- const squirrelDamage = deadEntity.cardId === "TB_BaconShop_HERO_17_Buddy_G" ? 4 : 2;
433
- const numberOfDeadMechsThisCombat = gameState.sharedState.deaths
434
- .filter((entity) => entity.friendly === deadEntity.friendly)
435
- .filter((entity) => (0, utils_2.hasCorrectTribe)(entity, boardWithDeadEntityHero, reference_data_1.Race.MECH, gameState.anomalies, gameState.allCards)).length;
436
- for (let j = 0; j < numberOfDeadMechsThisCombat; j++) {
437
- (0, attack_1.dealDamageToRandomEnemy)(otherBoard, otherBoardHero, deadEntity, squirrelDamage, boardWithDeadEntity, boardWithDeadEntityHero, gameState);
438
- }
439
- break;
440
- case "BG_BOT_606":
441
- case "TB_BaconUps_028":
442
- const kaboomLoops = deadEntity.cardId === "TB_BaconUps_028" ? 2 : 1;
443
- const baseDamage = 4 +
444
- boardWithDeadEntityHero.trinkets.filter((t) => t.cardId === "BG30_MagicItem_803").length *
445
- 10;
446
- for (let j = 0; j < kaboomLoops; j++) {
447
- (0, attack_1.dealDamageToRandomEnemy)(otherBoard, otherBoardHero, deadEntity, baseDamage, boardWithDeadEntity, boardWithDeadEntityHero, gameState);
448
- }
449
- break;
450
- case "BG28_968":
451
- case "BG28_968_G":
452
- const lighterFighterDamage = deadEntity.cardId === "BG28_968_G" ? 8 : 4;
453
- for (let j = 0; j < 2; j++) {
454
- const target = (0, utils_1.pickRandomLowestHealth)(otherBoard);
455
- gameState.spectator.registerPowerTarget(deadEntity, target, otherBoard, boardWithDeadEntityHero, otherBoardHero);
456
- (0, attack_1.dealDamageToMinion)(target, otherBoard, otherBoardHero, deadEntity, lighterFighterDamage, boardWithDeadEntity, boardWithDeadEntityHero, gameState);
457
- }
458
- break;
459
- case "BG25_165":
460
- case "BG25_165_G":
461
- const boomboxDamage = deadEntity.cardId === "BG25_165_G" ? 14 : 7;
462
- const targets = (0, attack_1.findNearestEnemies)(boardWithDeadEntity, null, deadEntityIndexFromRight, otherBoard, 2, gameState.allCards);
463
- targets.forEach((target) => {
464
- (0, attack_1.dealDamageToMinion)(target, otherBoard, otherBoardHero, deadEntity, boomboxDamage, boardWithDeadEntity, boardWithDeadEntityHero, gameState);
465
- });
466
- break;
467
- case "BG_FP1_024":
468
- const damage = 1;
469
- const minionsToDamage = [...otherBoard, ...boardWithDeadEntity];
470
- for (const target of minionsToDamage) {
471
- const isSameSide = target.friendly === deadEntity.friendly;
472
- const board = isSameSide ? boardWithDeadEntity : otherBoard;
473
- const hero = isSameSide ? boardWithDeadEntityHero : otherBoardHero;
474
- (0, attack_1.dealDamageToMinion)(target, board, hero, deadEntity, damage, isSameSide ? otherBoard : boardWithDeadEntity, isSameSide ? otherBoardHero : boardWithDeadEntityHero, gameState);
475
- }
476
- break;
477
- case "BG25_399":
478
- case "BG25_399_G":
479
- const radioQuantity = deadEntityCardId === "BG25_399_G" ? 2 : 1;
480
- const radioEntities = Array(radioQuantity).fill(deadEntity.lastAffectedByEntity);
481
- (0, cards_in_hand_1.addCardsInHand)(boardWithDeadEntityHero, boardWithDeadEntity, radioEntities, gameState);
482
- break;
483
- case "BG28_900":
484
- case "BG28_900_G":
485
- const loops = deadEntityCardId === "BG28_900_G" ? 2 : 1;
486
- const cardsToAdd = Array(loops).fill(null);
487
- (0, cards_in_hand_1.addCardsInHand)(boardWithDeadEntityHero, boardWithDeadEntity, cardsToAdd, gameState);
488
- break;
489
- case "TB_BaconShop_HERO_41_Buddy":
490
- case "TB_BaconShop_HERO_41_Buddy_G":
491
- const numberToGild = deadEntityCardId === "TB_BaconShop_HERO_41_Buddy_G" ? 2 : 1;
492
- const targetBoard = boardWithDeadEntity.filter((e) => !e.definitelyDead && e.health > 0);
493
- for (let i = 0; i < Math.min(numberToGild, boardWithDeadEntity.length); i++) {
494
- const rightMostMinion = targetBoard[targetBoard.length - 1 - i];
495
- if (rightMostMinion) {
496
- (0, golden_1.makeMinionGolden)(rightMostMinion, deadEntity, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState);
497
- }
498
- }
499
- break;
500
- case "BG26_360":
501
- case "BG26_360_G":
502
- const statsScourfin = deadEntityCardId === "BG26_360_G" ? 10 : 5;
503
- (0, utils_2.grantRandomStats)(deadEntity, boardWithDeadEntityHero.hand.filter((e) => {
504
- var _a;
505
- return ((_a = gameState.allCards.getCard(e.cardId).type) === null || _a === void 0 ? void 0 : _a.toUpperCase()) ===
506
- reference_data_1.CardType[reference_data_1.CardType.MINION];
507
- }), boardWithDeadEntityHero, statsScourfin, statsScourfin, null, true, gameState);
508
- break;
509
- case "BG23_017":
510
- case "BG23_017_G":
511
- const sanguineChampionStats = deadEntityCardId === "BG23_017" ? 1 : 2;
512
- boardWithDeadEntityHero.globalInfo.BloodGemAttackBonus += sanguineChampionStats;
513
- boardWithDeadEntityHero.globalInfo.BloodGemHealthBonus += sanguineChampionStats;
514
- break;
515
- case "BG26_160":
516
- case "BG26_160_G":
517
- const piperBuff = deadEntityCardId === "BG26_160" ? 1 : 2;
518
- boardWithDeadEntityHero.globalInfo.BloodGemAttackBonus += piperBuff;
519
- break;
520
- case "BG_RLK_957":
521
- (0, utils_2.addStatsToBoard)(deadEntity, boardWithDeadEntity, boardWithDeadEntityHero, 2, 1, gameState, reference_data_1.Race[reference_data_1.Race.UNDEAD]);
522
- break;
523
- case "BG26_GIL_513":
524
- (0, utils_2.addStatsToBoard)(deadEntity, boardWithDeadEntity, boardWithDeadEntityHero, 1, 0, gameState, null);
525
- break;
526
- case "BG_ICC_099":
527
- for (const entity of boardWithDeadEntity) {
528
- (0, attack_1.dealDamageToMinion)(entity, boardWithDeadEntity, boardWithDeadEntityHero, deadEntity, 5, otherBoard, otherBoardHero, gameState);
529
- }
530
- break;
531
- case "BG27_080":
532
- case "BG27_080_G":
533
- const motleyBuff = deadEntity.cardId === "BG27_080_G" ? 2 : 1;
534
- (0, utils_2.grantStatsToMinionsOfEachType)(deadEntity, boardWithDeadEntity, boardWithDeadEntityHero, motleyBuff * 1, motleyBuff * 1, gameState);
535
- break;
536
- case "BG28_304":
537
- case "BG28_304_G":
538
- const moroesBuffAtk = deadEntity.cardId === "BG28_304_G" ? 8 : 4;
539
- const moroesBuffHealth = deadEntity.cardId === "BG28_304_G" ? 12 : 6;
540
- (0, utils_2.addStatsToBoard)(deadEntity, boardWithDeadEntity, boardWithDeadEntityHero, moroesBuffAtk, moroesBuffHealth, gameState, reference_data_1.Race[reference_data_1.Race.UNDEAD]);
541
- break;
542
- case "BG28_306":
543
- case "BG28_306_G":
544
- const steadfastSpiritBuff = deadEntity.cardId === "BG28_306_G" ? 2 : 1;
545
- (0, utils_2.addStatsToBoard)(deadEntity, boardWithDeadEntity, boardWithDeadEntityHero, steadfastSpiritBuff, steadfastSpiritBuff, gameState);
546
- break;
547
- case "BG26_148":
548
- case "BG26_148_G":
549
- const scraperToAddQuantity = deadEntity.cardId === "BG26_148_G" ? 2 : 1;
550
- const scraperCardsToAdd = [];
551
- for (let i = 0; i < scraperToAddQuantity; i++) {
552
- scraperCardsToAdd.push((0, utils_1.pickRandom)(gameState.cardsData.scrapScraperSpawns));
553
- }
554
- (0, cards_in_hand_1.addCardsInHand)(boardWithDeadEntityHero, boardWithDeadEntity, scraperCardsToAdd, gameState);
555
- break;
556
- case "BG29_862":
557
- case "BG29_862_G":
558
- const conjurerToAddQuantity = deadEntity.cardId === "BG29_862_G" ? 2 : 1;
559
- const conjurerCardsToAdd = [];
560
- for (let i = 0; i < conjurerToAddQuantity; i++) {
561
- conjurerCardsToAdd.push((0, utils_1.pickRandom)(gameState.cardsData.battlecryMinions));
562
- }
563
- (0, cards_in_hand_1.addCardsInHand)(boardWithDeadEntityHero, boardWithDeadEntity, conjurerCardsToAdd, gameState);
564
- break;
565
- case "BG29_808":
566
- case "BG29_808_G":
567
- const spikedSaviorLoops = deadEntity.cardId === "BG29_808_G" ? 2 : 1;
568
- for (let j = 0; j < spikedSaviorLoops; j++) {
569
- const targetBoard = [...boardWithDeadEntity];
570
- for (const entity of targetBoard) {
571
- (0, stats_1.modifyStats)(entity, deadEntity, 0, 1, boardWithDeadEntity, boardWithDeadEntityHero, gameState);
572
- }
573
- for (const entity of targetBoard) {
574
- (0, attack_1.dealDamageToMinion)(entity, boardWithDeadEntity, boardWithDeadEntityHero, deadEntity, 1, otherBoard, otherBoardHero, gameState);
575
- }
576
- }
577
- break;
578
- case "BG30_MagicItem_917e":
579
- (0, cards_in_hand_1.addCardsInHand)(boardWithDeadEntityHero, boardWithDeadEntity, [null], gameState);
580
- break;
581
- case "BG30_MagicItem_411e":
582
- (0, cards_in_hand_1.addCardsInHand)(boardWithDeadEntityHero, boardWithDeadEntity, ["BG20_GEM"], gameState);
583
- break;
584
- case "BG21_000e":
585
- case "BG21_000_Ge":
586
- (0, deathrattle_effects_1.applyLeapFroggerEffect)(boardWithDeadEntity, boardWithDeadEntityHero, deadEntity, deadEntityCardId === "BG21_000_Ge", gameState, 1);
587
- break;
588
- case "BG22_HERO_001_Buddy_e1":
589
- (0, deathrattle_effects_1.applyEarthInvocationEnchantment)(boardWithDeadEntity, deadEntity, deadEntity, gameState);
590
- break;
591
- case "BG22_HERO_001_Buddy_e2":
592
- (0, deathrattle_effects_1.applyFireInvocationEnchantment)(boardWithDeadEntity, boardWithDeadEntityHero, deadEntity, deadEntity, gameState);
593
- break;
594
- case "BG22_HERO_001_Buddy_e3":
595
- (0, deathrattle_effects_1.applyWaterInvocationEnchantment)(boardWithDeadEntity, boardWithDeadEntityHero, otherBoardHero, deadEntity, deadEntity, gameState);
596
- break;
597
- case "BG22_HERO_001_Buddy_e4":
598
- (0, deathrattle_effects_1.applyLightningInvocationEnchantment)(boardWithDeadEntity, boardWithDeadEntityHero, deadEntity, otherBoard, otherBoardHero, gameState);
599
- break;
600
- default:
601
- if ((_f = deadEntity.additionalCards) === null || _f === void 0 ? void 0 : _f.includes(deadEntityCardId)) {
602
- if (!(0, utils_2.hasMechanic)(gameState.allCards.getCard(deadEntityCardId), reference_data_1.GameTag.DEATHRATTLE)) {
603
- hasTriggered = false;
604
- }
605
- }
606
- else {
607
- const source = [deadEntity, ...enchantments].find((e) => e.cardId === deadEntityCardId);
608
- if (!(0, utils_2.hasEntityMechanic)(source, reference_data_1.GameTag.DEATHRATTLE, gameState.allCards)) {
609
- hasTriggered = false;
610
- }
426
+ break;
427
+ case "BG21_001_G":
428
+ const crocTarget = (0, utils_2.grantRandomStats)(deadEntity, boardWithDeadEntity, boardWithDeadEntityHero, 12, 12, reference_data_1.Race.BEAST, true, gameState);
429
+ if (!!crocTarget) {
430
+ gameState.spectator.registerPowerTarget(deadEntity, crocTarget, boardWithDeadEntity, boardWithDeadEntityHero, otherBoardHero);
431
+ }
432
+ break;
433
+ case "BG25_022":
434
+ case "BG25_022_G":
435
+ const scarletMultiplier = deadEntityCardId === "BG25_022_G" ? 2 : 1;
436
+ const scarletTarget = (0, utils_2.grantRandomStats)(deadEntity, boardWithDeadEntity, boardWithDeadEntityHero, scarletMultiplier * 1, scarletMultiplier * 2, reference_data_1.Race.UNDEAD, false, gameState);
437
+ if (!!scarletTarget) {
438
+ gameState.spectator.registerPowerTarget(deadEntity, scarletTarget, boardWithDeadEntity, boardWithDeadEntityHero, otherBoardHero);
439
+ }
440
+ break;
441
+ case "TB_BaconShop_HERO_17_Buddy":
442
+ case "TB_BaconShop_HERO_17_Buddy_G":
443
+ const squirrelDamage = deadEntity.cardId === "TB_BaconShop_HERO_17_Buddy_G"
444
+ ? 4
445
+ : 2;
446
+ const numberOfDeadMechsThisCombat = gameState.sharedState.deaths
447
+ .filter((entity) => entity.friendly === deadEntity.friendly)
448
+ .filter((entity) => (0, utils_2.hasCorrectTribe)(entity, boardWithDeadEntityHero, reference_data_1.Race.MECH, gameState.anomalies, gameState.allCards)).length;
449
+ for (let j = 0; j < numberOfDeadMechsThisCombat; j++) {
450
+ (0, attack_1.dealDamageToRandomEnemy)(otherBoard, otherBoardHero, deadEntity, squirrelDamage, boardWithDeadEntity, boardWithDeadEntityHero, gameState);
451
+ }
452
+ break;
453
+ case "BG_BOT_606":
454
+ case "TB_BaconUps_028":
455
+ const kaboomLoops = deadEntity.cardId === "TB_BaconUps_028" ? 2 : 1;
456
+ const baseDamage = 4 +
457
+ boardWithDeadEntityHero.trinkets.filter((t) => t.cardId === "BG30_MagicItem_803").length *
458
+ 10;
459
+ for (let j = 0; j < kaboomLoops; j++) {
460
+ (0, attack_1.dealDamageToRandomEnemy)(otherBoard, otherBoardHero, deadEntity, baseDamage, boardWithDeadEntity, boardWithDeadEntityHero, gameState);
461
+ }
462
+ break;
463
+ case "BG28_968":
464
+ case "BG28_968_G":
465
+ const lighterFighterDamage = deadEntity.cardId === "BG28_968_G" ? 8 : 4;
466
+ for (let j = 0; j < 2; j++) {
467
+ const target = (0, utils_1.pickRandomLowestHealth)(otherBoard);
468
+ gameState.spectator.registerPowerTarget(deadEntity, target, otherBoard, boardWithDeadEntityHero, otherBoardHero);
469
+ (0, attack_1.dealDamageToMinion)(target, otherBoard, otherBoardHero, deadEntity, lighterFighterDamage, boardWithDeadEntity, boardWithDeadEntityHero, gameState);
470
+ }
471
+ break;
472
+ case "BG25_165":
473
+ case "BG25_165_G":
474
+ const boomboxDamage = deadEntity.cardId === "BG25_165_G" ? 14 : 7;
475
+ const targets = (0, attack_1.findNearestEnemies)(boardWithDeadEntity, null, deadEntityIndexFromRight, otherBoard, 2, gameState.allCards);
476
+ targets.forEach((target) => {
477
+ (0, attack_1.dealDamageToMinion)(target, otherBoard, otherBoardHero, deadEntity, boomboxDamage, boardWithDeadEntity, boardWithDeadEntityHero, gameState);
478
+ });
479
+ break;
480
+ case "BG_FP1_024":
481
+ const damage = 1;
482
+ const minionsToDamage = [...otherBoard, ...boardWithDeadEntity];
483
+ for (const target of minionsToDamage) {
484
+ const isSameSide = target.friendly === deadEntity.friendly;
485
+ const board = isSameSide ? boardWithDeadEntity : otherBoard;
486
+ const hero = isSameSide ? boardWithDeadEntityHero : otherBoardHero;
487
+ (0, attack_1.dealDamageToMinion)(target, board, hero, deadEntity, damage, isSameSide ? otherBoard : boardWithDeadEntity, isSameSide ? otherBoardHero : boardWithDeadEntityHero, gameState);
488
+ }
489
+ break;
490
+ case "BG25_399":
491
+ case "BG25_399_G":
492
+ const radioQuantity = deadEntityCardId === "BG25_399_G" ? 2 : 1;
493
+ const radioEntities = Array(radioQuantity).fill(deadEntity.lastAffectedByEntity);
494
+ (0, cards_in_hand_1.addCardsInHand)(boardWithDeadEntityHero, boardWithDeadEntity, radioEntities, gameState);
495
+ break;
496
+ case "BG28_900":
497
+ case "BG28_900_G":
498
+ const loops = deadEntityCardId === "BG28_900_G" ? 2 : 1;
499
+ const cardsToAdd = Array(loops).fill(null);
500
+ (0, cards_in_hand_1.addCardsInHand)(boardWithDeadEntityHero, boardWithDeadEntity, cardsToAdd, gameState);
501
+ break;
502
+ case "TB_BaconShop_HERO_41_Buddy":
503
+ case "TB_BaconShop_HERO_41_Buddy_G":
504
+ const numberToGild = deadEntityCardId === "TB_BaconShop_HERO_41_Buddy_G" ? 2 : 1;
505
+ const targetBoard = boardWithDeadEntity.filter((e) => !e.definitelyDead && e.health > 0);
506
+ for (let i = 0; i < Math.min(numberToGild, boardWithDeadEntity.length); i++) {
507
+ const rightMostMinion = targetBoard[targetBoard.length - 1 - i];
508
+ if (rightMostMinion) {
509
+ (0, golden_1.makeMinionGolden)(rightMostMinion, deadEntity, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState);
510
+ }
511
+ }
512
+ break;
513
+ case "BG26_360":
514
+ case "BG26_360_G":
515
+ const statsScourfin = deadEntityCardId === "BG26_360_G" ? 10 : 5;
516
+ (0, utils_2.grantRandomStats)(deadEntity, boardWithDeadEntityHero.hand.filter((e) => {
517
+ var _a;
518
+ return ((_a = gameState.allCards.getCard(e.cardId).type) === null || _a === void 0 ? void 0 : _a.toUpperCase()) ===
519
+ reference_data_1.CardType[reference_data_1.CardType.MINION];
520
+ }), boardWithDeadEntityHero, statsScourfin, statsScourfin, null, true, gameState);
521
+ break;
522
+ case "BG23_017":
523
+ case "BG23_017_G":
524
+ const sanguineChampionStats = deadEntityCardId === "BG23_017" ? 1 : 2;
525
+ boardWithDeadEntityHero.globalInfo.BloodGemAttackBonus += sanguineChampionStats;
526
+ boardWithDeadEntityHero.globalInfo.BloodGemHealthBonus += sanguineChampionStats;
527
+ break;
528
+ case "BG26_160":
529
+ case "BG26_160_G":
530
+ const piperBuff = deadEntityCardId === "BG26_160" ? 1 : 2;
531
+ boardWithDeadEntityHero.globalInfo.BloodGemAttackBonus += piperBuff;
532
+ break;
533
+ case "BG_RLK_957":
534
+ (0, utils_2.addStatsToBoard)(deadEntity, boardWithDeadEntity, boardWithDeadEntityHero, 2, 1, gameState, reference_data_1.Race[reference_data_1.Race.UNDEAD]);
535
+ break;
536
+ case "BG26_GIL_513":
537
+ (0, utils_2.addStatsToBoard)(deadEntity, boardWithDeadEntity, boardWithDeadEntityHero, 1, 0, gameState, null);
538
+ break;
539
+ case "BG_ICC_099":
540
+ for (const entity of boardWithDeadEntity) {
541
+ (0, attack_1.dealDamageToMinion)(entity, boardWithDeadEntity, boardWithDeadEntityHero, deadEntity, 5, otherBoard, otherBoardHero, gameState);
542
+ }
543
+ break;
544
+ case "BG27_080":
545
+ case "BG27_080_G":
546
+ const motleyBuff = deadEntity.cardId === "BG27_080_G" ? 2 : 1;
547
+ (0, utils_2.grantStatsToMinionsOfEachType)(deadEntity, boardWithDeadEntity, boardWithDeadEntityHero, motleyBuff * 1, motleyBuff * 1, gameState);
548
+ break;
549
+ case "BG28_304":
550
+ case "BG28_304_G":
551
+ const moroesBuffAtk = deadEntity.cardId === "BG28_304_G" ? 8 : 4;
552
+ const moroesBuffHealth = deadEntity.cardId === "BG28_304_G" ? 12 : 6;
553
+ (0, utils_2.addStatsToBoard)(deadEntity, boardWithDeadEntity, boardWithDeadEntityHero, moroesBuffAtk, moroesBuffHealth, gameState, reference_data_1.Race[reference_data_1.Race.UNDEAD]);
554
+ break;
555
+ case "BG28_306":
556
+ case "BG28_306_G":
557
+ const steadfastSpiritBuff = deadEntity.cardId === "BG28_306_G" ? 2 : 1;
558
+ (0, utils_2.addStatsToBoard)(deadEntity, boardWithDeadEntity, boardWithDeadEntityHero, steadfastSpiritBuff, steadfastSpiritBuff, gameState);
559
+ break;
560
+ case "BG26_148":
561
+ case "BG26_148_G":
562
+ const scraperToAddQuantity = deadEntity.cardId === "BG26_148_G" ? 2 : 1;
563
+ const scraperCardsToAdd = [];
564
+ for (let i = 0; i < scraperToAddQuantity; i++) {
565
+ scraperCardsToAdd.push((0, utils_1.pickRandom)(gameState.cardsData.scrapScraperSpawns));
566
+ }
567
+ (0, cards_in_hand_1.addCardsInHand)(boardWithDeadEntityHero, boardWithDeadEntity, scraperCardsToAdd, gameState);
568
+ break;
569
+ case "BG29_862":
570
+ case "BG29_862_G":
571
+ const conjurerToAddQuantity = deadEntity.cardId === "BG29_862_G" ? 2 : 1;
572
+ const conjurerCardsToAdd = [];
573
+ for (let i = 0; i < conjurerToAddQuantity; i++) {
574
+ conjurerCardsToAdd.push((0, utils_1.pickRandom)(gameState.cardsData.battlecryMinions));
575
+ }
576
+ (0, cards_in_hand_1.addCardsInHand)(boardWithDeadEntityHero, boardWithDeadEntity, conjurerCardsToAdd, gameState);
577
+ break;
578
+ case "BG29_808":
579
+ case "BG29_808_G":
580
+ const spikedSaviorLoops = deadEntity.cardId === "BG29_808_G" ? 2 : 1;
581
+ for (let j = 0; j < spikedSaviorLoops; j++) {
582
+ const targetBoard = [...boardWithDeadEntity];
583
+ for (const entity of targetBoard) {
584
+ (0, stats_1.modifyStats)(entity, deadEntity, 0, 1, boardWithDeadEntity, boardWithDeadEntityHero, gameState);
585
+ }
586
+ for (const entity of targetBoard) {
587
+ (0, attack_1.dealDamageToMinion)(entity, boardWithDeadEntity, boardWithDeadEntityHero, deadEntity, 1, otherBoard, otherBoardHero, gameState);
588
+ }
589
+ }
590
+ break;
591
+ case "BG30_MagicItem_917e":
592
+ (0, cards_in_hand_1.addCardsInHand)(boardWithDeadEntityHero, boardWithDeadEntity, [null], gameState);
593
+ break;
594
+ case "BG30_MagicItem_411e":
595
+ (0, cards_in_hand_1.addCardsInHand)(boardWithDeadEntityHero, boardWithDeadEntity, ["BG20_GEM"], gameState);
596
+ break;
597
+ case "BG21_000e":
598
+ case "BG21_000_Ge":
599
+ (0, deathrattle_effects_1.applyLeapFroggerEffect)(boardWithDeadEntity, boardWithDeadEntityHero, deadEntity, deadEntityCardId === "BG21_000_Ge", gameState, 1);
600
+ break;
601
+ case "BG22_HERO_001_Buddy_e1":
602
+ (0, deathrattle_effects_1.applyEarthInvocationEnchantment)(boardWithDeadEntity, deadEntity, deadEntity, gameState);
603
+ break;
604
+ case "BG22_HERO_001_Buddy_e2":
605
+ (0, deathrattle_effects_1.applyFireInvocationEnchantment)(boardWithDeadEntity, boardWithDeadEntityHero, deadEntity, deadEntity, gameState);
606
+ break;
607
+ case "BG22_HERO_001_Buddy_e3":
608
+ (0, deathrattle_effects_1.applyWaterInvocationEnchantment)(boardWithDeadEntity, boardWithDeadEntityHero, otherBoardHero, deadEntity, deadEntity, gameState);
609
+ break;
610
+ case "BG22_HERO_001_Buddy_e4":
611
+ (0, deathrattle_effects_1.applyLightningInvocationEnchantment)(boardWithDeadEntity, boardWithDeadEntityHero, deadEntity, otherBoard, otherBoardHero, gameState);
612
+ break;
613
+ default:
614
+ if ((_f = deadEntity.additionalCards) === null || _f === void 0 ? void 0 : _f.includes(deadEntityCardId)) {
615
+ if (!(0, utils_2.hasMechanic)(gameState.allCards.getCard(deadEntityCardId), reference_data_1.GameTag.DEATHRATTLE)) {
616
+ hasTriggeredThisLoop = false;
617
+ }
618
+ }
619
+ else {
620
+ const source = [deadEntity, ...enchantments].find((e) => e.cardId === deadEntityCardId);
621
+ if (!(0, utils_2.hasEntityMechanic)(source, reference_data_1.GameTag.DEATHRATTLE, gameState.allCards)) {
622
+ hasTriggeredThisLoop = false;
623
+ }
624
+ }
625
+ break;
611
626
  }
612
- break;
627
+ }
628
+ hasTriggered = hasTriggered || hasTriggeredThisLoop;
629
+ if ((spawnedEntities === null || spawnedEntities === void 0 ? void 0 : spawnedEntities.length) > 0) {
630
+ const actualSpawns = (0, spawns_1.performEntitySpawns)(spawnedEntities, boardWithDeadEntity, boardWithDeadEntityHero, deadEntity, deadEntityIndexFromRight, otherBoard, otherBoardHero, gameState);
631
+ finalSpawns.push(...actualSpawns);
632
+ }
613
633
  }
614
634
  }
615
- if ((spawnedEntities === null || spawnedEntities === void 0 ? void 0 : spawnedEntities.length) > 0) {
616
- const actualSpawns = (0, spawns_1.performEntitySpawns)(spawnedEntities, boardWithDeadEntity, boardWithDeadEntityHero, deadEntity, deadEntityIndexFromRight, otherBoard, otherBoardHero, gameState);
617
- finalSpawns.push(...actualSpawns);
618
- }
619
- if (hasTriggered) {
620
- (0, deathrattle_on_trigger_1.onDeathrattleTriggered)(deathrattleTriggeredInput);
621
- }
622
- }
623
- }
624
- return finalSpawns;
625
- };
626
- exports.spawnEntitiesFromDeathrattle = spawnEntitiesFromDeathrattle;
627
- const spawnEntitiesFromEnchantments = (deadEntity, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState) => {
628
- var _a;
629
- const multiplier = (0, deathrattle_effects_1.computeDeathrattleMultiplier)(boardWithDeadEntity, boardWithDeadEntityHero, deadEntity, gameState.sharedState);
630
- const deathrattleTriggeredInput = {
631
- boardWithDeadEntity,
632
- boardWithDeadEntityHero,
633
- deadEntity,
634
- otherBoard,
635
- otherBoardHero,
636
- gameState,
637
- };
638
- const spawnedEntities = [];
639
- for (const enchantment of deadEntity.enchantments) {
640
- const deathrattleImpl = _card_mappings_1.cardMappings[enchantment.cardId];
641
- if ((0, card_interface_1.hasDeathrattleSpawnEnchantment)(deathrattleImpl)) {
642
- for (let i = 0; i < multiplier; i++) {
643
- const spawns = deathrattleImpl.deathrattleSpawnEnchantmentEffect(enchantment, deadEntity, deathrattleTriggeredInput);
644
- if (!!(spawns === null || spawns === void 0 ? void 0 : spawns.length)) {
645
- spawnedEntities.push(...spawns);
635
+ else {
636
+ const spawnedEntities = [];
637
+ let hasTriggeredThisLoop = true;
638
+ const enchantment = card;
639
+ const deathrattleImpl = _card_mappings_1.cardMappings[enchantment.cardId];
640
+ if ((0, card_interface_1.hasDeathrattleSpawnEnchantment)(deathrattleImpl)) {
641
+ const spawns = deathrattleImpl.deathrattleSpawnEnchantmentEffect(enchantment, deadEntity, deathrattleTriggeredInput);
642
+ if (!!(spawns === null || spawns === void 0 ? void 0 : spawns.length)) {
643
+ spawnedEntities.push(...spawns);
644
+ }
645
+ }
646
+ else {
647
+ switch (enchantment.cardId) {
648
+ case "BG_BOT_312e":
649
+ spawnedEntities.push(...(0, exports.spawnEntities)("BG_BOT_312t", 3, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
650
+ break;
651
+ case "TB_BaconUps_032e":
652
+ spawnedEntities.push(...(0, exports.spawnEntities)("TB_BaconUps_032t", 3, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
653
+ break;
654
+ case "UNG_999t2e":
655
+ spawnedEntities.push(...(0, exports.spawnEntities)("UNG_999t2t1", 2, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
656
+ break;
657
+ case "BG22_HERO_001p_t1e":
658
+ spawnedEntities.push(...(0, exports.spawnEntities)("BG22_HERO_001p_t1et", 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
659
+ break;
660
+ case "BG28_603e":
661
+ spawnedEntities.push(...(0, exports.spawnEntities)("BG28_603t", 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
662
+ break;
663
+ case "BG29_875e":
664
+ spawnedEntities.push(...(0, exports.spawnEntities)("BG29_875t", 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
665
+ break;
666
+ case "BG29_875_Ge":
667
+ spawnedEntities.push(...(0, exports.spawnEntities)("BG29_875_Gt", 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
668
+ break;
669
+ case "BG21_HERO_030pe":
670
+ const tavernTier = (_g = deadEntity.tavernTier) !== null && _g !== void 0 ? _g : gameState.cardsData.getTavernLevel(deadEntity.cardId);
671
+ spawnedEntities.push(...(0, exports.spawnEntities)(gameState.cardsData.getRandomMinionForTavernTier(Math.max(1, tavernTier - 1)), 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
672
+ break;
673
+ case "BG30_MagicItem_952e":
674
+ spawnedEntities.push(...(0, exports.spawnEntities)("BG26_537", 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
675
+ break;
676
+ default:
677
+ hasTriggeredThisLoop = false;
678
+ break;
679
+ }
680
+ }
681
+ hasTriggered = hasTriggered || hasTriggeredThisLoop;
682
+ if ((spawnedEntities === null || spawnedEntities === void 0 ? void 0 : spawnedEntities.length) > 0) {
683
+ const actualSpawns = (0, spawns_1.performEntitySpawns)(spawnedEntities, boardWithDeadEntity, boardWithDeadEntityHero, deadEntity, deadEntityIndexFromRight, otherBoard, otherBoardHero, gameState);
684
+ finalSpawns.push(...actualSpawns);
646
685
  }
647
- (0, deathrattle_on_trigger_1.onDeathrattleTriggered)(deathrattleTriggeredInput);
648
686
  }
649
687
  }
650
- for (let i = 0; i < multiplier; i++) {
651
- let deathrattleTriggered = true;
652
- switch (enchantment.cardId) {
653
- case "BG_BOT_312e":
654
- spawnedEntities.push(...(0, exports.spawnEntities)("BG_BOT_312t", 3, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
655
- break;
656
- case "TB_BaconUps_032e":
657
- spawnedEntities.push(...(0, exports.spawnEntities)("TB_BaconUps_032t", 3, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
658
- break;
659
- case "UNG_999t2e":
660
- spawnedEntities.push(...(0, exports.spawnEntities)("UNG_999t2t1", 2, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
661
- break;
662
- case "BG22_HERO_001p_t1e":
663
- spawnedEntities.push(...(0, exports.spawnEntities)("BG22_HERO_001p_t1et", 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
664
- break;
665
- case "BG28_603e":
666
- spawnedEntities.push(...(0, exports.spawnEntities)("BG28_603t", 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
667
- break;
668
- case "BG29_875e":
669
- spawnedEntities.push(...(0, exports.spawnEntities)("BG29_875t", 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
670
- break;
671
- case "BG29_875_Ge":
672
- spawnedEntities.push(...(0, exports.spawnEntities)("BG29_875_Gt", 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
673
- break;
674
- case "BG21_HERO_030pe":
675
- const tavernTier = (_a = deadEntity.tavernTier) !== null && _a !== void 0 ? _a : gameState.cardsData.getTavernLevel(deadEntity.cardId);
676
- spawnedEntities.push(...(0, exports.spawnEntities)(gameState.cardsData.getRandomMinionForTavernTier(Math.max(1, tavernTier - 1)), 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
677
- break;
678
- case "BG30_MagicItem_952e":
679
- spawnedEntities.push(...(0, exports.spawnEntities)("BG26_537", 1, boardWithDeadEntity, boardWithDeadEntityHero, otherBoard, otherBoardHero, gameState, deadEntity.friendly, false));
680
- break;
681
- default:
682
- deathrattleTriggered = false;
683
- break;
684
- }
685
- if (deathrattleTriggered) {
686
- (0, deathrattle_on_trigger_1.onDeathrattleTriggered)({
687
- boardWithDeadEntity: boardWithDeadEntity,
688
- boardWithDeadEntityHero: boardWithDeadEntityHero,
689
- deadEntity: deadEntity,
690
- otherBoard: otherBoard,
691
- otherBoardHero: otherBoardHero,
692
- gameState: gameState,
693
- });
694
- }
688
+ if (hasTriggered) {
689
+ (0, deathrattle_on_trigger_1.onDeathrattleTriggered)(deathrattleTriggeredInput);
695
690
  }
696
691
  }
697
- return spawnedEntities;
692
+ return finalSpawns;
698
693
  };
699
- exports.spawnEntitiesFromEnchantments = spawnEntitiesFromEnchantments;
694
+ exports.spawnEntitiesFromDeathrattle = spawnEntitiesFromDeathrattle;
700
695
  //# sourceMappingURL=deathrattle-spawns.js.map