@firestone-hs/simulate-bgs-battle 1.1.704 → 1.1.706

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 (36) hide show
  1. package/dist/cards/impl/_card-mappings.js +2 -0
  2. package/dist/cards/impl/_card-mappings.js.map +1 -1
  3. package/dist/cards/impl/bg-spell/azerite-empowerment.js +3 -1
  4. package/dist/cards/impl/bg-spell/azerite-empowerment.js.map +1 -1
  5. package/dist/cards/impl/minion/abyssal-bruiser.d.ts +2 -2
  6. package/dist/cards/impl/minion/abyssal-bruiser.js +12 -0
  7. package/dist/cards/impl/minion/abyssal-bruiser.js.map +1 -1
  8. package/dist/cards/impl/minion/black-chromadrake.js +2 -2
  9. package/dist/cards/impl/minion/black-chromadrake.js.map +1 -1
  10. package/dist/cards/impl/minion/blue-chromadrake.js +2 -2
  11. package/dist/cards/impl/minion/blue-chromadrake.js.map +1 -1
  12. package/dist/cards/impl/minion/bronze-chromadrake.js +2 -2
  13. package/dist/cards/impl/minion/bronze-chromadrake.js.map +1 -1
  14. package/dist/cards/impl/minion/expert-aviator.js +1 -2
  15. package/dist/cards/impl/minion/expert-aviator.js.map +1 -1
  16. package/dist/cards/impl/minion/green-chromadrake.js +2 -2
  17. package/dist/cards/impl/minion/green-chromadrake.js.map +1 -1
  18. package/dist/cards/impl/minion/red-chromadrake.js +2 -2
  19. package/dist/cards/impl/minion/red-chromadrake.js.map +1 -1
  20. package/dist/cards/impl/minion/scarlet-survivor.js +7 -11
  21. package/dist/cards/impl/minion/scarlet-survivor.js.map +1 -1
  22. package/dist/cards/impl/minion/twilight-hatchling.js +7 -1
  23. package/dist/cards/impl/minion/twilight-hatchling.js.map +1 -1
  24. package/dist/cards/impl/trinket/blood-golem-sticker.d.ts +2 -0
  25. package/dist/cards/impl/trinket/blood-golem-sticker.js +44 -0
  26. package/dist/cards/impl/trinket/blood-golem-sticker.js.map +1 -0
  27. package/dist/mechanics/tavern-spell-repeat.js +5 -0
  28. package/dist/mechanics/tavern-spell-repeat.js.map +1 -1
  29. package/dist/simulation/attack.d.ts +1 -0
  30. package/dist/simulation/attack.js +7 -5
  31. package/dist/simulation/attack.js.map +1 -1
  32. package/dist/simulation/minion-death.js +0 -30
  33. package/dist/simulation/minion-death.js.map +1 -1
  34. package/dist/simulation/utils/golden.js +5 -2
  35. package/dist/simulation/utils/golden.js.map +1 -1
  36. package/package.json +1 -1
@@ -5,9 +5,9 @@ const reference_data_1 = require("@firestone-hs/reference-data");
5
5
  const stats_1 = require("../../../simulation/stats");
6
6
  const utils_1 = require("../../../utils");
7
7
  exports.GreenChromadrake = {
8
- cardIds: ["BG34_636", "BG34_636_G"],
8
+ cardIds: ["BG34_636t", "BG34_636_Gt"],
9
9
  battlecry: (minion, input) => {
10
- const mult = minion.cardId === "BG34_636_G" ? 2 : 1;
10
+ const mult = minion.cardId === "BG34_636_Gt" ? 2 : 1;
11
11
  const stats = 5 * mult;
12
12
  for (const e of input.board) {
13
13
  if (e.entityId === minion.entityId) {
@@ -1 +1 @@
1
- {"version":3,"file":"green-chromadrake.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/green-chromadrake.ts"],"names":[],"mappings":";;;AAAA,iEAAoD;AAGpD,qDAAwD;AAExD,0CAAiD;AAGpC,QAAA,gBAAgB,GAAkB;IAC9C,OAAO,EAAE,0BAAwE;IACjF,SAAS,EAAE,CAAC,MAAmB,EAAE,KAAqB,EAAE,EAAE;QACzD,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,iBAAwC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3E,MAAM,KAAK,GAAG,CAAC,GAAG,IAAI,CAAC;QACvB,KAAK,MAAM,CAAC,IAAI,KAAK,CAAC,KAAK,EAAE;YAC5B,IAAI,CAAC,CAAC,QAAQ,KAAK,MAAM,CAAC,QAAQ,EAAE;gBACnC,SAAS;aACT;YACD,IAAI,IAAA,uBAAe,EAAC,CAAC,EAAE,KAAK,CAAC,IAAI,EAAE,qBAAI,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE;gBACrG,IAAA,mBAAW,EAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;aAC3E;SACD;QACD,OAAO,IAAI,CAAC;IACb,CAAC;CACD,CAAC","sourcesContent":["import { Race } from '@firestone-hs/reference-data';\r\nimport { BoardEntity } from '../../../board-entity';\r\nimport { BattlecryInput } from '../../../simulation/battlecries';\r\nimport { modifyStats } from '../../../simulation/stats';\r\nimport { CardIds } from '../../../services/card-ids';\r\nimport { hasCorrectTribe } from '../../../utils';\r\nimport { BattlecryCard } from '../../card.interface';\r\n\r\nexport const GreenChromadrake: BattlecryCard = {\r\n\tcardIds: [CardIds.GreenChromadrake_BG34_636, CardIds.GreenChromadrake_BG34_636_G],\r\n\tbattlecry: (minion: BoardEntity, input: BattlecryInput) => {\r\n\t\tconst mult = minion.cardId === CardIds.GreenChromadrake_BG34_636_G ? 2 : 1;\r\n\t\tconst stats = 5 * mult;\r\n\t\tfor (const e of input.board) {\r\n\t\t\tif (e.entityId === minion.entityId) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif (hasCorrectTribe(e, input.hero, Race.DRAGON, input.gameState.anomalies, input.gameState.allCards)) {\r\n\t\t\t\tmodifyStats(e, minion, 0, stats, input.board, input.hero, input.gameState);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t},\r\n};\r\n"]}
1
+ {"version":3,"file":"green-chromadrake.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/green-chromadrake.ts"],"names":[],"mappings":";;;AAAA,iEAAoD;AAIpD,qDAAwD;AACxD,0CAAiD;AAGpC,QAAA,gBAAgB,GAAkB;IAC9C,OAAO,EAAE,4BAAoF;IAC7F,SAAS,EAAE,CAAC,MAAmB,EAAE,KAAqB,EAAE,EAAE;QACzD,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,kBAA8C,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACjF,MAAM,KAAK,GAAG,CAAC,GAAG,IAAI,CAAC;QACvB,KAAK,MAAM,CAAC,IAAI,KAAK,CAAC,KAAK,EAAE;YAC5B,IAAI,CAAC,CAAC,QAAQ,KAAK,MAAM,CAAC,QAAQ,EAAE;gBACnC,SAAS;aACT;YACD,IAAI,IAAA,uBAAe,EAAC,CAAC,EAAE,KAAK,CAAC,IAAI,EAAE,qBAAI,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE;gBACrG,IAAA,mBAAW,EAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;aAC3E;SACD;QACD,OAAO,IAAI,CAAC;IACb,CAAC;CACD,CAAC","sourcesContent":["import { Race } from '@firestone-hs/reference-data';\r\nimport { BoardEntity } from '../../../board-entity';\r\nimport { CardIds } from '../../../services/card-ids';\r\nimport { BattlecryInput } from '../../../simulation/battlecries';\r\nimport { modifyStats } from '../../../simulation/stats';\r\nimport { hasCorrectTribe } from '../../../utils';\r\nimport { BattlecryCard } from '../../card.interface';\r\n\r\nexport const GreenChromadrake: BattlecryCard = {\r\n\tcardIds: [CardIds.GreenChromadrakeToken_BG34_636t, CardIds.GreenChromadrakeToken_BG34_636_Gt],\r\n\tbattlecry: (minion: BoardEntity, input: BattlecryInput) => {\r\n\t\tconst mult = minion.cardId === CardIds.GreenChromadrakeToken_BG34_636_Gt ? 2 : 1;\r\n\t\tconst stats = 5 * mult;\r\n\t\tfor (const e of input.board) {\r\n\t\t\tif (e.entityId === minion.entityId) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif (hasCorrectTribe(e, input.hero, Race.DRAGON, input.gameState.anomalies, input.gameState.allCards)) {\r\n\t\t\t\tmodifyStats(e, minion, 0, stats, input.board, input.hero, input.gameState);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t},\r\n};\r\n"]}
@@ -2,10 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RedChromadrake = void 0;
4
4
  exports.RedChromadrake = {
5
- cardIds: ["BG34_638", "BG34_638_G"],
5
+ cardIds: ["BG34_638_Gt", "BG34_638_Gt"],
6
6
  battlecry: (minion, input) => {
7
7
  var _a;
8
- const mult = minion.cardId === "BG34_638_G" ? 2 : 1;
8
+ const mult = minion.cardId === "BG34_638_Gt" ? 2 : 1;
9
9
  input.hero.globalInfo.TavernSpellAttackBuff = ((_a = input.hero.globalInfo.TavernSpellAttackBuff) !== null && _a !== void 0 ? _a : 0) + 1 * mult;
10
10
  return true;
11
11
  },
@@ -1 +1 @@
1
- {"version":3,"file":"red-chromadrake.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/red-chromadrake.ts"],"names":[],"mappings":";;;AAKa,QAAA,cAAc,GAAkB;IAC5C,OAAO,EAAE,0BAAoE;IAC7E,SAAS,EAAE,CAAC,MAAmB,EAAE,KAAqB,EAAE,EAAE;;QACzD,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,iBAAsC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACzE,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,qBAAqB,GAAG,CAAC,MAAA,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,qBAAqB,mCAAI,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;QAC5G,OAAO,IAAI,CAAC;IACb,CAAC;CACD,CAAC","sourcesContent":["import { BoardEntity } from '../../../board-entity';\r\nimport { BattlecryInput } from '../../../simulation/battlecries';\r\nimport { CardIds } from '../../../services/card-ids';\r\nimport { BattlecryCard } from '../../card.interface';\r\n\r\nexport const RedChromadrake: BattlecryCard = {\r\n\tcardIds: [CardIds.RedChromadrake_BG34_638, CardIds.RedChromadrake_BG34_638_G],\r\n\tbattlecry: (minion: BoardEntity, input: BattlecryInput) => {\r\n\t\tconst mult = minion.cardId === CardIds.RedChromadrake_BG34_638_G ? 2 : 1;\r\n\t\tinput.hero.globalInfo.TavernSpellAttackBuff = (input.hero.globalInfo.TavernSpellAttackBuff ?? 0) + 1 * mult;\r\n\t\treturn true;\r\n\t},\r\n};\r\n"]}
1
+ {"version":3,"file":"red-chromadrake.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/red-chromadrake.ts"],"names":[],"mappings":";;;AAKa,QAAA,cAAc,GAAkB;IAC5C,OAAO,EAAE,8BAAkF;IAC3F,SAAS,EAAE,CAAC,MAAmB,EAAE,KAAqB,EAAE,EAAE;;QACzD,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,kBAA4C,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/E,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,qBAAqB,GAAG,CAAC,MAAA,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,qBAAqB,mCAAI,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;QAC5G,OAAO,IAAI,CAAC;IACb,CAAC;CACD,CAAC","sourcesContent":["import { BoardEntity } from '../../../board-entity';\r\nimport { CardIds } from '../../../services/card-ids';\r\nimport { BattlecryInput } from '../../../simulation/battlecries';\r\nimport { BattlecryCard } from '../../card.interface';\r\n\r\nexport const RedChromadrake: BattlecryCard = {\r\n\tcardIds: [CardIds.RedChromadrakeToken_BG34_638_Gt, CardIds.RedChromadrakeToken_BG34_638_Gt],\r\n\tbattlecry: (minion: BoardEntity, input: BattlecryInput) => {\r\n\t\tconst mult = minion.cardId === CardIds.RedChromadrakeToken_BG34_638_Gt ? 2 : 1;\r\n\t\tinput.hero.globalInfo.TavernSpellAttackBuff = (input.hero.globalInfo.TavernSpellAttackBuff ?? 0) + 1 * mult;\r\n\t\treturn true;\r\n\t},\r\n};\r\n"]}
@@ -4,23 +4,19 @@ exports.ScarletSurvivor = void 0;
4
4
  const divine_shield_1 = require("../../../keywords/divine-shield");
5
5
  const THRESHOLD = 6;
6
6
  const tryGrantDivineShieldOnce = (minion, board, hero, otherHero, gameState) => {
7
- var _a;
8
7
  if (minion.abiityChargesLeft <= 0 ||
9
8
  minion.attack < THRESHOLD ||
10
9
  minion.enchantments.some((e) => e.cardId === "BG35_814e")) {
11
10
  return;
12
11
  }
13
12
  minion.abiityChargesLeft = 0;
14
- minion.onResolve = (_a = minion.onResolve) !== null && _a !== void 0 ? _a : [];
15
- minion.onResolve.push(() => {
16
- (0, divine_shield_1.updateDivineShield)(minion, board, hero, otherHero, true, gameState);
17
- minion.enchantments.push({
18
- cardId: "BG35_814e",
19
- originEntityId: minion.entityId,
20
- timing: gameState.sharedState.currentEntityId++,
21
- tagScriptDataNum1: -1,
22
- tagScriptDataNum2: -1,
23
- });
13
+ (0, divine_shield_1.updateDivineShield)(minion, board, hero, otherHero, true, gameState);
14
+ minion.enchantments.push({
15
+ cardId: "BG35_814e",
16
+ originEntityId: minion.entityId,
17
+ timing: gameState.sharedState.currentEntityId++,
18
+ tagScriptDataNum1: -1,
19
+ tagScriptDataNum2: -1,
24
20
  });
25
21
  };
26
22
  exports.ScarletSurvivor = {
@@ -1 +1 @@
1
- {"version":3,"file":"scarlet-survivor.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/scarlet-survivor.ts"],"names":[],"mappings":";;;AAEA,mEAAqE;AAOrE,MAAM,SAAS,GAAG,CAAC,CAAC;AAEpB,MAAM,wBAAwB,GAAG,CAChC,MAAmB,EACnB,KAAoB,EACpB,IAAqB,EACrB,SAA0B,EAC1B,SAAwB,EACjB,EAAE;;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KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IACvF,CAAC;IACD,cAAc,EAAE,CAAC,MAAmB,EAAE,KAA0B,EAAE,EAAE;QACnE,IAAI,KAAK,CAAC,MAAM,CAAC,QAAQ,KAAK,MAAM,CAAC,QAAQ,EAAE;YAC9C,OAAO;SACP;QACD,wBAAwB,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAC7F,CAAC;CACD,CAAC","sourcesContent":["import { BgsPlayerEntity } from '../../../bgs-player-entity';\r\nimport { BoardEntity } from '../../../board-entity';\r\nimport { updateDivineShield } from '../../../keywords/divine-shield';\r\nimport { CardIds } from '../../../services/card-ids';\r\nimport { OnSpawnInput } from '../../../simulation/add-minion-to-board';\r\nimport { FullGameState } from '../../../simulation/internal-game-state';\r\nimport { OnStatsChangedInput } from '../../../simulation/stats';\r\nimport { DefaultChargesCard, OnSpawnedCard, OnStatsChangedCard } from '../../card.interface';\r\n\r\nconst THRESHOLD = 6;\r\n\r\nconst tryGrantDivineShieldOnce = (\r\n\tminion: BoardEntity,\r\n\tboard: BoardEntity[],\r\n\thero: BgsPlayerEntity,\r\n\totherHero: BgsPlayerEntity,\r\n\tgameState: FullGameState,\r\n): void => {\r\n\tif (\r\n\t\tminion.abiityChargesLeft <= 0 ||\r\n\t\tminion.attack < THRESHOLD ||\r\n\t\tminion.enchantments.some((e) => e.cardId === CardIds.ScarletSurvivor_SurvivedEnchantment_BG35_814e)\r\n\t) {\r\n\t\treturn;\r\n\t}\r\n\tminion.abiityChargesLeft = 0;\r\n\r\n\tminion.onResolve = minion.onResolve ?? [];\r\n\tminion.onResolve.push(() => {\r\n\t\tupdateDivineShield(minion, board, hero, otherHero, true, gameState);\r\n\t\tminion.enchantments.push({\r\n\t\t\tcardId: CardIds.ScarletSurvivor_SurvivedEnchantment_BG35_814e,\r\n\t\t\toriginEntityId: minion.entityId,\r\n\t\t\ttiming: gameState.sharedState.currentEntityId++,\r\n\t\t\ttagScriptDataNum1: -1,\r\n\t\t\ttagScriptDataNum2: -1,\r\n\t\t});\r\n\t});\r\n};\r\n\r\nexport const ScarletSurvivor: OnSpawnedCard & OnStatsChangedCard & DefaultChargesCard = {\r\n\tcardIds: [CardIds.ScarletSurvivor_BG35_814, CardIds.ScarletSurvivor_BG35_814_G],\r\n\tdefaultCharges: (entity: BoardEntity) => 1,\r\n\tonSpawned: (minion: BoardEntity, input: OnSpawnInput) => {\r\n\t\tconst otherHero =\r\n\t\t\tinput.gameState.gameState.player.player === input.hero\r\n\t\t\t\t? input.gameState.gameState.opponent.player\r\n\t\t\t\t: input.gameState.gameState.player.player;\r\n\t\ttryGrantDivineShieldOnce(minion, input.board, input.hero, otherHero, input.gameState);\r\n\t},\r\n\tonStatsChanged: (minion: BoardEntity, input: OnStatsChangedInput) => {\r\n\t\tif (input.target.entityId !== minion.entityId) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\ttryGrantDivineShieldOnce(minion, input.board, input.hero, input.otherHero, input.gameState);\r\n\t},\r\n};\r\n"]}
1
+ {"version":3,"file":"scarlet-survivor.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/scarlet-survivor.ts"],"names":[],"mappings":";;;AAEA,mEAAqE;AAOrE,MAAM,SAAS,GAAG,CAAC,CAAC;AAEpB,MAAM,wBAAwB,GAAG,CAChC,MAAmB,EACnB,KAAoB,EACpB,IAAqB,EACrB,SAA0B,EAC1B,SAAwB,EACjB,EAAE;IACT,IACC,MAAM,CAAC,iBAAiB,IAAI,CAAC;QAC7B,MAAM,CAAC,MAAM,GAAG,SAAS;QACzB,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,gBAA0D,CAAC,EAClG;QACD,OAAO;KACP;IACD,MAAM,CAAC,iBA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CAAC;CACD,CAAC","sourcesContent":["import { BgsPlayerEntity } from '../../../bgs-player-entity';\r\nimport { BoardEntity } from '../../../board-entity';\r\nimport { updateDivineShield } from '../../../keywords/divine-shield';\r\nimport { CardIds } from '../../../services/card-ids';\r\nimport { OnSpawnInput } from '../../../simulation/add-minion-to-board';\r\nimport { FullGameState } from '../../../simulation/internal-game-state';\r\nimport { OnStatsChangedInput } from '../../../simulation/stats';\r\nimport { DefaultChargesCard, OnSpawnedCard, OnStatsChangedCard } from '../../card.interface';\r\n\r\nconst THRESHOLD = 6;\r\n\r\nconst tryGrantDivineShieldOnce = (\r\n\tminion: BoardEntity,\r\n\tboard: BoardEntity[],\r\n\thero: BgsPlayerEntity,\r\n\totherHero: BgsPlayerEntity,\r\n\tgameState: FullGameState,\r\n): void => {\r\n\tif (\r\n\t\tminion.abiityChargesLeft <= 0 ||\r\n\t\tminion.attack < THRESHOLD ||\r\n\t\tminion.enchantments.some((e) => e.cardId === CardIds.ScarletSurvivor_SurvivedEnchantment_BG35_814e)\r\n\t) {\r\n\t\treturn;\r\n\t}\r\n\tminion.abiityChargesLeft = 0;\r\n\r\n\t// 35.2: even without an update I'm see the Survivor get the DS before the \"attack immediately\" from a\r\n\t// Twilight Hatchling spawn. So the timing is somewhere in-between at the moment (after attacking, but\r\n\t// before a deathrattle) so I'll just pretend the bug doesn't exist for now\r\n\t// UPDATE 2026-04-17: apparently that's not consistent, sometimes it doesn't grand the divine shield\r\n\t// https://replays.firestoneapp.com/?reviewId=b342665e-7667-4095-b4f0-b42e1eaec457&turn=5&action=0\r\n\tupdateDivineShield(minion, board, hero, otherHero, true, gameState);\r\n\tminion.enchantments.push({\r\n\t\tcardId: CardIds.ScarletSurvivor_SurvivedEnchantment_BG35_814e,\r\n\t\toriginEntityId: minion.entityId,\r\n\t\ttiming: gameState.sharedState.currentEntityId++,\r\n\t\ttagScriptDataNum1: -1,\r\n\t\ttagScriptDataNum2: -1,\r\n\t});\r\n\t// This is a bug, and once it's fixed we should change the timing so the divine shield is immediately\r\n\t// granted\r\n\t// minion.onResolve = minion.onResolve ?? [];\r\n\t// minion.onResolve.push(() => {\r\n\t// });\r\n};\r\n\r\nexport const ScarletSurvivor: OnSpawnedCard & OnStatsChangedCard & DefaultChargesCard = {\r\n\tcardIds: [CardIds.ScarletSurvivor_BG35_814, CardIds.ScarletSurvivor_BG35_814_G],\r\n\tdefaultCharges: (entity: BoardEntity) => 1,\r\n\tonSpawned: (minion: BoardEntity, input: OnSpawnInput) => {\r\n\t\tconst otherHero =\r\n\t\t\tinput.gameState.gameState.player.player === input.hero\r\n\t\t\t\t? input.gameState.gameState.opponent.player\r\n\t\t\t\t: input.gameState.gameState.player.player;\r\n\t\ttryGrantDivineShieldOnce(minion, input.board, input.hero, otherHero, input.gameState);\r\n\t},\r\n\tonStatsChanged: (minion: BoardEntity, input: OnStatsChangedInput) => {\r\n\t\tif (input.target.entityId !== minion.entityId) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\ttryGrantDivineShieldOnce(minion, input.board, input.hero, input.otherHero, input.gameState);\r\n\t},\r\n};\r\n"]}
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TwilightHatchling = void 0;
4
4
  const deathrattle_spawns_1 = require("../../../simulation/deathrattle-spawns");
5
+ const spawns_1 = require("../../../simulation/spawns");
5
6
  exports.TwilightHatchling = {
6
7
  cardIds: ["BG34_630", "BG34_630_G"],
7
8
  deathrattleSpawn: (minion, input) => {
@@ -10,7 +11,12 @@ exports.TwilightHatchling = {
10
11
  spawns.forEach((e) => {
11
12
  e.attackImmediately = true;
12
13
  });
13
- return spawns;
14
+ const indexFromRight = input.deadEntityIndexFromRight;
15
+ const spawned = (0, spawns_1.performEntitySpawns)(spawns, input.boardWithDeadEntity, input.boardWithDeadEntityHero, minion, indexFromRight, input.otherBoard, input.otherBoardHero, input.gameState, true);
16
+ spawned.forEach((e) => {
17
+ e.hasAttacked = undefined;
18
+ });
19
+ return [];
14
20
  },
15
21
  };
16
22
  //# sourceMappingURL=twilight-hatchling.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"twilight-hatchling.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/twilight-hatchling.ts"],"names":[],"mappings":";;;AAGA,+EAAiF;AAGpE,QAAA,iBAAiB,GAAyB;IACtD,OAAO,EAAE,0BAA0E;IACnF,gBAAgB,EAAE,CAAC,MAAmB,EAAE,KAAgC,EAA0B,EAAE;QACnG,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,iBAAyC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5E,MAAM,MAAM,GAAG,IAAA,4CAAuB,eAAyD,IAAI,EAAE,KAAK,CAAC,CAAC;QAC5G,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;YACpB,CAAC,CAAC,iBAAiB,GAAG,IAAI,CAAC;QAC5B,CAAC,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IACf,CAAC;CACD,CAAC","sourcesContent":["import { BoardEntity } from '../../../board-entity';\r\nimport { CardIds } from '../../../services/card-ids';\r\nimport { DeathrattleTriggeredInput } from '../../../simulation/deathrattle-on-trigger';\r\nimport { simplifiedSpawnEntities } from '../../../simulation/deathrattle-spawns';\r\nimport { DeathrattleSpawnCard } from '../../card.interface';\r\n\r\nexport const TwilightHatchling: DeathrattleSpawnCard = {\r\n\tcardIds: [CardIds.TwilightHatchling_BG34_630, CardIds.TwilightHatchling_BG34_630_G],\r\n\tdeathrattleSpawn: (minion: BoardEntity, input: DeathrattleTriggeredInput): readonly BoardEntity[] => {\r\n\t\tconst mult = minion.cardId === CardIds.TwilightHatchling_BG34_630_G ? 2 : 1;\r\n\t\tconst spawns = simplifiedSpawnEntities(CardIds.TwilightHatchling_TwilightWhelpToken_BG34_630t, mult, input);\r\n\t\tspawns.forEach((e) => {\r\n\t\t\te.attackImmediately = true;\r\n\t\t});\r\n\t\treturn spawns;\r\n\t},\r\n};\r\n"]}
1
+ {"version":3,"file":"twilight-hatchling.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/twilight-hatchling.ts"],"names":[],"mappings":";;;AAGA,+EAAiF;AACjF,uDAAiE;AAGpD,QAAA,iBAAiB,GAAyB;IACtD,OAAO,EAAE,0BAA0E;IACnF,gBAAgB,EAAE,CAAC,MAAmB,EAAE,KAAgC,EAA0B,EAAE;QACnG,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,iBAAyC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAE5E,MAAM,MAAM,GAAG,IAAA,4CAAuB,eAAyD,IAAI,EAAE,KAAK,CAAC,CAAC;QAC5G,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;YACpB,CAAC,CAAC,iBAAiB,GAAG,IAAI,CAAC;QAC5B,CAAC,CAAC,CAAC;QACH,MAAM,cAAc,GAAG,KAAK,CAAC,wBAAwB,CAAC;QACtD,MAAM,OAAO,GAAG,IAAA,4BAAmB,EAClC,MAAM,EACN,KAAK,CAAC,mBAAmB,EACzB,KAAK,CAAC,uBAAuB,EAC7B,MAAM,EACN,cAAc,EACd,KAAK,CAAC,UAAU,EAChB,KAAK,CAAC,cAAc,EACpB,KAAK,CAAC,SAAS,EACf,IAAI,CACJ,CAAC;QAGF,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;YACrB,CAAC,CAAC,WAAW,GAAG,SAAS,CAAC;QAC3B,CAAC,CAAC,CAAC;QAEH,OAAO,EAAE,CAAC;IACX,CAAC;CACD,CAAC","sourcesContent":["import { BoardEntity } from '../../../board-entity';\r\nimport { CardIds } from '../../../services/card-ids';\r\nimport { DeathrattleTriggeredInput } from '../../../simulation/deathrattle-on-trigger';\r\nimport { simplifiedSpawnEntities } from '../../../simulation/deathrattle-spawns';\r\nimport { performEntitySpawns } from '../../../simulation/spawns';\r\nimport { DeathrattleSpawnCard } from '../../card.interface';\r\n\r\nexport const TwilightHatchling: DeathrattleSpawnCard = {\r\n\tcardIds: [CardIds.TwilightHatchling_BG34_630, CardIds.TwilightHatchling_BG34_630_G],\r\n\tdeathrattleSpawn: (minion: BoardEntity, input: DeathrattleTriggeredInput): readonly BoardEntity[] => {\r\n\t\tconst mult = minion.cardId === CardIds.TwilightHatchling_BG34_630_G ? 2 : 1;\r\n\r\n\t\tconst spawns = simplifiedSpawnEntities(CardIds.TwilightHatchling_TwilightWhelpToken_BG34_630t, mult, input);\r\n\t\tspawns.forEach((e) => {\r\n\t\t\te.attackImmediately = true;\r\n\t\t});\r\n\t\tconst indexFromRight = input.deadEntityIndexFromRight;\r\n\t\tconst spawned = performEntitySpawns(\r\n\t\t\tspawns,\r\n\t\t\tinput.boardWithDeadEntity,\r\n\t\t\tinput.boardWithDeadEntityHero,\r\n\t\t\tminion,\r\n\t\t\tindexFromRight,\r\n\t\t\tinput.otherBoard,\r\n\t\t\tinput.otherBoardHero,\r\n\t\t\tinput.gameState,\r\n\t\t\ttrue,\r\n\t\t);\r\n\t\t// We do it this way because it can then re-attack\r\n\t\t// https://replays.firestoneapp.com/?reviewId=7c838df7-992b-4dae-ad96-c0f8a0d7872a&turn=7&action=0\r\n\t\tspawned.forEach((e) => {\r\n\t\t\te.hasAttacked = undefined;\r\n\t\t});\r\n\r\n\t\treturn [];\r\n\t},\r\n};\r\n"]}
@@ -0,0 +1,2 @@
1
+ import { DefaultScriptDataNumCard, OnAfterDeathCard } from '../../card.interface';
2
+ export declare const BloodGolemSticker: OnAfterDeathCard & DefaultScriptDataNumCard;
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BloodGolemSticker = void 0;
4
+ const reference_data_1 = require("@firestone-hs/reference-data");
5
+ const deathrattle_spawns_1 = require("../../../simulation/deathrattle-spawns");
6
+ const spawns_1 = require("../../../simulation/spawns");
7
+ const utils_1 = require("../../../utils");
8
+ exports.BloodGolemSticker = {
9
+ cardIds: ["BG30_MagicItem_442"],
10
+ defaultScriptDataNum: (cardId) => 3,
11
+ onAfterDeath: (trinket, input) => {
12
+ const { hero, gameState, board, otherBoard, otherHero } = input;
13
+ for (const deadEntity of input.deadEntities) {
14
+ if (deadEntity.friendly === hero.friendly &&
15
+ trinket.scriptDataNum1 > 0 &&
16
+ (0, utils_1.hasCorrectTribe)(deadEntity, hero, reference_data_1.Race.QUILBOAR, gameState.anomalies, gameState.allCards)) {
17
+ const indexFromRight = input.deadEntitiesIndexesFromRight[input.deadEntities.indexOf(deadEntity)] + 1;
18
+ let bloodGemEnchantments = deadEntity.enchantments.filter((e) => e.cardId === "BG20_GEMe2");
19
+ if ((bloodGemEnchantments === null || bloodGemEnchantments === void 0 ? void 0 : bloodGemEnchantments.length) === 0) {
20
+ bloodGemEnchantments = deadEntity.enchantments.filter((e) => e.cardId === "BG20_GEMe");
21
+ }
22
+ if ((bloodGemEnchantments === null || bloodGemEnchantments === void 0 ? void 0 : bloodGemEnchantments.length) > 0) {
23
+ const bloodGemAttack = bloodGemEnchantments
24
+ .map((e) => { var _a; return (_a = e.tagScriptDataNum1) !== null && _a !== void 0 ? _a : 0; })
25
+ .reduce((a, b) => a + b, 0);
26
+ const bloodGemHealth = bloodGemEnchantments
27
+ .map((e) => { var _a; return (_a = e.tagScriptDataNum2) !== null && _a !== void 0 ? _a : 0; })
28
+ .reduce((a, b) => a + b, 0);
29
+ if (bloodGemAttack > 0 || bloodGemHealth > 0) {
30
+ const spawns = (0, deathrattle_spawns_1.spawnEntities)("BG30_MagicItem_442t", 1, board, hero, otherBoard, otherHero, gameState, deadEntity.friendly, false);
31
+ spawns.forEach((b) => {
32
+ b.attack = bloodGemAttack;
33
+ b.health = bloodGemHealth;
34
+ b.hasAttacked = deadEntity.hasAttacked;
35
+ });
36
+ (0, spawns_1.performEntitySpawns)(spawns, board, hero, deadEntity, indexFromRight, otherBoard, otherHero, gameState);
37
+ trinket.scriptDataNum1--;
38
+ }
39
+ }
40
+ }
41
+ }
42
+ },
43
+ };
44
+ //# sourceMappingURL=blood-golem-sticker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blood-golem-sticker.js","sourceRoot":"","sources":["../../../../src/cards/impl/trinket/blood-golem-sticker.ts"],"names":[],"mappings":";;;AAAA,iEAAoD;AAIpD,+EAAuE;AACvE,uDAAiE;AACjE,0CAAiD;AAKpC,QAAA,iBAAiB,GAAgD;IAC7E,OAAO,EAAE,sBAA8C;IACvD,oBAAoB,EAAE,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;IAC3C,YAAY,EAAE,CAAC,OAAqB,EAAE,KAAwB,EAAE,EAAE;QACjE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;QAChE,KAAK,MAAM,UAAU,IAAI,KAAK,CAAC,YAAY,EAAE;YAC5C,IACC,UAAU,CAAC,QAAQ,KAAK,IAAI,CAAC,QAAQ;gBACrC,OAAO,CAAC,cAAc,GAAG,CAAC;gBAC1B,IAAA,uBAAe,EAAC,UAAU,EAAE,IAAI,EAAE,qBAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC,QAAQ,CAAC,EACxF;gBAED,MAAM,cAAc,GAAG,KAAK,CAAC,4BAA4B,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC;gBACtG,IAAI,oBAAoB,GAAG,UAAU,CAAC,YAAY,CAAC,MAAM,CACxD,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,iBAA0C,CACzD,CAAC;gBACF,IAAI,CAAA,oBAAoB,aAApB,oBAAoB,uBAApB,oBAAoB,CAAE,MAAM,MAAK,CAAC,EAAE;oBACvC,oBAAoB,GAAG,UAAU,CAAC,YAAY,CAAC,MAAM,CACpD,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,g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ACD;IACF,CAAC;CACD,CAAC","sourcesContent":["import { Race } from '@firestone-hs/reference-data';\r\nimport { BoardTrinket } from '../../../bgs-player-entity';\r\nimport { CardIds } from '../../../services/card-ids';\r\nimport { OnAfterDeathInput } from '../../../simulation/attack';\r\nimport { spawnEntities } from '../../../simulation/deathrattle-spawns';\r\nimport { performEntitySpawns } from '../../../simulation/spawns';\r\nimport { hasCorrectTribe } from '../../../utils';\r\nimport { DefaultScriptDataNumCard, OnAfterDeathCard } from '../../card.interface';\r\n\r\n// 2026-04-17: Deathrattles trigger before the Sticker\r\n// https://replays.firestoneapp.com/?reviewId=99605623-18e1-45ad-a7a1-daf7ef29adcb&turn=23&action=7\r\nexport const BloodGolemSticker: OnAfterDeathCard & DefaultScriptDataNumCard = {\r\n\tcardIds: [CardIds.BloodGolemSticker_BG30_MagicItem_442],\r\n\tdefaultScriptDataNum: (cardId: string) => 3,\r\n\tonAfterDeath: (trinket: BoardTrinket, input: OnAfterDeathInput) => {\r\n\t\tconst { hero, gameState, board, otherBoard, otherHero } = input;\r\n\t\tfor (const deadEntity of input.deadEntities) {\r\n\t\t\tif (\r\n\t\t\t\tdeadEntity.friendly === hero.friendly &&\r\n\t\t\t\ttrinket.scriptDataNum1 > 0 &&\r\n\t\t\t\thasCorrectTribe(deadEntity, hero, Race.QUILBOAR, gameState.anomalies, gameState.allCards)\r\n\t\t\t) {\r\n\t\t\t\t// -1 because the minion is already removed from the board\r\n\t\t\t\tconst indexFromRight = input.deadEntitiesIndexesFromRight[input.deadEntities.indexOf(deadEntity)] + 1;\r\n\t\t\t\tlet bloodGemEnchantments = deadEntity.enchantments.filter(\r\n\t\t\t\t\t(e) => e.cardId === CardIds.BloodGem_BloodGemsEnchantment,\r\n\t\t\t\t);\r\n\t\t\t\tif (bloodGemEnchantments?.length === 0) {\r\n\t\t\t\t\tbloodGemEnchantments = deadEntity.enchantments.filter(\r\n\t\t\t\t\t\t(e) => e.cardId === CardIds.BloodGem_BloodGemEnchantment,\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t\tif (bloodGemEnchantments?.length > 0) {\r\n\t\t\t\t\tconst bloodGemAttack = bloodGemEnchantments\r\n\t\t\t\t\t\t.map((e) => e.tagScriptDataNum1 ?? 0)\r\n\t\t\t\t\t\t.reduce((a, b) => a + b, 0);\r\n\t\t\t\t\tconst bloodGemHealth = bloodGemEnchantments\r\n\t\t\t\t\t\t.map((e) => e.tagScriptDataNum2 ?? 0)\r\n\t\t\t\t\t\t.reduce((a, b) => a + b, 0);\r\n\t\t\t\t\tif (bloodGemAttack > 0 || bloodGemHealth > 0) {\r\n\t\t\t\t\t\tconst spawns = spawnEntities(\r\n\t\t\t\t\t\t\tCardIds.BloodGolemSticker_BloodGolemToken_BG30_MagicItem_442t,\r\n\t\t\t\t\t\t\t1,\r\n\t\t\t\t\t\t\tboard,\r\n\t\t\t\t\t\t\thero,\r\n\t\t\t\t\t\t\totherBoard,\r\n\t\t\t\t\t\t\totherHero,\r\n\t\t\t\t\t\t\tgameState,\r\n\t\t\t\t\t\t\tdeadEntity.friendly,\r\n\t\t\t\t\t\t\tfalse,\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\tspawns.forEach((b) => {\r\n\t\t\t\t\t\t\tb.attack = bloodGemAttack;\r\n\t\t\t\t\t\t\tb.health = bloodGemHealth;\r\n\t\t\t\t\t\t\tb.hasAttacked = deadEntity.hasAttacked;\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tperformEntitySpawns(\r\n\t\t\t\t\t\t\tspawns,\r\n\t\t\t\t\t\t\tboard,\r\n\t\t\t\t\t\t\thero,\r\n\t\t\t\t\t\t\tdeadEntity,\r\n\t\t\t\t\t\t\tindexFromRight,\r\n\t\t\t\t\t\t\totherBoard,\r\n\t\t\t\t\t\t\totherHero,\r\n\t\t\t\t\t\t\tgameState,\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\ttrinket.scriptDataNum1--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n};\r\n"]}
@@ -24,6 +24,11 @@ const getTavernSpellEffectRepeatCount = (input) => {
24
24
  2 * input.board.filter((e) => e.cardId === "BG33_825_G").length;
25
25
  repeats += proudPrivateerExtra;
26
26
  }
27
+ const cathedrals = input.hero.trinkets.filter((t) => t.cardId === "BG30_MagicItem_434" && t.scriptDataNum1 > 0);
28
+ repeats += cathedrals.length;
29
+ for (const cathedral of cathedrals) {
30
+ cathedral.scriptDataNum1--;
31
+ }
27
32
  return repeats;
28
33
  };
29
34
  exports.getTavernSpellEffectRepeatCount = getTavernSpellEffectRepeatCount;
@@ -1 +1 @@
1
- {"version":3,"file":"tavern-spell-repeat.js","sourceRoot":"","sources":["../../src/mechanics/tavern-spell-repeat.ts"],"names":[],"mappings":";;;AAOO,MAAM,+BAA+B,GAAG,CAAC,KAAqB,EAAU,EAAE;;IAChF,IAAI,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,IAAI,EAAE;QAChC,OAAO,CAAC,CAAC;KACT;IACD,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,MAAM,gBAAgB,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,iBAA0C,CAAC,CAAC;IACrG,MAAM,gBAAgB,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,eAAwC,CAAC,CAAC;IACnG,IACC,CAAC,gBAAgB,IAAI,gBAAgB,CAAC;QACtC,KAAK,CAAC,MAAM;QACZ,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,EAC5D;QACD,OAAO,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KACnC;IACD,MAAM,cAAc,GACnB,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,eAAuC,CAAC,CAAC,MAAM;QACjF,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,iBAAyC,CAAC,CAAC,MAAM,CAAC;IACzF,OAAO,IAAI,cAAc,CAAC;IAE1B,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IACtE,MAAM,aAAa,GAAG,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,SAAS,0CAAE,QAAQ,CAAC,cAAc,CAAC,CAAC;IAErE,IAAI,aAAa,IAAI,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,IAAI,EAAE;QACjD,MAAM,mBAAmB,GACxB,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,eAAoC,CAAC,CAAC,MAAM;YAC9E,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,iBAAsC,CAAC,CAAC,MAAM,CAAC;QACtF,OAAO,IAAI,mBAAmB,CAAC;KAC/B;IAED,OAAO,OAAO,CAAC;AAChB,CAAC,CAAC;AA9BW,QAAA,+BAA+B,mCA8B1C","sourcesContent":["import { CastSpellInput } from '../cards/card.interface';\r\nimport { CardIds } from '../services/card-ids';\r\n\r\n/**\r\n * Balinda Stonehearth: extra spell effect resolutions for spells you cast that target a friendly board minion.\r\n * Maelstrom Emergent: each copy adds +1 extra resolution (golden +2) for tavern spells you cast; stacks additively with Balinda.\r\n */\r\nexport const getTavernSpellEffectRepeatCount = (input: CastSpellInput): number => {\r\n\tif (input.source !== input.hero) {\r\n\t\treturn 1;\r\n\t}\r\n\tlet repeats = 1;\r\n\tconst hasGoldenBalinda = input.board.some((e) => e.cardId === CardIds.BalindaStonehearth_BG35_883_G);\r\n\tconst hasNormalBalinda = input.board.some((e) => e.cardId === CardIds.BalindaStonehearth_BG35_883);\r\n\tif (\r\n\t\t(hasGoldenBalinda || hasNormalBalinda) &&\r\n\t\tinput.target &&\r\n\t\tinput.board.some((e) => e.entityId === input.target.entityId)\r\n\t) {\r\n\t\trepeats = hasGoldenBalinda ? 3 : 2;\r\n\t}\r\n\tconst maelstromExtra =\r\n\t\tinput.board.filter((e) => e.cardId === CardIds.MaelstromEmergent_BG34_922).length +\r\n\t\t2 * input.board.filter((e) => e.cardId === CardIds.MaelstromEmergent_BG34_922_G).length;\r\n\trepeats += maelstromExtra;\r\n\r\n\tconst spellCard = input.gameState.allCards.getCard(input.spellCardId);\r\n\tconst isBountySpell = spellCard?.mechanics?.includes('BACON_BOUNTY');\r\n\t// Proud Privateer only affects bounties *you* (the hero) cast — same as Balinda / onTavernSpellCast.\r\n\tif (isBountySpell && input.source === input.hero) {\r\n\t\tconst proudPrivateerExtra =\r\n\t\t\tinput.board.filter((e) => e.cardId === CardIds.ProudPrivateer_BG33_825).length +\r\n\t\t\t2 * input.board.filter((e) => e.cardId === CardIds.ProudPrivateer_BG33_825_G).length;\r\n\t\trepeats += proudPrivateerExtra;\r\n\t}\r\n\r\n\treturn repeats;\r\n};\r\n"]}
1
+ {"version":3,"file":"tavern-spell-repeat.js","sourceRoot":"","sources":["../../src/mechanics/tavern-spell-repeat.ts"],"names":[],"mappings":";;;AAOO,MAAM,+BAA+B,GAAG,CAAC,KAAqB,EAAU,EAAE;;IAChF,IAAI,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,IAAI,EAAE;QAChC,OAAO,CAAC,CAAC;KACT;IACD,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,MAAM,gBAAgB,GAAG,KAAK,CAAC,KAAK,CAAC,I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9E,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,iBAAsC,CAAC,CAAC,MAAM,CAAC;QACtF,OAAO,IAAI,mBAAmB,CAAC;KAC/B;IAED,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAC5C,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,yBAAgD,IAAI,CAAC,CAAC,cAAc,GAAG,CAAC,CACvF,CAAC;IACF,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC;IAC7B,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE;QACnC,SAAS,CAAC,cAAc,EAAE,CAAC;KAC3B;IAED,OAAO,OAAO,CAAC;AAChB,CAAC,CAAC;AAtCW,QAAA,+BAA+B,mCAsC1C","sourcesContent":["import { CastSpellInput } from '../cards/card.interface';\r\nimport { CardIds } from '../services/card-ids';\r\n\r\n/**\r\n * Balinda Stonehearth: extra spell effect resolutions for spells you cast that target a friendly board minion.\r\n * Maelstrom Emergent: each copy adds +1 extra resolution (golden +2) for tavern spells you cast; stacks additively with Balinda.\r\n */\r\nexport const getTavernSpellEffectRepeatCount = (input: CastSpellInput): number => {\r\n\tif (input.source !== input.hero) {\r\n\t\treturn 1;\r\n\t}\r\n\tlet repeats = 1;\r\n\tconst hasGoldenBalinda = input.board.some((e) => e.cardId === CardIds.BalindaStonehearth_BG35_883_G);\r\n\tconst hasNormalBalinda = input.board.some((e) => e.cardId === CardIds.BalindaStonehearth_BG35_883);\r\n\tif (\r\n\t\t(hasGoldenBalinda || hasNormalBalinda) &&\r\n\t\tinput.target &&\r\n\t\tinput.board.some((e) => e.entityId === input.target.entityId)\r\n\t) {\r\n\t\trepeats = hasGoldenBalinda ? 3 : 2;\r\n\t}\r\n\tconst maelstromExtra =\r\n\t\tinput.board.filter((e) => e.cardId === CardIds.MaelstromEmergent_BG34_922).length +\r\n\t\t2 * input.board.filter((e) => e.cardId === CardIds.MaelstromEmergent_BG34_922_G).length;\r\n\trepeats += maelstromExtra;\r\n\r\n\tconst spellCard = input.gameState.allCards.getCard(input.spellCardId);\r\n\tconst isBountySpell = spellCard?.mechanics?.includes('BACON_BOUNTY');\r\n\t// Proud Privateer only affects bounties *you* (the hero) cast — same as Balinda / onTavernSpellCast.\r\n\tif (isBountySpell && input.source === input.hero) {\r\n\t\tconst proudPrivateerExtra =\r\n\t\t\tinput.board.filter((e) => e.cardId === CardIds.ProudPrivateer_BG33_825).length +\r\n\t\t\t2 * input.board.filter((e) => e.cardId === CardIds.ProudPrivateer_BG33_825_G).length;\r\n\t\trepeats += proudPrivateerExtra;\r\n\t}\r\n\r\n\tconst cathedrals = input.hero.trinkets.filter(\r\n\t\t(t) => t.cardId === CardIds.ReplicaCathedral_BG30_MagicItem_434 && t.scriptDataNum1 > 0,\r\n\t);\r\n\trepeats += cathedrals.length;\r\n\tfor (const cathedral of cathedrals) {\r\n\t\tcathedral.scriptDataNum1--;\r\n\t}\r\n\r\n\treturn repeats;\r\n};\r\n"]}
@@ -29,6 +29,7 @@ export interface OnAfterDeathInput {
29
29
  readonly otherHero: BgsPlayerEntity;
30
30
  readonly otherBoard: BoardEntity[];
31
31
  readonly deadEntities: BoardEntity[];
32
+ readonly deadEntitiesIndexesFromRight: number[];
32
33
  readonly gameState: FullGameState;
33
34
  }
34
35
  export interface OnAfterFriendlyMinionDeathInput {
@@ -463,7 +463,7 @@ const processMinionDeath = (board1, board1Hero, board2, board2Hero, gameState, s
463
463
  if (!skipSummonWhenSpace) {
464
464
  (0, summon_when_space_1.handleSummonsWhenSpace)(board1, board1Hero, board2, board2Hero, gameState);
465
465
  }
466
- handleAfterMinionsDeaths(board1, deadEntities1, board1Hero, board2, deadEntities2, board2Hero, gameState);
466
+ handleAfterMinionsDeaths(board1, deadEntities1, board1Hero.friendly ? deadMinionIndexesFromRights1 : deadMinionIndexesFromRights2, board1Hero, board2, deadEntities2, board1Hero.friendly ? deadMinionIndexesFromRights2 : deadMinionIndexesFromRights1, board2Hero, gameState);
467
467
  board1
468
468
  .filter((entity) => (0, utils_2.isFish)(entity))
469
469
  .forEach((entity) => (0, deathrattle_effects_1.rememberDeathrattles)(entity, deadEntities1, gameState.cardsData, gameState.allCards, gameState.sharedState));
@@ -473,12 +473,12 @@ const processMinionDeath = (board1, board1Hero, board2, board2Hero, gameState, s
473
473
  (0, pending_effects_1.resolvePendingEffects)(board1, board1Hero, board2, board2Hero, gameState);
474
474
  };
475
475
  exports.processMinionDeath = processMinionDeath;
476
- const handleAfterMinionsDeaths = (board1, deadEntities1, heroEntity1, board2, deadEntities2, heroEntity2, gameState) => {
476
+ const handleAfterMinionsDeaths = (board1, deadEntities1, deadEntitiesIndexesFromRight1, heroEntity1, board2, deadEntities2, deadEntitiesIndexesFromRight2, heroEntity2, gameState) => {
477
477
  const random = Math.random() > 0.5;
478
- handleAfterMinionsDeathsForBoard(random ? board1 : board2, random ? deadEntities1 : deadEntities2, random ? heroEntity1 : heroEntity2, random ? board2 : board1, random ? deadEntities2 : deadEntities1, random ? heroEntity2 : heroEntity1, gameState);
479
- handleAfterMinionsDeathsForBoard(!random ? board1 : board2, !random ? deadEntities1 : deadEntities2, !random ? heroEntity1 : heroEntity2, !random ? board2 : board1, !random ? deadEntities2 : deadEntities1, !random ? heroEntity2 : heroEntity1, gameState);
478
+ handleAfterMinionsDeathsForBoard(random ? board1 : board2, random ? deadEntities1 : deadEntities2, random ? deadEntitiesIndexesFromRight1 : deadEntitiesIndexesFromRight2, random ? heroEntity1 : heroEntity2, random ? board2 : board1, random ? deadEntities2 : deadEntities1, random ? deadEntitiesIndexesFromRight2 : deadEntitiesIndexesFromRight1, random ? heroEntity2 : heroEntity1, gameState);
479
+ handleAfterMinionsDeathsForBoard(!random ? board1 : board2, !random ? deadEntities1 : deadEntities2, !random ? deadEntitiesIndexesFromRight1 : deadEntitiesIndexesFromRight2, !random ? heroEntity1 : heroEntity2, !random ? board2 : board1, !random ? deadEntities2 : deadEntities1, !random ? deadEntitiesIndexesFromRight2 : deadEntitiesIndexesFromRight1, !random ? heroEntity2 : heroEntity1, gameState);
480
480
  };
481
- const handleAfterMinionsDeathsForBoard = (friendlyBoard, friendlyDeadEntities, friendlyHeroEntity, otherBoard, otherDeadEntities, otherHeroEntity, gameState) => {
481
+ const handleAfterMinionsDeathsForBoard = (friendlyBoard, friendlyDeadEntities, friendlyDeadEntitiesIndexesFromRight, friendlyHeroEntity, otherBoard, otherDeadEntities, otherDeadEntitiesIndexesFromRight, otherHeroEntity, gameState) => {
482
482
  var _a;
483
483
  const candidateEntities = [];
484
484
  for (const trinket of (_a = friendlyHeroEntity.trinkets) !== null && _a !== void 0 ? _a : []) {
@@ -490,6 +490,7 @@ const handleAfterMinionsDeathsForBoard = (friendlyBoard, friendlyDeadEntities, f
490
490
  otherHero: otherHeroEntity,
491
491
  otherBoard: otherBoard,
492
492
  deadEntities: friendlyDeadEntities,
493
+ deadEntitiesIndexesFromRight: friendlyDeadEntitiesIndexesFromRight,
493
494
  gameState: gameState,
494
495
  });
495
496
  }
@@ -503,6 +504,7 @@ const handleAfterMinionsDeathsForBoard = (friendlyBoard, friendlyDeadEntities, f
503
504
  otherHero: otherHeroEntity,
504
505
  otherBoard: otherBoard,
505
506
  deadEntities: friendlyDeadEntities,
507
+ deadEntitiesIndexesFromRight: friendlyDeadEntitiesIndexesFromRight,
506
508
  gameState: gameState,
507
509
  });
508
510
  }