@firestone-hs/simulate-bgs-battle 1.1.766 → 1.1.767

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 (88) hide show
  1. package/dist/board-entity.d.ts +1 -0
  2. package/dist/board-entity.js.map +1 -1
  3. package/dist/cards/card.interface.d.ts +7 -3
  4. package/dist/cards/card.interface.js +4 -2
  5. package/dist/cards/card.interface.js.map +1 -1
  6. package/dist/cards/impl/_card-mappings.js +6 -0
  7. package/dist/cards/impl/_card-mappings.js.map +1 -1
  8. package/dist/cards/impl/bg-spell/boon-of-beetles.js +3 -2
  9. package/dist/cards/impl/bg-spell/boon-of-beetles.js.map +1 -1
  10. package/dist/cards/impl/enchantments/booming.d.ts +2 -0
  11. package/dist/cards/impl/enchantments/booming.js +44 -0
  12. package/dist/cards/impl/enchantments/booming.js.map +1 -0
  13. package/dist/cards/impl/enchantments/golemancy.js +1 -1
  14. package/dist/cards/impl/enchantments/golemancy.js.map +1 -1
  15. package/dist/cards/impl/enchantments/set-sail.d.ts +2 -0
  16. package/dist/cards/impl/enchantments/set-sail.js +39 -0
  17. package/dist/cards/impl/enchantments/set-sail.js.map +1 -0
  18. package/dist/cards/impl/enchantments/spell-siphon.js +5 -7
  19. package/dist/cards/impl/enchantments/spell-siphon.js.map +1 -1
  20. package/dist/cards/impl/hero-power/mechgyver.d.ts +2 -0
  21. package/dist/cards/impl/hero-power/mechgyver.js +27 -0
  22. package/dist/cards/impl/hero-power/mechgyver.js.map +1 -0
  23. package/dist/cards/impl/minion/cthun.js.map +1 -1
  24. package/dist/cards/impl/minion/diremuck-forager.js +4 -1
  25. package/dist/cards/impl/minion/diremuck-forager.js.map +1 -1
  26. package/dist/cards/impl/minion/expert-aviator.js +3 -1
  27. package/dist/cards/impl/minion/expert-aviator.js.map +1 -1
  28. package/dist/cards/impl/minion/faceless-converter.d.ts +2 -2
  29. package/dist/cards/impl/minion/faceless-converter.js +38 -5
  30. package/dist/cards/impl/minion/faceless-converter.js.map +1 -1
  31. package/dist/cards/impl/minion/jailbird-juggernaut.js +7 -14
  32. package/dist/cards/impl/minion/jailbird-juggernaut.js.map +1 -1
  33. package/dist/cards/impl/minion/sinrunner-blanchy.d.ts +1 -1
  34. package/dist/cards/impl/minion/sinrunner-blanchy.js +3 -1
  35. package/dist/cards/impl/minion/sinrunner-blanchy.js.map +1 -1
  36. package/dist/cards/impl/minion/wildfire-elemental.js +1 -1
  37. package/dist/cards/impl/minion/wildfire-elemental.js.map +1 -1
  38. package/dist/cards/impl/minion/yshaarj.js +6 -4
  39. package/dist/cards/impl/minion/yshaarj.js.map +1 -1
  40. package/dist/cards/impl/trinket/artisanal-urn.js +3 -2
  41. package/dist/cards/impl/trinket/artisanal-urn.js.map +1 -1
  42. package/dist/cards/impl/trinket/blood-golem-sticker.d.ts +2 -2
  43. package/dist/cards/impl/trinket/blood-golem-sticker.js +2 -2
  44. package/dist/cards/impl/trinket/blood-golem-sticker.js.map +1 -1
  45. package/dist/cards/impl/trinket/miniature-ship.js +21 -1
  46. package/dist/cards/impl/trinket/miniature-ship.js.map +1 -1
  47. package/dist/cards/impl/trinket/soul-fermenter.js +4 -1
  48. package/dist/cards/impl/trinket/soul-fermenter.js.map +1 -1
  49. package/dist/input-clone.js +8 -2
  50. package/dist/input-clone.js.map +1 -1
  51. package/dist/mechanics/tavern-spell-repeat.js +4 -4
  52. package/dist/mechanics/tavern-spell-repeat.js.map +1 -1
  53. package/dist/simulation/add-minion-to-board.js +5 -2
  54. package/dist/simulation/add-minion-to-board.js.map +1 -1
  55. package/dist/simulation/attack.js +8 -1
  56. package/dist/simulation/attack.js.map +1 -1
  57. package/dist/simulation/auras.js +8 -5
  58. package/dist/simulation/auras.js.map +1 -1
  59. package/dist/simulation/death-effects.js +21 -4
  60. package/dist/simulation/death-effects.js.map +1 -1
  61. package/dist/simulation/deathrattle-effects.js +8 -1
  62. package/dist/simulation/deathrattle-effects.js.map +1 -1
  63. package/dist/simulation/deathrattle-orchestration.js +2 -6
  64. package/dist/simulation/deathrattle-orchestration.js.map +1 -1
  65. package/dist/simulation/deathrattle-spawns.d.ts +3 -1
  66. package/dist/simulation/deathrattle-spawns.js +32 -2
  67. package/dist/simulation/deathrattle-spawns.js.map +1 -1
  68. package/dist/simulation/deity.d.ts +6 -1
  69. package/dist/simulation/deity.js +23 -13
  70. package/dist/simulation/deity.js.map +1 -1
  71. package/dist/simulation/reborn.d.ts +10 -0
  72. package/dist/simulation/reborn.js +75 -8
  73. package/dist/simulation/reborn.js.map +1 -1
  74. package/dist/simulation/shared-state.d.ts +1 -0
  75. package/dist/simulation/shared-state.js +1 -0
  76. package/dist/simulation/shared-state.js.map +1 -1
  77. package/dist/simulation/start-of-combat/soc-illidan-hero-power.js +5 -2
  78. package/dist/simulation/start-of-combat/soc-illidan-hero-power.js.map +1 -1
  79. package/dist/simulation/start-of-combat/soc-minion.js +1 -1
  80. package/dist/simulation/start-of-combat/soc-minion.js.map +1 -1
  81. package/dist/simulation/start-of-combat/soc-trinket.js +35 -17
  82. package/dist/simulation/start-of-combat/soc-trinket.js.map +1 -1
  83. package/dist/simulation/start-of-combat/start-of-combat.js.map +1 -1
  84. package/dist/simulation/stats.js +8 -6
  85. package/dist/simulation/stats.js.map +1 -1
  86. package/dist/simulation/summon-when-space.js +13 -1
  87. package/dist/simulation/summon-when-space.js.map +1 -1
  88. package/package.json +2 -2
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SetSail = void 0;
4
+ const storedBonus = (value) => (value != null && value > 0 ? value : 0);
5
+ const addBonus = (minion, attack, health) => {
6
+ var _a, _b;
7
+ if (attack) {
8
+ minion.attack += attack;
9
+ minion.maxAttack = ((_a = minion.maxAttack) !== null && _a !== void 0 ? _a : minion.attack - attack) + attack;
10
+ }
11
+ if (health) {
12
+ minion.health += health;
13
+ minion.maxHealth = ((_b = minion.maxHealth) !== null && _b !== void 0 ? _b : minion.health - health) + health;
14
+ }
15
+ };
16
+ const removeBonus = (minion, attack, health) => {
17
+ if (attack) {
18
+ minion.attack -= attack;
19
+ if (minion.maxAttack != null) {
20
+ minion.maxAttack -= attack;
21
+ }
22
+ }
23
+ if (health) {
24
+ minion.health -= health;
25
+ if (minion.maxHealth != null) {
26
+ minion.maxHealth -= health;
27
+ }
28
+ }
29
+ };
30
+ exports.SetSail = {
31
+ cardIds: ["BG35_MagicItem_710e"],
32
+ onSpawnedEnchantment: (minion, enchantment, input) => {
33
+ addBonus(minion, input.applyAttackAuras ? storedBonus(enchantment.tagScriptDataNum1) : 0, input.applyHealthAuras ? storedBonus(enchantment.tagScriptDataNum2) : 0);
34
+ },
35
+ onDespawnedEnchantment: (minion, enchantment, input) => {
36
+ removeBonus(minion, input.applyAttackAuras ? storedBonus(enchantment.tagScriptDataNum1) : 0, input.applyHealthAuras ? storedBonus(enchantment.tagScriptDataNum2) : 0);
37
+ },
38
+ };
39
+ //# sourceMappingURL=set-sail.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"set-sail.js","sourceRoot":"","sources":["../../../../src/cards/impl/enchantments/set-sail.ts"],"names":[],"mappings":";;;AAcA,MAAM,WAAW,GAAG,CAAC,KAAyB,EAAU,EAAE,CAAC,CAAC,KAAK,IAAI,IAAI,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAEpG,MAAM,QAAQ,GAAG,CAAC,MAAmB,EAAE,MAAc,EAAE,MAAc,EAAE,EAAE;;IACxE,IAAI,MAAM,EAAE;QACX,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC;QACxB,MAAM,CAAC,SAAS,GAAG,CAAC,MAAA,MAAM,CAAC,SAAS,mCAAI,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,MAAM,CAAC;KACzE;IACD,IAAI,MAAM,EAAE;QACX,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC;QACxB,MAAM,CAAC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C,CAAC,CAAC,CACvE,CAAC;IACH,CAAC;CACD,CAAC","sourcesContent":["/**\r\n * Set Sail (Miniature Ship)\r\n * After you cast a Tavern spell, give your Pirates +3/+3.\r\n *\r\n * The bonus already on the minion is an aura. Stat sets strip it and put it back,\r\n * so Hostility and Resistance double the current total and then add Set Sail again.\r\n * Each enchantment stores its own bonus: tagScriptDataNum1 is attack, tagScriptDataNum2\r\n * is health. A minion can carry more than one.\r\n */\r\nimport { BoardEnchantment, BoardEntity } from '../../../board-entity';\r\nimport { CardIds } from '../../../services/card-ids';\r\nimport { OnDespawnInput, OnSpawnInput } from '../../../simulation/add-minion-to-board';\r\nimport { OnDespawnedEnchantmentCard, OnSpawnedEnchantmentCard } from '../../card.interface';\r\n\r\nconst storedBonus = (value: number | undefined): number => (value != null && value > 0 ? value : 0);\r\n\r\nconst addBonus = (minion: BoardEntity, attack: number, health: number) => {\r\n\tif (attack) {\r\n\t\tminion.attack += attack;\r\n\t\tminion.maxAttack = (minion.maxAttack ?? minion.attack - attack) + attack;\r\n\t}\r\n\tif (health) {\r\n\t\tminion.health += health;\r\n\t\tminion.maxHealth = (minion.maxHealth ?? minion.health - health) + health;\r\n\t}\r\n};\r\n\r\nconst removeBonus = (minion: BoardEntity, attack: number, health: number) => {\r\n\tif (attack) {\r\n\t\tminion.attack -= attack;\r\n\t\tif (minion.maxAttack != null) {\r\n\t\t\tminion.maxAttack -= attack;\r\n\t\t}\r\n\t}\r\n\tif (health) {\r\n\t\tminion.health -= health;\r\n\t\tif (minion.maxHealth != null) {\r\n\t\t\tminion.maxHealth -= health;\r\n\t\t}\r\n\t}\r\n};\r\n\r\nexport const SetSail: OnSpawnedEnchantmentCard & OnDespawnedEnchantmentCard = {\r\n\tcardIds: [CardIds.MiniatureShip_SetSailEnchantment_BG35_MagicItem_710e],\r\n\tonSpawnedEnchantment: (minion: BoardEntity, enchantment: BoardEnchantment, input: OnSpawnInput) => {\r\n\t\taddBonus(\r\n\t\t\tminion,\r\n\t\t\tinput.applyAttackAuras ? storedBonus(enchantment.tagScriptDataNum1) : 0,\r\n\t\t\tinput.applyHealthAuras ? storedBonus(enchantment.tagScriptDataNum2) : 0,\r\n\t\t);\r\n\t},\r\n\tonDespawnedEnchantment: (minion: BoardEntity, enchantment: BoardEnchantment, input: OnDespawnInput) => {\r\n\t\tremoveBonus(\r\n\t\t\tminion,\r\n\t\t\tinput.applyAttackAuras ? storedBonus(enchantment.tagScriptDataNum1) : 0,\r\n\t\t\tinput.applyHealthAuras ? storedBonus(enchantment.tagScriptDataNum2) : 0,\r\n\t\t);\r\n\t},\r\n};\r\n"]}
@@ -39,7 +39,8 @@ exports.SpellSiphon = {
39
39
  onSpawnedEnchantment: (minion, enchantment, input) => {
40
40
  var _a;
41
41
  const spells = (_a = input.hero.globalInfo.TavernSpellsCastThisGame) !== null && _a !== void 0 ? _a : 0;
42
- addBonus(minion, bonusPerSpell(enchantment) * spells, input.applyAttackAuras, input.applyHealthAuras);
42
+ const already = appliedSpellCount(enchantment, 0);
43
+ addBonus(minion, bonusPerSpell(enchantment) * (spells - already), input.applyAttackAuras, input.applyHealthAuras);
43
44
  enchantment.tagScriptDataNum2 = spells;
44
45
  },
45
46
  onDespawnedEnchantment: (minion, enchantment, input) => {
@@ -48,15 +49,12 @@ exports.SpellSiphon = {
48
49
  const bonus = bonusPerSpell(enchantment) * spells;
49
50
  if (input.applyAttackAuras) {
50
51
  minion.attack -= bonus;
51
- if (minion.maxAttack != null) {
52
- minion.maxAttack -= bonus;
53
- }
54
52
  }
55
53
  if (input.applyHealthAuras) {
56
54
  minion.health -= bonus;
57
- if (minion.maxHealth != null) {
58
- minion.maxHealth -= bonus;
59
- }
55
+ }
56
+ if (input.applyAttackAuras && input.applyHealthAuras) {
57
+ enchantment.tagScriptDataNum2 = 0;
60
58
  }
61
59
  },
62
60
  };
@@ -1 +1 @@
1
- {"version":3,"file":"spell-siphon.js","sourceRoot":"","sources":["../../../../src/cards/impl/enchantments/spell-siphon.ts"],"names":[],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AAM,CAAC,MAAM,IAAI,KAAK,CAAC;YACvB,IAAI,MAAM,CAAC,SAAS,IAAI,IAAI,EAAE;gBAC7B,MAAM,CAAC,SAAS,IAAI,KAAK,CAAC;aAC1B;SACD;IACF,CAAC;CACD,CAAC","sourcesContent":["/**\r\n * Spell Siphon (Dark Gift)\r\n * Has +3/+3 (+2/+2) for each Tavern spell you've cast this game.\r\n * The bonus is an aura: \"set attack/health\" effects (Brood of Nozdormu) replace the base stats,\r\n * then this enchantment is applied again on top.\r\n */\r\nimport { BoardEnchantment, BoardEntity } from '../../../board-entity';\r\nimport { OnGlobalInfoUpdatedInput } from '../../../mechanics/player-global-effects';\r\nimport { CardIds } from '../../../services/card-ids';\r\nimport { OnDespawnInput, OnSpawnInput } from '../../../simulation/add-minion-to-board';\r\nimport {\r\n\tOnDespawnedEnchantmentCard,\r\n\tOnGlobalInfoUpdatedEnchantmentCard,\r\n\tOnSpawnedEnchantmentCard,\r\n} from '../../card.interface';\r\n\r\nconst bonusPerSpell = (enchantment: BoardEnchantment): number =>\r\n\tenchantment.cardId === CardIds.SpellSiphon_SpellSiphonEnchantment_BG36_MidGameEffect_000t30e ? 3 : 2;\r\n\r\nconst appliedSpellCount = (enchantment: BoardEnchantment, fallback: number): number => {\r\n\tconst stored = enchantment.tagScriptDataNum2;\r\n\treturn stored != null && stored >= 0 ? stored : fallback;\r\n};\r\n\r\nconst addBonus = (minion: BoardEntity, bonus: number, applyAttack: boolean, applyHealth: boolean) => {\r\n\tif (!bonus) {\r\n\t\treturn;\r\n\t}\r\n\tif (applyAttack) {\r\n\t\tminion.attack += bonus;\r\n\t\tminion.maxAttack = (minion.maxAttack ?? minion.attack - bonus) + bonus;\r\n\t}\r\n\tif (applyHealth) {\r\n\t\tminion.health += bonus;\r\n\t\tminion.maxHealth = (minion.maxHealth ?? minion.health - bonus) + bonus;\r\n\t}\r\n};\r\n\r\nexport const SpellSiphon: OnGlobalInfoUpdatedEnchantmentCard &\r\n\tOnSpawnedEnchantmentCard &\r\n\tOnDespawnedEnchantmentCard = {\r\n\tcardIds: [\r\n\t\tCardIds.SpellSiphon_SpellSiphonEnchantment_BG36_MidGameEffect_000t30te,\r\n\t\tCardIds.SpellSiphon_SpellSiphonEnchantment_BG36_MidGameEffect_000t30e,\r\n\t],\r\n\tonGlobalInfoUpdatedEnchantment: (\r\n\t\tminion: BoardEntity,\r\n\t\tenchantment: BoardEnchantment,\r\n\t\tinput: OnGlobalInfoUpdatedInput,\r\n\t) => {\r\n\t\tconst base = bonusPerSpell(enchantment);\r\n\t\tfor (const value of input.values) {\r\n\t\t\tif (value.type === 'TavernSpellsCastThisGame') {\r\n\t\t\t\tconst delta = value.newValue - value.oldValue;\r\n\t\t\t\taddBonus(minion, delta * base, true, true);\r\n\t\t\t\tconst stored = enchantment.tagScriptDataNum2;\r\n\t\t\t\tenchantment.tagScriptDataNum2 = stored != null && stored >= 0 ? stored + delta : value.newValue;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tonSpawnedEnchantment: (minion: BoardEntity, enchantment: BoardEnchantment, input: OnSpawnInput) => {\r\n\t\tconst spells = input.hero.globalInfo.TavernSpellsCastThisGame ?? 0;\r\n\t\taddBonus(minion, bonusPerSpell(enchantment) * spells, input.applyAttackAuras, input.applyHealthAuras);\r\n\t\tenchantment.tagScriptDataNum2 = spells;\r\n\t},\r\n\tonDespawnedEnchantment: (minion: BoardEntity, enchantment: BoardEnchantment, input: OnDespawnInput) => {\r\n\t\tconst spells = appliedSpellCount(enchantment, input.hero.globalInfo.TavernSpellsCastThisGame ?? 0);\r\n\t\tconst bonus = bonusPerSpell(enchantment) * spells;\r\n\t\tif (input.applyAttackAuras) {\r\n\t\t\tminion.attack -= bonus;\r\n\t\t\tif (minion.maxAttack != null) {\r\n\t\t\t\tminion.maxAttack -= bonus;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (input.applyHealthAuras) {\r\n\t\t\tminion.health -= bonus;\r\n\t\t\tif (minion.maxHealth != null) {\r\n\t\t\t\tminion.maxHealth -= bonus;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n};\r\n"]}
1
+ {"version":3,"file":"spell-siphon.js","sourceRoot":"","sources":["../../../../src/cards/impl/enchantments/spell-siphon.ts"],"names":[],"mappings":";;;AAoBA,MAAM,aAAa,GAAG,CAAC,WAA6B,EAAU,EAAE,CAC/D,WAAW,CAAC,MAAM,iCAA0E,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAEtG,MAAM,iBAAiB,GAAG,CAAC,WAA6B,EAAE,QAAgB,EAAU,EAAE;IACrF,MAAM,MAAM,GAAG,WAAW,CAAC,iBAAiB,CAAC;IAC7C,OAAO,MAAM,IAAI,IAAI,IAAI,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC;AAC1D,CAAC,CAAC;AAEF,MAAM,QAAQ,GAAG,CAAC,MAAmB,EAAE,KAAa,EAAE,WAAoB,EAAE,WAAoB,EAAE,EAAE;;IACnG,IAAI,CAAC,KAAK,EAAE;QACX,OAAO;KACP;IACD,IAAI,WAAW,EAAE;QAChB,MAAM,CAAC,MAAM,IAAI,KAAK,CAAC;QACvB,MAAM,CAAC,SAAS,GAAG,CAAC,MAAA,MAAM,CAAC,SAAS,mCAAI,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC;KACvE;IACD,IAAI,WAAW,EAAE;QAChB,MAAM,CAAC,MAAM,IAAI,KAAK,CAAC;QACvB,MAAM,CAAC,SAAS,GAAG,CAAC,MAAA,MAAM,CAAC,SAAS,mCAAI,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC;KACvE;AACF,CAAC,CAAC;AAEW,QAAA,WAAW,GAEM;IAC7B,OAAO,EAAE;;;KAGR;IACD,8BAA8B,EAAE,CAC/B,MAAmB,EACnB,WAA6B,EAC7B,KAA+B,EAC9B,EAAE;QACH,MAAM,IAAI,G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,MAAM,CAAC;QAIlD,IAAI,KAAK,CAAC,gBAAgB,EAAE;YAC3B,MAAM,CAAC,MAAM,IAAI,KAAK,CAAC;SACvB;QACD,IAAI,KAAK,CAAC,gBAAgB,EAAE;YAC3B,MAAM,CAAC,MAAM,IAAI,KAAK,CAAC;SACvB;QACD,IAAI,KAAK,CAAC,gBAAgB,IAAI,KAAK,CAAC,gBAAgB,EAAE;YACrD,WAAW,CAAC,iBAAiB,GAAG,CAAC,CAAC;SAClC;IACF,CAAC;CACD,CAAC","sourcesContent":["/**\r\n * Spell Siphon (Dark Gift)\r\n * Has +3/+3 (+2/+2) for each Tavern spell you've cast this game.\r\n * The bonus is an aura: \"set attack/health\" effects (Brood of Nozdormu) replace the base stats,\r\n * then this enchantment is applied again on top.\r\n *\r\n * tagScriptDataNum2 is how many spells are already in the minion's stats. A copy from hand\r\n * keeps the count from when the gift was last updated, so summoning it adds only the spells\r\n * cast since then. Clearing the tag on despawn lets the next spawn put the full aura back.\r\n */\r\nimport { BoardEnchantment, BoardEntity } from '../../../board-entity';\r\nimport { OnGlobalInfoUpdatedInput } from '../../../mechanics/player-global-effects';\r\nimport { CardIds } from '../../../services/card-ids';\r\nimport { OnDespawnInput, OnSpawnInput } from '../../../simulation/add-minion-to-board';\r\nimport {\r\n\tOnDespawnedEnchantmentCard,\r\n\tOnGlobalInfoUpdatedEnchantmentCard,\r\n\tOnSpawnedEnchantmentCard,\r\n} from '../../card.interface';\r\n\r\nconst bonusPerSpell = (enchantment: BoardEnchantment): number =>\r\n\tenchantment.cardId === CardIds.SpellSiphon_SpellSiphonEnchantment_BG36_MidGameEffect_000t30e ? 3 : 2;\r\n\r\nconst appliedSpellCount = (enchantment: BoardEnchantment, fallback: number): number => {\r\n\tconst stored = enchantment.tagScriptDataNum2;\r\n\treturn stored != null && stored >= 0 ? stored : fallback;\r\n};\r\n\r\nconst addBonus = (minion: BoardEntity, bonus: number, applyAttack: boolean, applyHealth: boolean) => {\r\n\tif (!bonus) {\r\n\t\treturn;\r\n\t}\r\n\tif (applyAttack) {\r\n\t\tminion.attack += bonus;\r\n\t\tminion.maxAttack = (minion.maxAttack ?? minion.attack - bonus) + bonus;\r\n\t}\r\n\tif (applyHealth) {\r\n\t\tminion.health += bonus;\r\n\t\tminion.maxHealth = (minion.maxHealth ?? minion.health - bonus) + bonus;\r\n\t}\r\n};\r\n\r\nexport const SpellSiphon: OnGlobalInfoUpdatedEnchantmentCard &\r\n\tOnSpawnedEnchantmentCard &\r\n\tOnDespawnedEnchantmentCard = {\r\n\tcardIds: [\r\n\t\tCardIds.SpellSiphon_SpellSiphonEnchantment_BG36_MidGameEffect_000t30te,\r\n\t\tCardIds.SpellSiphon_SpellSiphonEnchantment_BG36_MidGameEffect_000t30e,\r\n\t],\r\n\tonGlobalInfoUpdatedEnchantment: (\r\n\t\tminion: BoardEntity,\r\n\t\tenchantment: BoardEnchantment,\r\n\t\tinput: OnGlobalInfoUpdatedInput,\r\n\t) => {\r\n\t\tconst base = bonusPerSpell(enchantment);\r\n\t\tfor (const value of input.values) {\r\n\t\t\tif (value.type === 'TavernSpellsCastThisGame') {\r\n\t\t\t\tconst delta = value.newValue - value.oldValue;\r\n\t\t\t\taddBonus(minion, delta * base, true, true);\r\n\t\t\t\tconst stored = enchantment.tagScriptDataNum2;\r\n\t\t\t\tenchantment.tagScriptDataNum2 = stored != null && stored >= 0 ? stored + delta : value.newValue;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tonSpawnedEnchantment: (minion: BoardEntity, enchantment: BoardEnchantment, input: OnSpawnInput) => {\r\n\t\tconst spells = input.hero.globalInfo.TavernSpellsCastThisGame ?? 0;\r\n\t\tconst already = appliedSpellCount(enchantment, 0);\r\n\t\taddBonus(\r\n\t\t\tminion,\r\n\t\t\tbonusPerSpell(enchantment) * (spells - already),\r\n\t\t\tinput.applyAttackAuras,\r\n\t\t\tinput.applyHealthAuras,\r\n\t\t);\r\n\t\tenchantment.tagScriptDataNum2 = spells;\r\n\t},\r\n\tonDespawnedEnchantment: (minion: BoardEntity, enchantment: BoardEnchantment, input: OnDespawnInput) => {\r\n\t\tconst spells = appliedSpellCount(enchantment, input.hero.globalInfo.TavernSpellsCastThisGame ?? 0);\r\n\t\tconst bonus = bonusPerSpell(enchantment) * spells;\r\n\t\t// Current stats lose the aura. maxAttack and maxHealth stay, the same way\r\n\t\t// Deaths Embrace and Hammer of Twilight remember the bonus after despawn.\r\n\t\t// Y'Shaarj summons from those maximums.\r\n\t\tif (input.applyAttackAuras) {\r\n\t\t\tminion.attack -= bonus;\r\n\t\t}\r\n\t\tif (input.applyHealthAuras) {\r\n\t\t\tminion.health -= bonus;\r\n\t\t}\r\n\t\tif (input.applyAttackAuras && input.applyHealthAuras) {\r\n\t\t\tenchantment.tagScriptDataNum2 = 0;\r\n\t\t}\r\n\t},\r\n};\r\n"]}
@@ -0,0 +1,2 @@
1
+ import { OnAfterFriendlyMinionDeathCard } from '../../card.interface';
2
+ export declare const MechGyver: OnAfterFriendlyMinionDeathCard;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MechGyver = void 0;
4
+ const reference_data_1 = require("@firestone-hs/reference-data");
5
+ const cards_in_hand_1 = require("../../../simulation/cards-in-hand");
6
+ const deathsPerMech = 9;
7
+ exports.MechGyver = {
8
+ cardIds: ["BG22_HERO_200p"],
9
+ onAfterFriendlyMinionDeath: (listener, input) => {
10
+ var _a;
11
+ const heroPower = listener;
12
+ if (input.deadEntity.friendly !== input.hero.friendly) {
13
+ return;
14
+ }
15
+ let left = typeof heroPower.info === 'number' && heroPower.info > 0 ? heroPower.info : deathsPerMech;
16
+ left--;
17
+ if (left <= 0) {
18
+ const randomMech = input.gameState.cardsData.getRandomMinionForTribe(reference_data_1.Race.MECH, (_a = input.hero.tavernTier) !== null && _a !== void 0 ? _a : 1, []);
19
+ if (randomMech) {
20
+ (0, cards_in_hand_1.addCardsInHand)(input.hero, input.board, [randomMech], input.gameState);
21
+ }
22
+ left = deathsPerMech;
23
+ }
24
+ heroPower.info = left;
25
+ },
26
+ };
27
+ //# sourceMappingURL=mechgyver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mechgyver.js","sourceRoot":"","sources":["../../../../src/cards/impl/hero-power/mechgyver.ts"],"names":[],"mappings":";;;AAAA,iEAAoD;AAIpD,qEAAmE;AASnE,MAAM,aAAa,GAAG,CAAC,CAAC;AAEX,QAAA,SAAS,GAAmC;IACxD,OAAO,EAAE,kBAAgC;IACzC,0BAA0B,EAAE,CAAC,QAAQ,EAAE,KAAsC,EAAE,EAAE;;QAChF,MAAM,SAAS,GAAG,QAAwB,CAAC;QAC3C,IAAI,KAAK,CAAC,UAAU,CAAC,QAAQ,KAAK,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE;YACtD,OAAO;SACP;QAED,IAAI,IAAI,GAAG,OAAO,SAAS,CAAC,IAAI,KAAK,QAAQ,IAAI,SAAS,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC;QACrG,IAAI,EAAE,CAAC;QACP,IAAI,IAAI,IAAI,CAAC,EAAE;YACd,MAAM,UAAU,GAAG,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,uBAAuB,CACnE,qBAAI,CAAC,IAAI,EACT,MAAA,KAAK,CAAC,IAAI,CAAC,UAAU,mCAAI,CAAC,EAC1B,EAAE,CACF,CAAC;YACF,IAAI,UAAU,EAAE;gBACf,IAAA,8BAAc,EAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;aACvE;YACD,IAAI,GAAG,aAAa,CAAC;SACrB;QACD,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC;IACvB,CAAC;CACD,CAAC","sourcesContent":["import { Race } from '@firestone-hs/reference-data';\r\nimport { BgsHeroPower } from '../../../bgs-player-entity';\r\nimport { CardIds } from '../../../services/card-ids';\r\nimport { OnAfterFriendlyMinionDeathInput } from '../../../simulation/attack';\r\nimport { addCardsInHand } from '../../../simulation/cards-in-hand';\r\nimport { OnAfterFriendlyMinionDeathCard } from '../../card.interface';\r\n\r\n/**\r\n * MechGyver (Ini Stormcoil)\r\n * After 9 friendly minions die, get a random Mech.\r\n *\r\n * info = TAG_SCRIPT_DATA_NUM_1 (deaths remaining until the next Mech; default 9)\r\n */\r\nconst deathsPerMech = 9;\r\n\r\nexport const MechGyver: OnAfterFriendlyMinionDeathCard = {\r\n\tcardIds: [CardIds.IniStormcoil_Mechgyver],\r\n\tonAfterFriendlyMinionDeath: (listener, input: OnAfterFriendlyMinionDeathInput) => {\r\n\t\tconst heroPower = listener as BgsHeroPower;\r\n\t\tif (input.deadEntity.friendly !== input.hero.friendly) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlet left = typeof heroPower.info === 'number' && heroPower.info > 0 ? heroPower.info : deathsPerMech;\r\n\t\tleft--;\r\n\t\tif (left <= 0) {\r\n\t\t\tconst randomMech = input.gameState.cardsData.getRandomMinionForTribe(\r\n\t\t\t\tRace.MECH,\r\n\t\t\t\tinput.hero.tavernTier ?? 1,\r\n\t\t\t\t[],\r\n\t\t\t);\r\n\t\t\tif (randomMech) {\r\n\t\t\t\taddCardsInHand(input.hero, input.board, [randomMech], input.gameState);\r\n\t\t\t}\r\n\t\t\tleft = deathsPerMech;\r\n\t\t}\r\n\t\theroPower.info = left;\r\n\t},\r\n};\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"cthun.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/cthun.ts"],"names":[],"mappings":";;;AAWA,mDAAqD;AACrD,qDAAwD;AAG3C,QAAA,KAAK,GAAc;IAC/B,OAAO,EAAE,4BAAoD;IAC7D,QAAQ,EAAE,CAAC,MAAmB,EAAE,KAAuB,EAAE,EAAE;;QAC1D,MAAM,MAAM,GAAG,KAAK,CA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AG,EAAE,CAAC,IAAI,CAAC,CAAC;IACvC,MAAM,eAAe,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC;IACrC,OAAO,SAAS,GAAG,CAAC,IAAI,eAAe,CAAC,MAAM,EAAE;QAC/C,MAAM,MAAM,GAAG,IAAA,kBAAU,EAAC,eAAe,EAAE,MAAM,CAAC,CAAC;QACnD,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC;QACrC,eAAe,CAAC,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;QAC3D,SAAS,EAAE,CAAC;KACZ;IACD,OAAO,MAAM,CAAC;AACf,CAAC,CAAC","sourcesContent":["/**\r\n * C'Thun (Tier 3, 1/1)\r\n * Deity. After this awakens, give this minion's stats split amongst your other minions.\r\n *\r\n * Golden C'Thun (Tier 3, 2/2)\r\n * Deity. After this awakens, give double this minion's stats split amongst your other minions.\r\n *\r\n * Only fires on BG_OldGod awaken, not generic spawn / reborn.\r\n */\r\nimport { BoardEntity } from '../../../board-entity';\r\nimport { CardIds } from '../../../services/card-ids';\r\nimport { pickRandom } from '../../../services/utils';\r\nimport { modifyStats } from '../../../simulation/stats';\r\nimport { DeityAwakenInput, DeityCard } from '../../card.interface';\r\n\r\nexport const CThun: DeityCard = {\r\n\tcardIds: [CardIds.Cthun_BGFYM_000, CardIds.Cthun_BGFYM_000_G],\r\n\tonAwaken: (minion: BoardEntity, input: DeityAwakenInput) => {\r\n\t\tconst others = input.board.filter((e) => e.entityId !== minion.entityId && e.health > 0 && !e.definitelyDead);\r\n\t\tif (!others.length) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tconst double = minion.cardId === CardIds.Cthun_BGFYM_000_G ? 2 : 1;\r\n\t\tconst attackShares = splitEvenly((minion.attack ?? 0) * double, others, minion);\r\n\t\tconst healthShares = splitEvenly((minion.health ?? 0) * double, others, minion);\r\n\t\tfor (let i = 0; i < others.length; i++) {\r\n\t\t\tmodifyStats(others[i], minion, attackShares[i], healthShares[i], input.board, input.hero, input.gameState);\r\n\t\t}\r\n\t},\r\n};\r\n\r\nconst splitEvenly = (total: number, targets: BoardEntity[], source: BoardEntity): number[] => {\r\n\tconst base = Math.floor(total / targets.length);\r\n\tlet remaining = total - base * targets.length;\r\n\tconst shares = targets.map(() => base);\r\n\tconst leftoverTargets = [...targets];\r\n\twhile (remaining > 0 && leftoverTargets.length) {\r\n\t\tconst target = pickRandom(leftoverTargets, source);\r\n\t\tshares[targets.indexOf(target)] += 1;\r\n\t\tleftoverTargets.splice(leftoverTargets.indexOf(target), 1);\r\n\t\tremaining--;\r\n\t}\r\n\treturn shares;\r\n};\r\n"]}
1
+ {"version":3,"file":"cthun.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/cthun.ts"],"names":[],"mappings":";;;AAYA,mDAAqD;AACrD,qDAAwD;AAG3C,QAAA,KAAK,GAAc;IAC/B,OAAO,EAAE,4BAAoD;IAC7D,QAAQ,EAAE,CAAC,MAAmB,EAAE,KAAuB,EAAE,EAAE;;QAC1D,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,MAAM,CAAC,QAAQ,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC;QAC9G,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;YACnB,OAAO;SACP;QACD,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,kBAA8B,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACnE,MAAM,YAAY,GAAG,WAAW,CAAC,CAAC,MAAA,MAAM,CAAC,MAAM,mCAAI,CAAC,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAChF,MAAM,YAAY,GAAG,WAAW,CAAC,CA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ens, give this minion's stats split amongst your other minions.\r\n *\r\n * Golden C'Thun (Tier 3, 2/2)\r\n * Deity. After this awakens, give double this minion's stats split amongst your other minions.\r\n *\r\n * Only fires on BG_OldGod awaken, not generic spawn / reborn.\r\n * The trigger runs after summon auras, so \"this minion's stats\" includes them.\r\n */\r\nimport { BoardEntity } from '../../../board-entity';\r\nimport { CardIds } from '../../../services/card-ids';\r\nimport { pickRandom } from '../../../services/utils';\r\nimport { modifyStats } from '../../../simulation/stats';\r\nimport { DeityAwakenInput, DeityCard } from '../../card.interface';\r\n\r\nexport const CThun: DeityCard = {\r\n\tcardIds: [CardIds.Cthun_BGFYM_000, CardIds.Cthun_BGFYM_000_G],\r\n\tonAwaken: (minion: BoardEntity, input: DeityAwakenInput) => {\r\n\t\tconst others = input.board.filter((e) => e.entityId !== minion.entityId && e.health > 0 && !e.definitelyDead);\r\n\t\tif (!others.length) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tconst double = minion.cardId === CardIds.Cthun_BGFYM_000_G ? 2 : 1;\r\n\t\tconst attackShares = splitEvenly((minion.attack ?? 0) * double, others, minion);\r\n\t\tconst healthShares = splitEvenly((minion.health ?? 0) * double, others, minion);\r\n\t\tfor (let i = 0; i < others.length; i++) {\r\n\t\t\tmodifyStats(others[i], minion, attackShares[i], healthShares[i], input.board, input.hero, input.gameState);\r\n\t\t}\r\n\t},\r\n};\r\n\r\nconst splitEvenly = (total: number, targets: BoardEntity[], source: BoardEntity): number[] => {\r\n\tconst base = Math.floor(total / targets.length);\r\n\tlet remaining = total - base * targets.length;\r\n\tconst shares = targets.map(() => base);\r\n\tconst leftoverTargets = [...targets];\r\n\twhile (remaining > 0 && leftoverTargets.length) {\r\n\t\tconst target = pickRandom(leftoverTargets, source);\r\n\t\tshares[targets.indexOf(target)] += 1;\r\n\t\tleftoverTargets.splice(leftoverTargets.indexOf(target), 1);\r\n\t\tremaining--;\r\n\t}\r\n\treturn shares;\r\n};\r\n"]}
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DiremuckForager = exports.handleDiremuckPendingSummons = void 0;
4
4
  const reference_data_1 = require("@firestone-hs/reference-data");
5
5
  const hand_minion_priority_1 = require("../../../services/hand-minion-priority");
6
+ const add_minion_to_board_1 = require("../../../simulation/add-minion-to-board");
6
7
  const deathrattle_spawns_1 = require("../../../simulation/deathrattle-spawns");
7
8
  const spawns_1 = require("../../../simulation/spawns");
8
9
  const utils_1 = require("../../../utils");
@@ -11,7 +12,9 @@ const summonHandMinionFromDiremuck = (forager, handTarget, spawnRight, playerBoa
11
12
  var _a;
12
13
  handTarget.locked = true;
13
14
  const friendly = (_a = forager === null || forager === void 0 ? void 0 : forager.friendly) !== null && _a !== void 0 ? _a : playerEntity.friendly;
14
- const newMinions = (0, deathrattle_spawns_1.spawnEntities)(handTarget.cardId, 1, playerBoard, playerEntity, opponentBoard, opponentEntity, gameState, friendly, false, false, true, { ...handTarget });
15
+ const clone = (0, utils_1.copyEntity)(handTarget);
16
+ (0, add_minion_to_board_1.removeAurasFromSelf)(clone, playerBoard, playerEntity, gameState, true, true, false);
17
+ const newMinions = (0, deathrattle_spawns_1.spawnEntities)(handTarget.cardId, 1, playerBoard, playerEntity, opponentBoard, opponentEntity, gameState, friendly, false, false, true, clone);
15
18
  for (const s of newMinions) {
16
19
  s.onCanceledSummon = () => (handTarget.locked = false);
17
20
  }
@@ -1 +1 @@
1
- {"version":3,"file":"diremuck-forager.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/diremuck-forager.ts"],"names":[],"mappings":";;;AAOA,iEAAoD;AAIpD,iFAA4G;AAC5G,+EAAuE;AAEvE,uDAAiE;AAEjE,0CAAiD;AAGjD,MAAM,mBAAmB,GAAG,CAAC,QAAmC,EAAE,EAAE,CAAC,CAAC,CAAc,EAAE,EAAE,CACvF,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,IAAA,4CAAqB,EAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,WAAC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/**\r\n * Diremuck Forager (Tier 4, 5/6)\r\n * Start of Combat: When you have space, summon the highest-Attack minion from your hand for this combat only.\r\n *\r\n * Golden Diremuck Forager (Tier 4, 10/12)\r\n * Start of Combat: When you have space, summon the two highest-Attack minions from your hand for this combat only.\r\n */\r\nimport { Race } from '@firestone-hs/reference-data';\r\nimport { BgsPlayerEntity } from '../../../bgs-player-entity';\r\nimport { BoardEntity } from '../../../board-entity';\r\nimport { CardIds } from '../../../services/card-ids';\r\nimport { getHighestAttackHandMinions, isHandMinionCandidate } from '../../../services/hand-minion-priority';\r\nimport { spawnEntities } from '../../../simulation/deathrattle-spawns';\r\nimport { FullGameState } from '../../../simulation/internal-game-state';\r\nimport { performEntitySpawns } from '../../../simulation/spawns';\r\nimport { SoCInput } from '../../../simulation/start-of-combat/start-of-combat-input';\r\nimport { hasCorrectTribe } from '../../../utils';\r\nimport { StartOfCombatCard } from '../../card.interface';\r\n\r\nconst handMinionPredicate = (allCards: FullGameState['allCards']) => (e: BoardEntity) =>\r\n\t!!e.maxHealth && isHandMinionCandidate(e, (id) => allCards.getCard(id).type?.toUpperCase());\r\n\r\n/** If the Forager died after SOC, pass `null` — summons still resolve (spawn source = hero, index from right = 0). */\r\nconst summonHandMinionFromDiremuck = (\r\n\tforager: BoardEntity | null,\r\n\thandTarget: BoardEntity,\r\n\tspawnRight: boolean,\r\n\tplayerBoard: BoardEntity[],\r\n\tplayerEntity: BgsPlayerEntity,\r\n\topponentBoard: BoardEntity[],\r\n\topponentEntity: BgsPlayerEntity,\r\n\tgameState: FullGameState,\r\n): void => {\r\n\thandTarget.locked = true;\r\n\tconst friendly = forager?.friendly ?? playerEntity.friendly;\r\n\tconst newMinions = spawnEntities(\r\n\t\thandTarget.cardId,\r\n\t\t1,\r\n\t\tplayerBoard,\r\n\t\tplayerEntity,\r\n\t\topponentBoard,\r\n\t\topponentEntity,\r\n\t\tgameState,\r\n\t\tfriendly,\r\n\t\tfalse,\r\n\t\tfalse,\r\n\t\ttrue,\r\n\t\t{ ...handTarget } as BoardEntity,\r\n\t);\r\n\tfor (const s of newMinions) {\r\n\t\ts.onCanceledSummon = () => (handTarget.locked = false);\r\n\t}\r\n\tconst spawnSource = forager ?? playerEntity;\r\n\t// Current theory:\r\n\t// - spawns next to the Forager, if the board isn't full at start of combat\r\n\t// https://replays.firestoneapp.com/?reviewId=1d34f5b4-7e04-4b17-bcc0-353698abaed3&turn=25&action=1\r\n\t// - spawns to the right, if the board is full at start of combat\r\n\t// https://replays.firestoneapp.com/?reviewId=b498d69f-bf1b-4bc0-8902-3643434394d5&turn=23&action=3\r\n\tconst indexFromRight = !spawnRight ? playerBoard.length - (playerBoard.indexOf(forager) + 1) : 0;\r\n\tperformEntitySpawns(\r\n\t\tnewMinions,\r\n\t\tplayerBoard,\r\n\t\tplayerEntity,\r\n\t\tspawnSource,\r\n\t\tindexFromRight,\r\n\t\topponentBoard,\r\n\t\topponentEntity,\r\n\t\tgameState,\r\n\t);\r\n};\r\n\r\n/** Called from `summon-when-space` when board space opens during start-of-combat. */\r\nexport const handleDiremuckPendingSummons = (\r\n\tplayerBoard: BoardEntity[],\r\n\tplayerEntity: BgsPlayerEntity,\r\n\topponentBoard: BoardEntity[],\r\n\topponentEntity: BgsPlayerEntity,\r\n\tgameState: FullGameState,\r\n): void => {\r\n\tconst raw = playerEntity.globalInfo?.DiremuckPendingSummons;\r\n\tif (!raw?.length) {\r\n\t\treturn;\r\n\t}\r\n\tconst allCards = gameState.allCards;\r\n\tconst nextQueue: { foragerEntityId: number; remaining: number; spawnRight: boolean }[] = [];\r\n\r\n\tfor (const entry of raw) {\r\n\t\tlet remaining = entry.remaining;\r\n\t\tconst forager = playerBoard.find((e) => e.entityId === entry.foragerEntityId) ?? null;\r\n\t\twhile (playerBoard.length < 7 && remaining > 0) {\r\n\t\t\tconst candidates = playerEntity.hand.filter((e) =>\r\n\t\t\t\thasCorrectTribe(e, playerEntity, Race.MURLOC, gameState.anomalies, gameState.allCards),\r\n\t\t\t);\r\n\t\t\tconst targets = getHighestAttackHandMinions(candidates, 1, (e) => handMinionPredicate(allCards)(e));\r\n\t\t\tconst handTarget = targets[0];\r\n\t\t\tif (!handTarget?.cardId || handTarget.locked) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tsummonHandMinionFromDiremuck(\r\n\t\t\t\tforager,\r\n\t\t\t\thandTarget,\r\n\t\t\t\tentry.spawnRight,\r\n\t\t\t\tplayerBoard,\r\n\t\t\t\tplayerEntity,\r\n\t\t\t\topponentBoard,\r\n\t\t\t\topponentEntity,\r\n\t\t\t\tgameState,\r\n\t\t\t);\r\n\t\t\tremaining--;\r\n\t\t}\r\n\t\tif (remaining > 0) {\r\n\t\t\tnextQueue.push({ foragerEntityId: entry.foragerEntityId, remaining, spawnRight: entry.spawnRight });\r\n\t\t}\r\n\t}\r\n\tplayerEntity.globalInfo.DiremuckPendingSummons = nextQueue.length ? nextQueue : undefined;\r\n};\r\n\r\nexport const DiremuckForager: StartOfCombatCard = {\r\n\tcardIds: [CardIds.DiremuckForager_BG27_556, CardIds.DiremuckForager_BG27_556_G],\r\n\tstartOfCombatTiming: 'start-of-combat',\r\n\tstartOfCombat: (minion: BoardEntity, input: SoCInput) => {\r\n\t\t// Don't clear the info, as multiple Diremuck Foragers can be on the board at the same time,\r\n\t\t// and they stack\r\n\t\t// input.playerEntity.globalInfo.DiremuckPendingSummons = undefined;\r\n\t\tconst totalWanted = minion.cardId === CardIds.DiremuckForager_BG27_556_G ? 2 : 1;\r\n\t\t// Not sure this is the right rule, but so far it looks like that if it can't spawn during start of combat,\r\n\t\t// then it will spawn to the right side of the board\r\n\t\tconst spawnRight =\r\n\t\t\tinput.playerBoard.length >= 7 ||\r\n\t\t\tinput.playerEntity.hand.filter(handMinionPredicate(input.gameState.allCards)).length === 0;\r\n\t\tinput.playerEntity.globalInfo.DiremuckPendingSummons = [\r\n\t\t\t...(input.playerEntity.globalInfo.DiremuckPendingSummons ?? []),\r\n\t\t\t{ foragerEntityId: minion.entityId, remaining: totalWanted, spawnRight },\r\n\t\t];\r\n\t\treturn {\r\n\t\t\thasTriggered: true,\r\n\t\t\tshouldRecomputeCurrentAttacker: !spawnRight,\r\n\t\t};\r\n\t},\r\n};\r\n"]}
1
+ {"version":3,"file":"diremuck-forager.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/diremuck-forager.ts"],"names":[],"mappings":";;;AAOA,iEAAoD;AAIpD,iFAA4G;AAC5G,iFAA8E;AAC9E,+EAAuE;AAEvE,uDAAiE;AAEjE,0CAA6D;AAG7D,MAAM,mBAAmB,GAAG,CAAC,QAAmC,EAAE,EAAE,CAAC,CAAC,CAAc,EAAE,EAAE,CACvF,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,IAAA,4CAAqB,EAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,WAAC,OAAA,MAAA,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,IAAI,0CAAE,WAAW,EAAE,CAAA,EAAA,CAAC,CAAC;AAG7F,MAAM,4BAA4B,GAAG,CACpC,OAA2B,EAC3B,UAAuB,EACvB,UAAmB,EACnB,WAA0B,EAC1B,YAA6B,EAC7B,aAA4B,EAC5B,cAA+B,EAC/B,SAAwB,EACjB,EAAE;;IACT,UAAU,CAAC,MAAM,GAAG,IAAI,CAAC;IACzB,MAAM,QAAQ,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,mCAAI,YAAY,CAAC,QAAQ,CAAC;IAG5D,MAAM,KAAK,GAAG,IAAA,kBAAU,EAAC,UAAU,CAAC,CAAC;IACrC,IAAA,yCAAmB,EAAC,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IACpF,MAAM,UAAU,GAAG,IAAA,kCAAa,EAC/B,UAAU,CAAC,MAAM,EACjB,CAAC,EACD,WAAW,EACX,YAAY,EACZ,aAAa,EACb,cAAc,EAC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AE,EAAE;;QAIvD,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,iBAAuC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAGjF,MAAM,UAAU,GACf,KAAK,CAAC,WAAW,CAAC,MAAM,IAAI,CAAC;YAC7B,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC;QAC5F,KAAK,CAAC,YAAY,CAAC,UAAU,CAAC,sBAAsB,GAAG;YACtD,GAAG,CAAC,MAAA,KAAK,CAAC,YAAY,CAAC,UAAU,CAAC,sBAAsB,mCAAI,EAAE,CAAC;YAC/D,EAAE,eAAe,EAAE,MAAM,CAAC,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE;SACxE,CAAC;QACF,OAAO;YACN,YAAY,EAAE,IAAI;YAClB,8BAA8B,EAAE,CAAC,UAAU;SAC3C,CAAC;IACH,CAAC;CACD,CAAC","sourcesContent":["/**\r\n * Diremuck Forager (Tier 4, 5/6)\r\n * Start of Combat: When you have space, summon the highest-Attack minion from your hand for this combat only.\r\n *\r\n * Golden Diremuck Forager (Tier 4, 10/12)\r\n * Start of Combat: When you have space, summon the two highest-Attack minions from your hand for this combat only.\r\n */\r\nimport { Race } from '@firestone-hs/reference-data';\r\nimport { BgsPlayerEntity } from '../../../bgs-player-entity';\r\nimport { BoardEntity } from '../../../board-entity';\r\nimport { CardIds } from '../../../services/card-ids';\r\nimport { getHighestAttackHandMinions, isHandMinionCandidate } from '../../../services/hand-minion-priority';\r\nimport { removeAurasFromSelf } from '../../../simulation/add-minion-to-board';\r\nimport { spawnEntities } from '../../../simulation/deathrattle-spawns';\r\nimport { FullGameState } from '../../../simulation/internal-game-state';\r\nimport { performEntitySpawns } from '../../../simulation/spawns';\r\nimport { SoCInput } from '../../../simulation/start-of-combat/start-of-combat-input';\r\nimport { copyEntity, hasCorrectTribe } from '../../../utils';\r\nimport { StartOfCombatCard } from '../../card.interface';\r\n\r\nconst handMinionPredicate = (allCards: FullGameState['allCards']) => (e: BoardEntity) =>\r\n\t!!e.maxHealth && isHandMinionCandidate(e, (id) => allCards.getCard(id).type?.toUpperCase());\r\n\r\n/** If the Forager died after SOC, pass `null` — summons still resolve (spawn source = hero, index from right = 0). */\r\nconst summonHandMinionFromDiremuck = (\r\n\tforager: BoardEntity | null,\r\n\thandTarget: BoardEntity,\r\n\tspawnRight: boolean,\r\n\tplayerBoard: BoardEntity[],\r\n\tplayerEntity: BgsPlayerEntity,\r\n\topponentBoard: BoardEntity[],\r\n\topponentEntity: BgsPlayerEntity,\r\n\tgameState: FullGameState,\r\n): void => {\r\n\thandTarget.locked = true;\r\n\tconst friendly = forager?.friendly ?? playerEntity.friendly;\r\n\t// The hand copy already includes its self auras. Strip them first and let the summon\r\n\t// write them back from the current counters, so a 15/15 Dark Paradox stays 15/15.\r\n\tconst clone = copyEntity(handTarget);\r\n\tremoveAurasFromSelf(clone, playerBoard, playerEntity, gameState, true, true, false);\r\n\tconst newMinions = spawnEntities(\r\n\t\thandTarget.cardId,\r\n\t\t1,\r\n\t\tplayerBoard,\r\n\t\tplayerEntity,\r\n\t\topponentBoard,\r\n\t\topponentEntity,\r\n\t\tgameState,\r\n\t\tfriendly,\r\n\t\tfalse,\r\n\t\tfalse,\r\n\t\ttrue,\r\n\t\tclone,\r\n\t);\r\n\tfor (const s of newMinions) {\r\n\t\ts.onCanceledSummon = () => (handTarget.locked = false);\r\n\t}\r\n\tconst spawnSource = forager ?? playerEntity;\r\n\t// Current theory:\r\n\t// - spawns next to the Forager, if the board isn't full at start of combat\r\n\t// https://replays.firestoneapp.com/?reviewId=1d34f5b4-7e04-4b17-bcc0-353698abaed3&turn=25&action=1\r\n\t// - spawns to the right, if the board is full at start of combat\r\n\t// https://replays.firestoneapp.com/?reviewId=b498d69f-bf1b-4bc0-8902-3643434394d5&turn=23&action=3\r\n\tconst indexFromRight = !spawnRight ? playerBoard.length - (playerBoard.indexOf(forager) + 1) : 0;\r\n\tperformEntitySpawns(\r\n\t\tnewMinions,\r\n\t\tplayerBoard,\r\n\t\tplayerEntity,\r\n\t\tspawnSource,\r\n\t\tindexFromRight,\r\n\t\topponentBoard,\r\n\t\topponentEntity,\r\n\t\tgameState,\r\n\t);\r\n};\r\n\r\n/** Called from `summon-when-space` when board space opens during start-of-combat. */\r\nexport const handleDiremuckPendingSummons = (\r\n\tplayerBoard: BoardEntity[],\r\n\tplayerEntity: BgsPlayerEntity,\r\n\topponentBoard: BoardEntity[],\r\n\topponentEntity: BgsPlayerEntity,\r\n\tgameState: FullGameState,\r\n): void => {\r\n\tconst raw = playerEntity.globalInfo?.DiremuckPendingSummons;\r\n\tif (!raw?.length) {\r\n\t\treturn;\r\n\t}\r\n\tconst allCards = gameState.allCards;\r\n\tconst nextQueue: { foragerEntityId: number; remaining: number; spawnRight: boolean }[] = [];\r\n\r\n\tfor (const entry of raw) {\r\n\t\tlet remaining = entry.remaining;\r\n\t\tconst forager = playerBoard.find((e) => e.entityId === entry.foragerEntityId) ?? null;\r\n\t\twhile (playerBoard.length < 7 && remaining > 0) {\r\n\t\t\tconst candidates = playerEntity.hand.filter((e) =>\r\n\t\t\t\thasCorrectTribe(e, playerEntity, Race.MURLOC, gameState.anomalies, gameState.allCards),\r\n\t\t\t);\r\n\t\t\tconst targets = getHighestAttackHandMinions(candidates, 1, (e) => handMinionPredicate(allCards)(e));\r\n\t\t\tconst handTarget = targets[0];\r\n\t\t\tif (!handTarget?.cardId || handTarget.locked) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tsummonHandMinionFromDiremuck(\r\n\t\t\t\tforager,\r\n\t\t\t\thandTarget,\r\n\t\t\t\tentry.spawnRight,\r\n\t\t\t\tplayerBoard,\r\n\t\t\t\tplayerEntity,\r\n\t\t\t\topponentBoard,\r\n\t\t\t\topponentEntity,\r\n\t\t\t\tgameState,\r\n\t\t\t);\r\n\t\t\tremaining--;\r\n\t\t}\r\n\t\tif (remaining > 0) {\r\n\t\t\tnextQueue.push({ foragerEntityId: entry.foragerEntityId, remaining, spawnRight: entry.spawnRight });\r\n\t\t}\r\n\t}\r\n\tplayerEntity.globalInfo.DiremuckPendingSummons = nextQueue.length ? nextQueue : undefined;\r\n};\r\n\r\nexport const DiremuckForager: StartOfCombatCard = {\r\n\tcardIds: [CardIds.DiremuckForager_BG27_556, CardIds.DiremuckForager_BG27_556_G],\r\n\tstartOfCombatTiming: 'start-of-combat',\r\n\tstartOfCombat: (minion: BoardEntity, input: SoCInput) => {\r\n\t\t// Don't clear the info, as multiple Diremuck Foragers can be on the board at the same time,\r\n\t\t// and they stack\r\n\t\t// input.playerEntity.globalInfo.DiremuckPendingSummons = undefined;\r\n\t\tconst totalWanted = minion.cardId === CardIds.DiremuckForager_BG27_556_G ? 2 : 1;\r\n\t\t// Not sure this is the right rule, but so far it looks like that if it can't spawn during start of combat,\r\n\t\t// then it will spawn to the right side of the board\r\n\t\tconst spawnRight =\r\n\t\t\tinput.playerBoard.length >= 7 ||\r\n\t\t\tinput.playerEntity.hand.filter(handMinionPredicate(input.gameState.allCards)).length === 0;\r\n\t\tinput.playerEntity.globalInfo.DiremuckPendingSummons = [\r\n\t\t\t...(input.playerEntity.globalInfo.DiremuckPendingSummons ?? []),\r\n\t\t\t{ foragerEntityId: minion.entityId, remaining: totalWanted, spawnRight },\r\n\t\t];\r\n\t\treturn {\r\n\t\t\thasTriggered: true,\r\n\t\t\tshouldRecomputeCurrentAttacker: !spawnRight,\r\n\t\t};\r\n\t},\r\n};\r\n"]}
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ExpertAviator = void 0;
4
4
  const reference_data_1 = require("@firestone-hs/reference-data");
5
5
  const hand_minion_priority_1 = require("../../../services/hand-minion-priority");
6
+ const add_minion_to_board_1 = require("../../../simulation/add-minion-to-board");
6
7
  const deathrattle_spawns_1 = require("../../../simulation/deathrattle-spawns");
7
8
  const spawns_1 = require("../../../simulation/spawns");
8
9
  const utils_1 = require("../../../utils");
@@ -19,6 +20,7 @@ exports.ExpertAviator = {
19
20
  }
20
21
  target.locked = true;
21
22
  const clone = (0, utils_1.copyEntity)(target);
23
+ (0, add_minion_to_board_1.removeAurasFromSelf)(clone, input.attackingBoard, input.attackingHero, input.gameState, true, true, false);
22
24
  const spawnInput = {
23
25
  boardWithDeadEntity: input.attackingBoard,
24
26
  boardWithDeadEntityHero: input.attackingHero,
@@ -31,7 +33,7 @@ exports.ExpertAviator = {
31
33
  for (const s of spawns) {
32
34
  s.onCanceledSummon = () => (target.locked = false);
33
35
  }
34
- (0, spawns_1.performEntitySpawns)(spawns, spawnInput.boardWithDeadEntity, spawnInput.boardWithDeadEntityHero, minion, input.attackingBoard.length - input.attackingBoard.indexOf(minion) - 1, spawnInput.otherBoard, spawnInput.otherBoardHero, input.gameState, false);
36
+ (0, spawns_1.performEntitySpawns)(spawns, spawnInput.boardWithDeadEntity, spawnInput.boardWithDeadEntityHero, minion, input.attackingBoard.length - input.attackingBoard.indexOf(minion) - 1, spawnInput.otherBoard, spawnInput.otherBoardHero, input.gameState);
35
37
  }
36
38
  return {
37
39
  dmgDoneByAttacker: 0,
@@ -1 +1 @@
1
- {"version":3,"file":"expert-aviator.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/expert-aviator.ts"],"names":[],"mappings":";;;AAOA,iEAAoD;AAGpD,iFAA4G;AAE5G,+EAAiF;AAEjF,uDAAiE;AACjE,0CAA6D;AAGhD,QAAA,aAAa,GAAc;IACvC,OAAO,EAAE,0BAAkE;IAC3E,KAAK,EAAE,CAAC,MAAmB,EAAE,KAAoB,EAA4D,EAAE;QAC9G,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,iBAAqC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACxE,MAAM,QAAQ,GAAG,KAAK,CAAC,SAA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B,GAAG,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC;aACnD;YAID,IAAA,4BAAmB,EAClB,MAAM,EACN,UAAU,CAAC,mBAAmB,EAC9B,UAAU,CAAC,uBAAuB,EAClC,MAAM,EACN,KAAK,CAAC,cAAc,CAAC,MAAM,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,EACtE,UAAU,CAAC,UAAU,EACrB,UAAU,CAAC,cAAc,EACzB,KAAK,CAAC,SAAS,EACf,KAAK,CACL,CAAC;SACF;QACD,OAAO;YACN,iBAAiB,EAAE,CAAC;YACpB,iBAAiB,EAAE,CAAC;SACpB,CAAC;IACH,CAAC;CACD,CAAC","sourcesContent":["/**\r\n * Expert Aviator (Tier 2, 3/4)\r\n * Rally: Summon the highest-Attack minion from your hand for this combat only.\r\n *\r\n * Golden Expert Aviator (Tier 2, 6/8)\r\n * Rally: Summon the two highest-Attack minions from your hand for this combat only.\r\n */\r\nimport { Race } from '@firestone-hs/reference-data';\r\nimport { BoardEntity } from '../../../board-entity';\r\nimport { CardIds } from '../../../services/card-ids';\r\nimport { getHighestAttackHandMinions, isHandMinionCandidate } from '../../../services/hand-minion-priority';\r\nimport { DeathrattleTriggeredInput } from '../../../simulation/deathrattle-on-trigger';\r\nimport { simplifiedSpawnEntities } from '../../../simulation/deathrattle-spawns';\r\nimport { OnAttackInput } from '../../../simulation/on-attack';\r\nimport { performEntitySpawns } from '../../../simulation/spawns';\r\nimport { copyEntity, hasCorrectTribe } from '../../../utils';\r\nimport { RallyCard } from '../../card.interface';\r\n\r\nexport const ExpertAviator: RallyCard = {\r\n\tcardIds: [CardIds.ExpertAviator_BG34_140, CardIds.ExpertAviator_BG34_140_G],\r\n\trally: (minion: BoardEntity, input: OnAttackInput): { dmgDoneByAttacker: number; dmgDoneByDefender: number } => {\r\n\t\tconst mult = minion.cardId === CardIds.ExpertAviator_BG34_140_G ? 2 : 1;\r\n\t\tconst allCards = input.gameState.allCards;\r\n\t\tconst candidates = input.attackingHero.hand.filter((e) =>\r\n\t\t\thasCorrectTribe(e, input.attackingHero, Race.MURLOC, input.gameState.anomalies, input.gameState.allCards),\r\n\t\t);\r\n\t\tconst targets = getHighestAttackHandMinions(\r\n\t\t\tcandidates,\r\n\t\t\tmult,\r\n\t\t\t(e) => !!e.maxHealth && isHandMinionCandidate(e, (id) => allCards.getCard(id).type?.toUpperCase()),\r\n\t\t);\r\n\t\tfor (const target of targets) {\r\n\t\t\tif (target.locked) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\ttarget.locked = true;\r\n\t\t\tconst clone = copyEntity(target);\r\n\t\t\tconst spawnInput: DeathrattleTriggeredInput = {\r\n\t\t\t\tboardWithDeadEntity: input.attackingBoard,\r\n\t\t\t\tboardWithDeadEntityHero: input.attackingHero,\r\n\t\t\t\tgameState: input.gameState,\r\n\t\t\t\tdeadEntity: minion,\r\n\t\t\t\totherBoard: input.defendingBoard,\r\n\t\t\t\totherBoardHero: input.defendingHero,\r\n\t\t\t};\r\n\t\t\tconst spawns = simplifiedSpawnEntities(clone.cardId, 1, spawnInput, clone);\r\n\t\t\tfor (const s of spawns) {\r\n\t\t\t\ts.onCanceledSummon = () => (target.locked = false);\r\n\t\t\t}\r\n\t\t\t// Here we need to apply the auras from the board, but not re-apply the auras that are inherent to the minion itself\r\n\t\t\t// (like Automaton)\r\n\t\t\t// I think I should rework the aura, see TODO.md\r\n\t\t\tperformEntitySpawns(\r\n\t\t\t\tspawns,\r\n\t\t\t\tspawnInput.boardWithDeadEntity,\r\n\t\t\t\tspawnInput.boardWithDeadEntityHero,\r\n\t\t\t\tminion,\r\n\t\t\t\tinput.attackingBoard.length - input.attackingBoard.indexOf(minion) - 1,\r\n\t\t\t\tspawnInput.otherBoard,\r\n\t\t\t\tspawnInput.otherBoardHero,\r\n\t\t\t\tinput.gameState,\r\n\t\t\t\tfalse,\r\n\t\t\t);\r\n\t\t}\r\n\t\treturn {\r\n\t\t\tdmgDoneByAttacker: 0,\r\n\t\t\tdmgDoneByDefender: 0,\r\n\t\t};\r\n\t},\r\n};\r\n"]}
1
+ {"version":3,"file":"expert-aviator.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/expert-aviator.ts"],"names":[],"mappings":";;;AAOA,iEAAoD;AAGpD,iFAA4G;AAC5G,iFAA8E;AAE9E,+EAAiF;AAEjF,uDAAiE;AACjE,0CAA6D;AAGhD,QAAA,aAAa,GAAc;IACvC,OAAO,EAAE,0BAAkE;IAC3E,KAAK,EAAE,CAAC,MAAmB,EAAE,KAAoB,EAA4D,EAAE;QAC9G,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,iBAAqC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACxE,MAAM,QAAQ,GAAG,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC;QAC1C,MAAM,UAAU,GAAG,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CACxD,IAAA,uBAAe,EAAC,CAAC,EAAE,KAAK,CAAC,aAAa,EAAE,qBAAI,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,CACzG,CAAC;QACF,MAAM,OAAO,GAAG,IAAA,kDAA2B,EAC1C,UAAU,EACV,IAAI,EACJ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,IAAA,4CAAqB,EAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,WAAC,OAAA,MAAA,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,IAAI,0CAAE,WAAW,EAAE,CAAA,EAAA,CAAC,CAClG,CAAC;QACF,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;YAC7B,IAAI,MAAM,CAAC,MAAM,EAAE;gBAClB,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this combat only.\r\n *\r\n * Golden Expert Aviator (Tier 2, 6/8)\r\n * Rally: Summon the two highest-Attack minions from your hand for this combat only.\r\n */\r\nimport { Race } from '@firestone-hs/reference-data';\r\nimport { BoardEntity } from '../../../board-entity';\r\nimport { CardIds } from '../../../services/card-ids';\r\nimport { getHighestAttackHandMinions, isHandMinionCandidate } from '../../../services/hand-minion-priority';\r\nimport { removeAurasFromSelf } from '../../../simulation/add-minion-to-board';\r\nimport { DeathrattleTriggeredInput } from '../../../simulation/deathrattle-on-trigger';\r\nimport { simplifiedSpawnEntities } from '../../../simulation/deathrattle-spawns';\r\nimport { OnAttackInput } from '../../../simulation/on-attack';\r\nimport { performEntitySpawns } from '../../../simulation/spawns';\r\nimport { copyEntity, hasCorrectTribe } from '../../../utils';\r\nimport { RallyCard } from '../../card.interface';\r\n\r\nexport const ExpertAviator: RallyCard = {\r\n\tcardIds: [CardIds.ExpertAviator_BG34_140, CardIds.ExpertAviator_BG34_140_G],\r\n\trally: (minion: BoardEntity, input: OnAttackInput): { dmgDoneByAttacker: number; dmgDoneByDefender: number } => {\r\n\t\tconst mult = minion.cardId === CardIds.ExpertAviator_BG34_140_G ? 2 : 1;\r\n\t\tconst allCards = input.gameState.allCards;\r\n\t\tconst candidates = input.attackingHero.hand.filter((e) =>\r\n\t\t\thasCorrectTribe(e, input.attackingHero, Race.MURLOC, input.gameState.anomalies, input.gameState.allCards),\r\n\t\t);\r\n\t\tconst targets = getHighestAttackHandMinions(\r\n\t\t\tcandidates,\r\n\t\t\tmult,\r\n\t\t\t(e) => !!e.maxHealth && isHandMinionCandidate(e, (id) => allCards.getCard(id).type?.toUpperCase()),\r\n\t\t);\r\n\t\tfor (const target of targets) {\r\n\t\t\tif (target.locked) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\ttarget.locked = true;\r\n\t\t\tconst clone = copyEntity(target);\r\n\t\t\t// The hand copy already includes its self auras. Strip them first (off-board, so\r\n\t\t\t// Automaton uses the full summoned count) and let the summon write them back from\r\n\t\t\t// the current counters. That keeps a 9/8 Automaton at 9/8, and lets Spell Siphon\r\n\t\t\t// catch up to Tavern spells cast since the gift was stored.\r\n\t\t\tremoveAurasFromSelf(\r\n\t\t\t\tclone,\r\n\t\t\t\tinput.attackingBoard,\r\n\t\t\t\tinput.attackingHero,\r\n\t\t\t\tinput.gameState,\r\n\t\t\t\ttrue,\r\n\t\t\t\ttrue,\r\n\t\t\t\tfalse,\r\n\t\t\t);\r\n\t\t\tconst spawnInput: DeathrattleTriggeredInput = {\r\n\t\t\t\tboardWithDeadEntity: input.attackingBoard,\r\n\t\t\t\tboardWithDeadEntityHero: input.attackingHero,\r\n\t\t\t\tgameState: input.gameState,\r\n\t\t\t\tdeadEntity: minion,\r\n\t\t\t\totherBoard: input.defendingBoard,\r\n\t\t\t\totherBoardHero: input.defendingHero,\r\n\t\t\t};\r\n\t\t\tconst spawns = simplifiedSpawnEntities(clone.cardId, 1, spawnInput, clone);\r\n\t\t\tfor (const s of spawns) {\r\n\t\t\t\ts.onCanceledSummon = () => (target.locked = false);\r\n\t\t\t}\r\n\t\t\tperformEntitySpawns(\r\n\t\t\t\tspawns,\r\n\t\t\t\tspawnInput.boardWithDeadEntity,\r\n\t\t\t\tspawnInput.boardWithDeadEntityHero,\r\n\t\t\t\tminion,\r\n\t\t\t\tinput.attackingBoard.length - input.attackingBoard.indexOf(minion) - 1,\r\n\t\t\t\tspawnInput.otherBoard,\r\n\t\t\t\tspawnInput.otherBoardHero,\r\n\t\t\t\tinput.gameState,\r\n\t\t\t);\r\n\t\t}\r\n\t\treturn {\r\n\t\t\tdmgDoneByAttacker: 0,\r\n\t\t\tdmgDoneByDefender: 0,\r\n\t\t};\r\n\t},\r\n};\r\n"]}
@@ -1,2 +1,2 @@
1
- import { DeathrattleEffectCard } from '../../card.interface';
2
- export declare const FacelessConverter: DeathrattleEffectCard;
1
+ import { DeathrattleEffectCard, OnGlobalInfoUpdatedCard, RebornSelfAttributeTransferCard } from '../../card.interface';
2
+ export declare const FacelessConverter: DeathrattleEffectCard & OnGlobalInfoUpdatedCard & RebornSelfAttributeTransferCard;
@@ -2,14 +2,47 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FacelessConverter = void 0;
4
4
  const deity_1 = require("../../../simulation/deity");
5
+ const baseBuff = (minion) => {
6
+ const mult = minion.cardId === "BG36_318_G" ? 2 : 1;
7
+ return { attack: 2 * mult, health: 1 * mult };
8
+ };
9
+ const deathrattleBuff = (minion, tavernSpells) => {
10
+ var _a, _b;
11
+ const base = baseBuff(minion);
12
+ if (((_a = minion.scriptDataNum1) !== null && _a !== void 0 ? _a : 0) > 0) {
13
+ return {
14
+ attack: minion.scriptDataNum1,
15
+ health: ((_b = minion.scriptDataNum2) !== null && _b !== void 0 ? _b : 0) > 0 ? minion.scriptDataNum2 : base.health,
16
+ };
17
+ }
18
+ const steps = 1 + (tavernSpells !== null && tavernSpells !== void 0 ? tavernSpells : 0);
19
+ return { attack: base.attack * steps, health: base.health * steps };
20
+ };
5
21
  exports.FacelessConverter = {
6
22
  cardIds: ["BG36_318", "BG36_318_G"],
23
+ rebornSelfAttributeTransfer: ['scriptDataNum1', 'scriptDataNum2'],
7
24
  deathrattleEffect: (minion, input) => {
8
- const mult = minion.cardId === "BG36_318_G" ? 2 : 1;
9
- const base = 1 + input.boardWithDeadEntityHero.globalInfo.TavernSpellsCastThisGame;
10
- const atk = 2 * mult * base;
11
- const hp = 1 * mult * base;
12
- (0, deity_1.buffYourDeity)(input.boardWithDeadEntityHero, input.boardWithDeadEntity, minion, atk, hp, input.gameState);
25
+ const { attack, health } = deathrattleBuff(minion, input.boardWithDeadEntityHero.globalInfo.TavernSpellsCastThisGame);
26
+ (0, deity_1.buffYourDeity)(input.boardWithDeadEntityHero, input.boardWithDeadEntity, minion, attack, health, input.gameState);
27
+ },
28
+ onGlobalInfoUpdated: (entity, input) => {
29
+ var _a, _b;
30
+ if (!(((_a = entity.scriptDataNum1) !== null && _a !== void 0 ? _a : 0) > 0)) {
31
+ return;
32
+ }
33
+ const base = baseBuff(entity);
34
+ for (const value of input.values) {
35
+ if (value.type !== 'TavernSpellsCastThisGame') {
36
+ continue;
37
+ }
38
+ const delta = value.newValue - value.oldValue;
39
+ if (!delta) {
40
+ continue;
41
+ }
42
+ entity.scriptDataNum1 += base.attack * delta;
43
+ const health = ((_b = entity.scriptDataNum2) !== null && _b !== void 0 ? _b : 0) > 0 ? entity.scriptDataNum2 : base.health;
44
+ entity.scriptDataNum2 = health + base.health * delta;
45
+ }
13
46
  },
14
47
  };
15
48
  //# sourceMappingURL=faceless-converter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"faceless-converter.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/faceless-converter.ts"],"names":[],"mappings":";;;AAUA,qDAA0D;AAG7C,QAAA,iBAAiB,GAA0B;IACvD,OAAO,EAAE,0BAA0E;IACnF,iBAAiB,EAAE,CAAC,MAAmB,EAAE,KAAgC,EAAE,EAAE;QAC5E,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,iBAAyC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5E,MAAM,IAAI,GAAG,CAAC,GAAG,KAAK,CAAC,uBAAuB,CAAC,UAAU,CAAC,wBAAwB,CAAC;QACnF,MAAM,GAAG,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;QAC5B,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;QAC3B,IAAA,qBAAa,EAAC,KAAK,CAAC,uBAAuB,EAAE,KAAK,CAAC,mBAAmB,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAC3G,CAAC;CACD,CAAC","sourcesContent":["/**\r\n * Faceless Converter (Tier 5, 5/5)\r\n * Deathrattle: Give your Deity +1/+1 (improved by each Tavern spell you've cast this game).\r\n *\r\n * Golden Faceless Converter (Tier 5, 10/10)\r\n * Deathrattle: Give your Deity +2/+2 (improved by each Tavern spell you've cast this game).\r\n */\r\nimport { BoardEntity } from '../../../board-entity';\r\nimport { CardIds } from '../../../services/card-ids';\r\nimport { DeathrattleTriggeredInput } from '../../../simulation/deathrattle-on-trigger';\r\nimport { buffYourDeity } from '../../../simulation/deity';\r\nimport { DeathrattleEffectCard } from '../../card.interface';\r\n\r\nexport const FacelessConverter: DeathrattleEffectCard = {\r\n\tcardIds: [CardIds.FacelessConverter_BG36_318, CardIds.FacelessConverter_BG36_318_G],\r\n\tdeathrattleEffect: (minion: BoardEntity, input: DeathrattleTriggeredInput) => {\r\n\t\tconst mult = minion.cardId === CardIds.FacelessConverter_BG36_318_G ? 2 : 1;\r\n\t\tconst base = 1 + input.boardWithDeadEntityHero.globalInfo.TavernSpellsCastThisGame;\r\n\t\tconst atk = 2 * mult * base;\r\n\t\tconst hp = 1 * mult * base;\r\n\t\tbuffYourDeity(input.boardWithDeadEntityHero, input.boardWithDeadEntity, minion, atk, hp, input.gameState);\r\n\t},\r\n};\r\n"]}
1
+ {"version":3,"file":"faceless-converter.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/faceless-converter.ts"],"names":[],"mappings":";;;AAgBA,qDAA0D;AAG1D,MAAM,QAAQ,GAAG,CAAC,MAAmB,EAAsC,EAAE;IAC5E,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,iBAAyC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5E,OAAO,EAAE,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC;AAC/C,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,MAAmB,EAAE,YAAoB,EAAsC,EAAE;;IACzG,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC9B,IAAI,CAAC,MAAA,MAAM,CAAC,cAAc,mCAAI,CAAC,CAAC,GAAG,CA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AAK,0BAA0B,EAAE;gBAC9C,SAAS;aACT;YACD,MAAM,KAAK,GAAG,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;YAC9C,IAAI,CAAC,KAAK,EAAE;gBACX,SAAS;aACT;YACD,MAAM,CAAC,cAAc,IAAI,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;YAC7C,MAAM,MAAM,GAAG,CAAC,MAAA,MAAM,CAAC,cAAc,mCAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;YACtF,MAAM,CAAC,cAAc,GAAG,MAAM,GAAG,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;SACrD;IACF,CAAC;CACD,CAAC","sourcesContent":["/**\r\n * Faceless Converter (Tier 5, 5/5)\r\n * Deathrattle: Give your Deity +2/+1 (improved by each Tavern spell you've cast this game).\r\n *\r\n * Golden Faceless Converter (Tier 5, 10/10)\r\n * Deathrattle: Give your Deity +4/+2 (improved by each Tavern spell you've cast this game).\r\n *\r\n * The improved amounts live on scriptDataNum1 / scriptDataNum2 (+2/+1 per spell, doubled if golden).\r\n * Combat payloads often leave TavernSpellsCastThisGame at 0, so the stored values are the buff.\r\n * A tavern spell cast in combat adds another step to a copy that already has them.\r\n * Reborn clears scriptDataNum1, so the stored buff is copied onto the new body.\r\n */\r\nimport { BoardEntity } from '../../../board-entity';\r\nimport { OnGlobalInfoUpdatedInput } from '../../../mechanics/player-global-effects';\r\nimport { CardIds } from '../../../services/card-ids';\r\nimport { DeathrattleTriggeredInput } from '../../../simulation/deathrattle-on-trigger';\r\nimport { buffYourDeity } from '../../../simulation/deity';\r\nimport { DeathrattleEffectCard, OnGlobalInfoUpdatedCard, RebornSelfAttributeTransferCard } from '../../card.interface';\r\n\r\nconst baseBuff = (minion: BoardEntity): { attack: number; health: number } => {\r\n\tconst mult = minion.cardId === CardIds.FacelessConverter_BG36_318_G ? 2 : 1;\r\n\treturn { attack: 2 * mult, health: 1 * mult };\r\n};\r\n\r\nconst deathrattleBuff = (minion: BoardEntity, tavernSpells: number): { attack: number; health: number } => {\r\n\tconst base = baseBuff(minion);\r\n\tif ((minion.scriptDataNum1 ?? 0) > 0) {\r\n\t\treturn {\r\n\t\t\tattack: minion.scriptDataNum1,\r\n\t\t\thealth: (minion.scriptDataNum2 ?? 0) > 0 ? minion.scriptDataNum2 : base.health,\r\n\t\t};\r\n\t}\r\n\tconst steps = 1 + (tavernSpells ?? 0);\r\n\treturn { attack: base.attack * steps, health: base.health * steps };\r\n};\r\n\r\nexport const FacelessConverter: DeathrattleEffectCard &\r\n\tOnGlobalInfoUpdatedCard &\r\n\tRebornSelfAttributeTransferCard = {\r\n\tcardIds: [CardIds.FacelessConverter_BG36_318, CardIds.FacelessConverter_BG36_318_G],\r\n\trebornSelfAttributeTransfer: ['scriptDataNum1', 'scriptDataNum2'],\r\n\tdeathrattleEffect: (minion: BoardEntity, input: DeathrattleTriggeredInput) => {\r\n\t\tconst { attack, health } = deathrattleBuff(\r\n\t\t\tminion,\r\n\t\t\tinput.boardWithDeadEntityHero.globalInfo.TavernSpellsCastThisGame,\r\n\t\t);\r\n\t\tbuffYourDeity(input.boardWithDeadEntityHero, input.boardWithDeadEntity, minion, attack, health, input.gameState);\r\n\t},\r\n\tonGlobalInfoUpdated: (entity: BoardEntity, input: OnGlobalInfoUpdatedInput) => {\r\n\t\t// An unset copy still uses the spell counter in the deathrattle. Writing a partial\r\n\t\t// step here would hide the base +2/+1.\r\n\t\tif (!((entity.scriptDataNum1 ?? 0) > 0)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tconst base = baseBuff(entity);\r\n\t\tfor (const value of input.values) {\r\n\t\t\tif (value.type !== 'TavernSpellsCastThisGame') {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tconst delta = value.newValue - value.oldValue;\r\n\t\t\tif (!delta) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tentity.scriptDataNum1 += base.attack * delta;\r\n\t\t\tconst health = (entity.scriptDataNum2 ?? 0) > 0 ? entity.scriptDataNum2 : base.health;\r\n\t\t\tentity.scriptDataNum2 = health + base.health * delta;\r\n\t\t}\r\n\t},\r\n};\r\n"]}
@@ -3,22 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.JailbirdJuggernaut = void 0;
4
4
  const deathrattle_spawns_1 = require("../../../simulation/deathrattle-spawns");
5
5
  const spawns_1 = require("../../../simulation/spawns");
6
- const BLOOD_GEM_ENCHANTMENTS = ["BG20_GEMe", "BG20_GEMe2"];
7
- const getBloodGemStats = (minion) => {
8
- var _a;
9
- const enchantments = ((_a = minion.enchantments) !== null && _a !== void 0 ? _a : []).filter((e) => BLOOD_GEM_ENCHANTMENTS.includes(e.cardId));
10
- return {
11
- attack: Math.max(0, ...enchantments.map((e) => { var _a; return (_a = e.tagScriptDataNum1) !== null && _a !== void 0 ? _a : 0; })),
12
- health: Math.max(0, ...enchantments.map((e) => { var _a; return (_a = e.tagScriptDataNum2) !== null && _a !== void 0 ? _a : 0; })),
13
- };
14
- };
15
6
  exports.JailbirdJuggernaut = {
16
7
  cardIds: ["BG36_333", "BG36_333_G"],
17
8
  rally: (minion, input) => {
18
9
  if (!input.defendingEntity) {
19
10
  return { dmgDoneByAttacker: 0, dmgDoneByDefender: 0 };
20
11
  }
21
- const { attack, health } = { attack: input.attacker.maxAttack, health: input.attacker.maxHealth };
12
+ const attack = input.attacker.attack;
13
+ const health = input.attacker.health;
22
14
  const mult = minion.cardId === "BG36_333_G" ? 2 : 1;
23
15
  const spawnInput = {
24
16
  boardWithDeadEntity: input.attackingBoard,
@@ -36,10 +28,11 @@ exports.JailbirdJuggernaut = {
36
28
  spawn.maxHealth = health * mult;
37
29
  spawn.attackImmediately = true;
38
30
  });
39
- const spawned = (0, spawns_1.performEntitySpawns)(spawns, input.attackingBoard, input.attackingHero, input.attacker, input.attackingBoard.length - input.attackingBoard.indexOf(input.attacker) - 1, input.defendingBoard, input.defendingHero, input.gameState, true, input.defendingEntity);
40
- spawned.forEach((e) => {
41
- e.hasAttacked = undefined;
42
- });
31
+ (0, spawns_1.performEntitySpawns)(spawns, input.attackingBoard, input.attackingHero, input.attacker, input.attackingBoard.length - input.attackingBoard.indexOf(input.attacker) - 1, input.defendingBoard, input.defendingHero, input.gameState, true, input.defendingEntity);
32
+ const defender = input.defendingEntity;
33
+ if (spawns.length > 0 && (defender.health <= 0 || defender.definitelyDead)) {
34
+ input.attacker.skipAttackDamage = true;
35
+ }
43
36
  return { dmgDoneByAttacker: 0, dmgDoneByDefender: 0 };
44
37
  },
45
38
  };
@@ -1 +1 @@
1
- {"version":3,"file":"jailbird-juggernaut.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/jailbird-juggernaut.ts"],"names":[],"mappings":";;;AAaA,+EAAiF;AAEjF,uDAAiE;AAIjE,MAAM,sBAAsB,GAAa,2BAA6E,CAAC;AAEvH,MAAM,gBAAgB,GAAG,CAAC,MAAmB,EAAsC,EAAE;;IACpF,MAAM,YAAY,GAAG,CAAC,MAAA,MAAM,CAAC,YAAY,mCAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,sBAAsB,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;IAC1G,OAAO;QACN,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,WAAC,OAAA,MAAA,CAAC,CAAC,iBAAiB,mCAAI,CAAC,CAAA,EAAA,CAAC,CAAC;QACzE,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,WAAC,OAAA,MAAA,CAAC,CAAC,iBAAiB,mCAAI,CAAC,CAAA,EAAA,CAAC,CA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,IAAA,4BAAmB,EAClC,MAAM,EACN,KAAK,CAAC,cAAc,EACpB,KAAK,CAAC,aAAa,EACnB,KAAK,CAAC,QAAQ,EACd,KAAK,CAAC,cAAc,CAAC,MAAM,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAC9E,KAAK,CAAC,cAAc,EACpB,KAAK,CAAC,aAAa,EACnB,KAAK,CAAC,SAAS,EACf,IAAI,EACJ,KAAK,CAAC,eAAe,CACrB,CAAC;QACF,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;YACrB,CAAC,CAAC,WAAW,GAAG,SAAS,CAAC;QAC3B,CAAC,CAAC,CAAC;QACH,OAAO,EAAE,iBAAiB,EAAE,CAAC,EAAE,iBAAiB,EAAE,CAAC,EAAE,CAAC;IACvD,CAAC;CACD,CAAC","sourcesContent":["/**\r\n * Jailbird Juggernaut (Tier 5, 2/7)\r\n * Rally: Summon a Golem with stats equal to this minion's Blood Gems to attack the target first.\r\n *\r\n * Golden Jailbird Juggernaut (Tier 5, 4/14)\r\n * Rally: Summon two Golems with stats equal to this minion's Blood Gems to attack the target first.\r\n *\r\n * The Blood Gem totals are tracked on the Blood Gem enchantments, which hold the accumulated attack\r\n * and health granted to the minion.\r\n */\r\nimport { 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 { OnAttackInput } from '../../../simulation/on-attack';\r\nimport { performEntitySpawns } from '../../../simulation/spawns';\r\nimport { RallyCard } from '../../card.interface';\r\n\r\n// The two enchantments mirror each other, so we take the highest rather than the sum\r\nconst BLOOD_GEM_ENCHANTMENTS: string[] = [CardIds.BloodGem_BloodGemEnchantment, CardIds.BloodGem_BloodGemsEnchantment];\r\n\r\nconst getBloodGemStats = (minion: BoardEntity): { attack: number; health: number } => {\r\n\tconst enchantments = (minion.enchantments ?? []).filter((e) => BLOOD_GEM_ENCHANTMENTS.includes(e.cardId));\r\n\treturn {\r\n\t\tattack: Math.max(0, ...enchantments.map((e) => e.tagScriptDataNum1 ?? 0)),\r\n\t\thealth: Math.max(0, ...enchantments.map((e) => e.tagScriptDataNum2 ?? 0)),\r\n\t};\r\n};\r\n\r\nexport const JailbirdJuggernaut: RallyCard = {\r\n\tcardIds: [CardIds.JailbirdJuggernaut_BG36_333, CardIds.JailbirdJuggernaut_BG36_333_G],\r\n\trally: (minion: BoardEntity, input: OnAttackInput) => {\r\n\t\tif (!input.defendingEntity) {\r\n\t\t\treturn { dmgDoneByAttacker: 0, dmgDoneByDefender: 0 };\r\n\t\t}\r\n\r\n\t\tconst { attack, health } = { attack: input.attacker.maxAttack, health: input.attacker.maxHealth };\r\n\t\tconst mult = minion.cardId === CardIds.JailbirdJuggernaut_BG36_333_G ? 2 : 1;\r\n\t\tconst spawnInput: DeathrattleTriggeredInput = {\r\n\t\t\tboardWithDeadEntity: input.attackingBoard,\r\n\t\t\tboardWithDeadEntityHero: input.attackingHero,\r\n\t\t\tdeadEntity: input.attacker,\r\n\t\t\totherBoard: input.defendingBoard,\r\n\t\t\totherBoardHero: input.defendingHero,\r\n\t\t\tgameState: input.gameState,\r\n\t\t};\r\n\t\tconst spawns = simplifiedSpawnEntities(\r\n\t\t\tCardIds.BloodGolemSticker_BloodGolemToken_BG30_MagicItem_442t,\r\n\t\t\t1,\r\n\t\t\tspawnInput,\r\n\t\t);\r\n\t\tspawns.forEach((spawn) => {\r\n\t\t\tspawn.attack = attack * mult;\r\n\t\t\tspawn.maxAttack = attack * mult;\r\n\t\t\tspawn.health = health * mult;\r\n\t\t\tspawn.maxHealth = health * mult;\r\n\t\t\tspawn.attackImmediately = true;\r\n\t\t});\r\n\t\tconst spawned = performEntitySpawns(\r\n\t\t\tspawns,\r\n\t\t\tinput.attackingBoard,\r\n\t\t\tinput.attackingHero,\r\n\t\t\tinput.attacker,\r\n\t\t\tinput.attackingBoard.length - input.attackingBoard.indexOf(input.attacker) - 1,\r\n\t\t\tinput.defendingBoard,\r\n\t\t\tinput.defendingHero,\r\n\t\t\tinput.gameState,\r\n\t\t\ttrue,\r\n\t\t\tinput.defendingEntity,\r\n\t\t);\r\n\t\tspawned.forEach((e) => {\r\n\t\t\te.hasAttacked = undefined;\r\n\t\t});\r\n\t\treturn { dmgDoneByAttacker: 0, dmgDoneByDefender: 0 };\r\n\t},\r\n};\r\n"]}
1
+ {"version":3,"file":"jailbird-juggernaut.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/jailbird-juggernaut.ts"],"names":[],"mappings":";;;AAcA,+EAAiF;AAEjF,uDAAiE;AAGpD,QAAA,kBAAkB,GAAc;IAC5C,OAAO,EAAE,0BAA4E;IACrF,KAAK,EAAE,CAAC,MAAmB,EAAE,KAAoB,EAAE,EAAE;QACpD,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE;YAC3B,OAAO,EAAE,iBAAiB,EAAE,CAAC,EAAE,iBAAiB,EAAE,CAAC,EAAE,CAAC;SACtD;QAED,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;QACrC,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;QACrC,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,iBAA0C,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7E,MAAM,UAAU,GAA8B;YAC7C,mBAAmB,EAAE,KAAK,CAAC,cAAc;YACzC,uBAAuB,EAAE,KAAK,CAAC,aAAa;YAC5C,UAAU,EAAE,KAAK,CAAC,QAAQ;YAC1B,UAAU,EAAE,KAAK,CAAC,cAAc;YAChC,cAAc,EAAE,KAAK,CAAC,aAAa;YACnC,SAAS,EAAE,KAAK,CAAC,SAAS;SAC1B,CAAC;QACF,MAAM,MAAM,GAAG,IAAA,4CAAuB,yBAErC,CAAC,EACD,UAAU,CACV,CAAC;QACF,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;YACxB,KAAK,CAAC,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;YAC7B,KAAK,CAAC,SAAS,GAAG,MAAM,GAAG,IAAI,CAAC;YAChC,KAAK,CAAC,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;YAC7B,KAAK,CAAC,SAAS,GAAG,MAAM,GAAG,IAAI,CAAC;YAChC,KAAK,CAAC,iBAAiB,GAAG,IAAI,CAAC;QAChC,CAAC,CAAC,CAAC;QACH,IAAA,4BAAmB,EAClB,MAAM,EACN,KAAK,CAAC,cAAc,EACpB,KAAK,CAAC,aAAa,EACnB,KAAK,CAAC,QAAQ,EACd,KAAK,CAAC,cAAc,CAAC,MAAM,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAC9E,KAAK,CAAC,cAAc,EACpB,KAAK,CAAC,aAAa,EACnB,KAAK,CAAC,SAAS,EACf,IAAI,EACJ,KAAK,CAAC,eAAe,CACrB,CAAC;QAGF,MAAM,QAAQ,GAAG,KAAK,CAAC,eAAe,CAAC;QACvC,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,IAAI,CAAC,IAAI,QAAQ,CAAC,cAAc,CAAC,EAAE;YAC3E,KAAK,CAAC,QAAQ,CAAC,gBAAgB,GAAG,IAAI,CAAC;SACvC;QACD,OAAO,EAAE,iBAAiB,EAAE,CAAC,EAAE,iBAAiB,EAAE,CAAC,EAAE,CAAC;IACvD,CAAC;CACD,CAAC","sourcesContent":["/**\r\n * Jailbird Juggernaut (Tier 5, 6/15)\r\n * Rally: Summon a Golem with this minion's stats to attack the target first.\r\n *\r\n * Golden Jailbird Juggernaut\r\n * Rally: Summon a Golem with double this minion's stats to attack the target first.\r\n *\r\n * The golem copies current attack and health, attacks the target, and is exhausted.\r\n * If that target is still alive, Jailbird's own damage exchange still happens,\r\n * including when the golem died on its attack. The swing still counts.\r\n */\r\nimport { 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 { OnAttackInput } from '../../../simulation/on-attack';\r\nimport { performEntitySpawns } from '../../../simulation/spawns';\r\nimport { RallyCard } from '../../card.interface';\r\n\r\nexport const JailbirdJuggernaut: RallyCard = {\r\n\tcardIds: [CardIds.JailbirdJuggernaut_BG36_333, CardIds.JailbirdJuggernaut_BG36_333_G],\r\n\trally: (minion: BoardEntity, input: OnAttackInput) => {\r\n\t\tif (!input.defendingEntity) {\r\n\t\t\treturn { dmgDoneByAttacker: 0, dmgDoneByDefender: 0 };\r\n\t\t}\r\n\r\n\t\tconst attack = input.attacker.attack;\r\n\t\tconst health = input.attacker.health;\r\n\t\tconst mult = minion.cardId === CardIds.JailbirdJuggernaut_BG36_333_G ? 2 : 1;\r\n\t\tconst spawnInput: DeathrattleTriggeredInput = {\r\n\t\t\tboardWithDeadEntity: input.attackingBoard,\r\n\t\t\tboardWithDeadEntityHero: input.attackingHero,\r\n\t\t\tdeadEntity: input.attacker,\r\n\t\t\totherBoard: input.defendingBoard,\r\n\t\t\totherBoardHero: input.defendingHero,\r\n\t\t\tgameState: input.gameState,\r\n\t\t};\r\n\t\tconst spawns = simplifiedSpawnEntities(\r\n\t\t\tCardIds.BloodGolemSticker_BloodGolemToken_BG30_MagicItem_442t,\r\n\t\t\t1,\r\n\t\t\tspawnInput,\r\n\t\t);\r\n\t\tspawns.forEach((spawn) => {\r\n\t\t\tspawn.attack = attack * mult;\r\n\t\t\tspawn.maxAttack = attack * mult;\r\n\t\t\tspawn.health = health * mult;\r\n\t\t\tspawn.maxHealth = health * mult;\r\n\t\t\tspawn.attackImmediately = true;\r\n\t\t});\r\n\t\tperformEntitySpawns(\r\n\t\t\tspawns,\r\n\t\t\tinput.attackingBoard,\r\n\t\t\tinput.attackingHero,\r\n\t\t\tinput.attacker,\r\n\t\t\tinput.attackingBoard.length - input.attackingBoard.indexOf(input.attacker) - 1,\r\n\t\t\tinput.defendingBoard,\r\n\t\t\tinput.defendingHero,\r\n\t\t\tinput.gameState,\r\n\t\t\ttrue,\r\n\t\t\tinput.defendingEntity,\r\n\t\t);\r\n\t\t// The golem's attack already resolved. Jailbird still trades when the target\r\n\t\t// survived, including when the golem died. A dead target ends the swing.\r\n\t\tconst defender = input.defendingEntity;\r\n\t\tif (spawns.length > 0 && (defender.health <= 0 || defender.definitelyDead)) {\r\n\t\t\tinput.attacker.skipAttackDamage = true;\r\n\t\t}\r\n\t\treturn { dmgDoneByAttacker: 0, dmgDoneByDefender: 0 };\r\n\t},\r\n};\r\n"]}
@@ -1,3 +1,3 @@
1
1
  import { BoardEntity } from '../../../board-entity';
2
- export declare const buildSinrunnerBlanchyRebornEntity: (deadEntity: BoardEntity) => BoardEntity;
2
+ export declare const buildSinrunnerBlanchyRebornEntity: (deadEntity: BoardEntity, keepEnchantments?: boolean) => BoardEntity;
3
3
  export declare const isSinrunnerBlanchy: (cardId: string) => boolean;
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isSinrunnerBlanchy = exports.buildSinrunnerBlanchyRebornEntity = void 0;
4
- const buildSinrunnerBlanchyRebornEntity = (deadEntity) => {
4
+ const buildSinrunnerBlanchyRebornEntity = (deadEntity, keepEnchantments = false) => {
5
+ var _a;
5
6
  return {
6
7
  ...deadEntity,
7
8
  hasAttacked: undefined,
@@ -10,6 +11,7 @@ const buildSinrunnerBlanchyRebornEntity = (deadEntity) => {
10
11
  reborn: false,
11
12
  venomous: deadEntity.venomous || deadEntity.hadVenomous,
12
13
  stealth: deadEntity.stealth || deadEntity.hadStealth,
14
+ enchantments: keepEnchantments ? [...((_a = deadEntity.enchantments) !== null && _a !== void 0 ? _a : [])] : [],
13
15
  };
14
16
  };
15
17
  exports.buildSinrunnerBlanchyRebornEntity = buildSinrunnerBlanchyRebornEntity;
@@ -1 +1 @@
1
- {"version":3,"file":"sinrunner-blanchy.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/sinrunner-blanchy.ts"],"names":[],"mappings":";;;AAIO,MAAM,iCAAiC,GAAG,CAAC,UAAuB,EAAe,EAAE;IACzF,OAAO;QACN,GAAG,UAAU;QACb,WAAW,EAAE,SAAS;QACtB,MAAM,EAAE,UAAU,CAAC,SAAS;QAC5B,YAAY,EAAE,UAAU,CAAC,eAAe;QACxC,MAAM,EAAE,KAAK;QACb,QAAQ,EAAE,UAAU,CAAC,QAAQ,IAAI,UAAU,CAAC,WAAW;QACvD,OAAO,EAAE,UAAU,CAAC,OAAO,IAAI,UAAU,CAAC,UAAU;KACpD,CAAC;AACH,CAAC,CAAC;AAVW,QAAA,iCAAiC,qCAU5C;AAEK,MAAM,kBAAkB,GAAG,CAAC,MAAc,EAAW,EAAE,CAC7D,MAAM,eAAsC,IAAI,MAAM,iBAAwC,CAAC;AADnF,QAAA,kBAAkB,sBACiE","sourcesContent":["import { BoardEntity } from '../../../board-entity';\r\nimport { CardIds } from '../../../services/card-ids';\r\n\r\n/** Reborn with full stats and bonus keywords (enchantments stripped by spread + fresh entity). */\r\nexport const buildSinrunnerBlanchyRebornEntity = (deadEntity: BoardEntity): BoardEntity => {\r\n\treturn {\r\n\t\t...deadEntity,\r\n\t\thasAttacked: undefined,\r\n\t\thealth: deadEntity.maxHealth,\r\n\t\tdivineShield: deadEntity.hadDivineShield,\r\n\t\treborn: false,\r\n\t\tvenomous: deadEntity.venomous || deadEntity.hadVenomous,\r\n\t\tstealth: deadEntity.stealth || deadEntity.hadStealth,\r\n\t};\r\n};\r\n\r\nexport const isSinrunnerBlanchy = (cardId: string): boolean =>\r\n\tcardId === CardIds.SinrunnerBlanchy_BG24_005 || cardId === CardIds.SinrunnerBlanchy_BG24_005_G;\r\n"]}
1
+ {"version":3,"file":"sinrunner-blanchy.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/sinrunner-blanchy.ts"],"names":[],"mappings":";;;AAQO,MAAM,iCAAiC,GAAG,CAChD,UAAuB,EACvB,gBAAgB,GAAG,KAAK,EACV,EAAE;;IAChB,OAAO;QACN,GAAG,UAAU;QACb,WAAW,EAAE,SAAS;QACtB,MAAM,EAAE,UAAU,CAAC,SAAS;QAC5B,YAAY,EAAE,UAAU,CAAC,eAAe;QACxC,MAAM,EAAE,KAAK;QACb,QAAQ,EAAE,UAAU,CAAC,QAAQ,IAAI,UAAU,CAAC,WAAW;QACvD,OAAO,EAAE,UAAU,CAAC,OAAO,IAAI,UAAU,CAAC,UAAU;QACpD,YAAY,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAA,UAAU,CAAC,YAAY,mCAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;KAC1E,CAAC;AACH,CAAC,CAAC;AAdW,QAAA,iCAAiC,qCAc5C;AAEK,MAAM,kBAAkB,GAAG,CAAC,MAAc,EAAW,EAAE,CAC7D,MAAM,eAAsC,IAAI,MAAM,iBAAwC,CAAC;AADnF,QAAA,kBAAkB,sBACiE","sourcesContent":["import { BoardEntity } from '../../../board-entity';\r\nimport { CardIds } from '../../../services/card-ids';\r\n\r\n/**\r\n * Reborn with full stats and bonus keywords.\r\n * Keyword flags stay on the entity. Deathrattle and other enchantments do not,\r\n * except Ultra-Capacitor, which reborns with its enchantments.\r\n */\r\nexport const buildSinrunnerBlanchyRebornEntity = (\r\n\tdeadEntity: BoardEntity,\r\n\tkeepEnchantments = false,\r\n): BoardEntity => {\r\n\treturn {\r\n\t\t...deadEntity,\r\n\t\thasAttacked: undefined,\r\n\t\thealth: deadEntity.maxHealth,\r\n\t\tdivineShield: deadEntity.hadDivineShield,\r\n\t\treborn: false,\r\n\t\tvenomous: deadEntity.venomous || deadEntity.hadVenomous,\r\n\t\tstealth: deadEntity.stealth || deadEntity.hadStealth,\r\n\t\tenchantments: keepEnchantments ? [...(deadEntity.enchantments ?? [])] : [],\r\n\t};\r\n};\r\n\r\nexport const isSinrunnerBlanchy = (cardId: string): boolean =>\r\n\tcardId === CardIds.SinrunnerBlanchy_BG24_005 || cardId === CardIds.SinrunnerBlanchy_BG24_005_G;\r\n"]}
@@ -10,7 +10,7 @@ exports.WildfireElemental = {
10
10
  return { dmgDoneByAttacker: 0, dmgDoneByDefender: 0 };
11
11
  }
12
12
  const hadVenomous = input.hadVenomous;
13
- const excessDamage = -input.minionKilled.health;
13
+ const excessDamage = Math.max(0, -input.minionKilled.health);
14
14
  let damageDoneByAttacker = 0;
15
15
  if (input.defenderNeighbours.length > 0) {
16
16
  if (minion.cardId === "BGS_126") {
@@ -1 +1 @@
1
- {"version":3,"file":"wildfire-elemental.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/wildfire-elemental.ts"],"names":[],"mappings":";;;AAEA,mDAAqD;AACrD,uDAAqF;AAGxE,QAAA,iBAAiB,GAAuB;IACpD,OAAO,EAAE,8BAA8E;IACvF,cAAc,EAAE,CACf,MAAmB,EACnB,KAA0B,EACiC,EAAE;QAC7D,IAAI,KAAK,CAAC,MAAM,KAAK,MAAM,IAAI,CAAC,KAAK,CAAC,iBAAiB,EAAE;YACxD,OAAO,EAAE,iBAAiB,EAAE,CAAC,EAAE,iBAAiB,EAAE,CAAC,EAAE,CAAC;SACtD;QAED,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;QACtC,MAAM,YAAY,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC;QAChD,IAAI,oBAAoB,GAAG,CAAC,CAAC;QAE7B,IAAI,KAAK,CAAC,kBAAkB,CAAC,MAAM,GAAG,CAAC,EAAE;YACxC,IAAI,MAAM,CAAC,MAAM,cAAsC,EAAE;gBACxD,MAAM,YAAY,GAAG,IAAA,kBAAU,EAAC,KAAK,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC;gBAClE,KAAK,CAAC,YAAY,CAAC,oBAAoB,CAAC,QAAQ,GAAG,WAAW,CAAC;gBAC/D,oBAAoB,IAAI,IAAA,2BAAkB,EACzC,YAAY,EACZ,KAAK,CAAC,cAAc,EACpB,KAAK,CAAC,aAAa,EACnB,KAAK,CAAC,YAAY,CAAC,oBAAoB,EACvC,YAAY,EACZ,KAAK,CAAC,cAAc,EACpB,KAAK,CAAC,aAAa,EACnB,KAAK,CAAC,SAAS,CACf,CAAC;gBACF,KAAK,CAAC,YAAY,CAAC,oBAAoB,CAAC,QAAQ,GAAG,KAAK,CAAC;aACzD;iBAAM;gBACN,KAAK,MAAM,SAAS,IAAI,KAAK,CAAC,kBAAkB,EAAE;oBACjD,KAAK,CAAC,YAAY,CAAC,oBAAoB,CAAC,QAAQ,GAAG,WAAW,CAAC;oBAC/D,oBAAoB,IAAI,IAAA,2BAAkB,EACzC,SAAS,EACT,KAAK,CAAC,cAAc,EACpB,KAAK,CAAC,aAAa,EACnB,KAAK,CAAC,YAAY,CAAC,oBAAoB,EACvC,YAAY,EACZ,KAAK,CAAC,cAAc,EACpB,KAAK,CAAC,aAAa,EACnB,KAAK,CAAC,SAAS,CACf,CAAC;oBACF,KAAK,CAAC,YAAY,CAAC,oBAAoB,CAAC,QAAQ,GAAG,KAAK,CAAC;iBACzD;aACD;SACD;QACD,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,CAAC,EAAE,CAAC;IAC1E,CAAC;CACD,CAAC","sourcesContent":["import { BoardEntity } from '../../../board-entity';\r\nimport { CardIds } from '../../../services/card-ids';\r\nimport { pickRandom } from '../../../services/utils';\r\nimport { dealDamageToMinion, OnMinionKilledInput } from '../../../simulation/attack';\r\nimport { OnMinionKilledCard } from '../../card.interface';\r\n\r\nexport const WildfireElemental: OnMinionKilledCard = {\r\n\tcardIds: [CardIds.WildfireElemental_BGS_126, CardIds.WildfireElemental_TB_BaconUps_166],\r\n\tonMinionKilled: (\r\n\t\tminion: BoardEntity,\r\n\t\tinput: OnMinionKilledInput,\r\n\t): { dmgDoneByAttacker: number; dmgDoneByDefender: number } => {\r\n\t\tif (input.killer !== minion || !input.killerIsAttacking) {\r\n\t\t\treturn { dmgDoneByAttacker: 0, dmgDoneByDefender: 0 };\r\n\t\t}\r\n\r\n\t\tconst hadVenomous = input.hadVenomous;\r\n\t\tconst excessDamage = -input.minionKilled.health;\r\n\t\tlet damageDoneByAttacker = 0;\r\n\t\t// console.log('neighbours', stringifySimple(neighbours, allCards));\r\n\t\tif (input.defenderNeighbours.length > 0) {\r\n\t\t\tif (minion.cardId === CardIds.WildfireElemental_BGS_126) {\r\n\t\t\t\tconst randomTarget = pickRandom(input.defenderNeighbours, minion);\r\n\t\t\t\tinput.minionKilled.lastAffectedByEntity.venomous = hadVenomous;\r\n\t\t\t\tdamageDoneByAttacker += dealDamageToMinion(\r\n\t\t\t\t\trandomTarget,\r\n\t\t\t\t\tinput.defendingBoard,\r\n\t\t\t\t\tinput.defendingHero,\r\n\t\t\t\t\tinput.minionKilled.lastAffectedByEntity,\r\n\t\t\t\t\texcessDamage,\r\n\t\t\t\t\tinput.attackingBoard,\r\n\t\t\t\t\tinput.attackingHero,\r\n\t\t\t\t\tinput.gameState,\r\n\t\t\t\t);\r\n\t\t\t\tinput.minionKilled.lastAffectedByEntity.venomous = false;\r\n\t\t\t} else {\r\n\t\t\t\tfor (const neighbour of input.defenderNeighbours) {\r\n\t\t\t\t\tinput.minionKilled.lastAffectedByEntity.venomous = hadVenomous;\r\n\t\t\t\t\tdamageDoneByAttacker += dealDamageToMinion(\r\n\t\t\t\t\t\tneighbour,\r\n\t\t\t\t\t\tinput.defendingBoard,\r\n\t\t\t\t\t\tinput.defendingHero,\r\n\t\t\t\t\t\tinput.minionKilled.lastAffectedByEntity,\r\n\t\t\t\t\t\texcessDamage,\r\n\t\t\t\t\t\tinput.attackingBoard,\r\n\t\t\t\t\t\tinput.attackingHero,\r\n\t\t\t\t\t\tinput.gameState,\r\n\t\t\t\t\t);\r\n\t\t\t\t\tinput.minionKilled.lastAffectedByEntity.venomous = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn { dmgDoneByAttacker: damageDoneByAttacker, dmgDoneByDefender: 0 };\r\n\t},\r\n};\r\n"]}
1
+ {"version":3,"file":"wildfire-elemental.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/wildfire-elemental.ts"],"names":[],"mappings":";;;AAEA,mDAAqD;AACrD,uDAAqF;AAGxE,QAAA,iBAAiB,GAAuB;IACpD,OAAO,EAAE,8BAA8E;IACvF,cAAc,EAAE,CACf,MAAmB,EACnB,KAA0B,EACiC,EAAE;QAC7D,IAAI,KAAK,CAAC,MAAM,KAAK,MAAM,IAAI,CAAC,KAAK,CAAC,iBAAiB,EAAE;YACxD,OAAO,EAAE,iBAAiB,EAAE,CAAC,EAAE,iBAAiB,EAAE,CAAC,EAAE,CAAC;SACtD;QAED,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;QAItC,MAAM,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QAC7D,IAAI,oBAAoB,GAAG,CAAC,CAAC;QAE7B,IAAI,KAAK,CAAC,kBAAkB,CAAC,MAAM,GAAG,CAAC,EAAE;YACxC,IAAI,MAAM,CAAC,MAAM,cAAsC,EAAE;gBACxD,MAAM,YAAY,GAAG,IAAA,kBAAU,EAAC,KAAK,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC;gBAClE,KAAK,CAAC,YAAY,CAAC,oBAAoB,CAAC,QAAQ,GAAG,WAAW,CAAC;gBAC/D,oBAAoB,IAAI,IAAA,2BAAkB,EACzC,YAAY,EACZ,KAAK,CAAC,cAAc,EACpB,KAAK,CAAC,aAAa,EACnB,KAAK,CAAC,YAAY,CAAC,oBAAoB,EACvC,YAAY,EACZ,KAAK,CAAC,cAAc,EACpB,KAAK,CAAC,aAAa,EACnB,KAAK,CAAC,SAAS,CACf,CAAC;gBACF,KAAK,CAAC,YAAY,CAAC,oBAAoB,CAAC,QAAQ,GAAG,KAAK,CAAC;aACzD;iBAAM;gBACN,KAAK,MAAM,SAAS,IAAI,KAAK,CAAC,kBAAkB,EAAE;oBACjD,KAAK,CAAC,YAAY,CAAC,oBAAoB,CAAC,QAAQ,GAAG,WAAW,CAAC;oBAC/D,oBAAoB,IAAI,IAAA,2BAAkB,EACzC,SAAS,EACT,KAAK,CAAC,cAAc,EACpB,KAAK,CAAC,aAAa,EACnB,KAAK,CAAC,YAAY,CAAC,oBAAoB,EACvC,YAAY,EACZ,KAAK,CAAC,cAAc,EACpB,KAAK,CAAC,aAAa,EACnB,KAAK,CAAC,SAAS,CACf,CAAC;oBACF,KAAK,CAAC,YAAY,CAAC,oBAAoB,CAAC,QAAQ,GAAG,KAAK,CAAC;iBACzD;aACD;SACD;QACD,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,CAAC,EAAE,CAAC;IAC1E,CAAC;CACD,CAAC","sourcesContent":["import { BoardEntity } from '../../../board-entity';\r\nimport { CardIds } from '../../../services/card-ids';\r\nimport { pickRandom } from '../../../services/utils';\r\nimport { dealDamageToMinion, OnMinionKilledInput } from '../../../simulation/attack';\r\nimport { OnMinionKilledCard } from '../../card.interface';\r\n\r\nexport const WildfireElemental: OnMinionKilledCard = {\r\n\tcardIds: [CardIds.WildfireElemental_BGS_126, CardIds.WildfireElemental_TB_BaconUps_166],\r\n\tonMinionKilled: (\r\n\t\tminion: BoardEntity,\r\n\t\tinput: OnMinionKilledInput,\r\n\t): { dmgDoneByAttacker: number; dmgDoneByDefender: number } => {\r\n\t\tif (input.killer !== minion || !input.killerIsAttacking) {\r\n\t\t\treturn { dmgDoneByAttacker: 0, dmgDoneByDefender: 0 };\r\n\t\t}\r\n\r\n\t\tconst hadVenomous = input.hadVenomous;\r\n\t\t// Venomous and Poisonous leave health positive when they kill without overkill.\r\n\t\t// Negative \"excess\" still counts as an attack, so the splash would apply Venomous\r\n\t\t// to a neighbour that took no damage.\r\n\t\tconst excessDamage = Math.max(0, -input.minionKilled.health);\r\n\t\tlet damageDoneByAttacker = 0;\r\n\t\t// console.log('neighbours', stringifySimple(neighbours, allCards));\r\n\t\tif (input.defenderNeighbours.length > 0) {\r\n\t\t\tif (minion.cardId === CardIds.WildfireElemental_BGS_126) {\r\n\t\t\t\tconst randomTarget = pickRandom(input.defenderNeighbours, minion);\r\n\t\t\t\tinput.minionKilled.lastAffectedByEntity.venomous = hadVenomous;\r\n\t\t\t\tdamageDoneByAttacker += dealDamageToMinion(\r\n\t\t\t\t\trandomTarget,\r\n\t\t\t\t\tinput.defendingBoard,\r\n\t\t\t\t\tinput.defendingHero,\r\n\t\t\t\t\tinput.minionKilled.lastAffectedByEntity,\r\n\t\t\t\t\texcessDamage,\r\n\t\t\t\t\tinput.attackingBoard,\r\n\t\t\t\t\tinput.attackingHero,\r\n\t\t\t\t\tinput.gameState,\r\n\t\t\t\t);\r\n\t\t\t\tinput.minionKilled.lastAffectedByEntity.venomous = false;\r\n\t\t\t} else {\r\n\t\t\t\tfor (const neighbour of input.defenderNeighbours) {\r\n\t\t\t\t\tinput.minionKilled.lastAffectedByEntity.venomous = hadVenomous;\r\n\t\t\t\t\tdamageDoneByAttacker += dealDamageToMinion(\r\n\t\t\t\t\t\tneighbour,\r\n\t\t\t\t\t\tinput.defendingBoard,\r\n\t\t\t\t\t\tinput.defendingHero,\r\n\t\t\t\t\t\tinput.minionKilled.lastAffectedByEntity,\r\n\t\t\t\t\t\texcessDamage,\r\n\t\t\t\t\t\tinput.attackingBoard,\r\n\t\t\t\t\t\tinput.attackingHero,\r\n\t\t\t\t\t\tinput.gameState,\r\n\t\t\t\t\t);\r\n\t\t\t\t\tinput.minionKilled.lastAffectedByEntity.venomous = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn { dmgDoneByAttacker: damageDoneByAttacker, dmgDoneByDefender: 0 };\r\n\t},\r\n};\r\n"]}
@@ -16,11 +16,13 @@ exports.YShaarj = {
16
16
  const spawned = [];
17
17
  for (const candidate of candidates) {
18
18
  const spawns = (0, deathrattle_spawns_1.spawnEntities)(candidate.cardId, 1, input.boardWithDeadEntity, input.boardWithDeadEntityHero, input.otherBoard, input.otherBoardHero, input.gameState, minion.friendly, false, false, true);
19
+ const attack = (_a = candidate.maxAttack) !== null && _a !== void 0 ? _a : candidate.attack;
20
+ const health = (_b = candidate.maxHealth) !== null && _b !== void 0 ? _b : candidate.health;
19
21
  for (const spawn of spawns) {
20
- spawn.attack = (_a = candidate.maxAttack) !== null && _a !== void 0 ? _a : candidate.attack;
21
- spawn.maxAttack = spawn.attack;
22
- spawn.health = (_b = candidate.maxHealth) !== null && _b !== void 0 ? _b : candidate.health;
23
- spawn.maxHealth = spawn.health;
22
+ spawn.attack = attack;
23
+ spawn.maxAttack = attack;
24
+ spawn.health = health;
25
+ spawn.maxHealth = health;
24
26
  }
25
27
  spawned.push(...spawns);
26
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"yshaarj.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/yshaarj.ts"],"names":[],"mappings":";;;AAYA,+EAAuE;AACvE,qDAAsE;AAGzD,QAAA,OAAO,GAAyB;IAC5C,OAAO,EAAE,4BAAwD;IACjE,gBAAgB,EAAE,CAAC,MAAmB,EAAE,KAAgC,EAA0B,EAAE;;QACnG,MAAM,aAAa,GAAG,MAAM,CAAC,cAAc,IAAI,CAAC,MAAM,CAAC,MAAM,kBAAgC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACvG,MAAM,UAAU,GAAG,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,MAAM;aACnD,MAAM,CACN,CAAC,MAAM,EAAE,EAAE,CACV,MAAM,CAAC,QAAQ,KAAK,MAAM,CAAC,QAAQ;YACnC,CAAC,IAAA,mBAAW,EAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC;YACrD,IAAA,oBAAY,EAAC,MAAM,EAAE,KAAK,CAAC,uBAAuB,EAAE,KAAK,CAAC,SAAS,CAAC,CACrE;aACA,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC;QAC1B,MAAM,OAAO,GAAkB,EAAE,CAAC;QAClC,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE;YACnC,MAAM,MAAM,GAAG,IAAA,kCAAa,EAC3B,SAAS,CAAC,MAAM,EAChB,CAAC,EACD,KAAK,CAAC,mBAAmB,EACzB,KAAK,CAAC,uBAAuB,EAC7B,KAAK,CAAC,UAAU,EAChB,KAAK,CAAC,cAAc,EACpB,KAAK,CAAC,SAAS,EACf,MAAM,CAAC,QAAQ,EACf,KAAK,EACL,KAAK,EACL,IAAI,CACJ,CAAC;YACF,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;gBAC3B,KAAK,CAAC,MAAM,GAAG,MAAA,SAAS,CAAC,SAAS,mCAAI,SAAS,CAAC,MAAM,CAAC;gBACvD,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC;gBAC/B,KAAK,CAAC,MAAM,GAAG,MAAA,SAAS,CAAC,SAAS,mCAAI,SAAS,CAAC,MAAM,CAAC;gBACvD,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC;aAC/B;YACD,OAAO,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC;SACxB;QACD,OAAO,OAAO,CAAC;IAChB,CAAC;CACD,CAAC","sourcesContent":["/**\r\n * Y'Shaarj (Tier 3, 1/1)\r\n * Deity. Deathrattle: Summon your first 2 Aberrations that died this combat\r\n * with their maximum stats (except Deities).\r\n *\r\n * Golden Y'Shaarj (Tier 3, 2/2)\r\n * Deity. Deathrattle: Summon your first 4 Aberrations that died this combat\r\n * with their maximum stats (except Deities).\r\n */\r\nimport { BoardEntity } from '../../../board-entity';\r\nimport { CardIds } from '../../../services/card-ids';\r\nimport { DeathrattleTriggeredInput } from '../../../simulation/deathrattle-on-trigger';\r\nimport { spawnEntities } from '../../../simulation/deathrattle-spawns';\r\nimport { isAberration, isDeityCard } from '../../../simulation/deity';\r\nimport { DeathrattleSpawnCard } from '../../card.interface';\r\n\r\nexport const YShaarj: DeathrattleSpawnCard = {\r\n\tcardIds: [CardIds.Yshaarj_BGFYM_011, CardIds.Yshaarj_BGFYM_011_G],\r\n\tdeathrattleSpawn: (minion: BoardEntity, input: DeathrattleTriggeredInput): readonly BoardEntity[] => {\r\n\t\tconst numberToSpawn = minion.scriptDataNum1 || (minion.cardId === CardIds.Yshaarj_BGFYM_011_G ? 4 : 2);\r\n\t\tconst candidates = input.gameState.sharedState.deaths\r\n\t\t\t.filter(\r\n\t\t\t\t(entity) =>\r\n\t\t\t\t\tentity.friendly === minion.friendly &&\r\n\t\t\t\t\t!isDeityCard(entity.cardId, input.gameState.allCards) &&\r\n\t\t\t\t\tisAberration(entity, input.boardWithDeadEntityHero, input.gameState),\r\n\t\t\t)\r\n\t\t\t.slice(0, numberToSpawn);\r\n\t\tconst spawned: BoardEntity[] = [];\r\n\t\tfor (const candidate of candidates) {\r\n\t\t\tconst spawns = spawnEntities(\r\n\t\t\t\tcandidate.cardId,\r\n\t\t\t\t1,\r\n\t\t\t\tinput.boardWithDeadEntity,\r\n\t\t\t\tinput.boardWithDeadEntityHero,\r\n\t\t\t\tinput.otherBoard,\r\n\t\t\t\tinput.otherBoardHero,\r\n\t\t\t\tinput.gameState,\r\n\t\t\t\tminion.friendly,\r\n\t\t\t\tfalse,\r\n\t\t\t\tfalse,\r\n\t\t\t\ttrue,\r\n\t\t\t);\r\n\t\t\tfor (const spawn of spawns) {\r\n\t\t\t\tspawn.attack = candidate.maxAttack ?? candidate.attack;\r\n\t\t\t\tspawn.maxAttack = spawn.attack;\r\n\t\t\t\tspawn.health = candidate.maxHealth ?? candidate.health;\r\n\t\t\t\tspawn.maxHealth = spawn.health;\r\n\t\t\t}\r\n\t\t\tspawned.push(...spawns);\r\n\t\t}\r\n\t\treturn spawned;\r\n\t},\r\n};\r\n"]}
1
+ {"version":3,"file":"yshaarj.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/yshaarj.ts"],"names":[],"mappings":";;;AAYA,+EAAuE;AACvE,qDAAsE;AAGzD,QAAA,OAAO,GAAyB;IAC5C,OAAO,EAAE,4BAAwD;IACjE,gBAAgB,EAAE,CAAC,MAAmB,EAAE,KAAgC,EAA0B,EAAE;;QACnG,MAAM,aAAa,GAAG,MAAM,CAAC,cAAc,IAAI,CAAC,MAAM,CAAC,MAAM,kBAAgC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACvG,MAAM,UAAU,GAAG,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,MAAM;aACnD,MAAM,CACN,CAAC,MAAM,EAAE,EAAE,CACV,MAAM,CAAC,QAAQ,KAAK,MAAM,CAAC,QAAQ;YACnC,CAAC,IAAA,mBAAW,EAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC;YACrD,IAAA,oBAAY,EAAC,MAAM,EAAE,KAAK,CAAC,uBAAuB,EAAE,KAAK,CAAC,SAAS,CAAC,CACrE;aACA,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC;QAC1B,MAAM,OAAO,GAAkB,EAAE,CAAC;QAClC,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE;YACnC,MAAM,MAAM,GAAG,IAAA,kCAAa,EAC3B,SAAS,CAAC,MAAM,EAChB,CAAC,EACD,KAAK,CAAC,mBAAmB,EACzB,KAAK,CAAC,uBAAuB,EAC7B,KAAK,CAAC,UAAU,EAChB,KAAK,CAAC,cAAc,EACpB,KAAK,CAAC,SAAS,EACf,MAAM,CAAC,QAAQ,EACf,KAAK,EACL,KAAK,EACL,IAAI,CACJ,CAAC;YACF,MAAM,MAAM,GAAG,MAAA,SAAS,CAAC,SAAS,mCAAI,SAAS,CAAC,MAAM,CAAC;YACvD,MAAM,MAAM,GAAG,MAAA,SAAS,CAAC,SAAS,mCAAI,SAAS,CAAC,MAAM,CAAC;YACvD,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;gBAC3B,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;gBACtB,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC;gBACzB,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;gBACtB,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC;aACzB;YACD,OAAO,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC;SACxB;QACD,OAAO,OAAO,CAAC;IAChB,CAAC;CACD,CAAC","sourcesContent":["/**\r\n * Y'Shaarj (Tier 3, 1/1)\r\n * Deity. Deathrattle: Summon your first 2 Aberrations that died this combat\r\n * with their maximum stats (except Deities).\r\n *\r\n * Golden Y'Shaarj (Tier 3, 2/2)\r\n * Deity. Deathrattle: Summon your first 4 Aberrations that died this combat\r\n * with their maximum stats (except Deities).\r\n */\r\nimport { BoardEntity } from '../../../board-entity';\r\nimport { CardIds } from '../../../services/card-ids';\r\nimport { DeathrattleTriggeredInput } from '../../../simulation/deathrattle-on-trigger';\r\nimport { spawnEntities } from '../../../simulation/deathrattle-spawns';\r\nimport { isAberration, isDeityCard } from '../../../simulation/deity';\r\nimport { DeathrattleSpawnCard } from '../../card.interface';\r\n\r\nexport const YShaarj: DeathrattleSpawnCard = {\r\n\tcardIds: [CardIds.Yshaarj_BGFYM_011, CardIds.Yshaarj_BGFYM_011_G],\r\n\tdeathrattleSpawn: (minion: BoardEntity, input: DeathrattleTriggeredInput): readonly BoardEntity[] => {\r\n\t\tconst numberToSpawn = minion.scriptDataNum1 || (minion.cardId === CardIds.Yshaarj_BGFYM_011_G ? 4 : 2);\r\n\t\tconst candidates = input.gameState.sharedState.deaths\r\n\t\t\t.filter(\r\n\t\t\t\t(entity) =>\r\n\t\t\t\t\tentity.friendly === minion.friendly &&\r\n\t\t\t\t\t!isDeityCard(entity.cardId, input.gameState.allCards) &&\r\n\t\t\t\t\tisAberration(entity, input.boardWithDeadEntityHero, input.gameState),\r\n\t\t\t)\r\n\t\t\t.slice(0, numberToSpawn);\r\n\t\tconst spawned: BoardEntity[] = [];\r\n\t\tfor (const candidate of candidates) {\r\n\t\t\tconst spawns = spawnEntities(\r\n\t\t\t\tcandidate.cardId,\r\n\t\t\t\t1,\r\n\t\t\t\tinput.boardWithDeadEntity,\r\n\t\t\t\tinput.boardWithDeadEntityHero,\r\n\t\t\t\tinput.otherBoard,\r\n\t\t\t\tinput.otherBoardHero,\r\n\t\t\t\tinput.gameState,\r\n\t\t\t\tminion.friendly,\r\n\t\t\t\tfalse,\r\n\t\t\t\tfalse,\r\n\t\t\t\ttrue,\r\n\t\t\t);\r\n\t\t\tconst attack = candidate.maxAttack ?? candidate.attack;\r\n\t\t\tconst health = candidate.maxHealth ?? candidate.health;\r\n\t\t\tfor (const spawn of spawns) {\r\n\t\t\t\tspawn.attack = attack;\r\n\t\t\t\tspawn.maxAttack = attack;\r\n\t\t\t\tspawn.health = health;\r\n\t\t\t\tspawn.maxHealth = health;\r\n\t\t\t}\r\n\t\t\tspawned.push(...spawns);\r\n\t\t}\r\n\t\treturn spawned;\r\n\t},\r\n};\r\n"]}
@@ -1,12 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ArtisanalUrn = void 0;
4
- const global_info_helpers_1 = require("../../../simulation/global-info-helpers");
5
4
  exports.ArtisanalUrn = {
6
5
  cardIds: ["BG30_MagicItem_989", "BG30_MagicItem_989t"],
7
6
  startOfCombat: (trinket, input) => {
7
+ var _a;
8
8
  const buff = trinket.cardId === "BG30_MagicItem_989" ? 4 : 20;
9
- (0, global_info_helpers_1.increaseUndeadAttackBonus)(input.playerEntity, input.playerBoard, input.playerEntity, buff, input.gameState);
9
+ input.playerEntity.globalInfo.UndeadAttackBonus =
10
+ ((_a = input.playerEntity.globalInfo.UndeadAttackBonus) !== null && _a !== void 0 ? _a : 0) + buff;
10
11
  return { hasTriggered: true, shouldRecomputeCurrentAttacker: false };
11
12
  },
12
13
  };