@firestone-hs/simulate-bgs-battle 1.1.705 → 1.1.707
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cards/impl/bg-spell/azerite-empowerment.js +3 -1
- package/dist/cards/impl/bg-spell/azerite-empowerment.js.map +1 -1
- package/dist/cards/impl/minion/abyssal-bruiser.d.ts +2 -2
- package/dist/cards/impl/minion/abyssal-bruiser.js +12 -0
- package/dist/cards/impl/minion/abyssal-bruiser.js.map +1 -1
- package/dist/cards/impl/minion/fire-forged-evoker.js +1 -1
- package/dist/cards/impl/minion/fire-forged-evoker.js.map +1 -1
- package/dist/cards/impl/minion/incubation-researcher.js +1 -1
- package/dist/cards/impl/minion/incubation-researcher.js.map +1 -1
- package/dist/cards/impl/minion/junk-jouster.js +1 -1
- package/dist/cards/impl/minion/junk-jouster.js.map +1 -1
- package/dist/cards/impl/minion/mama-mrrglton.js +1 -1
- package/dist/cards/impl/minion/mama-mrrglton.js.map +1 -1
- package/dist/cards/impl/minion/papa-mrrglton.js +1 -1
- package/dist/cards/impl/minion/papa-mrrglton.js.map +1 -1
- package/dist/cards/impl/minion/scarlet-survivor.js.map +1 -1
- package/dist/cards/impl/minion/twilight-hatchling.js +7 -1
- package/dist/cards/impl/minion/twilight-hatchling.js.map +1 -1
- package/dist/mechanics/tavern-spell-repeat.js +5 -0
- package/dist/mechanics/tavern-spell-repeat.js.map +1 -1
- package/dist/services/hand-minion-priority.js +6 -6
- package/dist/services/hand-minion-priority.js.map +1 -1
- package/dist/simulation/spawns.js.map +1 -1
- package/dist/simulation/utils/golden.js +5 -2
- package/dist/simulation/utils/golden.js.map +1 -1
- package/package.json +1 -1
|
@@ -9,7 +9,9 @@ exports.AzeriteEmpowerment = {
|
|
|
9
9
|
const baseAttack = input.gameState.allCards.getCard(spellCardId).tags[reference_data_1.GameTag[reference_data_1.GameTag.TAG_SCRIPT_DATA_NUM_1]];
|
|
10
10
|
const baseHealth = input.gameState.allCards.getCard(spellCardId).tags[reference_data_1.GameTag[reference_data_1.GameTag.TAG_SCRIPT_DATA_NUM_2]];
|
|
11
11
|
const { attack, health } = (0, utils_1.withTavernSpellStatBuff)(input.hero, baseAttack, baseHealth, input.gameState.allCards, input.spellCardId);
|
|
12
|
-
|
|
12
|
+
for (let i = 0; i < 2; i++) {
|
|
13
|
+
(0, utils_1.addStatsToBoard)(input.source, input.board, input.hero, attack, health, input.gameState);
|
|
14
|
+
}
|
|
13
15
|
},
|
|
14
16
|
};
|
|
15
17
|
//# sourceMappingURL=azerite-empowerment.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"azerite-empowerment.js","sourceRoot":"","sources":["../../../../src/cards/impl/bg-spell/azerite-empowerment.ts"],"names":[],"mappings":";;;AAAA,iEAAuD;AAEvD,0CAA0E;AAG7D,QAAA,kBAAkB,GAAoB;IAClD,OAAO,EAAE,YAAqC;IAC9C,eAAe,EAAE,CAAC,WAAmB,EAAE,KAAqB,EAAE,EAAE;QAC/D,MAAM,UAAU,GAAG,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,wBAAO,CAAC,wBAAO,CAAC,qBAAqB,CAAC,CAAC,CAAC;QAC9G,MAAM,UAAU,GAAG,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,wBAAO,CAAC,wBAAO,CAAC,qBAAqB,CAAC,CAAC,CAAC;QAC9G,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,+BAAuB,EACjD,KAAK,CAAC,IAAI,EACV,UAAU,EACV,UAAU,EACV,KAAK,CAAC,SAAS,CAAC,QAAQ,EACxB,KAAK,CAAC,WAAW,CACjB,CAAC;QACF,IAAA,uBAAe,EAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"azerite-empowerment.js","sourceRoot":"","sources":["../../../../src/cards/impl/bg-spell/azerite-empowerment.ts"],"names":[],"mappings":";;;AAAA,iEAAuD;AAEvD,0CAA0E;AAG7D,QAAA,kBAAkB,GAAoB;IAClD,OAAO,EAAE,YAAqC;IAC9C,eAAe,EAAE,CAAC,WAAmB,EAAE,KAAqB,EAAE,EAAE;QAC/D,MAAM,UAAU,GAAG,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,wBAAO,CAAC,wBAAO,CAAC,qBAAqB,CAAC,CAAC,CAAC;QAC9G,MAAM,UAAU,GAAG,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,wBAAO,CAAC,wBAAO,CAAC,qBAAqB,CAAC,CAAC,CAAC;QAC9G,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,+BAAuB,EACjD,KAAK,CAAC,IAAI,EACV,UAAU,EACV,UAAU,EACV,KAAK,CAAC,SAAS,CAAC,QAAQ,EACxB,KAAK,CAAC,WAAW,CACjB,CAAC;QACF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;YAC3B,IAAA,uBAAe,EAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;SACxF;IACF,CAAC;CACD,CAAC","sourcesContent":["import { GameTag } from '@firestone-hs/reference-data';\r\nimport { CardIds } from '../../../services/card-ids';\r\nimport { addStatsToBoard, withTavernSpellStatBuff } from '../../../utils';\r\nimport { CastSpellInput, TavernSpellCard } from '../../card.interface';\r\n\r\nexport const AzeriteEmpowerment: TavernSpellCard = {\r\n\tcardIds: [CardIds.AzeriteEmpowerment_BG28_169],\r\n\tcastTavernSpell: (spellCardId: string, input: CastSpellInput) => {\r\n\t\tconst baseAttack = input.gameState.allCards.getCard(spellCardId).tags[GameTag[GameTag.TAG_SCRIPT_DATA_NUM_1]];\r\n\t\tconst baseHealth = input.gameState.allCards.getCard(spellCardId).tags[GameTag[GameTag.TAG_SCRIPT_DATA_NUM_2]];\r\n\t\tconst { attack, health } = withTavernSpellStatBuff(\r\n\t\t\tinput.hero,\r\n\t\t\tbaseAttack,\r\n\t\t\tbaseHealth,\r\n\t\t\tinput.gameState.allCards,\r\n\t\t\tinput.spellCardId,\r\n\t\t);\r\n\t\tfor (let i = 0; i < 2; i++) {\r\n\t\t\taddStatsToBoard(input.source, input.board, input.hero, attack, health, input.gameState);\r\n\t\t}\r\n\t},\r\n};\r\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { OnDespawnedCard, OnSpawnedCard } from '../../card.interface';
|
|
2
|
-
export declare const AbyssalBruiser: OnDespawnedCard & OnSpawnedCard;
|
|
1
|
+
import { OnDespawnedCard, OnSpawnedCard, OnTavernSpellCastCard } from '../../card.interface';
|
|
2
|
+
export declare const AbyssalBruiser: OnDespawnedCard & OnSpawnedCard & OnTavernSpellCastCard;
|
|
@@ -27,10 +27,22 @@ exports.AbyssalBruiser = {
|
|
|
27
27
|
const n = (_a = input.hero.globalInfo.TavernSpellsCastThisGame) !== null && _a !== void 0 ? _a : 0;
|
|
28
28
|
if (input.applyAttackAuras) {
|
|
29
29
|
minion.attack = Math.max(0, minion.attack - n * mult);
|
|
30
|
+
minion.maxAttack = Math.max(minion.maxAttack, minion.attack);
|
|
30
31
|
}
|
|
31
32
|
if (input.applyHealthAuras) {
|
|
32
33
|
minion.health = Math.max(1, minion.health - n * mult);
|
|
34
|
+
minion.maxHealth = Math.max(minion.maxHealth, minion.health);
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
onTavernSpellCast: (entity, input) => {
|
|
38
|
+
if (input.source !== input.hero) {
|
|
39
|
+
return;
|
|
33
40
|
}
|
|
41
|
+
const mult = entity.cardId === "BG35_921_G" ? 2 : 1;
|
|
42
|
+
entity.attack += mult;
|
|
43
|
+
entity.attack = Math.max(entity.attack, entity.maxAttack);
|
|
44
|
+
entity.health += mult;
|
|
45
|
+
entity.maxHealth = Math.max(entity.maxHealth, entity.health);
|
|
34
46
|
},
|
|
35
47
|
};
|
|
36
48
|
//# sourceMappingURL=abyssal-bruiser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abyssal-bruiser.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/abyssal-bruiser.ts"],"names":[],"mappings":";;;AACA,mEAAqE;AAKxD,QAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"abyssal-bruiser.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/abyssal-bruiser.ts"],"names":[],"mappings":";;;AACA,mEAAqE;AAKxD,QAAA,cAAc,GAA4D;IACtF,OAAO,EAAE,0BAAoE;IAC7E,SAAS,EAAE,CAAC,MAAmB,EAAE,KAAmB,EAAE,EAAE;;QACvD,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,iBAAsC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACzE,MAAM,CAAC,GAAG,MAAA,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,wBAAwB,mCAAI,CAAC,CAAC;QAC9D,IAAI,KAAK,CAAC,gBAAgB,EAAE;YAC3B,MAAM,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC;YAC1B,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC;SACjC;QACD,IAAI,KAAK,CAAC,gBAAgB,EAAE;YAC3B,MAAM,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC;YAC1B,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,C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AAM,CAAC,MAAM,CAAC,CAAC;SAC7D;IACF,CAAC;IACD,iBAAiB,EAAE,CAAC,MAAmB,EAAE,KAAqB,EAAE,EAAE;QACjE,IAAI,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,IAAI,EAAE;YAChC,OAAO;SACP;QAED,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,iBAAsC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACzE,MAAM,CAAC,MAAM,IAAI,IAAI,CAAC;QACtB,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;QAC1D,MAAM,CAAC,MAAM,IAAI,IAAI,CAAC;QACtB,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IAC9D,CAAC;CACD,CAAC","sourcesContent":["import { BoardEntity } from '../../../board-entity';\r\nimport { updateDivineShield } from '../../../keywords/divine-shield';\r\nimport { CardIds } from '../../../services/card-ids';\r\nimport { OnDespawnInput, OnSpawnInput } from '../../../simulation/add-minion-to-board';\r\nimport { CastSpellInput, OnDespawnedCard, OnSpawnedCard, OnTavernSpellCastCard } from '../../card.interface';\r\n\r\nexport const AbyssalBruiser: OnDespawnedCard & OnSpawnedCard & OnTavernSpellCastCard = {\r\n\tcardIds: [CardIds.AbyssalBruiser_BG35_921, CardIds.AbyssalBruiser_BG35_921_G],\r\n\tonSpawned: (minion: BoardEntity, input: OnSpawnInput) => {\r\n\t\tconst mult = minion.cardId === CardIds.AbyssalBruiser_BG35_921_G ? 2 : 1;\r\n\t\tconst n = input.hero.globalInfo.TavernSpellsCastThisGame ?? 0;\r\n\t\tif (input.applyAttackAuras) {\r\n\t\t\tminion.attack += n * mult;\r\n\t\t\tminion.maxAttack = minion.attack;\r\n\t\t}\r\n\t\tif (input.applyHealthAuras) {\r\n\t\t\tminion.health += n * mult;\r\n\t\t\tminion.maxHealth = Math.max(minion.maxHealth, minion.health);\r\n\t\t}\r\n\t\tconst otherHero =\r\n\t\t\tinput.gameState.gameState.player.player === input.hero\r\n\t\t\t\t? input.gameState.gameState.opponent.player\r\n\t\t\t\t: input.gameState.gameState.player.player;\r\n\t\tupdateDivineShield(minion, input.board, input.hero, otherHero, true, input.gameState);\r\n\t},\r\n\tonDespawned: (minion: BoardEntity, input: OnDespawnInput) => {\r\n\t\tconst mult = minion.cardId === CardIds.AbyssalBruiser_BG35_921_G ? 2 : 1;\r\n\t\tconst n = input.hero.globalInfo.TavernSpellsCastThisGame ?? 0;\r\n\t\tif (input.applyAttackAuras) {\r\n\t\t\tminion.attack = Math.max(0, minion.attack - n * mult);\r\n\t\t\tminion.maxAttack = Math.max(minion.maxAttack, minion.attack);\r\n\t\t}\r\n\t\tif (input.applyHealthAuras) {\r\n\t\t\tminion.health = Math.max(1, minion.health - n * mult);\r\n\t\t\tminion.maxHealth = Math.max(minion.maxHealth, minion.health);\r\n\t\t}\r\n\t},\r\n\tonTavernSpellCast: (entity: BoardEntity, input: CastSpellInput) => {\r\n\t\tif (input.source !== input.hero) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst mult = entity.cardId === CardIds.AbyssalBruiser_BG35_921_G ? 2 : 1;\r\n\t\tentity.attack += mult;\r\n\t\tentity.attack = Math.max(entity.attack, entity.maxAttack);\r\n\t\tentity.health += mult;\r\n\t\tentity.maxHealth = Math.max(entity.maxHealth, entity.health);\r\n\t},\r\n};\r\n"]}
|
|
@@ -10,7 +10,7 @@ exports.FireForgedEvoker = {
|
|
|
10
10
|
var _a, _b, _c;
|
|
11
11
|
const mult = minion.cardId === "BG32_822_G" ? 2 : 1;
|
|
12
12
|
const spells = (_a = input.playerEntity.globalInfo.SpellsCastThisGame) !== null && _a !== void 0 ? _a : 0;
|
|
13
|
-
const atk = (_b = minion.scriptDataNum1) !== null && _b !== void 0 ? _b : mult * (
|
|
13
|
+
const atk = (_b = minion.scriptDataNum1) !== null && _b !== void 0 ? _b : mult * (2 + spells);
|
|
14
14
|
const health = (_c = minion.scriptDataNum2) !== null && _c !== void 0 ? _c : mult * (1 + spells);
|
|
15
15
|
const targetBoard = input.playerBoard.filter((e) => (0, utils_1.hasCorrectTribe)(e, input.playerEntity, reference_data_1.Race.DRAGON, input.gameState.anomalies, input.gameState.allCards));
|
|
16
16
|
for (const target of targetBoard) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fire-forged-evoker.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/fire-forged-evoker.ts"],"names":[],"mappings":";;;AAQA,iEAAoD;AAIpD,qDAAwD;AACxD,0CAAiD;AAGpC,QAAA,gBAAgB,GAAsB;IAClD,OAAO,EAAE,0BAAwE;IACjF,aAAa,EAAE,CAAC,MAAmB,EAAE,KAAe,EAAE,EAAE;;QACvD,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,iBAAwC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3E,MAAM,MAAM,GAAG,MAAA,KAAK,CAAC,YAAY,CAAC,UAAU,CAAC,kBAAkB,mCAAI,CAAC,CAAC;QACrE,MAAM,GAAG,GAAG,MAAA,MAAM,CAAC,cAAc,mCAAI,IAAI,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC;QACzD,MAAM,MAAM,GAAG,MAAA,MAAM,CAAC,cAAc,mCAAI,IAAI,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC;QAC5D,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAClD,IAAA,uBAAe,EAAC,CAAC,EAAE,KAAK,CAAC,YAAY,EAAE,qBAAI,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,CACxG,CAAC;QACF,KAAK,MAAM,MAAM,IAAI,WAAW,EAAE;YACjC,IAAA,mBAAW,EAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,WAAW,EAAE,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;SACjG;QACD,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,8BAA8B,EAAE,KAAK,EAAE,CAAC;IACtE,CAAC;CACD,CAAC","sourcesContent":["/**\r\n * Fire-forged Evoker (Tier 6, 8/5)\r\n * Start of Combat: Give your Dragons +1/+1. Improves permanently after you cast a Tavern spell.\r\n * (Spells during combat should count — see REVIEW_QUEUE_BG_35_2.md if any spell path skips SpellsCastThisGame.)\r\n *\r\n * Golden Fire-forged Evoker (Tier 6, 16/10)\r\n * Start of Combat: Give your Dragons +2/+2. Improves permanently after you cast a Tavern spell.\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 { SoCInput } from '../../../simulation/start-of-combat/start-of-combat-input';\r\nimport { modifyStats } from '../../../simulation/stats';\r\nimport { hasCorrectTribe } from '../../../utils';\r\nimport { StartOfCombatCard } from '../../card.interface';\r\n\r\nexport const FireForgedEvoker: StartOfCombatCard = {\r\n\tcardIds: [CardIds.FireForgedEvoker_BG32_822, CardIds.FireForgedEvoker_BG32_822_G],\r\n\tstartOfCombat: (minion: BoardEntity, input: SoCInput) => {\r\n\t\tconst mult = minion.cardId === CardIds.FireForgedEvoker_BG32_822_G ? 2 : 1;\r\n\t\tconst spells = input.playerEntity.globalInfo.SpellsCastThisGame ?? 0;\r\n\t\tconst atk = minion.scriptDataNum1 ?? mult * (
|
|
1
|
+
{"version":3,"file":"fire-forged-evoker.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/fire-forged-evoker.ts"],"names":[],"mappings":";;;AAQA,iEAAoD;AAIpD,qDAAwD;AACxD,0CAAiD;AAGpC,QAAA,gBAAgB,GAAsB;IAClD,OAAO,EAAE,0BAAwE;IACjF,aAAa,EAAE,CAAC,MAAmB,EAAE,KAAe,EAAE,EAAE;;QACvD,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,iBAAwC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3E,MAAM,MAAM,GAAG,MAAA,KAAK,CAAC,YAAY,CAAC,UAAU,CAAC,kBAAkB,mCAAI,CAAC,CAAC;QACrE,MAAM,GAAG,GAAG,MAAA,MAAM,CAAC,cAAc,mCAAI,IAAI,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC;QACzD,MAAM,MAAM,GAAG,MAAA,MAAM,CAAC,cAAc,mCAAI,IAAI,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC;QAC5D,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAClD,IAAA,uBAAe,EAAC,CAAC,EAAE,KAAK,CAAC,YAAY,EAAE,qBAAI,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,CACxG,CAAC;QACF,KAAK,MAAM,MAAM,IAAI,WAAW,EAAE;YACjC,IAAA,mBAAW,EAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,WAAW,EAAE,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;SACjG;QACD,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,8BAA8B,EAAE,KAAK,EAAE,CAAC;IACtE,CAAC;CACD,CAAC","sourcesContent":["/**\r\n * Fire-forged Evoker (Tier 6, 8/5)\r\n * Start of Combat: Give your Dragons +1/+1. Improves permanently after you cast a Tavern spell.\r\n * (Spells during combat should count — see REVIEW_QUEUE_BG_35_2.md if any spell path skips SpellsCastThisGame.)\r\n *\r\n * Golden Fire-forged Evoker (Tier 6, 16/10)\r\n * Start of Combat: Give your Dragons +2/+2. Improves permanently after you cast a Tavern spell.\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 { SoCInput } from '../../../simulation/start-of-combat/start-of-combat-input';\r\nimport { modifyStats } from '../../../simulation/stats';\r\nimport { hasCorrectTribe } from '../../../utils';\r\nimport { StartOfCombatCard } from '../../card.interface';\r\n\r\nexport const FireForgedEvoker: StartOfCombatCard = {\r\n\tcardIds: [CardIds.FireForgedEvoker_BG32_822, CardIds.FireForgedEvoker_BG32_822_G],\r\n\tstartOfCombat: (minion: BoardEntity, input: SoCInput) => {\r\n\t\tconst mult = minion.cardId === CardIds.FireForgedEvoker_BG32_822_G ? 2 : 1;\r\n\t\tconst spells = input.playerEntity.globalInfo.SpellsCastThisGame ?? 0;\r\n\t\tconst atk = minion.scriptDataNum1 ?? mult * (2 + spells);\r\n\t\tconst health = minion.scriptDataNum2 ?? mult * (1 + spells);\r\n\t\tconst targetBoard = input.playerBoard.filter((e) =>\r\n\t\t\thasCorrectTribe(e, input.playerEntity, Race.DRAGON, input.gameState.anomalies, input.gameState.allCards),\r\n\t\t);\r\n\t\tfor (const target of targetBoard) {\r\n\t\t\tmodifyStats(target, minion, atk, health, input.playerBoard, input.playerEntity, input.gameState);\r\n\t\t}\r\n\t\treturn { hasTriggered: true, shouldRecomputeCurrentAttacker: false };\r\n\t},\r\n};\r\n"]}
|
|
@@ -6,7 +6,7 @@ const cards_in_hand_1 = require("../../../simulation/cards-in-hand");
|
|
|
6
6
|
const chromadrake_pool_1 = require("./chromadrake-pool");
|
|
7
7
|
exports.IncubationResearcher = {
|
|
8
8
|
cardIds: ["BG34_632", "BG34_632_G"],
|
|
9
|
-
baseAvengeValue: () =>
|
|
9
|
+
baseAvengeValue: () => 3,
|
|
10
10
|
avenge: (minion, input) => {
|
|
11
11
|
const mult = minion.cardId === "BG34_632_G" ? 2 : 1;
|
|
12
12
|
for (let i = 0; i < mult; i++) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"incubation-researcher.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/incubation-researcher.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"incubation-researcher.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/incubation-researcher.ts"],"names":[],"mappings":";;;AAEA,mDAAqD;AAErD,qEAAmE;AAEnE,yDAAwD;AAE3C,QAAA,oBAAoB,GAAe;IAC/C,OAAO,EAAE,0BAAgF;IACzF,eAAe,EAAE,GAAG,EAAE,CAAC,CAAC;IACxB,MAAM,EAAE,CAAC,MAAmB,EAAE,KAAkB,EAAE,EAAE;QACnD,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,iBAA4C,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/E,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,EAAE;YAC9B,MAAM,EAAE,GAAG,IAAA,kBAAU,EAAC,qCAAkB,CAAC,CAAC;YAC1C,IAAI,EAAE,EAAE;gBACP,IAAA,8BAAc,EAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;aAC/D;SACD;IACF,CAAC;CACD,CAAC","sourcesContent":["import { BoardEntity } from '../../../board-entity';\r\nimport { CardIds } from '../../../services/card-ids';\r\nimport { pickRandom } from '../../../services/utils';\r\nimport { AvengeInput } from '../../../simulation/avenge';\r\nimport { addCardsInHand } from '../../../simulation/cards-in-hand';\r\nimport { AvengeCard } from '../../card.interface';\r\nimport { chromadrakeCardIds } from './chromadrake-pool';\r\n\r\nexport const IncubationResearcher: AvengeCard = {\r\n\tcardIds: [CardIds.IncubationResearcher_BG34_632, CardIds.IncubationResearcher_BG34_632_G],\r\n\tbaseAvengeValue: () => 3,\r\n\tavenge: (minion: BoardEntity, input: AvengeInput) => {\r\n\t\tconst mult = minion.cardId === CardIds.IncubationResearcher_BG34_632_G ? 2 : 1;\r\n\t\tfor (let i = 0; i < mult; i++) {\r\n\t\t\tconst id = pickRandom(chromadrakeCardIds);\r\n\t\t\tif (id) {\r\n\t\t\t\taddCardsInHand(input.hero, input.board, [id], input.gameState);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n};\r\n"]}
|
|
@@ -7,7 +7,7 @@ exports.JunkJouster = {
|
|
|
7
7
|
onAfterMagnetize: (entity, input) => {
|
|
8
8
|
const mult = entity.cardId === "BG34_175_G" ? 2 : 1;
|
|
9
9
|
for (const m of input.board) {
|
|
10
|
-
(0, stats_1.modifyStats)(m, entity,
|
|
10
|
+
(0, stats_1.modifyStats)(m, entity, 5 * mult, 5 * mult, input.board, input.hero, input.gameState);
|
|
11
11
|
}
|
|
12
12
|
},
|
|
13
13
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"junk-jouster.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/junk-jouster.ts"],"names":[],"mappings":";;;AAUA,qDAAwD;AAG3C,QAAA,WAAW,GAAyB;IAChD,OAAO,EAAE,0BAA8D;IACvE,gBAAgB,EAAE,CAAC,MAAmB,EAAE,KAA4B,EAAE,EAAE;QACvE,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,iBAAmC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACtE,KAAK,MAAM,CAAC,IAAI,KAAK,CAAC,KAAK,EAAE;YAC5B,IAAA,mBAAW,EAAC,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;SACrF;IACF,CAAC;CACD,CAAC","sourcesContent":["/**\r\n * Junk Jouster (Tier 6, 8/7)\r\n * After you Magnetize a minion, give your minions +6/+6.\r\n *\r\n * Golden Junk Jouster (Tier 6, 16/14)\r\n * After you Magnetize a minion, give your minions +12/+12.\r\n */\r\nimport { BoardEntity } from '../../../board-entity';\r\nimport { CardIds } from '../../../services/card-ids';\r\nimport { OnAfterMagnetizeInput } from '../../../simulation/magnetize';\r\nimport { modifyStats } from '../../../simulation/stats';\r\nimport { OnAfterMagnetizeCard } from '../../card.interface';\r\n\r\nexport const JunkJouster: OnAfterMagnetizeCard = {\r\n\tcardIds: [CardIds.JunkJouster_BG34_175, CardIds.JunkJouster_BG34_175_G],\r\n\tonAfterMagnetize: (entity: BoardEntity, input: OnAfterMagnetizeInput) => {\r\n\t\tconst mult = entity.cardId === CardIds.JunkJouster_BG34_175_G ? 2 : 1;\r\n\t\tfor (const m of input.board) {\r\n\t\t\tmodifyStats(m, entity,
|
|
1
|
+
{"version":3,"file":"junk-jouster.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/junk-jouster.ts"],"names":[],"mappings":";;;AAUA,qDAAwD;AAG3C,QAAA,WAAW,GAAyB;IAChD,OAAO,EAAE,0BAA8D;IACvE,gBAAgB,EAAE,CAAC,MAAmB,EAAE,KAA4B,EAAE,EAAE;QACvE,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,iBAAmC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACtE,KAAK,MAAM,CAAC,IAAI,KAAK,CAAC,KAAK,EAAE;YAC5B,IAAA,mBAAW,EAAC,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;SACrF;IACF,CAAC;CACD,CAAC","sourcesContent":["/**\r\n * Junk Jouster (Tier 6, 8/7)\r\n * After you Magnetize a minion, give your minions +6/+6.\r\n *\r\n * Golden Junk Jouster (Tier 6, 16/14)\r\n * After you Magnetize a minion, give your minions +12/+12.\r\n */\r\nimport { BoardEntity } from '../../../board-entity';\r\nimport { CardIds } from '../../../services/card-ids';\r\nimport { OnAfterMagnetizeInput } from '../../../simulation/magnetize';\r\nimport { modifyStats } from '../../../simulation/stats';\r\nimport { OnAfterMagnetizeCard } from '../../card.interface';\r\n\r\nexport const JunkJouster: OnAfterMagnetizeCard = {\r\n\tcardIds: [CardIds.JunkJouster_BG34_175, CardIds.JunkJouster_BG34_175_G],\r\n\tonAfterMagnetize: (entity: BoardEntity, input: OnAfterMagnetizeInput) => {\r\n\t\tconst mult = entity.cardId === CardIds.JunkJouster_BG34_175_G ? 2 : 1;\r\n\t\tfor (const m of input.board) {\r\n\t\t\tmodifyStats(m, entity, 5 * mult, 5 * mult, input.board, input.hero, input.gameState);\r\n\t\t}\r\n\t},\r\n};\r\n"]}
|
|
@@ -10,7 +10,7 @@ exports.MamaMrrglton = {
|
|
|
10
10
|
var _a;
|
|
11
11
|
const mult = minion.cardId === "BG35_140_G" ? 2 : 1;
|
|
12
12
|
const mrrg = (_a = input.hero.globalInfo.MrrgltonsPlayedThisGame) !== null && _a !== void 0 ? _a : 0;
|
|
13
|
-
const atk =
|
|
13
|
+
const atk = 2 * mult + mrrg;
|
|
14
14
|
for (const e of input.board) {
|
|
15
15
|
if ((0, utils_1.hasCorrectTribe)(e, input.hero, reference_data_1.Race.MURLOC, input.gameState.anomalies, input.gameState.allCards)) {
|
|
16
16
|
(0, stats_1.modifyStats)(e, minion, atk, 0, input.board, input.hero, input.gameState);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mama-mrrglton.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/mama-mrrglton.ts"],"names":[],"mappings":";;;AAAA,iEAAoD;
|
|
1
|
+
{"version":3,"file":"mama-mrrglton.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/mama-mrrglton.ts"],"names":[],"mappings":";;;AAAA,iEAAoD;AAIpD,qDAAwD;AACxD,0CAAiD;AAGpC,QAAA,YAAY,GAAkB;IAC1C,OAAO,EAAE,0BAAgE;IACzE,SAAS,EAAE,CAAC,MAAmB,EAAE,KAAqB,EAAE,EAAE;;QACzD,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,iBAAoC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACvE,MAAM,IAAI,GAAG,MAAA,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,uBAAuB,mCAAI,CAAC,CAAC;QAChE,MAAM,GAAG,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;QAC5B,KAAK,MAAM,CAAC,IAAI,KAAK,CAAC,KAAK,EAAE;YAC5B,IAAI,IAAA,uBAAe,EAAC,CAAC,EAAE,KAAK,CAAC,IAAI,EAAE,qBAAI,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE;gBACrG,IAAA,mBAAW,EAAC,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;aACzE;SACD;QACD,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,uBAAuB,GAAG,IAAI,GAAG,CAAC,CAAC;QACzD,OAAO,IAAI,CAAC;IACb,CAAC;CACD,CAAC","sourcesContent":["import { Race } from '@firestone-hs/reference-data';\r\nimport { BoardEntity } from '../../../board-entity';\r\nimport { CardIds } from '../../../services/card-ids';\r\nimport { BattlecryInput } from '../../../simulation/battlecries';\r\nimport { modifyStats } from '../../../simulation/stats';\r\nimport { hasCorrectTribe } from '../../../utils';\r\nimport { BattlecryCard } from '../../card.interface';\r\n\r\nexport const MamaMrrglton: BattlecryCard = {\r\n\tcardIds: [CardIds.MamaMrrglton_BG35_140, CardIds.MamaMrrglton_BG35_140_G],\r\n\tbattlecry: (minion: BoardEntity, input: BattlecryInput) => {\r\n\t\tconst mult = minion.cardId === CardIds.MamaMrrglton_BG35_140_G ? 2 : 1;\r\n\t\tconst mrrg = input.hero.globalInfo.MrrgltonsPlayedThisGame ?? 0;\r\n\t\tconst atk = 2 * mult + mrrg;\r\n\t\tfor (const e of input.board) {\r\n\t\t\tif (hasCorrectTribe(e, input.hero, Race.MURLOC, input.gameState.anomalies, input.gameState.allCards)) {\r\n\t\t\t\tmodifyStats(e, minion, atk, 0, input.board, input.hero, input.gameState);\r\n\t\t\t}\r\n\t\t}\r\n\t\tinput.hero.globalInfo.MrrgltonsPlayedThisGame = mrrg + 1;\r\n\t\treturn true;\r\n\t},\r\n};\r\n"]}
|
|
@@ -10,7 +10,7 @@ exports.PapaMrrglton = {
|
|
|
10
10
|
var _a;
|
|
11
11
|
const mult = minion.cardId === "BG35_141_G" ? 2 : 1;
|
|
12
12
|
const mrrg = (_a = input.hero.globalInfo.MrrgltonsPlayedThisGame) !== null && _a !== void 0 ? _a : 0;
|
|
13
|
-
const hp =
|
|
13
|
+
const hp = 2 * mult + mrrg;
|
|
14
14
|
for (const e of input.board) {
|
|
15
15
|
if ((0, utils_1.hasCorrectTribe)(e, input.hero, reference_data_1.Race.MURLOC, input.gameState.anomalies, input.gameState.allCards)) {
|
|
16
16
|
(0, stats_1.modifyStats)(e, minion, 0, hp, input.board, input.hero, input.gameState);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"papa-mrrglton.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/papa-mrrglton.ts"],"names":[],"mappings":";;;AAAA,iEAAoD;
|
|
1
|
+
{"version":3,"file":"papa-mrrglton.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/papa-mrrglton.ts"],"names":[],"mappings":";;;AAAA,iEAAoD;AAIpD,qDAAwD;AACxD,0CAAiD;AAGpC,QAAA,YAAY,GAAkB;IAC1C,OAAO,EAAE,0BAAgE;IACzE,SAAS,EAAE,CAAC,MAAmB,EAAE,KAAqB,EAAE,EAAE;;QACzD,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,iBAAoC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACvE,MAAM,IAAI,GAAG,MAAA,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,uBAAuB,mCAAI,CAAC,CAAC;QAChE,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;QAC3B,KAAK,MAAM,CAAC,IAAI,KAAK,CAAC,KAAK,EAAE;YAC5B,IAAI,IAAA,uBAAe,EAAC,CAAC,EAAE,KAAK,CAAC,IAAI,EAAE,qBAAI,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE;gBACrG,IAAA,mBAAW,EAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;aACxE;SACD;QACD,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,uBAAuB,GAAG,IAAI,GAAG,CAAC,CAAC;QACzD,OAAO,IAAI,CAAC;IACb,CAAC;CACD,CAAC","sourcesContent":["import { Race } from '@firestone-hs/reference-data';\r\nimport { BoardEntity } from '../../../board-entity';\r\nimport { CardIds } from '../../../services/card-ids';\r\nimport { BattlecryInput } from '../../../simulation/battlecries';\r\nimport { modifyStats } from '../../../simulation/stats';\r\nimport { hasCorrectTribe } from '../../../utils';\r\nimport { BattlecryCard } from '../../card.interface';\r\n\r\nexport const PapaMrrglton: BattlecryCard = {\r\n\tcardIds: [CardIds.PapaMrrglton_BG35_141, CardIds.PapaMrrglton_BG35_141_G],\r\n\tbattlecry: (minion: BoardEntity, input: BattlecryInput) => {\r\n\t\tconst mult = minion.cardId === CardIds.PapaMrrglton_BG35_141_G ? 2 : 1;\r\n\t\tconst mrrg = input.hero.globalInfo.MrrgltonsPlayedThisGame ?? 0;\r\n\t\tconst hp = 2 * mult + mrrg;\r\n\t\tfor (const e of input.board) {\r\n\t\t\tif (hasCorrectTribe(e, input.hero, Race.MURLOC, input.gameState.anomalies, input.gameState.allCards)) {\r\n\t\t\t\tmodifyStats(e, minion, 0, hp, input.board, input.hero, input.gameState);\r\n\t\t\t}\r\n\t\t}\r\n\t\tinput.hero.globalInfo.MrrgltonsPlayedThisGame = mrrg + 1;\r\n\t\treturn true;\r\n\t},\r\n};\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scarlet-survivor.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/scarlet-survivor.ts"],"names":[],"mappings":";;;AAEA,mEAAqE;AAOrE,MAAM,SAAS,GAAG,CAAC,CAAC;AAEpB,MAAM,wBAAwB,GAAG,CAChC,MAAmB,EACnB,KAAoB,EACpB,IAAqB,EACrB,SAA0B,EAC1B,SAAwB,EACjB,EAAE;IACT,IACC,MAAM,CAAC,iBAAiB,IAAI,CAAC;QAC7B,MAAM,CAAC,MAAM,GAAG,SAAS;QACzB,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,gBAA0D,CAAC,EAClG;QACD,OAAO;KACP;IACD,MAAM,CAAC,iBAAiB,GAAG,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"scarlet-survivor.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/scarlet-survivor.ts"],"names":[],"mappings":";;;AAEA,mEAAqE;AAOrE,MAAM,SAAS,GAAG,CAAC,CAAC;AAEpB,MAAM,wBAAwB,GAAG,CAChC,MAAmB,EACnB,KAAoB,EACpB,IAAqB,EACrB,SAA0B,EAC1B,SAAwB,EACjB,EAAE;IACT,IACC,MAAM,CAAC,iBAAiB,IAAI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,KAAK,MAAM,CAAC,QAAQ,EAAE;YAC9C,OAAO;SACP;QACD,wBAAwB,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAC7F,CAAC;CACD,CAAC","sourcesContent":["import { BgsPlayerEntity } from '../../../bgs-player-entity';\r\nimport { BoardEntity } from '../../../board-entity';\r\nimport { updateDivineShield } from '../../../keywords/divine-shield';\r\nimport { CardIds } from '../../../services/card-ids';\r\nimport { OnSpawnInput } from '../../../simulation/add-minion-to-board';\r\nimport { FullGameState } from '../../../simulation/internal-game-state';\r\nimport { OnStatsChangedInput } from '../../../simulation/stats';\r\nimport { DefaultChargesCard, OnSpawnedCard, OnStatsChangedCard } from '../../card.interface';\r\n\r\nconst THRESHOLD = 6;\r\n\r\nconst tryGrantDivineShieldOnce = (\r\n\tminion: BoardEntity,\r\n\tboard: BoardEntity[],\r\n\thero: BgsPlayerEntity,\r\n\totherHero: BgsPlayerEntity,\r\n\tgameState: FullGameState,\r\n): void => {\r\n\tif (\r\n\t\tminion.abiityChargesLeft <= 0 ||\r\n\t\tminion.attack < THRESHOLD ||\r\n\t\tminion.enchantments.some((e) => e.cardId === CardIds.ScarletSurvivor_SurvivedEnchantment_BG35_814e)\r\n\t) {\r\n\t\treturn;\r\n\t}\r\n\tminion.abiityChargesLeft = 0;\r\n\r\n\t// 35.2: even without an update I'm see the Survivor get the DS before the \"attack immediately\" from a\r\n\t// Twilight Hatchling spawn. So the timing is somewhere in-between at the moment (after attacking, but\r\n\t// before a deathrattle) so I'll just pretend the bug doesn't exist for now\r\n\t// UPDATE 2026-04-17: apparently that's not consistent, sometimes it doesn't grand the divine shield\r\n\t// https://replays.firestoneapp.com/?reviewId=b342665e-7667-4095-b4f0-b42e1eaec457&turn=5&action=0\r\n\tupdateDivineShield(minion, board, hero, otherHero, true, gameState);\r\n\tminion.enchantments.push({\r\n\t\tcardId: CardIds.ScarletSurvivor_SurvivedEnchantment_BG35_814e,\r\n\t\toriginEntityId: minion.entityId,\r\n\t\ttiming: gameState.sharedState.currentEntityId++,\r\n\t\ttagScriptDataNum1: -1,\r\n\t\ttagScriptDataNum2: -1,\r\n\t});\r\n\t// This is a bug, and once it's fixed we should change the timing so the divine shield is immediately\r\n\t// granted\r\n\t// minion.onResolve = minion.onResolve ?? [];\r\n\t// minion.onResolve.push(() => {\r\n\t// });\r\n};\r\n\r\nexport const ScarletSurvivor: OnSpawnedCard & OnStatsChangedCard & DefaultChargesCard = {\r\n\tcardIds: [CardIds.ScarletSurvivor_BG35_814, CardIds.ScarletSurvivor_BG35_814_G],\r\n\tdefaultCharges: (entity: BoardEntity) => 1,\r\n\tonSpawned: (minion: BoardEntity, input: OnSpawnInput) => {\r\n\t\tconst otherHero =\r\n\t\t\tinput.gameState.gameState.player.player === input.hero\r\n\t\t\t\t? input.gameState.gameState.opponent.player\r\n\t\t\t\t: input.gameState.gameState.player.player;\r\n\t\ttryGrantDivineShieldOnce(minion, input.board, input.hero, otherHero, input.gameState);\r\n\t},\r\n\tonStatsChanged: (minion: BoardEntity, input: OnStatsChangedInput) => {\r\n\t\tif (input.target.entityId !== minion.entityId) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\ttryGrantDivineShieldOnce(minion, input.board, input.hero, input.otherHero, input.gameState);\r\n\t},\r\n};\r\n"]}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TwilightHatchling = void 0;
|
|
4
4
|
const deathrattle_spawns_1 = require("../../../simulation/deathrattle-spawns");
|
|
5
|
+
const spawns_1 = require("../../../simulation/spawns");
|
|
5
6
|
exports.TwilightHatchling = {
|
|
6
7
|
cardIds: ["BG34_630", "BG34_630_G"],
|
|
7
8
|
deathrattleSpawn: (minion, input) => {
|
|
@@ -10,7 +11,12 @@ exports.TwilightHatchling = {
|
|
|
10
11
|
spawns.forEach((e) => {
|
|
11
12
|
e.attackImmediately = true;
|
|
12
13
|
});
|
|
13
|
-
|
|
14
|
+
const indexFromRight = input.deadEntityIndexFromRight;
|
|
15
|
+
const spawned = (0, spawns_1.performEntitySpawns)(spawns, input.boardWithDeadEntity, input.boardWithDeadEntityHero, minion, indexFromRight, input.otherBoard, input.otherBoardHero, input.gameState, true);
|
|
16
|
+
spawned.forEach((e) => {
|
|
17
|
+
e.hasAttacked = undefined;
|
|
18
|
+
});
|
|
19
|
+
return [];
|
|
14
20
|
},
|
|
15
21
|
};
|
|
16
22
|
//# sourceMappingURL=twilight-hatchling.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"twilight-hatchling.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/twilight-hatchling.ts"],"names":[],"mappings":";;;AAGA,+EAAiF;
|
|
1
|
+
{"version":3,"file":"twilight-hatchling.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/twilight-hatchling.ts"],"names":[],"mappings":";;;AAGA,+EAAiF;AACjF,uDAAiE;AAGpD,QAAA,iBAAiB,GAAyB;IACtD,OAAO,EAAE,0BAA0E;IACnF,gBAAgB,EAAE,CAAC,MAAmB,EAAE,KAAgC,EAA0B,EAAE;QACnG,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,iBAAyC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAE5E,MAAM,MAAM,GAAG,IAAA,4CAAuB,eAAyD,IAAI,EAAE,KAAK,CAAC,CAAC;QAC5G,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;YACpB,CAAC,CAAC,iBAAiB,GAAG,IAAI,CAAC;QAC5B,CAAC,CAAC,CAAC;QACH,MAAM,cAAc,GAAG,KAAK,CAAC,wBAAwB,CAAC;QACtD,MAAM,OAAO,GAAG,IAAA,4BAAmB,EAClC,MAAM,EACN,KAAK,CAAC,mBAAmB,EACzB,KAAK,CAAC,uBAAuB,EAC7B,MAAM,EACN,cAAc,EACd,KAAK,CAAC,UAAU,EAChB,KAAK,CAAC,cAAc,EACpB,KAAK,CAAC,SAAS,EACf,IAAI,CACJ,CAAC;QAGF,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;YACrB,CAAC,CAAC,WAAW,GAAG,SAAS,CAAC;QAC3B,CAAC,CAAC,CAAC;QAEH,OAAO,EAAE,CAAC;IACX,CAAC;CACD,CAAC","sourcesContent":["import { BoardEntity } from '../../../board-entity';\r\nimport { CardIds } from '../../../services/card-ids';\r\nimport { DeathrattleTriggeredInput } from '../../../simulation/deathrattle-on-trigger';\r\nimport { simplifiedSpawnEntities } from '../../../simulation/deathrattle-spawns';\r\nimport { performEntitySpawns } from '../../../simulation/spawns';\r\nimport { DeathrattleSpawnCard } from '../../card.interface';\r\n\r\nexport const TwilightHatchling: DeathrattleSpawnCard = {\r\n\tcardIds: [CardIds.TwilightHatchling_BG34_630, CardIds.TwilightHatchling_BG34_630_G],\r\n\tdeathrattleSpawn: (minion: BoardEntity, input: DeathrattleTriggeredInput): readonly BoardEntity[] => {\r\n\t\tconst mult = minion.cardId === CardIds.TwilightHatchling_BG34_630_G ? 2 : 1;\r\n\r\n\t\tconst spawns = simplifiedSpawnEntities(CardIds.TwilightHatchling_TwilightWhelpToken_BG34_630t, mult, input);\r\n\t\tspawns.forEach((e) => {\r\n\t\t\te.attackImmediately = true;\r\n\t\t});\r\n\t\tconst indexFromRight = input.deadEntityIndexFromRight;\r\n\t\tconst spawned = performEntitySpawns(\r\n\t\t\tspawns,\r\n\t\t\tinput.boardWithDeadEntity,\r\n\t\t\tinput.boardWithDeadEntityHero,\r\n\t\t\tminion,\r\n\t\t\tindexFromRight,\r\n\t\t\tinput.otherBoard,\r\n\t\t\tinput.otherBoardHero,\r\n\t\t\tinput.gameState,\r\n\t\t\ttrue,\r\n\t\t);\r\n\t\t// We do it this way because it can then re-attack\r\n\t\t// https://replays.firestoneapp.com/?reviewId=7c838df7-992b-4dae-ad96-c0f8a0d7872a&turn=7&action=0\r\n\t\tspawned.forEach((e) => {\r\n\t\t\te.hasAttacked = undefined;\r\n\t\t});\r\n\r\n\t\treturn [];\r\n\t},\r\n};\r\n"]}
|
|
@@ -24,6 +24,11 @@ const getTavernSpellEffectRepeatCount = (input) => {
|
|
|
24
24
|
2 * input.board.filter((e) => e.cardId === "BG33_825_G").length;
|
|
25
25
|
repeats += proudPrivateerExtra;
|
|
26
26
|
}
|
|
27
|
+
const cathedrals = input.hero.trinkets.filter((t) => t.cardId === "BG30_MagicItem_434" && t.scriptDataNum1 > 0);
|
|
28
|
+
repeats += cathedrals.length;
|
|
29
|
+
for (const cathedral of cathedrals) {
|
|
30
|
+
cathedral.scriptDataNum1--;
|
|
31
|
+
}
|
|
27
32
|
return repeats;
|
|
28
33
|
};
|
|
29
34
|
exports.getTavernSpellEffectRepeatCount = getTavernSpellEffectRepeatCount;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tavern-spell-repeat.js","sourceRoot":"","sources":["../../src/mechanics/tavern-spell-repeat.ts"],"names":[],"mappings":";;;AAOO,MAAM,+BAA+B,GAAG,CAAC,KAAqB,EAAU,EAAE;;IAChF,IAAI,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,IAAI,EAAE;QAChC,OAAO,CAAC,CAAC;KACT;IACD,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,MAAM,gBAAgB,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,iBAA0C,CAAC,CAAC;IACrG,MAAM,gBAAgB,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,eAAwC,CAAC,CAAC;IACnG,IACC,CAAC,gBAAgB,IAAI,gBAAgB,CAAC;QACtC,KAAK,CAAC,MAAM;QACZ,KAAK,CAAC,KAAK,CAAC,IAAI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AAc,CAAC,CAAC;IAErE,IAAI,aAAa,IAAI,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,IAAI,EAAE;QACjD,MAAM,mBAAmB,GACxB,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,eAAoC,CAAC,CAAC,MAAM;YAC9E,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,iBAAsC,CAAC,CAAC,MAAM,CAAC;QACtF,OAAO,IAAI,mBAAmB,CAAC;KAC/B;IAED,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAC5C,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,yBAAgD,IAAI,CAAC,CAAC,cAAc,GAAG,CAAC,CACvF,CAAC;IACF,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC;IAC7B,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE;QACnC,SAAS,CAAC,cAAc,EAAE,CAAC;KAC3B;IAED,OAAO,OAAO,CAAC;AAChB,CAAC,CAAC;AAtCW,QAAA,+BAA+B,mCAsC1C","sourcesContent":["import { CastSpellInput } from '../cards/card.interface';\r\nimport { CardIds } from '../services/card-ids';\r\n\r\n/**\r\n * Balinda Stonehearth: extra spell effect resolutions for spells you cast that target a friendly board minion.\r\n * Maelstrom Emergent: each copy adds +1 extra resolution (golden +2) for tavern spells you cast; stacks additively with Balinda.\r\n */\r\nexport const getTavernSpellEffectRepeatCount = (input: CastSpellInput): number => {\r\n\tif (input.source !== input.hero) {\r\n\t\treturn 1;\r\n\t}\r\n\tlet repeats = 1;\r\n\tconst hasGoldenBalinda = input.board.some((e) => e.cardId === CardIds.BalindaStonehearth_BG35_883_G);\r\n\tconst hasNormalBalinda = input.board.some((e) => e.cardId === CardIds.BalindaStonehearth_BG35_883);\r\n\tif (\r\n\t\t(hasGoldenBalinda || hasNormalBalinda) &&\r\n\t\tinput.target &&\r\n\t\tinput.board.some((e) => e.entityId === input.target.entityId)\r\n\t) {\r\n\t\trepeats = hasGoldenBalinda ? 3 : 2;\r\n\t}\r\n\tconst maelstromExtra =\r\n\t\tinput.board.filter((e) => e.cardId === CardIds.MaelstromEmergent_BG34_922).length +\r\n\t\t2 * input.board.filter((e) => e.cardId === CardIds.MaelstromEmergent_BG34_922_G).length;\r\n\trepeats += maelstromExtra;\r\n\r\n\tconst spellCard = input.gameState.allCards.getCard(input.spellCardId);\r\n\tconst isBountySpell = spellCard?.mechanics?.includes('BACON_BOUNTY');\r\n\t// Proud Privateer only affects bounties *you* (the hero) cast — same as Balinda / onTavernSpellCast.\r\n\tif (isBountySpell && input.source === input.hero) {\r\n\t\tconst proudPrivateerExtra =\r\n\t\t\tinput.board.filter((e) => e.cardId === CardIds.ProudPrivateer_BG33_825).length +\r\n\t\t\t2 * input.board.filter((e) => e.cardId === CardIds.ProudPrivateer_BG33_825_G).length;\r\n\t\trepeats += proudPrivateerExtra;\r\n\t}\r\n\r\n\tconst cathedrals = input.hero.trinkets.filter(\r\n\t\t(t) => t.cardId === CardIds.ReplicaCathedral_BG30_MagicItem_434 && t.scriptDataNum1 > 0,\r\n\t);\r\n\trepeats += cathedrals.length;\r\n\tfor (const cathedral of cathedrals) {\r\n\t\tcathedral.scriptDataNum1--;\r\n\t}\r\n\r\n\treturn repeats;\r\n};\r\n"]}
|
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isHandMinionCandidate = exports.getHighestAttackHandMinions = void 0;
|
|
4
4
|
const reference_data_1 = require("@firestone-hs/reference-data");
|
|
5
|
+
const utils_1 = require("./utils");
|
|
5
6
|
const getHighestAttackHandMinions = (hand, count, isMinionInHand) => {
|
|
6
7
|
if (!(hand === null || hand === void 0 ? void 0 : hand.length) || count <= 0) {
|
|
7
8
|
return [];
|
|
8
9
|
}
|
|
9
|
-
const scored = hand
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
scored.sort((a, b) => {
|
|
10
|
+
const scored = hand.map((entity, index) => ({ entity, index })).filter(({ entity }) => isMinionInHand(entity));
|
|
11
|
+
const randomized = (0, utils_1.shuffleArray)(scored);
|
|
12
|
+
randomized.sort((a, b) => {
|
|
13
13
|
var _a, _b;
|
|
14
14
|
const atkDiff = ((_a = b.entity.attack) !== null && _a !== void 0 ? _a : 0) - ((_b = a.entity.attack) !== null && _b !== void 0 ? _b : 0);
|
|
15
15
|
if (atkDiff !== 0) {
|
|
16
16
|
return atkDiff;
|
|
17
17
|
}
|
|
18
|
-
return
|
|
18
|
+
return 0;
|
|
19
19
|
});
|
|
20
|
-
return
|
|
20
|
+
return randomized.slice(0, count).map((s) => s.entity);
|
|
21
21
|
};
|
|
22
22
|
exports.getHighestAttackHandMinions = getHighestAttackHandMinions;
|
|
23
23
|
const isHandMinionCandidate = (entity, cardTypeUpper) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hand-minion-priority.js","sourceRoot":"","sources":["../../src/services/hand-minion-priority.ts"],"names":[],"mappings":";;;AAAA,iEAAwD;
|
|
1
|
+
{"version":3,"file":"hand-minion-priority.js","sourceRoot":"","sources":["../../src/services/hand-minion-priority.ts"],"names":[],"mappings":";;;AAAA,iEAAwD;AAExD,mCAAuC;AAMhC,MAAM,2BAA2B,GAAG,CAC1C,IAAwC,EACxC,KAAa,EACb,cAA2C,EAC3B,EAAE;IAClB,IAAI,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,CAAA,IAAI,KAAK,IAAI,CAAC,EAAE;QAChC,OAAO,EAAE,CAAC;KACV;IACD,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;IAC/G,MAAM,UAAU,GAAG,IAAA,oBAAY,EAAC,MAAM,CAAC,CAAC;IACxC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;;QACxB,MAAM,OAAO,GAAG,CAAC,MAAA,CAAC,CAAC,MAAM,CAAC,MAAM,mCAAI,CAAC,CAAC,GAAG,CAAC,MAAA,CAAC,CAAC,MAAM,CAAC,MAAM,mCAAI,CAAC,CAAC,CAAC;QAChE,IAAI,OAAO,KAAK,CAAC,EAAE;YAClB,OAAO,OAAO,CAAC;SACf;QAED,OAAO,CAAC,CAAC;IACV,CAAC,CAAC,CAAC;IACH,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AACxD,CAAC,CAAC;AAnBW,QAAA,2BAA2B,+BAmBtC;AAEK,MAAM,qBAAqB,GAAG,CACpC,MAAmB,EACnB,aAAiD,EACvC,EAAE;IACZ,OAAO,CAAC,CAAC,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,CAAA,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,yBAAQ,CAAC,yBAAQ,CAAC,MAAM,CAAC,CAAC;AACzG,CAAC,CAAC;AALW,QAAA,qBAAqB,yBAKhC","sourcesContent":["import { CardType } from '@firestone-hs/reference-data';\r\nimport { BoardEntity } from '../board-entity';\r\nimport { shuffleArray } from './utils';\r\n\r\n/**\r\n * Minions in hand with the highest current Attack.\r\n * Used by Expert Aviator, Diremuck Forager, etc.\r\n */\r\nexport const getHighestAttackHandMinions = (\r\n\thand: readonly BoardEntity[] | undefined,\r\n\tcount: number,\r\n\tisMinionInHand: (e: BoardEntity) => boolean,\r\n): BoardEntity[] => {\r\n\tif (!hand?.length || count <= 0) {\r\n\t\treturn [];\r\n\t}\r\n\tconst scored = hand.map((entity, index) => ({ entity, index })).filter(({ entity }) => isMinionInHand(entity));\r\n\tconst randomized = shuffleArray(scored);\r\n\trandomized.sort((a, b) => {\r\n\t\tconst atkDiff = (b.entity.attack ?? 0) - (a.entity.attack ?? 0);\r\n\t\tif (atkDiff !== 0) {\r\n\t\t\treturn atkDiff;\r\n\t\t}\r\n\t\t// UPDATE 2026-04-21: it doesn't look like we want to pick the earliest in hand anymore in case of ties\r\n\t\treturn 0; //a.index - b.index;\r\n\t});\r\n\treturn randomized.slice(0, count).map((s) => s.entity);\r\n};\r\n\r\nexport const isHandMinionCandidate = (\r\n\tentity: BoardEntity,\r\n\tcardTypeUpper: (id: string) => string | undefined,\r\n): boolean => {\r\n\treturn !!entity?.cardId && !entity.locked && cardTypeUpper(entity.cardId) === CardType[CardType.MINION];\r\n};\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spawns.js","sourceRoot":"","sources":["../../src/simulation/spawns.ts"],"names":[],"mappings":";;;AAEA,+DAAkF;AAClF,qCAA0C;AAE1C,6CAAqD;AAE9C,MAAM,mBAAmB,GAAG,CAClC,iBAAyC,EACzC,qBAAoC,EACpC,yBAA0C,EAC1C,iBAA+D,EAC/D,+BAAuC,EACvC,aAA4B,EAC5B,iBAAkC,EAClC,SAAwB,EACxB,cAAc,GAAG,IAAI,EACrB,cAA2B,IAAI,EACN,EAAE;;IAC3B,MAAM,YAAY,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;IACvG,MAAM,eAAe,GAAG,EAAE,CAAC;IAC3B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,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iBAAiB,GAAG,KAAK,CAAC;aACzC;iBAEI;gBACJ,SAAS,CAAC,iBAAiB,GAAG,KAAK,CAAC;aACpC;SACD;QAMD,IAAA,6CAAuB,EACtB,qBAAqB,EACrB,yBAAyB,EACzB,aAAa,EACb,iBAAiB,EACjB,CAAC,SAAS,CAAC,EACX,SAAS,CACT,CAAC;QACF,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE;YACtD,eAAe,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;SAChC;KACD;IAED,SAAS,CAAC,SAAS,CAAC,oBAAoB,CAAC,iBAAiB,EAAE,qBAAqB,EAAE,eAAe,CAAC,CAAC;IACpG,OAAO,eAAe,CAAC;AACxB,CAAC,CAAC;AAjFW,QAAA,mBAAmB,uBAiF9B","sourcesContent":["import { BgsPlayerEntity, BoardTrinket } from '../bgs-player-entity';\r\nimport { BoardEntity } from '../board-entity';\r\nimport { addMinionToBoard, handleAfterSpawnEffects } from './add-minion-to-board';\r\nimport { simulateAttack } from './attack';\r\nimport { FullGameState } from './internal-game-state';\r\nimport { onMinionFailedToSpawn } from './spawn-fail';\r\n\r\nexport const performEntitySpawns = (\r\n\tcandidateEntities: readonly BoardEntity[],\r\n\tboardWithKilledMinion: BoardEntity[],\r\n\tboardWithKilledMinionHero: BgsPlayerEntity,\r\n\tspawnSourceEntity: BoardEntity | BgsPlayerEntity | BoardTrinket,\r\n\tspawnSourceEntityIndexFromRight: number,\r\n\topponentBoard: BoardEntity[],\r\n\topponentBoardHero: BgsPlayerEntity,\r\n\tgameState: FullGameState,\r\n\tapplySelfAuras = true,\r\n\tforceTarget: BoardEntity = null,\r\n): readonly BoardEntity[] => {\r\n\tconst aliveEntites = candidateEntities.filter((entity) => entity.health > 0 && !entity.definitelyDead);\r\n\tconst spawnedEntities = [];\r\n\tfor (let i = 0; i < aliveEntites.length; i++) {\r\n\t\tconst newMinion = aliveEntites[i];\r\n\t\t// All entities have been spawned\r\n\t\tif (boardWithKilledMinion.length >= 7) {\r\n\t\t\tfor (let j = i; j < aliveEntites.length; j++) {\r\n\t\t\t\tonMinionFailedToSpawn(aliveEntites[j], boardWithKilledMinion, boardWithKilledMinionHero, gameState);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t// Avoid minions spawning backwards (we don't have this issue if we add all elements at\r\n\t\t// the same time, but here we want to be able to attack after each spawn, which in turn\r\n\t\t// means that the minion can die before the other one spawns)\r\n\t\t// In boardWithKilledMinion, the dead minion has already been removed\r\n\t\tspawnSourceEntityIndexFromRight = newMinion.spawnIndexFromRight ?? spawnSourceEntityIndexFromRight;\r\n\t\tconst indexToSpawnAt = Math.max(0, boardWithKilledMinion.length - spawnSourceEntityIndexFromRight);\r\n\t\taddMinionToBoard(\r\n\t\t\tboardWithKilledMinion,\r\n\t\t\tboardWithKilledMinionHero,\r\n\t\t\topponentBoard,\r\n\t\t\topponentBoardHero,\r\n\t\t\tindexToSpawnAt,\r\n\t\t\tnewMinion,\r\n\t\t\tgameState,\r\n\t\t\tapplySelfAuras,\r\n\t\t);\r\n\t\tif (newMinion.attackImmediately) {\r\n\t\t\t// Whenever we are already in a combat phase, we need to first clean up the state\r\n\t\t\tconst actualAttacker = simulateAttack(\r\n\t\t\t\tboardWithKilledMinion,\r\n\t\t\t\tboardWithKilledMinionHero,\r\n\t\t\t\topponentBoard,\r\n\t\t\t\topponentBoardHero,\r\n\t\t\t\tgameState,\r\n\t\t\t\t{ forceTarget: forceTarget },\r\n\t\t\t);\r\n\t\t\t// So that, even if the opponent's board is temporarily empty (e.g. no minion, but a token will\r\n\t\t\t// spawn in the enchantments resolution phase), the minion won't attack right away again\r\n\t\t\t// In case of attack immediately + multiple spawns minins, it's possible that the minion for which\r\n\t\t\t// we triggered the attack simulation was not the one who actually attacked\r\n\t\t\tif (actualAttacker) {\r\n\t\t\t\tactualAttacker.attackImmediately = false;\r\n\t\t\t}\r\n\t\t\t// Can happen if the attackImmediately minion spawns first, opponent board is empty, then opponent minino spawns\r\n\t\t\telse {\r\n\t\t\t\tnewMinion.attackImmediately = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// See https://replays.firestoneapp.com/?reviewId=aa23c9a3-2851-4c50-81b4-2d47d228a8fc&turn=7&action=4\r\n\t\t// Attack immediately resolves first, then the \"after spawn\"\r\n\t\t// 2026-04-21: it looks like this isn't how it works anymore, the Stalwart Kodo now procs before the \"attack\r\n\t\t// immediately\"\r\n\t\t// https://replays.firestoneapp.com/?reviewId=124fdc93-41db-4994-a66a-692fb525d47f&turn=27&action=1\r\n\t\thandleAfterSpawnEffects(\r\n\t\t\tboardWithKilledMinion,\r\n\t\t\tboardWithKilledMinionHero,\r\n\t\t\topponentBoard,\r\n\t\t\topponentBoardHero,\r\n\t\t\t[newMinion],\r\n\t\t\tgameState,\r\n\t\t);\r\n\t\tif (newMinion.health > 0 && !newMinion.definitelyDead) {\r\n\t\t\tspawnedEntities.push(newMinion);\r\n\t\t}\r\n\t}\r\n\r\n\tgameState.spectator.registerMinionsSpawn(spawnSourceEntity, boardWithKilledMinion, spawnedEntities);\r\n\treturn spawnedEntities;\r\n};\r\n"]}
|
|
@@ -8,7 +8,7 @@ const add_minion_to_board_1 = require("../add-minion-to-board");
|
|
|
8
8
|
const remove_minion_from_board_1 = require("../remove-minion-from-board");
|
|
9
9
|
const stats_1 = require("../stats");
|
|
10
10
|
const makeMinionGolden = (target, source, targetBoard, targetBoardHero, otherBoard, otherHero, gameState) => {
|
|
11
|
-
var _a;
|
|
11
|
+
var _a, _b;
|
|
12
12
|
if ((0, exports.isMinionGolden)(target, gameState.allCards)) {
|
|
13
13
|
return;
|
|
14
14
|
}
|
|
@@ -29,7 +29,10 @@ const makeMinionGolden = (target, source, targetBoard, targetBoardHero, otherBoa
|
|
|
29
29
|
const avengeCurrent = target.avengeCurrent;
|
|
30
30
|
(0, utils_1.addImpliedMechanics)(target, gameState.cardsData);
|
|
31
31
|
target.divineShield = hasDivineShield;
|
|
32
|
-
target.reborn =
|
|
32
|
+
target.reborn =
|
|
33
|
+
hasReborn ||
|
|
34
|
+
(((_a = goldenCard.mechanics) === null || _a === void 0 ? void 0 : _a.includes(reference_data_1.GameTag[reference_data_1.GameTag.REBORN])) &&
|
|
35
|
+
!((_b = refCard.mechanics) === null || _b === void 0 ? void 0 : _b.includes(reference_data_1.GameTag[reference_data_1.GameTag.REBORN])));
|
|
33
36
|
target.avengeCurrent = avengeCurrent;
|
|
34
37
|
target.gildedInCombat = true;
|
|
35
38
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"golden.js","sourceRoot":"","sources":["../../../src/simulation/utils/golden.ts"],"names":[],"mappings":";;;AAAA,iEAAwE;AAGxE,gFAAqG;AAErG,uCAAkD;AAClD,gEAAqE;AAErE,0EAA4E;AAC5E,oCAAuC;AAEhC,MAAM,gBAAgB,GAAG,CAC/B,MAAmB,EACnB,MAAoD,EACpD,WAA0B,EAC1B,eAAgC,EAChC,UAAyB,EACzB,SAA0B,EAC1B,SAAwB,EACjB,EAAE;;IAET,IAAI,IAAA,sBAAc,EAAC,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC,EAAE;QAC/C,OAAO;KACP;IAED,SAAS,CAAC,SAAS,CAAC,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAGjF,IAAA,wDAA6B,EAAC,WAAW,EAAE,MAAM,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC;IAI/E,gCAAgC,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAE1D,MAAM,OAAO,GAAG,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC1D,IAAI,UAAU,GAAG,SAAS,CAAC,QAAQ,CAAC,gBAAgB,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC;IAExF,IAAI,CAAC,CAAA,UAAU,aAAV,UAAU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,CAAC,gCAAgC,GAAG,CAAC,CAAC;YACtF,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,GAAG,gBAAgB,GAAG,wBAAwB,CAAC,CAAC;YAC7F,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,GAAG,gBAAgB,GAAG,wBAAwB,CAAC,CAAC;YAC7F,MAAM;QACP,gBAAqC;QACrC;YACC,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,iBAAsC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACrF,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,kBAAkB,GAAG,gBAAgB,CAAC,CAAC;YACvG,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,kBAAkB,GAAG,gBAAgB,CAAC,CAAC;YACvG,MAAM;KACP;AACF,CAAC,CAAC","sourcesContent":["import { AllCardsService, GameTag } from '@firestone-hs/reference-data';\r\nimport { BgsPlayerEntity, BoardTrinket } from '../../bgs-player-entity';\r\nimport { BoardEntity } from '../../board-entity';\r\nimport { eternalKnightAttack, eternalKnightHealth } from '../../cards/impl/trinket/eternal-portrait';\r\nimport { CardIds } from '../../services/card-ids';\r\nimport { addImpliedMechanics } from '../../utils';\r\nimport { handleAddedMinionAuraEffect } from '../add-minion-to-board';\r\nimport { FullGameState } from '../internal-game-state';\r\nimport { handleMinionRemovedAuraEffect } from '../remove-minion-from-board';\r\nimport { modifyStats } from '../stats';\r\n\r\nexport const makeMinionGolden = (\r\n\ttarget: BoardEntity,\r\n\tsource: BoardEntity | BgsPlayerEntity | BoardTrinket,\r\n\ttargetBoard: BoardEntity[],\r\n\ttargetBoardHero: BgsPlayerEntity,\r\n\totherBoard: BoardEntity[],\r\n\totherHero: BgsPlayerEntity,\r\n\tgameState: FullGameState,\r\n): void => {\r\n\t// Typically, we are already golden\r\n\tif (isMinionGolden(target, gameState.allCards)) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tgameState.spectator.registerPowerTarget(source, target, targetBoard, null, null);\r\n\r\n\t// console.log('before transforming minion', stringifySimple(targetBoard, allCards));\r\n\thandleMinionRemovedAuraEffect(targetBoard, target, targetBoardHero, gameState);\r\n\t// Specific for making a minion golden\r\n\t// This is not handled in handleMinionRemovedAuraEffect, though I'm not entirely sure why. Maybe because it's a self-effect only?\r\n\t// Also, because of how I implemented auras and such, it's probably good to have something specific for golden\r\n\tremoveMinionAuraEffectsForGolden(target, targetBoardHero);\r\n\t// console.log('after removed effect', stringifySimple(targetBoard, allCards));\r\n\tconst refCard = gameState.allCards.getCard(target.cardId);\r\n\tlet goldenCard = gameState.allCards.getCardFromDbfId(refCard.battlegroundsPremiumDbfId);\r\n\t// Happens when there is no dedicated golden card, like for the Bettle token from Boon of Beetles\r\n\tif (!goldenCard?.id) {\r\n\t\tgoldenCard = refCard;\r\n\t}\r\n\r\n\t// A minion becoming golden ignore the current death.\r\n\t// This way of handling it is not ideal, since it will still trigger if both avenges trigger at the same time, but\r\n\t// should solve the other cases\r\n\t// Update 2024-06-21: I'm not sure what this is about exactly. See\r\n\t// http://replays.firestoneapp.com/?reviewId=5d94ebeb-3691-4509-88de-5d5418b20597&turn=11&action=2\r\n\t// The Sr. Tomb Diver dies, thus gilding the Phaerix. Two other deaths later, the avenge procs\r\n\t// This means the death of the diver counted normally\r\n\t// target.avengeCurrent = Math.min(target.avengeDefault, target.avengeCurrent + 1);\r\n\r\n\t// Only change the card ID after modifying the stats, so that some effects (like Tarecgosa) won't trigger\r\n\t// too early\r\n\t// TODO: add a replay with Tarec to illustrate the difference with Defiant Shipwright, and\r\n\t// check if there is something different with Tarec\r\n\ttarget.cardId = goldenCard.id;\r\n\t// 33.6.2 (https://replays.firestoneapp.com/?reviewId=3b025701-01f5-4527-9d53-d8d67f78c5c8&turn=7&action=0)\r\n\t// The Phylactery enchantment exists before the Golden Deathrattle power so it goes first.\r\n\t// This most likely means that we need to create a new entityId when gilding a minion, so that it\r\n\t// is processed in the correct order.\r\n\ttarget.entityId = gameState.sharedState.currentEntityId++;\r\n\r\n\t// The rule for golden minions is to add the base stats\r\n\t// TO CHECK: not sure that this is what actually happens (i.e. do minions that trigger on stats modifications\r\n\t// trigger?)\r\n\t// UPDATE 2024-06-20: Defiant Shipwright (2/5) going golden (4/10) actually ends up at 4/12 because\r\n\t// of the +2 health bonus\r\n\t// http://replays.firestoneapp.com/?reviewId=283dc44c-5fc8-40fb-af89-7d752a39f9b9&turn=7&action=1\r\n\t// BUT (2025-05-10) Tarecgosa going golden just becomes a 10/10, it doesn't get the x2 from the buff\r\n\t// Maybe that's because it's not an enchantment, so let's just hard-code this here\r\n\t// (bug: it won't work with Poets)\r\n\t// Update 2025-05-05: Whelp Smuggler going golden doesn't not trigger the other whelp smuggler stat buff\r\n\t// https://replays.firestoneapp.com/?reviewId=253ddf7c-be1b-44f4-aa78-9a23442d3687&turn=15&action=0\r\n\t// So I'm just modifying the stats here without triggering any side-effects\r\n\t// target.attack += refCard.attack;\r\n\t// target.health += refCard.health;\r\n\t// UPDATE 33.6: Defiant Shipwright going golden triggers its effect. Not sure how this should behave\r\n\t// https://replays.firestoneapp.com/?reviewId=52ae764d-6dc8-43cc-bd00-035a121e2388&turn=11&action=0\r\n\tmodifyStats(target, null, refCard.attack, refCard.health, targetBoard, targetBoardHero, gameState, true, false);\r\n\r\n\t// console.log('before adding new effect', stringifySimple(targetBoard, allCards));\r\n\thandleAddedMinionAuraEffect(targetBoard, targetBoardHero, otherBoard, otherHero, target, gameState, true, false);\r\n\tconst hasDivineShield = target.divineShield;\r\n\tconst hasReborn = target.reborn;\r\n\tconst avengeCurrent = target.avengeCurrent;\r\n\taddImpliedMechanics(target, gameState.cardsData);\r\n\r\n\t// addImpliedMechanics grants divine shield if the card has divine shield, or if the entity had\r\n\t// it at some point. That means that when we gild Zilliax: Defense Module (with Divine Shield) into\r\n\t// Zilliaw: Assembled, we restore the divine shield, while we shouldn't\r\n\ttarget.divineShield = hasDivineShield;\r\n\t// Update 2024-06-19: Hat tested on one of their build, and gilding a zilliax module should NOT\r\n\t// remove its divine shield / reborn status\r\n\t// Gilding a reborn Risen Rider results into a golden Risen Rider with reborn\r\n\t// http://replays.firestoneapp.com/?reviewId=c553c3e7-01e2-494d-80f8-69f33c08fb39&turn=7&action=4\r\n\ttarget.reborn = hasReborn || goldenCard.mechanics?.includes(GameTag[GameTag.REBORN]);\r\n\t// target.windfury = refGoldenCard.mechanics?.includes(GameTag[GameTag.WINDFURY]);\r\n\t// target.taunt = refGoldenCard.mechanics?.includes(GameTag[GameTag.TAUNT]);\r\n\t// target.stealth = refGoldenCard.mechanics?.includes(GameTag[GameTag.STEALTH]);\r\n\ttarget.avengeCurrent = avengeCurrent;\r\n\ttarget.gildedInCombat = true;\r\n\r\n\t// console.log('after adding new effect', stringifySimple(targetBoard, allCards));\r\n};\r\n\r\nexport const isMinionGolden = (entity: BoardEntity, allCards: AllCardsService): boolean => {\r\n\tconst ref = allCards.getCard(entity.cardId);\r\n\t// Some cards (like the Bettle token from Boon of Beetles) don't have a premium dbf id. However, we can still\r\n\t// gild it\r\n\treturn ref.premium;\r\n};\r\n\r\n// This feels wrong, and is probably an indicator that auras are not applied at the right time\r\nconst removeMinionAuraEffectsForGolden = (entity: BoardEntity, hero: BgsPlayerEntity) => {\r\n\tswitch (entity.cardId) {\r\n\t\tcase CardIds.EternalKnight_BG25_008:\r\n\t\tcase CardIds.EternalKnight_BG25_008_G:\r\n\t\t\tconst eternalKnightBuffToRemove = hero.globalInfo.EternalKnightsDeadThisGame;\r\n\t\t\tconst eternalKnighMultiplier = entity.cardId === CardIds.EternalKnight_BG25_008_G ? 2 : 1;\r\n\t\t\tentity.health = Math.max(\r\n\t\t\t\t1,\r\n\t\t\t\tentity.health - eternalKnightHealth * eternalKnighMultiplier * eternalKnightBuffToRemove,\r\n\t\t\t);\r\n\t\t\tentity.attack = Math.max(\r\n\t\t\t\t0,\r\n\t\t\t\tentity.attack - eternalKnightAttack * eternalKnighMultiplier * eternalKnightBuffToRemove,\r\n\t\t\t);\r\n\t\t\tbreak;\r\n\t\tcase CardIds.SanlaynScribe_BGDUO31_208:\r\n\t\tcase CardIds.SanlaynScribe_BGDUO31_208_G:\r\n\t\t\tconst sanlaynBuffToRemove = hero.globalInfo.SanlaynScribesDeadThisGame;\r\n\t\t\tconst sanlaynMultiplier = entity.cardId === CardIds.SanlaynScribe_BGDUO31_208_G ? 2 : 1;\r\n\t\t\tentity.health = Math.max(1, entity.health - sanlaynMultiplier * sanlaynBuffToRemove);\r\n\t\t\tentity.attack = Math.max(0, entity.attack - sanlaynMultiplier * sanlaynBuffToRemove);\r\n\t\t\tbreak;\r\n\t\tcase CardIds.AstralAutomaton_BG_TTN_401:\r\n\t\tcase CardIds.AstralAutomaton_BG_TTN_401_G:\r\n\t\t\tconst multiplierAstral = entity.cardId === CardIds.AstralAutomaton_BG_TTN_401_G ? 2 : 1;\r\n\t\t\t// Doesn't count self\r\n\t\t\tconst statsBonusAstralToRemove = hero.globalInfo.AstralAutomatonsSummonedThisGame - 1;\r\n\t\t\tentity.health = Math.max(1, entity.health - 3 * multiplierAstral * statsBonusAstralToRemove);\r\n\t\t\tentity.attack = Math.max(0, entity.attack - 2 * multiplierAstral * statsBonusAstralToRemove);\r\n\t\t\tbreak;\r\n\t\tcase CardIds.DrBoomsMonster_BG31_176:\r\n\t\tcase CardIds.DrBoomsMonster_BG31_176_G:\r\n\t\t\tconst multiplierDrBoom = entity.cardId === CardIds.DrBoomsMonster_BG31_176_G ? 2 : 1;\r\n\t\t\tentity.health = Math.max(1, entity.health - 2 * hero.globalInfo.MagnetizedThisGame * multiplierDrBoom);\r\n\t\t\tentity.attack = Math.max(0, entity.attack - 2 * hero.globalInfo.MagnetizedThisGame * multiplierDrBoom);\r\n\t\t\tbreak;\r\n\t}\r\n};\r\n"]}
|
|
1
|
+
{"version":3,"file":"golden.js","sourceRoot":"","sources":["../../../src/simulation/utils/golden.ts"],"names":[],"mappings":";;;AAAA,iEAAwE;AAGxE,gFAAqG;AAErG,uCAAkD;AAClD,gEAAqE;AAErE,0EAA4E;AAC5E,oCAAuC;AAEhC,MAAM,gBAAgB,GAAG,CAC/B,MAAmB,EACnB,MAAoD,EACpD,WAA0B,EAC1B,eAAgC,EAChC,UAAyB,EACzB,SAA0B,EAC1B,SAAwB,EACjB,EAAE;;IAET,IAAI,IAAA,sBAAc,EAAC,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC,EAAE;QAC/C,OAAO;KACP;IAED,SAAS,CAAC,SAAS,CAAC,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAGjF,IAAA,wDAA6B,EAAC,WAAW,EAAE,MAAM,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC;IAI/E,gCAAgC,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAE1D,MAAM,OAAO,GAAG,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC1D,IAAI,UAAU,GAAG,SAAS,CAAC,QAAQ,CAAC,gBAAgB,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC;IAExF,IAAI,CAAC,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,EAAE,CAAA,EAAE;QACpB,UAAU,GAAG,OAAO,CAAC;KACrB;IAeD,MAAM,CAAC,MAAM,GAAG,UAAU,CAAC,EAAE,CAAC;IAK9B,MAAM,CAAC,QAAQ,GAAG,SAAS,CAAC,WAAW,CAAC,eAAe,EAAE,CAAC;IAk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CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,GAAG,gBAAgB,GAAG,wBAAwB,CAAC,CAAC;YAC7F,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,GAAG,gBAAgB,GAAG,wBAAwB,CAAC,CAAC;YAC7F,MAAM;QACP,gBAAqC;QACrC;YACC,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,iBAAsC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACrF,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,kBAAkB,GAAG,gBAAgB,CAAC,CAAC;YACvG,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,kBAAkB,GAAG,gBAAgB,CAAC,CAAC;YACvG,MAAM;KACP;AACF,CAAC,CAAC","sourcesContent":["import { AllCardsService, GameTag } from '@firestone-hs/reference-data';\r\nimport { BgsPlayerEntity, BoardTrinket } from '../../bgs-player-entity';\r\nimport { BoardEntity } from '../../board-entity';\r\nimport { eternalKnightAttack, eternalKnightHealth } from '../../cards/impl/trinket/eternal-portrait';\r\nimport { CardIds } from '../../services/card-ids';\r\nimport { addImpliedMechanics } from '../../utils';\r\nimport { handleAddedMinionAuraEffect } from '../add-minion-to-board';\r\nimport { FullGameState } from '../internal-game-state';\r\nimport { handleMinionRemovedAuraEffect } from '../remove-minion-from-board';\r\nimport { modifyStats } from '../stats';\r\n\r\nexport const makeMinionGolden = (\r\n\ttarget: BoardEntity,\r\n\tsource: BoardEntity | BgsPlayerEntity | BoardTrinket,\r\n\ttargetBoard: BoardEntity[],\r\n\ttargetBoardHero: BgsPlayerEntity,\r\n\totherBoard: BoardEntity[],\r\n\totherHero: BgsPlayerEntity,\r\n\tgameState: FullGameState,\r\n): void => {\r\n\t// Typically, we are already golden\r\n\tif (isMinionGolden(target, gameState.allCards)) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tgameState.spectator.registerPowerTarget(source, target, targetBoard, null, null);\r\n\r\n\t// console.log('before transforming minion', stringifySimple(targetBoard, allCards));\r\n\thandleMinionRemovedAuraEffect(targetBoard, target, targetBoardHero, gameState);\r\n\t// Specific for making a minion golden\r\n\t// This is not handled in handleMinionRemovedAuraEffect, though I'm not entirely sure why. Maybe because it's a self-effect only?\r\n\t// Also, because of how I implemented auras and such, it's probably good to have something specific for golden\r\n\tremoveMinionAuraEffectsForGolden(target, targetBoardHero);\r\n\t// console.log('after removed effect', stringifySimple(targetBoard, allCards));\r\n\tconst refCard = gameState.allCards.getCard(target.cardId);\r\n\tlet goldenCard = gameState.allCards.getCardFromDbfId(refCard.battlegroundsPremiumDbfId);\r\n\t// Happens when there is no dedicated golden card, like for the Bettle token from Boon of Beetles\r\n\tif (!goldenCard?.id) {\r\n\t\tgoldenCard = refCard;\r\n\t}\r\n\r\n\t// A minion becoming golden ignore the current death.\r\n\t// This way of handling it is not ideal, since it will still trigger if both avenges trigger at the same time, but\r\n\t// should solve the other cases\r\n\t// Update 2024-06-21: I'm not sure what this is about exactly. See\r\n\t// http://replays.firestoneapp.com/?reviewId=5d94ebeb-3691-4509-88de-5d5418b20597&turn=11&action=2\r\n\t// The Sr. Tomb Diver dies, thus gilding the Phaerix. Two other deaths later, the avenge procs\r\n\t// This means the death of the diver counted normally\r\n\t// target.avengeCurrent = Math.min(target.avengeDefault, target.avengeCurrent + 1);\r\n\r\n\t// Only change the card ID after modifying the stats, so that some effects (like Tarecgosa) won't trigger\r\n\t// too early\r\n\t// TODO: add a replay with Tarec to illustrate the difference with Defiant Shipwright, and\r\n\t// check if there is something different with Tarec\r\n\ttarget.cardId = goldenCard.id;\r\n\t// 33.6.2 (https://replays.firestoneapp.com/?reviewId=3b025701-01f5-4527-9d53-d8d67f78c5c8&turn=7&action=0)\r\n\t// The Phylactery enchantment exists before the Golden Deathrattle power so it goes first.\r\n\t// This most likely means that we need to create a new entityId when gilding a minion, so that it\r\n\t// is processed in the correct order.\r\n\ttarget.entityId = gameState.sharedState.currentEntityId++;\r\n\r\n\t// The rule for golden minions is to add the base stats\r\n\t// TO CHECK: not sure that this is what actually happens (i.e. do minions that trigger on stats modifications\r\n\t// trigger?)\r\n\t// UPDATE 2024-06-20: Defiant Shipwright (2/5) going golden (4/10) actually ends up at 4/12 because\r\n\t// of the +2 health bonus\r\n\t// http://replays.firestoneapp.com/?reviewId=283dc44c-5fc8-40fb-af89-7d752a39f9b9&turn=7&action=1\r\n\t// BUT (2025-05-10) Tarecgosa going golden just becomes a 10/10, it doesn't get the x2 from the buff\r\n\t// Maybe that's because it's not an enchantment, so let's just hard-code this here\r\n\t// (bug: it won't work with Poets)\r\n\t// Update 2025-05-05: Whelp Smuggler going golden doesn't not trigger the other whelp smuggler stat buff\r\n\t// https://replays.firestoneapp.com/?reviewId=253ddf7c-be1b-44f4-aa78-9a23442d3687&turn=15&action=0\r\n\t// So I'm just modifying the stats here without triggering any side-effects\r\n\t// target.attack += refCard.attack;\r\n\t// target.health += refCard.health;\r\n\t// UPDATE 33.6: Defiant Shipwright going golden triggers its effect. Not sure how this should behave\r\n\t// https://replays.firestoneapp.com/?reviewId=52ae764d-6dc8-43cc-bd00-035a121e2388&turn=11&action=0\r\n\tmodifyStats(target, null, refCard.attack, refCard.health, targetBoard, targetBoardHero, gameState, true, false);\r\n\r\n\t// console.log('before adding new effect', stringifySimple(targetBoard, allCards));\r\n\thandleAddedMinionAuraEffect(targetBoard, targetBoardHero, otherBoard, otherHero, target, gameState, true, false);\r\n\tconst hasDivineShield = target.divineShield;\r\n\tconst hasReborn = target.reborn;\r\n\tconst avengeCurrent = target.avengeCurrent;\r\n\taddImpliedMechanics(target, gameState.cardsData);\r\n\r\n\t// addImpliedMechanics grants divine shield if the card has divine shield, or if the entity had\r\n\t// it at some point. That means that when we gild Zilliax: Defense Module (with Divine Shield) into\r\n\t// Zilliaw: Assembled, we restore the divine shield, while we shouldn't\r\n\ttarget.divineShield = hasDivineShield;\r\n\t// Update 2024-06-19: Hat tested on one of their build, and gilding a zilliax module should NOT\r\n\t// remove its divine shield / reborn status\r\n\t// Gilding a reborn Risen Rider results into a golden Risen Rider with reborn\r\n\t// http://replays.firestoneapp.com/?reviewId=c553c3e7-01e2-494d-80f8-69f33c08fb39&turn=7&action=4\r\n\t// UPDATE 2026-04-17: Looks like this has been fixed / changed\r\n\t// https://replays.firestoneapp.com/?reviewId=5365a382-9c28-4cd8-8760-e7666cb701f3&turn=7&action=0\r\n\ttarget.reborn =\r\n\t\thasReborn ||\r\n\t\t(goldenCard.mechanics?.includes(GameTag[GameTag.REBORN]) &&\r\n\t\t\t!refCard.mechanics?.includes(GameTag[GameTag.REBORN]));\r\n\t// target.windfury = refGoldenCard.mechanics?.includes(GameTag[GameTag.WINDFURY]);\r\n\t// target.taunt = refGoldenCard.mechanics?.includes(GameTag[GameTag.TAUNT]);\r\n\t// target.stealth = refGoldenCard.mechanics?.includes(GameTag[GameTag.STEALTH]);\r\n\ttarget.avengeCurrent = avengeCurrent;\r\n\ttarget.gildedInCombat = true;\r\n};\r\n\r\nexport const isMinionGolden = (entity: BoardEntity, allCards: AllCardsService): boolean => {\r\n\tconst ref = allCards.getCard(entity.cardId);\r\n\t// Some cards (like the Bettle token from Boon of Beetles) don't have a premium dbf id. However, we can still\r\n\t// gild it\r\n\treturn ref.premium;\r\n};\r\n\r\n// This feels wrong, and is probably an indicator that auras are not applied at the right time\r\nconst removeMinionAuraEffectsForGolden = (entity: BoardEntity, hero: BgsPlayerEntity) => {\r\n\tswitch (entity.cardId) {\r\n\t\tcase CardIds.EternalKnight_BG25_008:\r\n\t\tcase CardIds.EternalKnight_BG25_008_G:\r\n\t\t\tconst eternalKnightBuffToRemove = hero.globalInfo.EternalKnightsDeadThisGame;\r\n\t\t\tconst eternalKnighMultiplier = entity.cardId === CardIds.EternalKnight_BG25_008_G ? 2 : 1;\r\n\t\t\tentity.health = Math.max(\r\n\t\t\t\t1,\r\n\t\t\t\tentity.health - eternalKnightHealth * eternalKnighMultiplier * eternalKnightBuffToRemove,\r\n\t\t\t);\r\n\t\t\tentity.attack = Math.max(\r\n\t\t\t\t0,\r\n\t\t\t\tentity.attack - eternalKnightAttack * eternalKnighMultiplier * eternalKnightBuffToRemove,\r\n\t\t\t);\r\n\t\t\tbreak;\r\n\t\tcase CardIds.SanlaynScribe_BGDUO31_208:\r\n\t\tcase CardIds.SanlaynScribe_BGDUO31_208_G:\r\n\t\t\tconst sanlaynBuffToRemove = hero.globalInfo.SanlaynScribesDeadThisGame;\r\n\t\t\tconst sanlaynMultiplier = entity.cardId === CardIds.SanlaynScribe_BGDUO31_208_G ? 2 : 1;\r\n\t\t\tentity.health = Math.max(1, entity.health - sanlaynMultiplier * sanlaynBuffToRemove);\r\n\t\t\tentity.attack = Math.max(0, entity.attack - sanlaynMultiplier * sanlaynBuffToRemove);\r\n\t\t\tbreak;\r\n\t\tcase CardIds.AstralAutomaton_BG_TTN_401:\r\n\t\tcase CardIds.AstralAutomaton_BG_TTN_401_G:\r\n\t\t\tconst multiplierAstral = entity.cardId === CardIds.AstralAutomaton_BG_TTN_401_G ? 2 : 1;\r\n\t\t\t// Doesn't count self\r\n\t\t\tconst statsBonusAstralToRemove = hero.globalInfo.AstralAutomatonsSummonedThisGame - 1;\r\n\t\t\tentity.health = Math.max(1, entity.health - 3 * multiplierAstral * statsBonusAstralToRemove);\r\n\t\t\tentity.attack = Math.max(0, entity.attack - 2 * multiplierAstral * statsBonusAstralToRemove);\r\n\t\t\tbreak;\r\n\t\tcase CardIds.DrBoomsMonster_BG31_176:\r\n\t\tcase CardIds.DrBoomsMonster_BG31_176_G:\r\n\t\t\tconst multiplierDrBoom = entity.cardId === CardIds.DrBoomsMonster_BG31_176_G ? 2 : 1;\r\n\t\t\tentity.health = Math.max(1, entity.health - 2 * hero.globalInfo.MagnetizedThisGame * multiplierDrBoom);\r\n\t\t\tentity.attack = Math.max(0, entity.attack - 2 * hero.globalInfo.MagnetizedThisGame * multiplierDrBoom);\r\n\t\t\tbreak;\r\n\t}\r\n};\r\n"]}
|