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