@firestone-hs/simulate-bgs-battle 1.1.646 → 1.1.648

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