@firestone-hs/simulate-bgs-battle 1.1.574 → 1.1.576
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/board-secret.d.ts +1 -0
- package/dist/board-secret.js.map +1 -1
- package/dist/cards/impl/hero-power/rapid-reanimation.js +1 -2
- package/dist/cards/impl/hero-power/rapid-reanimation.js.map +1 -1
- package/dist/cards/impl/minion/corrupted-bristler.js +1 -1
- package/dist/cards/impl/minion/corrupted-bristler.js.map +1 -1
- package/dist/cards/impl/minion/fire-forged-evoker.js +2 -1
- package/dist/cards/impl/minion/fire-forged-evoker.js.map +1 -1
- package/dist/cards/impl/minion/flighty-scout.js +1 -1
- package/dist/cards/impl/minion/flighty-scout.js.map +1 -1
- package/dist/cards/impl/spell/fleeting-vigor.js +1 -1
- package/dist/cards/impl/spell/fleeting-vigor.js.map +1 -1
- package/dist/cards/impl/trinket/beetle-band.js +3 -1
- package/dist/cards/impl/trinket/beetle-band.js.map +1 -1
- package/dist/cards/impl/trinket/eclectic-shrine.js +1 -1
- package/dist/cards/impl/trinket/eclectic-shrine.js.map +1 -1
- package/dist/input-sanitation.js +0 -1
- package/dist/input-sanitation.js.map +1 -1
- package/dist/simulation/auras.js +1 -1
- package/dist/simulation/auras.js.map +1 -1
- package/dist/simulation/deathrattle-effects.js +14 -4
- package/dist/simulation/deathrattle-effects.js.map +1 -1
- package/dist/simulation/deathrattle-spawns.js +1 -0
- package/dist/simulation/deathrattle-spawns.js.map +1 -1
- package/dist/simulation/spawns.d.ts +2 -2
- package/dist/simulation/spawns.js.map +1 -1
- package/dist/simulation/spectator/spectator.d.ts +1 -1
- package/dist/simulation/spectator/spectator.js.map +1 -1
- package/dist/simulation/start-of-combat/soc-anomalies.js +11 -6
- package/dist/simulation/start-of-combat/soc-anomalies.js.map +1 -1
- package/dist/simulation/start-of-combat/soc-hero-power.js +11 -5
- package/dist/simulation/start-of-combat/soc-hero-power.js.map +1 -1
- package/dist/simulation/start-of-combat/soc-illidan-hero-power.js +13 -7
- package/dist/simulation/start-of-combat/soc-illidan-hero-power.js.map +1 -1
- package/dist/simulation/start-of-combat/soc-minion.js +10 -3
- package/dist/simulation/start-of-combat/soc-minion.js.map +1 -1
- package/dist/simulation/start-of-combat/soc-pre-combat-hero-power.js +11 -5
- package/dist/simulation/start-of-combat/soc-pre-combat-hero-power.js.map +1 -1
- package/dist/simulation/start-of-combat/soc-quest-reward.js +11 -5
- package/dist/simulation/start-of-combat/soc-quest-reward.js.map +1 -1
- package/dist/simulation/start-of-combat/soc-secret.js +11 -6
- package/dist/simulation/start-of-combat/soc-secret.js.map +1 -1
- package/dist/simulation/start-of-combat/soc-trinket.js +8 -2
- package/dist/simulation/start-of-combat/soc-trinket.js.map +1 -1
- package/dist/simulation/start-of-combat/start-of-combat.js +26 -23
- package/dist/simulation/start-of-combat/start-of-combat.js.map +1 -1
- package/dist/simulation/stats.js +0 -8
- package/dist/simulation/stats.js.map +1 -1
- package/dist/utils.js +5 -3
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
package/dist/board-secret.d.ts
CHANGED
package/dist/board-secret.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"board-secret.js","sourceRoot":"","sources":["../src/board-secret.ts"],"names":[],"mappings":"","sourcesContent":["export interface BoardSecret {\r\n\tentityId: number;\r\n\tcardId: string;\r\n\ttriggered?: boolean;\r\n\tscriptDataNum1?: number;\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"board-secret.js","sourceRoot":"","sources":["../src/board-secret.ts"],"names":[],"mappings":"","sourcesContent":["export interface BoardSecret {\r\n\tentityId: number;\r\n\tcardId: string;\r\n\ttriggered?: boolean;\r\n\tscriptDataNum1?: number;\r\n\tscriptDataNum2?: number;\r\n}\r\n"]}
|
|
@@ -16,8 +16,7 @@ exports.RapidReanimation = {
|
|
|
16
16
|
a.enchantments.find((e) => e.cardId === "BG25_HERO_103pe").originEntityId || b.entityId - a.entityId)[0];
|
|
17
17
|
if (minionThatWillDie) {
|
|
18
18
|
const rapidReanimationIndexFromLeft = input.playerBoard.indexOf(minionThatWillDie);
|
|
19
|
-
input.playerEntity.rapidReanimationIndexFromRight =
|
|
20
|
-
input.playerBoard.length - 1 - rapidReanimationIndexFromLeft;
|
|
19
|
+
input.playerEntity.rapidReanimationIndexFromRight = 0;
|
|
21
20
|
const minionToCopy = (0, utils_1.copyEntity)(minionThatWillDie);
|
|
22
21
|
(0, add_minion_to_board_1.removeAurasFromSelf)(minionToCopy, input.playerBoard, input.playerEntity, input.gameState);
|
|
23
22
|
input.playerEntity.rapidReanimationMinion = minionToCopy;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rapid-reanimation.js","sourceRoot":"","sources":["../../../../src/cards/impl/hero-power/rapid-reanimation.ts"],"names":[],"mappings":";;;AAEA,iFAA8E;AAE9E,0CAA4C;AAG/B,QAAA,gBAAgB,GAAsB;IAClD,mBAAmB,EAAE,YAAY;IACjC,OAAO,EAAE,kBAAyC;IAClD,aAAa,EAAE,CAAC,OAAqB,EAAE,KAAe,EAAE,EAAE;QACzD,KAAK,MAAM,SAAS,IAAI,KAAK,CAAC,YAAY,CAAC,UAAU,EAAE;YACtD,IAAI,wBAAgB,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,SAAS,CAAC,IAAI,EAAE;gBAM1E,MAAM,iBAAiB,GAAG,KAAK,CAAC,WAAW;qBACzC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CACb,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,sBAAuD,CAAC,CAC3F;qBACA,IAAI,CACJ,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CACR,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,sBAAuD,CAA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,sBAAuD,CACtE,CAAC,cAAc,IAAI,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,QAAQ,CAC7C,CAAC,CAAC,CAAC,CAAC;gBACN,IAAI,iBAAiB,EAAE;oBAUtB,MAAM,6BAA6B,GAAG,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;oBAEnF,KAAK,CAAC,YAAY,CAAC,8BAA8B,GAAG,CAAC,CAAC;oBAEtD,MAAM,YAAY,GAAG,IAAA,kBAAU,EAAC,iBAAiB,CAAC,CAAC;oBAGnD,IAAA,yCAAmB,EAAC,YAAY,EAAE,KAAK,CAAC,WAAW,EAAE,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;oBAC1F,KAAK,CAAC,YAAY,CAAC,sBAAsB,GAAG,YAAY,CAAC;oBACzD,iBAAiB,CAAC,cAAc,GAAG,IAAI,CAAC;oBACxC,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,mBAAmB,CAC5C,KAAK,CAAC,YAAY,EAClB,iBAAiB,EACjB,KAAK,CAAC,WAAW,EACjB,KAAK,CAAC,YAAY,EAClB,KAAK,CAAC,cAAc,CACpB,CAAC;oBACF,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,8BAA8B,EAAE,IAAI,EAAE,CAAC;iBACpE;aACD;SACD;IACF,CAAC;CACD,CAAC","sourcesContent":["import { CardIds } from '@firestone-hs/reference-data';\r\nimport { BoardTrinket } from '../../../bgs-player-entity';\r\nimport { removeAurasFromSelf } from '../../../simulation/add-minion-to-board';\r\nimport { SoCInput } from '../../../simulation/start-of-combat/start-of-combat-input';\r\nimport { copyEntity } from '../../../utils';\r\nimport { StartOfCombatCard } from '../../card.interface';\r\n\r\nexport const RapidReanimation: StartOfCombatCard = {\r\n\tstartOfCombatTiming: 'pre-combat',\r\n\tcardIds: [CardIds.TeronGorefiend_RapidReanimation],\r\n\tstartOfCombat: (trinket: BoardTrinket, input: SoCInput) => {\r\n\t\tfor (const heroPower of input.playerEntity.heroPowers) {\r\n\t\t\tif (RapidReanimation.cardIds.includes(heroPower.cardId) && heroPower.used) {\r\n\t\t\t\t// Getting the right enchantment can be tricky. The RapidReanimation enchantment can sometimes be\r\n\t\t\t\t// in the Graveyard zone, so we can't filter them out. In that case, we can have multiple\r\n\t\t\t\t// enchantments\r\n\t\t\t\t// However, because of how things are handled in the logs, we should be able to always take the one *\r\n\t\t\t\t// with the biggest entityId\r\n\t\t\t\tconst minionThatWillDie = input.playerBoard\r\n\t\t\t\t\t.filter((m) =>\r\n\t\t\t\t\t\tm.enchantments.some((e) => e.cardId === CardIds.RapidReanimation_ImpendingDeathEnchantment),\r\n\t\t\t\t\t)\r\n\t\t\t\t\t.sort(\r\n\t\t\t\t\t\t(a, b) =>\r\n\t\t\t\t\t\t\tb.enchantments.find((e) => e.cardId === CardIds.RapidReanimation_ImpendingDeathEnchantment)\r\n\t\t\t\t\t\t\t\t.originEntityId -\r\n\t\t\t\t\t\t\t\ta.enchantments.find(\r\n\t\t\t\t\t\t\t\t\t(e) => e.cardId === CardIds.RapidReanimation_ImpendingDeathEnchantment,\r\n\t\t\t\t\t\t\t\t).originEntityId || b.entityId - a.entityId,\r\n\t\t\t\t\t)[0];\r\n\t\t\t\tif (minionThatWillDie) {\r\n\t\t\t\t\t// So this is a bit tricky (as all the stuff with indices...). Because in practice it's more likely that players use Rapid Reanimation\r\n\t\t\t\t\t// on minions that they want to die quickly, most of the time they will be placed\r\n\t\t\t\t\t// to the left of the board\r\n\t\t\t\t\t// So using a left-based index (usually 0) is more likely to be correct after minions spawn on the board\r\n\t\t\t\t\t// Update: this looks like it's not the case, and looking at\r\n\t\t\t\t\t// http://replays.firestoneapp.com/?reviewId=2e6b389f-d904-43a2-a7cd-928a60d973ce&turn=11&action=1\r\n\t\t\t\t\t// the index seems to be right-based at least in some cases\r\n\t\t\t\t\t// Looks like even this is wrong:\r\n\t\t\t\t\t// http://replays.firestoneapp.com/?reviewId=9a46ab39-ccf0-478c-a010-68f2abb06c6f&turn=9&action=0\r\n\t\t\t\t\tconst rapidReanimationIndexFromLeft = input.playerBoard.indexOf(minionThatWillDie);\r\n\t\t\t\t\t// This is a bug in HS, but changing it for now so that sims match what the game does\r\n\t\t\t\t\tinput.playerEntity.rapidReanimationIndexFromRight = 0;\r\n\t\t\t\t\t// input.playerBoard.length - 1 - rapidReanimationIndexFromLeft;\r\n\t\t\t\t\tconst minionToCopy = copyEntity(minionThatWillDie);\r\n\t\t\t\t\t// We don't reapply auras when resummoning\r\n\t\t\t\t\t// Actually we should: a dead Goldrinn is then buffed by the auras upon resummon\r\n\t\t\t\t\tremoveAurasFromSelf(minionToCopy, input.playerBoard, input.playerEntity, input.gameState);\r\n\t\t\t\t\tinput.playerEntity.rapidReanimationMinion = minionToCopy;\r\n\t\t\t\t\tminionThatWillDie.definitelyDead = true;\r\n\t\t\t\t\tinput.gameState.spectator.registerPowerTarget(\r\n\t\t\t\t\t\tinput.playerEntity,\r\n\t\t\t\t\t\tminionThatWillDie,\r\n\t\t\t\t\t\tinput.playerBoard,\r\n\t\t\t\t\t\tinput.playerEntity,\r\n\t\t\t\t\t\tinput.opponentEntity,\r\n\t\t\t\t\t);\r\n\t\t\t\t\treturn { hasTriggered: true, shouldRecomputeCurrentAttacker: true };\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n};\r\n"]}
|
|
@@ -6,7 +6,7 @@ exports.CorruptedBristler = {
|
|
|
6
6
|
cardIds: ["BG32_431", "BG32_431_G"],
|
|
7
7
|
deathrattleSpawn: (minion, input) => {
|
|
8
8
|
var _a, _b;
|
|
9
|
-
let bloodGemEnchantments = (_a = minion.enchantments) === null || _a === void 0 ? void 0 : _a.filter((e) => e.cardId === "
|
|
9
|
+
let bloodGemEnchantments = (_a = minion.enchantments) === null || _a === void 0 ? void 0 : _a.filter((e) => e.cardId === "BG20_GEMe");
|
|
10
10
|
if ((bloodGemEnchantments === null || bloodGemEnchantments === void 0 ? void 0 : bloodGemEnchantments.length) === 0) {
|
|
11
11
|
bloodGemEnchantments = (_b = minion.enchantments) === null || _b === void 0 ? void 0 : _b.filter((e) => e.cardId === "BG20_GEMe");
|
|
12
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"corrupted-bristler.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/corrupted-bristler.ts"],"names":[],"mappings":";;;AAGA,+EAAiF;AAGpE,QAAA,iBAAiB,GAAyB;IACtD,OAAO,EAAE,0BAA0E;IACnF,gBAAgB,EAAE,CAAC,MAAmB,EAAE,KAAgC,EAA0B,EAAE;;QACnG,IAAI,oBAAoB,GAAG,MAAA,MAAM,CAAC,YAAY,0CAAE,MAAM,CACrD,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"corrupted-bristler.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/corrupted-bristler.ts"],"names":[],"mappings":";;;AAGA,+EAAiF;AAGpE,QAAA,iBAAiB,GAAyB;IACtD,OAAO,EAAE,0BAA0E;IACnF,gBAAgB,EAAE,CAAC,MAAmB,EAAE,KAAgC,EAA0B,EAAE;;QACnG,IAAI,oBAAoB,GAAG,MAAA,MAAM,CAAC,YAAY,0CAAE,MAAM,CACrD,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,gBAAyC,CACxD,CAAC;QACF,IAAI,CAAA,oBAAoB,aAApB,oBAAoB,uBAApB,oBAAoB,CAAE,MAAM,MAAK,CAAC,EAAE;YACvC,oBAAoB,GAAG,MAAA,MAAM,CAAC,YAAY,0CAAE,MAAM,CACjD,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,gBAAyC,CACxD,CAAC;SACF;QACD,MAAM,SAAS,GAAG,EAAE,CAAC;QACrB,IAAI,CAAA,oBAAoB,aAApB,oBAAoB,uBAApB,oBAAoB,CAAE,MAAM,IAAG,CAAC,EAAE;YACrC,MAAM,cAAc,GAAG,oBAAoB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,WAAC,OAAA,MAAA,CAAC,CAAC,iBAAiB,mCAAI,CAAC,CAAA,EAAA,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;YAC5G,MAAM,cAAc,GAAG,oBAAoB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,WAAC,OAAA,MAAA,CAAC,CAAC,iBAAiB,mCAAI,CAAC,CAAA,EAAA,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;YAC5G,IAAI,cAAc,GAAG,CAAC,IAAI,cAAc,GAAG,CAAC,EAAE;gBAC7C,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,iBAAyC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC5E,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,EAAE;oBAC9B,MAAM,MAAM,GAAG,IAAA,4CAAuB,yBAErC,CAAC,EACD,KAAK,CACL,CAAC;oBACF,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;wBACpB,CAAC,CAAC,MAAM,GAAG,cAAc,CAAC;wBAC1B,CAAC,CAAC,MAAM,GAAG,cAAc,CAAC;oBAC3B,CAAC,CAAC,CAAC;oBACH,SAAS,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC;iBAC1B;aACD;SACD;QACD,OAAO,SAAS,CAAC;IAClB,CAAC;CACD,CAAC","sourcesContent":["import { CardIds } from '@firestone-hs/reference-data';\r\nimport { BoardEntity } from '../../../board-entity';\r\nimport { DeathrattleTriggeredInput } from '../../../simulation/deathrattle-on-trigger';\r\nimport { simplifiedSpawnEntities } from '../../../simulation/deathrattle-spawns';\r\nimport { DeathrattleSpawnCard } from '../../card.interface';\r\n\r\nexport const CorruptedBristler: DeathrattleSpawnCard = {\r\n\tcardIds: [CardIds.CorruptedBristler_BG32_431, CardIds.CorruptedBristler_BG32_431_G],\r\n\tdeathrattleSpawn: (minion: BoardEntity, input: DeathrattleTriggeredInput): readonly BoardEntity[] => {\r\n\t\tlet bloodGemEnchantments = minion.enchantments?.filter(\r\n\t\t\t(e) => e.cardId === CardIds.BloodGem_BloodGemEnchantment,\r\n\t\t);\r\n\t\tif (bloodGemEnchantments?.length === 0) {\r\n\t\t\tbloodGemEnchantments = minion.enchantments?.filter(\r\n\t\t\t\t(e) => e.cardId === CardIds.BloodGem_BloodGemEnchantment,\r\n\t\t\t);\r\n\t\t}\r\n\t\tconst allSpawns = [];\r\n\t\tif (bloodGemEnchantments?.length > 0) {\r\n\t\t\tconst bloodGemAttack = bloodGemEnchantments.map((e) => e.tagScriptDataNum1 ?? 0).reduce((a, b) => a + b, 0);\r\n\t\t\tconst bloodGemHealth = bloodGemEnchantments.map((e) => e.tagScriptDataNum2 ?? 0).reduce((a, b) => a + b, 0);\r\n\t\t\tif (bloodGemAttack > 0 || bloodGemHealth > 0) {\r\n\t\t\t\tconst mult = minion.cardId === CardIds.CorruptedBristler_BG32_431_G ? 2 : 1;\r\n\t\t\t\tfor (let i = 0; i < mult; i++) {\r\n\t\t\t\t\tconst spawns = simplifiedSpawnEntities(\r\n\t\t\t\t\t\tCardIds.BloodGolemSticker_BloodGolemToken_BG30_MagicItem_442t,\r\n\t\t\t\t\t\t1,\r\n\t\t\t\t\t\tinput,\r\n\t\t\t\t\t);\r\n\t\t\t\t\tspawns.forEach((b) => {\r\n\t\t\t\t\t\tb.attack = bloodGemAttack;\r\n\t\t\t\t\t\tb.health = bloodGemHealth;\r\n\t\t\t\t\t});\r\n\t\t\t\t\tallSpawns.push(...spawns);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn allSpawns;\r\n\t},\r\n};\r\n"]}
|
|
@@ -6,7 +6,8 @@ const utils_1 = require("../../../utils");
|
|
|
6
6
|
exports.FireForgedEvoker = {
|
|
7
7
|
cardIds: ["BG32_822", "BG32_822_G"],
|
|
8
8
|
startOfCombat: (minion, input) => {
|
|
9
|
-
const
|
|
9
|
+
const mult = minion.cardId === "BG32_822_G" ? 2 : 1;
|
|
10
|
+
const buff = mult + minion.scriptDataNum2;
|
|
10
11
|
(0, utils_1.addStatsToBoard)(minion, input.playerBoard, input.playerEntity, buff, buff, input.gameState, reference_data_1.Race[reference_data_1.Race.DRAGON]);
|
|
11
12
|
return { hasTriggered: true, shouldRecomputeCurrentAttacker: false };
|
|
12
13
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fire-forged-evoker.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/fire-forged-evoker.ts"],"names":[],"mappings":";;;AAAA,iEAA6D;AAG7D,0CAAiD;AAGpC,QAAA,gBAAgB,GAAsB;IAClD,OAAO,EAAE,0BAAwE;IACjF,aAAa,EAAE,CAAC,MAAmB,EAAE,KAAe,EAAE,EAAE;QACvD,MAAM,IAAI,GAAG,MAAM,CAAC,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"fire-forged-evoker.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/fire-forged-evoker.ts"],"names":[],"mappings":";;;AAAA,iEAA6D;AAG7D,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,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC,cAAc,CAAC;QAC1C,IAAA,uBAAe,EAAC,MAAM,EAAE,KAAK,CAAC,WAAW,EAAE,KAAK,CAAC,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,SAAS,EAAE,qBAAI,CAAC,qBAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QAC/G,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,8BAA8B,EAAE,KAAK,EAAE,CAAC;IACtE,CAAC;CACD,CAAC","sourcesContent":["import { CardIds, Race } from '@firestone-hs/reference-data';\r\nimport { BoardEntity } from '../../../board-entity';\r\nimport { SoCInput } from '../../../simulation/start-of-combat/start-of-combat-input';\r\nimport { addStatsToBoard } 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 buff = mult + minion.scriptDataNum2;\r\n\t\taddStatsToBoard(minion, input.playerBoard, input.playerEntity, buff, buff, input.gameState, Race[Race.DRAGON]);\r\n\t\treturn { hasTriggered: true, shouldRecomputeCurrentAttacker: false };\r\n\t},\r\n};\r\n"]}
|
|
@@ -8,7 +8,7 @@ exports.FlightyScout = {
|
|
|
8
8
|
cardIds: ["BG32_330", "BG32_330_G"],
|
|
9
9
|
startOfCombatFromHand: true,
|
|
10
10
|
startOfCombat: (minion, input) => {
|
|
11
|
-
if (!input.playerEntity.hand.includes(minion)) {
|
|
11
|
+
if (!input.playerEntity.hand.includes(minion) || minion.locked) {
|
|
12
12
|
return { hasTriggered: false, shouldRecomputeCurrentAttacker: false };
|
|
13
13
|
}
|
|
14
14
|
const copy = (0, utils_1.copyEntity)(minion);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flighty-scout.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/flighty-scout.ts"],"names":[],"mappings":";;;AAEA,+EAAuE;AACvE,uDAAiE;AAEjE,0CAA4C;AAG/B,QAAA,YAAY,GAA8B;IACtD,OAAO,EAAE,0BAAgE;IACzE,qBAAqB,EAAE,IAAI;IAC3B,aAAa,EAAE,CAAC,MAAmB,EAAE,KAAe,EAAE,EAAE;QACvD,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;
|
|
1
|
+
{"version":3,"file":"flighty-scout.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/flighty-scout.ts"],"names":[],"mappings":";;;AAEA,+EAAuE;AACvE,uDAAiE;AAEjE,0CAA4C;AAG/B,QAAA,YAAY,GAA8B;IACtD,OAAO,EAAE,0BAAgE;IACzE,qBAAqB,EAAE,IAAI;IAC3B,aAAa,EAAE,CAAC,MAAmB,EAAE,KAAe,EAAE,EAAE;QACvD,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE;YAC/D,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,8BAA8B,EAAE,KAAK,EAAE,CAAC;SACtE;QAED,MAAM,IAAI,GAAG,IAAA,kBAAU,EAAC,MAAM,CAAC,CAAC;QAChC,IAAI,MAAM,CAAC,MAAM,iBAAoC,EAAE;YACtD,IAAI,CAAC,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;YAC9B,IAAI,CAAC,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;SAC9B;QAED,MAAM,UAAU,GAAG,IAAA,kCAAa,EAC/B,IAAI,CAAC,MAAM,EACX,CAAC,EACD,KAAK,CAAC,WAAW,EACjB,KAAK,CAAC,YAAY,EAClB,KAAK,CAAC,aAAa,EACnB,KAAK,CAAC,cAAc,EACpB,KAAK,CAAC,SAAS,EACf,KAAK,CAAC,YAAY,CAAC,QAAQ,EAC3B,KAAK,EACL,KAAK,EACL,KAAK,EACL,IAAI,CACJ,CAAC;QACF,MAAM,MAAM,GAAG,IAAA,4BAAmB,EACjC,UAAU,EACV,KAAK,CAAC,WAAW,EACjB,KAAK,CAAC,YAAY,EAClB,MAAM,EACN,CAAC,EACD,KAAK,CAAC,aAAa,EACnB,KAAK,CAAC,cAAc,EACpB,KAAK,CAAC,SAAS,CACf,CAAC;QAEF,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,8BAA8B,EAAE,KAAK,EAAE,CAAC;IACtE,CAAC;CACD,CAAC","sourcesContent":["import { CardIds } from '@firestone-hs/reference-data';\r\nimport { BoardEntity } from '../../../board-entity';\r\nimport { spawnEntities } from '../../../simulation/deathrattle-spawns';\r\nimport { performEntitySpawns } from '../../../simulation/spawns';\r\nimport { SoCInput } from '../../../simulation/start-of-combat/start-of-combat-input';\r\nimport { copyEntity } from '../../../utils';\r\nimport { StartOfCombatFromHandCard } from '../../card.interface';\r\n\r\nexport const FlightyScout: StartOfCombatFromHandCard = {\r\n\tcardIds: [CardIds.FlightyScout_BG32_330, CardIds.FlightyScout_BG32_330_G],\r\n\tstartOfCombatFromHand: true,\r\n\tstartOfCombat: (minion: BoardEntity, input: SoCInput) => {\r\n\t\tif (!input.playerEntity.hand.includes(minion) || minion.locked) {\r\n\t\t\treturn { hasTriggered: false, shouldRecomputeCurrentAttacker: false };\r\n\t\t}\r\n\r\n\t\tconst copy = copyEntity(minion);\r\n\t\tif (minion.cardId === CardIds.FlightyScout_BG32_330_G) {\r\n\t\t\tcopy.attack = 2 * copy.attack;\r\n\t\t\tcopy.health = 2 * copy.health;\r\n\t\t}\r\n\r\n\t\tconst newMinions = spawnEntities(\r\n\t\t\tcopy.cardId,\r\n\t\t\t1,\r\n\t\t\tinput.playerBoard,\r\n\t\t\tinput.playerEntity,\r\n\t\t\tinput.opponentBoard,\r\n\t\t\tinput.opponentEntity,\r\n\t\t\tinput.gameState,\r\n\t\t\tinput.playerEntity.friendly,\r\n\t\t\tfalse,\r\n\t\t\tfalse,\r\n\t\t\tfalse,\r\n\t\t\tcopy,\r\n\t\t);\r\n\t\tconst spawns = performEntitySpawns(\r\n\t\t\tnewMinions,\r\n\t\t\tinput.playerBoard,\r\n\t\t\tinput.playerEntity,\r\n\t\t\tminion,\r\n\t\t\t0,\r\n\t\t\tinput.opponentBoard,\r\n\t\t\tinput.opponentEntity,\r\n\t\t\tinput.gameState,\r\n\t\t);\r\n\r\n\t\treturn { hasTriggered: true, shouldRecomputeCurrentAttacker: false };\r\n\t},\r\n};\r\n"]}
|
|
@@ -4,7 +4,7 @@ exports.FleetingVigor = void 0;
|
|
|
4
4
|
const utils_1 = require("../../../utils");
|
|
5
5
|
exports.FleetingVigor = {
|
|
6
6
|
startOfCombat: (secret, input) => {
|
|
7
|
-
(0, utils_1.addStatsToBoard)(secret, input.playerBoard, input.playerEntity,
|
|
7
|
+
(0, utils_1.addStatsToBoard)(secret, input.playerBoard, input.playerEntity, secret.scriptDataNum1, secret.scriptDataNum2, input.gameState);
|
|
8
8
|
return true;
|
|
9
9
|
},
|
|
10
10
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fleeting-vigor.js","sourceRoot":"","sources":["../../../../src/cards/impl/spell/fleeting-vigor.ts"],"names":[],"mappings":";;;AAEA,0CAAiD;AAEpC,QAAA,aAAa,GAAG;IAC5B,aAAa,EAAE,CAAC,MAAmB,EAAE,KAAe,EAAE,EAAE;QACvD,IAAA,uBAAe,
|
|
1
|
+
{"version":3,"file":"fleeting-vigor.js","sourceRoot":"","sources":["../../../../src/cards/impl/spell/fleeting-vigor.ts"],"names":[],"mappings":";;;AAEA,0CAAiD;AAEpC,QAAA,aAAa,GAAG;IAC5B,aAAa,EAAE,CAAC,MAAmB,EAAE,KAAe,EAAE,EAAE;QACvD,IAAA,uBAAe,EACd,MAAM,EACN,KAAK,CAAC,WAAW,EACjB,KAAK,CAAC,YAAY,EAClB,MAAM,CAAC,cAAc,EACrB,MAAM,CAAC,cAAc,EACrB,KAAK,CAAC,SAAS,CACf,CAAC;QACF,OAAO,IAAI,CAAC;IACb,CAAC;CACD,CAAC","sourcesContent":["import { BoardSecret } from '../../../board-secret';\r\nimport { SoCInput } from '../../../simulation/start-of-combat/start-of-combat-input';\r\nimport { addStatsToBoard } from '../../../utils';\r\n\r\nexport const FleetingVigor = {\r\n\tstartOfCombat: (secret: BoardSecret, input: SoCInput) => {\r\n\t\taddStatsToBoard(\r\n\t\t\tsecret,\r\n\t\t\tinput.playerBoard,\r\n\t\t\tinput.playerEntity,\r\n\t\t\tsecret.scriptDataNum1,\r\n\t\t\tsecret.scriptDataNum2,\r\n\t\t\tinput.gameState,\r\n\t\t);\r\n\t\treturn true;\r\n\t},\r\n};\r\n"]}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.BeetleBand = void 0;
|
|
4
4
|
const taunt_1 = require("../../../keywords/taunt");
|
|
5
5
|
const deathrattle_spawns_1 = require("../../../simulation/deathrattle-spawns");
|
|
6
|
+
const spawns_1 = require("../../../simulation/spawns");
|
|
6
7
|
exports.BeetleBand = {
|
|
7
8
|
cardIds: ["BG32_MagicItem_860", "BG32_MagicItem_860t"],
|
|
8
9
|
baseAvengeValue: (cardId) => (cardId === "BG32_MagicItem_860" ? 5 : 6),
|
|
@@ -12,7 +13,8 @@ exports.BeetleBand = {
|
|
|
12
13
|
spawns.forEach((spawn) => {
|
|
13
14
|
(0, taunt_1.updateTaunt)(spawn, true, input.board, input.hero, input.otherHero, input.gameState);
|
|
14
15
|
});
|
|
15
|
-
|
|
16
|
+
(0, spawns_1.performEntitySpawns)(spawns, input.board, input.hero, trinket, 0, input.otherBoard, input.otherHero, input.gameState);
|
|
17
|
+
return [];
|
|
16
18
|
},
|
|
17
19
|
};
|
|
18
20
|
//# sourceMappingURL=beetle-band.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"beetle-band.js","sourceRoot":"","sources":["../../../../src/cards/impl/trinket/beetle-band.ts"],"names":[],"mappings":";;;AAEA,mDAAsD;AAEtD,+EAAuE;
|
|
1
|
+
{"version":3,"file":"beetle-band.js","sourceRoot":"","sources":["../../../../src/cards/impl/trinket/beetle-band.ts"],"names":[],"mappings":";;;AAEA,mDAAsD;AAEtD,+EAAuE;AACvE,uDAAiE;AAGpD,QAAA,UAAU,GAAe;IACrC,OAAO,EAAE,6CAA+F;IACxG,eAAe,EAAE,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC,MAAM,yBAA0C,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/F,MAAM,EAAE,CAAC,OAAoB,EAAE,KAAkB,EAA0B,EAAE;QAC5E,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,yBAA0C,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAChF,MAAM,MAAM,GAAG,IAAA,kCAAa,eAE3B,MAAM,EACN,KAAK,CAAC,KAAK,EACX,KAAK,CAAC,IAAI,EACV,KAAK,CAAC,UAAU,EAChB,KAAK,CAAC,SAAS,EACf,KAAK,CAAC,SAAS,EACf,KAAK,CAAC,IAAI,CAAC,QAAQ,EACnB,KAAK,CACL,CAAC;QACF,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;YACxB,IAAA,mBAAW,EAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;QACrF,CAAC,CAAC,CAAC;QAGH,IAAA,4BAAmB,EAClB,MAAM,EACN,KAAK,CAAC,KAAK,EACX,KAAK,CAAC,IAAI,EACV,OAAO,EACP,CAAC,EACD,KAAK,CAAC,UAAU,EAChB,KAAK,CAAC,SAAS,EACf,KAAK,CAAC,SAAS,CACf,CAAC;QACF,OAAO,EAAE,CAAC;IACX,CAAC;CACD,CAAC","sourcesContent":["import { CardIds } from '@firestone-hs/reference-data';\r\nimport { BoardEntity } from '../../../board-entity';\r\nimport { updateTaunt } from '../../../keywords/taunt';\r\nimport { AvengeInput } from '../../../simulation/avenge';\r\nimport { spawnEntities } from '../../../simulation/deathrattle-spawns';\r\nimport { performEntitySpawns } from '../../../simulation/spawns';\r\nimport { AvengeCard } from '../../card.interface';\r\n\r\nexport const BeetleBand: AvengeCard = {\r\n\tcardIds: [CardIds.BeetleBand_BG32_MagicItem_860, CardIds.BeetleBand_BeetleBandToken_BG32_MagicItem_860t],\r\n\tbaseAvengeValue: (cardId: string) => (cardId === CardIds.BeetleBand_BG32_MagicItem_860 ? 5 : 6),\r\n\tavenge: (trinket: BoardEntity, input: AvengeInput): readonly BoardEntity[] => {\r\n\t\tconst number = trinket.cardId === CardIds.BeetleBand_BG32_MagicItem_860 ? 1 : 2;\r\n\t\tconst spawns = spawnEntities(\r\n\t\t\tCardIds.BoonOfBeetles_BeetleToken_BG28_603t,\r\n\t\t\tnumber,\r\n\t\t\tinput.board,\r\n\t\t\tinput.hero,\r\n\t\t\tinput.otherBoard,\r\n\t\t\tinput.otherHero,\r\n\t\t\tinput.gameState,\r\n\t\t\tinput.hero.friendly,\r\n\t\t\tfalse,\r\n\t\t);\r\n\t\tspawns.forEach((spawn) => {\r\n\t\t\tupdateTaunt(spawn, true, input.board, input.hero, input.otherHero, input.gameState);\r\n\t\t});\r\n\r\n\t\t// Because they spawn to the right, we handle them here instead of higher up\r\n\t\tperformEntitySpawns(\r\n\t\t\tspawns,\r\n\t\t\tinput.board,\r\n\t\t\tinput.hero,\r\n\t\t\ttrinket,\r\n\t\t\t0,\r\n\t\t\tinput.otherBoard,\r\n\t\t\tinput.otherHero,\r\n\t\t\tinput.gameState,\r\n\t\t);\r\n\t\treturn [];\r\n\t},\r\n};\r\n"]}
|
|
@@ -24,7 +24,7 @@ exports.EclecticShrine = {
|
|
|
24
24
|
return (_a = (0, utils_1.getEffectiveTribesForEntity)(e, input.playerEntity, input.gameState.anomalies, input.gameState.allCards)) === null || _a === void 0 ? void 0 : _a.includes(reference_data_1.Race.ALL);
|
|
25
25
|
}),
|
|
26
26
|
];
|
|
27
|
-
const stats =
|
|
27
|
+
const stats = (_a = trinket.scriptDataNum1) !== null && _a !== void 0 ? _a : 2;
|
|
28
28
|
allMinions.forEach((e) => {
|
|
29
29
|
(0, stats_1.modifyStats)(e, trinket, stats, stats, input.playerBoard, input.playerEntity, input.gameState);
|
|
30
30
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eclectic-shrine.js","sourceRoot":"","sources":["../../../../src/cards/impl/trinket/eclectic-shrine.ts"],"names":[],"mappings":";;;AAAA,iEAA2E;AAG3E,qDAAwD;AACxD,0CAA6D;AAE7D,2DAA0D;AAE7C,QAAA,cAAc,GAAsB;IAChD,mBAAmB,EAAE,YAAY;IACjC,OAAO,EAAE,sBAA2C;IACpD,aAAa,EAAE,CAAC,OAAqB,EAAE,KAAe,EAAE,EAAE;;QACzD,IAAI,KAAK,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE;YACjC,MAAM,eAAe,GAAG,KAAK,CAAC,WAAW,CAAC,MAAM,CAC/C,CAAC,CAAC,EAAE,EAAE,CACL,CAAC,CAAC,IAAA,mCAA2B,EAC5B,CAAC,EACD,KAAK,CAAC,YAAY,EAClB,KAAK,CAAC,SAAS,CAAC,SAAS,EACzB,KAAK,CAAC,SAAS,CAAC,QAAQ,CACxB,CAAC,MAAM,CACT,CAAC;YACF,MAAM,eAAe,GAAG,eAAe,CAAC,MAAM,CAC7C,CAAC,CAAC,EAAE,EAAE;;gBACL,OAAA,CAAC,CAAA,MAAA,IAAA,mCAA2B,EAC3B,CAAC,EACD,KAAK,CAAC,YAAY,EAClB,KAAK,CAAC,SAAS,CAAC,SAAS,EACzB,KAAK,CAAC,SAAS,CAAC,QAAQ,CACxB,0CAAE,QAAQ,CAAC,qBAAI,CAAC,GAAG,CAA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,EAC3B,CAAC,EACD,KAAK,CAAC,YAAY,EAClB,KAAK,CAAC,SAAS,CAAC,SAAS,EACzB,KAAK,CAAC,SAAS,CAAC,QAAQ,CACxB,0CAAE,QAAQ,CAAC,qBAAI,CAAC,GAAG,CAAC,CAAA,CAAA;aAAA,CACtB,CAAC;YACF,MAAM,eAAe,GAAG,IAAA,2BAAa,EAAC,eAAe,EAAE,6BAAY,EAAE,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;YAC/F,MAAM,UAAU,GAAG;gBAClB,GAAG,eAAe;gBAClB,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE;;oBAC/B,OAAA,MAAA,IAAA,mCAA2B,EAC1B,CAAC,EACD,KAAK,CAAC,YAAY,EAClB,KAAK,CAAC,SAAS,CAAC,SAAS,EACzB,KAAK,CAAC,SAAS,CAAC,QAAQ,CACxB,0CAAE,QAAQ,CAAC,qBAAI,CAAC,GAAG,CAAC,CAAA;iBAAA,CACrB;aACD,CAAC;YACF,MAAM,KAAK,GAAG,MAAA,OAAO,CAAC,cAAc,mCAAI,CAAC,CAAC;YAC1C,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;gBACxB,IAAA,mBAAW,EAAC,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,WAAW,EAAE,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;YAC/F,CAAC,CAAC,CAAC;YACH,OAAO,CAAC,cAAc,EAAE,CAAC;YACzB,OAAO,IAAI,CAAC;SACZ;IACF,CAAC;CACD,CAAC","sourcesContent":["import { ALL_BG_RACES, CardIds, Race } from '@firestone-hs/reference-data';\r\nimport { BoardTrinket } from '../../../bgs-player-entity';\r\nimport { SoCInput } from '../../../simulation/start-of-combat/start-of-combat-input';\r\nimport { modifyStats } from '../../../simulation/stats';\r\nimport { getEffectiveTribesForEntity } from '../../../utils';\r\nimport { StartOfCombatCard } from '../../card.interface';\r\nimport { selectMinions } from '../hero-power/wax-warband';\r\n\r\nexport const EclecticShrine: StartOfCombatCard = {\r\n\tstartOfCombatTiming: 'pre-combat',\r\n\tcardIds: [CardIds.EclecticShrine_BG32_MagicItem_280],\r\n\tstartOfCombat: (trinket: BoardTrinket, input: SoCInput) => {\r\n\t\tif (input.playerBoard.length > 0) {\r\n\t\t\tconst boardWithTribes = input.playerBoard.filter(\r\n\t\t\t\t(e) =>\r\n\t\t\t\t\t!!getEffectiveTribesForEntity(\r\n\t\t\t\t\t\te,\r\n\t\t\t\t\t\tinput.playerEntity,\r\n\t\t\t\t\t\tinput.gameState.anomalies,\r\n\t\t\t\t\t\tinput.gameState.allCards,\r\n\t\t\t\t\t).length,\r\n\t\t\t);\r\n\t\t\tconst boardWithoutAll = boardWithTribes.filter(\r\n\t\t\t\t(e) =>\r\n\t\t\t\t\t!getEffectiveTribesForEntity(\r\n\t\t\t\t\t\te,\r\n\t\t\t\t\t\tinput.playerEntity,\r\n\t\t\t\t\t\tinput.gameState.anomalies,\r\n\t\t\t\t\t\tinput.gameState.allCards,\r\n\t\t\t\t\t)?.includes(Race.ALL),\r\n\t\t\t);\r\n\t\t\tconst selectedMinions = selectMinions(boardWithoutAll, ALL_BG_RACES, input.gameState.allCards);\r\n\t\t\tconst allMinions = [\r\n\t\t\t\t...selectedMinions,\r\n\t\t\t\t...boardWithTribes.filter((e) =>\r\n\t\t\t\t\tgetEffectiveTribesForEntity(\r\n\t\t\t\t\t\te,\r\n\t\t\t\t\t\tinput.playerEntity,\r\n\t\t\t\t\t\tinput.gameState.anomalies,\r\n\t\t\t\t\t\tinput.gameState.allCards,\r\n\t\t\t\t\t)?.includes(Race.ALL),\r\n\t\t\t\t),\r\n\t\t\t];\r\n\t\t\tconst stats = trinket.scriptDataNum1 ?? 2;\r\n\t\t\tallMinions.forEach((e) => {\r\n\t\t\t\tmodifyStats(e, trinket, stats, stats, input.playerBoard, input.playerEntity, input.gameState);\r\n\t\t\t});\r\n\t\t\ttrinket.scriptDataNum1++;\r\n\t\t\treturn true;\r\n\t\t}\r\n\t},\r\n};\r\n"]}
|
package/dist/input-sanitation.js
CHANGED
|
@@ -57,7 +57,6 @@ const buildFinalInputForPlayer = (playerInfo, isPlayer, anomalies, cards, cardsD
|
|
|
57
57
|
const { board, hand } = buildFinalInputBoard(playerInfo, isPlayer, cardsData, cards);
|
|
58
58
|
const isGhost = ((_a = playerInfo.player) === null || _a === void 0 ? void 0 : _a.hpLeft) != null && playerInfo.player.hpLeft <= 0;
|
|
59
59
|
playerInfo.player.secrets = (_d = (_c = ((_b = playerInfo.player.secrets) !== null && _b !== void 0 ? _b : playerInfo.secrets)) === null || _c === void 0 ? void 0 : _c.filter((e) => !!(e === null || e === void 0 ? void 0 : e.cardId))) !== null && _d !== void 0 ? _d : [];
|
|
60
|
-
playerInfo.player.secrets.forEach((secret) => (secret.scriptDataNum1 = 0));
|
|
61
60
|
playerInfo.player.trinkets = ((_f = (_e = playerInfo.player.trinkets) === null || _e === void 0 ? void 0 : _e.filter((e) => !!(e === null || e === void 0 ? void 0 : e.cardId))) !== null && _f !== void 0 ? _f : []).sort((a, b) => a.entityId - b.entityId);
|
|
62
61
|
playerInfo.player.friendly = isPlayer;
|
|
63
62
|
playerInfo.player.globalInfo = (_g = playerInfo.player.globalInfo) !== null && _g !== void 0 ? _g : {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-sanitation.js","sourceRoot":"","sources":["../src/input-sanitation.ts"],"names":[],"mappings":";;;AAAA,iEAA6F;AAM7F,8CAA0E;AAC1E,4DAA4D;AAC5D,mCAA8C;AAEvC,MAAM,eAAe,GAAG,CAC9B,WAA0B,EAC1B,KAAsB,EACtB,SAAoB,EACJ,EAAE;IAClB,MAAM,iBAAiB,GAAG,EAAE,QAAQ,EAAE,SAAW,EAAE,CAAC;IAEpD,MAAM,EACL,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE,UAAU,EAChB,MA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,EAAE;;IAClD,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK;SAC5B,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAA,8BAAe,EAAC,MAAM,EAAE,KAAK,CAAC,CAAC;SAC/C,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QACjB,GAAG,MAAM;QACT,cAAc,EAAE,IAAI;QACpB,cAAc,EAAE,SAAS,CAAC,oBAAoB,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,cAAc;KACtF,CAAC,CAAC;SACF,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,IAAA,2BAAmB,EAAC,MAAM,EAAE,SAAS,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAkB,CAAA,CAAC,CAAC;IACtG,MAAM,IAAI,GACT,MAAA,MAAA,UAAU,CAAC,MAAM,CAAC,IAAI,0CACnB,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,EACtD,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,IAAA,2BAAmB,EAAC,MAAM,EAAE,SAAS,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAkB,CAAA,CAAC,mCAAI,EAAE,CAAC;IAE7G,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AACxB,CAAC,CAAC","sourcesContent":["import { AllCardsService, CardIds, normalizeHeroCardId } from '@firestone-hs/reference-data';\r\nimport { BgsBattleInfo } from './bgs-battle-info';\r\nimport { BgsBoardInfo } from './bgs-board-info';\r\nimport { BgsHeroPower, BgsPlayerEntity } from './bgs-player-entity';\r\nimport { BoardEntity } from './board-entity';\r\nimport { CardsData } from './cards/cards-data';\r\nimport { setImplicitDataHero, setMissingAuras } from './simulation/auras';\r\nimport { fixEnchantments } from './simulation/enchantments';\r\nimport { addImpliedMechanics } from './utils';\r\n\r\nexport const buildFinalInput = (\r\n\tbattleInput: BgsBattleInfo,\r\n\tcards: AllCardsService,\r\n\tcardsData: CardsData,\r\n): BgsBattleInfo => {\r\n\tconst entityIdContainer = { entityId: 999_999_999 };\r\n\r\n\tconst {\r\n\t\tboard: playerBoard,\r\n\t\thand: playerHand,\r\n\t\tplayer: playerEntity,\r\n\t} = buildFinalInputForPlayer(\r\n\t\tbattleInput.playerBoard,\r\n\t\ttrue,\r\n\t\tbattleInput.gameState.anomalies,\r\n\t\tcards,\r\n\t\tcardsData,\r\n\t\tentityIdContainer,\r\n\t);\r\n\tconst {\r\n\t\tboard: playerTeammateBoard,\r\n\t\thand: playerTeammateHand,\r\n\t\tplayer: playerTeammateEntity,\r\n\t} = buildFinalInputForPlayer(\r\n\t\tbattleInput.playerTeammateBoard,\r\n\t\ttrue,\r\n\t\tbattleInput.gameState.anomalies,\r\n\t\tcards,\r\n\t\tcardsData,\r\n\t\tentityIdContainer,\r\n\t);\r\n\r\n\tconst {\r\n\t\tboard: opponentBoard,\r\n\t\thand: opponentHand,\r\n\t\tplayer: opponentEntity,\r\n\t} = buildFinalInputForPlayer(\r\n\t\tbattleInput.opponentBoard,\r\n\t\tfalse,\r\n\t\tbattleInput.gameState.anomalies,\r\n\t\tcards,\r\n\t\tcardsData,\r\n\t\tentityIdContainer,\r\n\t);\r\n\tconst {\r\n\t\tboard: opponentTeammateBoard,\r\n\t\thand: opponentTeammateHand,\r\n\t\tplayer: opponentTeammateEntity,\r\n\t} = buildFinalInputForPlayer(\r\n\t\tbattleInput.opponentTeammateBoard,\r\n\t\tfalse,\r\n\t\tbattleInput.gameState.anomalies,\r\n\t\tcards,\r\n\t\tcardsData,\r\n\t\tentityIdContainer,\r\n\t);\r\n\r\n\t// We do this so that we can have mutated objects inside the simulation and still\r\n\t// be able to start from a fresh copy for each simulation\r\n\tconst inputReady: BgsBattleInfo = {\r\n\t\tplayerBoard: {\r\n\t\t\tboard: playerBoard,\r\n\t\t\tplayer: {\r\n\t\t\t\t...playerEntity,\r\n\t\t\t\thand: playerHand,\r\n\t\t\t},\r\n\t\t},\r\n\t\tplayerTeammateBoard: !!playerTeammateEntity\r\n\t\t\t? {\r\n\t\t\t\t\tboard: playerTeammateBoard,\r\n\t\t\t\t\tplayer: {\r\n\t\t\t\t\t\t...playerTeammateEntity,\r\n\t\t\t\t\t\thand: playerTeammateHand,\r\n\t\t\t\t\t},\r\n\t\t\t }\r\n\t\t\t: null,\r\n\t\topponentBoard: {\r\n\t\t\tboard: opponentBoard,\r\n\t\t\tplayer: {\r\n\t\t\t\t...opponentEntity,\r\n\t\t\t\thand: opponentHand,\r\n\t\t\t},\r\n\t\t},\r\n\t\topponentTeammateBoard: !!opponentTeammateEntity\r\n\t\t\t? {\r\n\t\t\t\t\tboard: opponentTeammateBoard,\r\n\t\t\t\t\tplayer: {\r\n\t\t\t\t\t\t...opponentTeammateEntity,\r\n\t\t\t\t\t\thand: opponentTeammateHand,\r\n\t\t\t\t\t},\r\n\t\t\t }\r\n\t\t\t: null,\r\n\t\tgameState: battleInput.gameState,\r\n\t} as BgsBattleInfo;\r\n\treturn inputReady;\r\n};\r\n\r\nconst buildFinalInputForPlayer = (\r\n\tplayerInfo: BgsBoardInfo,\r\n\tisPlayer: boolean,\r\n\tanomalies: readonly string[],\r\n\tcards: AllCardsService,\r\n\tcardsData: CardsData,\r\n\tentityIdContainer: { entityId: number },\r\n): { board: BoardEntity[]; hand: BoardEntity[]; player: BgsPlayerEntity } => {\r\n\tif (!playerInfo) {\r\n\t\treturn { board: [], hand: [], player: null };\r\n\t}\r\n\r\n\tconst { board, hand } = buildFinalInputBoard(playerInfo, isPlayer, cardsData, cards);\r\n\tconst isGhost = playerInfo.player?.hpLeft != null && playerInfo.player.hpLeft <= 0;\r\n\tplayerInfo.player.secrets = (playerInfo.player.secrets ?? playerInfo.secrets)?.filter((e) => !!e?.cardId) ?? [];\r\n\t// Add the scriptDataNum1 only on the start of combat phase, so that it doesn't trigger too soon\r\n\tplayerInfo.player.secrets.forEach((secret) => (secret.scriptDataNum1 = 0));\r\n\t// Trinkets don't seem to trigger when facing the ghost\r\n\t// http://replays.firestoneapp.com/?reviewId=4ad32e03-2620-4fb1-8b43-cad55afd30fc&turn=27&action=2\r\n\t// One of the trinkets is Blood Golem Sticker, and no Blood Golem is summoned\r\n\t// Looks like that's not always the case:\r\n\t// http://replays.firestoneapp.com/?reviewId=9958e8d3-4388-4e6f-9b36-35f3a08be2f6&turn=25&action=4\r\n\t// playerInfo.player.trinkets = isGhost ? [] : playerInfo.player.trinkets?.filter((e) => !!e?.cardId) ?? [];\r\n\tplayerInfo.player.trinkets = (playerInfo.player.trinkets?.filter((e) => !!e?.cardId) ?? []).sort(\r\n\t\t(a, b) => a.entityId - b.entityId,\r\n\t);\r\n\tplayerInfo.player.friendly = isPlayer;\r\n\tplayerInfo.player.globalInfo = playerInfo.player.globalInfo ?? {};\r\n\tplayerInfo.player.globalInfo.PirateAttackBonus = playerInfo.player.globalInfo.PirateAttackBonus ?? 0;\r\n\tplayerInfo.player.heroPowers = playerInfo.player.heroPowers?.length\r\n\t\t? playerInfo.player.heroPowers.map((hp, index) => sanitizeHeroPower(hp, index, playerInfo.player, cards))\r\n\t\t: [\r\n\t\t\t\t{\r\n\t\t\t\t\tcardId: playerInfo.player.heroPowerId,\r\n\t\t\t\t\tentityId: playerInfo.player.heroPowerEntityId,\r\n\t\t\t\t\tused: playerInfo.player.heroPowerUsed,\r\n\t\t\t\t\tinfo: playerInfo.player.heroPowerInfo,\r\n\t\t\t\t\tinfo2: playerInfo.player.heroPowerInfo2,\r\n\t\t\t\t} as BgsHeroPower,\r\n\t\t ];\r\n\t// playerInfo.player.heroPowerId =\r\n\t// \tplayerInfo.player.trinkets.find((t) => t.scriptDataNum6 === 3)?.cardId ??\r\n\t// \t(normalizeHeroCardId(playerInfo.player.cardId, cards) === CardIds.SireDenathrius_BG24_HERO_100\r\n\t// \t\t? playerInfo.player.questRewardEntities?.[0]?.cardId\r\n\t// \t\t: null) ??\r\n\t// \tplayerInfo.player.heroPowerId;\r\n\tplayerInfo.player.cardId = isGhost ? CardIds.Kelthuzad_TB_BaconShop_HERO_KelThuzad : playerInfo.player.cardId;\r\n\tplayerInfo.player.hpLeft = Math.max(1, playerInfo.player.hpLeft);\r\n\t// When using the simulator, the aura is not applied when receiving the board state.\r\n\tsetMissingAuras(board, playerInfo.player, anomalies, cards);\r\n\t// Avenge, maxHealth, etc.\r\n\t// setImplicitData(playerBoard, cardsData);\r\n\t// setImplicitData(opponentBoard, cardsData);\r\n\t// Avenge, globalInfo\r\n\tsetImplicitDataHero(playerInfo.player, cardsData, isPlayer, entityIdContainer);\r\n\treturn { board, hand, player: playerInfo.player };\r\n};\r\n\r\nconst sanitizeHeroPower = (\r\n\thp: BgsHeroPower,\r\n\tindex: number,\r\n\tplayer: BgsPlayerEntity,\r\n\tcards: AllCardsService,\r\n): BgsHeroPower => {\r\n\tif (index !== 0) {\r\n\t\treturn hp;\r\n\t}\r\n\r\n\thp.cardId =\r\n\t\tplayer.trinkets.find((t) => t.scriptDataNum6 === 3)?.cardId ??\r\n\t\t(normalizeHeroCardId(player.cardId, cards) === CardIds.SireDenathrius_BG24_HERO_100\r\n\t\t\t? player.questRewardEntities?.[0]?.cardId\r\n\t\t\t: null) ??\r\n\t\thp.cardId;\r\n\treturn hp;\r\n};\r\n\r\nconst buildFinalInputBoard = (\r\n\tplayerInfo: BgsBoardInfo,\r\n\tisPlayer: boolean,\r\n\tcardsData: CardsData,\r\n\tcards: AllCardsService,\r\n): { board: BoardEntity[]; hand: BoardEntity[] } => {\r\n\tconst board = playerInfo.board\r\n\t\t.map((entity) => fixEnchantments(entity, cards))\r\n\t\t.map((entity) => ({\r\n\t\t\t...entity,\r\n\t\t\tinInitialState: true,\r\n\t\t\tscriptDataNum1: cardsData.defaultScriptDataNum(entity.cardId) || entity.scriptDataNum1,\r\n\t\t}))\r\n\t\t.map((entity) => ({ ...addImpliedMechanics(entity, cardsData), friendly: isPlayer } as BoardEntity));\r\n\tconst hand =\r\n\t\tplayerInfo.player.hand\r\n\t\t\t?.map((entity) => ({ ...entity, inInitialState: true }))\r\n\t\t\t.map((entity) => ({ ...addImpliedMechanics(entity, cardsData), friendly: isPlayer } as BoardEntity)) ?? [];\r\n\r\n\treturn { board, hand };\r\n};\r\n"]}
|
|
1
|
+
{"version":3,"file":"input-sanitation.js","sourceRoot":"","sources":["../src/input-sanitation.ts"],"names":[],"mappings":";;;AAAA,iEAA6F;AAM7F,8CAA0E;AAC1E,4DAA4D;AAC5D,mCAA8C;AAEvC,MAAM,eAAe,GAAG,CAC9B,WAA0B,EAC1B,KAAsB,EACtB,SAAoB,EACJ,EAAE;IAClB,MAAM,iBAAiB,GAAG,EAAE,QAAQ,EAAE,SAAW,EAAE,CAAC;IAEpD,MAAM,EACL,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,YAAY,GACpB,GAAG,wBAAwB,CAC3B,WAAW,CAAC,WAAW,EACvB,IAAI,EACJ,WAAW,CAAC,SAAS,CAAC,SAAS,EAC/B,KAAK,EACL,SAAS,EACT,iBAAiB,CACjB,CAAC;IACF,MAAM,EACL,KAAK,EAAE,mBAAmB,EAC1B,IAAI,EAAE,kBAAkB,EACxB,MAAM,EAAE,oBAAoB,GAC5B,GAAG,wBAAwB,CAC3B,WAAW,CAAC,mBAAmB,EAC/B,IAAI,EACJ,WAAW,CAAC,SAAS,CAAC,SAAS,EAC/B,KAAK,EACL,SAAS,EACT,iBAAiB,CACjB,CAAC;IAEF,MAAM,EACL,KAAK,EAAE,aAAa,EACpB,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,cAAc,GACtB,GAAG,wBAAwB,CAC3B,WAAW,CAAC,aAAa,EACzB,KAAK,EACL,WAAW,CAAC,SAAS,CAAC,SAAS,EAC/B,KAAK,EACL,SAAS,EACT,iBAAiB,CACjB,CAAC;IACF,MAAM,EACL,KAAK,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,EAAE,SAAS,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAkB,CAAA,CAAC,mCAAI,EAAE,CAAC;IAE7G,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AACxB,CAAC,CAAC","sourcesContent":["import { AllCardsService, CardIds, normalizeHeroCardId } from '@firestone-hs/reference-data';\r\nimport { BgsBattleInfo } from './bgs-battle-info';\r\nimport { BgsBoardInfo } from './bgs-board-info';\r\nimport { BgsHeroPower, BgsPlayerEntity } from './bgs-player-entity';\r\nimport { BoardEntity } from './board-entity';\r\nimport { CardsData } from './cards/cards-data';\r\nimport { setImplicitDataHero, setMissingAuras } from './simulation/auras';\r\nimport { fixEnchantments } from './simulation/enchantments';\r\nimport { addImpliedMechanics } from './utils';\r\n\r\nexport const buildFinalInput = (\r\n\tbattleInput: BgsBattleInfo,\r\n\tcards: AllCardsService,\r\n\tcardsData: CardsData,\r\n): BgsBattleInfo => {\r\n\tconst entityIdContainer = { entityId: 999_999_999 };\r\n\r\n\tconst {\r\n\t\tboard: playerBoard,\r\n\t\thand: playerHand,\r\n\t\tplayer: playerEntity,\r\n\t} = buildFinalInputForPlayer(\r\n\t\tbattleInput.playerBoard,\r\n\t\ttrue,\r\n\t\tbattleInput.gameState.anomalies,\r\n\t\tcards,\r\n\t\tcardsData,\r\n\t\tentityIdContainer,\r\n\t);\r\n\tconst {\r\n\t\tboard: playerTeammateBoard,\r\n\t\thand: playerTeammateHand,\r\n\t\tplayer: playerTeammateEntity,\r\n\t} = buildFinalInputForPlayer(\r\n\t\tbattleInput.playerTeammateBoard,\r\n\t\ttrue,\r\n\t\tbattleInput.gameState.anomalies,\r\n\t\tcards,\r\n\t\tcardsData,\r\n\t\tentityIdContainer,\r\n\t);\r\n\r\n\tconst {\r\n\t\tboard: opponentBoard,\r\n\t\thand: opponentHand,\r\n\t\tplayer: opponentEntity,\r\n\t} = buildFinalInputForPlayer(\r\n\t\tbattleInput.opponentBoard,\r\n\t\tfalse,\r\n\t\tbattleInput.gameState.anomalies,\r\n\t\tcards,\r\n\t\tcardsData,\r\n\t\tentityIdContainer,\r\n\t);\r\n\tconst {\r\n\t\tboard: opponentTeammateBoard,\r\n\t\thand: opponentTeammateHand,\r\n\t\tplayer: opponentTeammateEntity,\r\n\t} = buildFinalInputForPlayer(\r\n\t\tbattleInput.opponentTeammateBoard,\r\n\t\tfalse,\r\n\t\tbattleInput.gameState.anomalies,\r\n\t\tcards,\r\n\t\tcardsData,\r\n\t\tentityIdContainer,\r\n\t);\r\n\r\n\t// We do this so that we can have mutated objects inside the simulation and still\r\n\t// be able to start from a fresh copy for each simulation\r\n\tconst inputReady: BgsBattleInfo = {\r\n\t\tplayerBoard: {\r\n\t\t\tboard: playerBoard,\r\n\t\t\tplayer: {\r\n\t\t\t\t...playerEntity,\r\n\t\t\t\thand: playerHand,\r\n\t\t\t},\r\n\t\t},\r\n\t\tplayerTeammateBoard: !!playerTeammateEntity\r\n\t\t\t? {\r\n\t\t\t\t\tboard: playerTeammateBoard,\r\n\t\t\t\t\tplayer: {\r\n\t\t\t\t\t\t...playerTeammateEntity,\r\n\t\t\t\t\t\thand: playerTeammateHand,\r\n\t\t\t\t\t},\r\n\t\t\t }\r\n\t\t\t: null,\r\n\t\topponentBoard: {\r\n\t\t\tboard: opponentBoard,\r\n\t\t\tplayer: {\r\n\t\t\t\t...opponentEntity,\r\n\t\t\t\thand: opponentHand,\r\n\t\t\t},\r\n\t\t},\r\n\t\topponentTeammateBoard: !!opponentTeammateEntity\r\n\t\t\t? {\r\n\t\t\t\t\tboard: opponentTeammateBoard,\r\n\t\t\t\t\tplayer: {\r\n\t\t\t\t\t\t...opponentTeammateEntity,\r\n\t\t\t\t\t\thand: opponentTeammateHand,\r\n\t\t\t\t\t},\r\n\t\t\t }\r\n\t\t\t: null,\r\n\t\tgameState: battleInput.gameState,\r\n\t} as BgsBattleInfo;\r\n\treturn inputReady;\r\n};\r\n\r\nconst buildFinalInputForPlayer = (\r\n\tplayerInfo: BgsBoardInfo,\r\n\tisPlayer: boolean,\r\n\tanomalies: readonly string[],\r\n\tcards: AllCardsService,\r\n\tcardsData: CardsData,\r\n\tentityIdContainer: { entityId: number },\r\n): { board: BoardEntity[]; hand: BoardEntity[]; player: BgsPlayerEntity } => {\r\n\tif (!playerInfo) {\r\n\t\treturn { board: [], hand: [], player: null };\r\n\t}\r\n\r\n\tconst { board, hand } = buildFinalInputBoard(playerInfo, isPlayer, cardsData, cards);\r\n\tconst isGhost = playerInfo.player?.hpLeft != null && playerInfo.player.hpLeft <= 0;\r\n\tplayerInfo.player.secrets = (playerInfo.player.secrets ?? playerInfo.secrets)?.filter((e) => !!e?.cardId) ?? [];\r\n\t// Add the scriptDataNum1 only on the start of combat phase, so that it doesn't trigger too soon\r\n\t// Don't do this, as secrets like Fleeting Vigor use this info to tell how much buff it will apply\r\n\t// playerInfo.player.secrets.forEach((secret) => (secret.scriptDataNum1 = 0));\r\n\t// Trinkets don't seem to trigger when facing the ghost\r\n\t// http://replays.firestoneapp.com/?reviewId=4ad32e03-2620-4fb1-8b43-cad55afd30fc&turn=27&action=2\r\n\t// One of the trinkets is Blood Golem Sticker, and no Blood Golem is summoned\r\n\t// Looks like that's not always the case:\r\n\t// http://replays.firestoneapp.com/?reviewId=9958e8d3-4388-4e6f-9b36-35f3a08be2f6&turn=25&action=4\r\n\t// playerInfo.player.trinkets = isGhost ? [] : playerInfo.player.trinkets?.filter((e) => !!e?.cardId) ?? [];\r\n\tplayerInfo.player.trinkets = (playerInfo.player.trinkets?.filter((e) => !!e?.cardId) ?? []).sort(\r\n\t\t(a, b) => a.entityId - b.entityId,\r\n\t);\r\n\tplayerInfo.player.friendly = isPlayer;\r\n\tplayerInfo.player.globalInfo = playerInfo.player.globalInfo ?? {};\r\n\tplayerInfo.player.globalInfo.PirateAttackBonus = playerInfo.player.globalInfo.PirateAttackBonus ?? 0;\r\n\tplayerInfo.player.heroPowers = playerInfo.player.heroPowers?.length\r\n\t\t? playerInfo.player.heroPowers.map((hp, index) => sanitizeHeroPower(hp, index, playerInfo.player, cards))\r\n\t\t: [\r\n\t\t\t\t{\r\n\t\t\t\t\tcardId: playerInfo.player.heroPowerId,\r\n\t\t\t\t\tentityId: playerInfo.player.heroPowerEntityId,\r\n\t\t\t\t\tused: playerInfo.player.heroPowerUsed,\r\n\t\t\t\t\tinfo: playerInfo.player.heroPowerInfo,\r\n\t\t\t\t\tinfo2: playerInfo.player.heroPowerInfo2,\r\n\t\t\t\t} as BgsHeroPower,\r\n\t\t ];\r\n\t// playerInfo.player.heroPowerId =\r\n\t// \tplayerInfo.player.trinkets.find((t) => t.scriptDataNum6 === 3)?.cardId ??\r\n\t// \t(normalizeHeroCardId(playerInfo.player.cardId, cards) === CardIds.SireDenathrius_BG24_HERO_100\r\n\t// \t\t? playerInfo.player.questRewardEntities?.[0]?.cardId\r\n\t// \t\t: null) ??\r\n\t// \tplayerInfo.player.heroPowerId;\r\n\tplayerInfo.player.cardId = isGhost ? CardIds.Kelthuzad_TB_BaconShop_HERO_KelThuzad : playerInfo.player.cardId;\r\n\tplayerInfo.player.hpLeft = Math.max(1, playerInfo.player.hpLeft);\r\n\t// When using the simulator, the aura is not applied when receiving the board state.\r\n\tsetMissingAuras(board, playerInfo.player, anomalies, cards);\r\n\t// Avenge, maxHealth, etc.\r\n\t// setImplicitData(playerBoard, cardsData);\r\n\t// setImplicitData(opponentBoard, cardsData);\r\n\t// Avenge, globalInfo\r\n\tsetImplicitDataHero(playerInfo.player, cardsData, isPlayer, entityIdContainer);\r\n\treturn { board, hand, player: playerInfo.player };\r\n};\r\n\r\nconst sanitizeHeroPower = (\r\n\thp: BgsHeroPower,\r\n\tindex: number,\r\n\tplayer: BgsPlayerEntity,\r\n\tcards: AllCardsService,\r\n): BgsHeroPower => {\r\n\tif (index !== 0) {\r\n\t\treturn hp;\r\n\t}\r\n\r\n\thp.cardId =\r\n\t\tplayer.trinkets.find((t) => t.scriptDataNum6 === 3)?.cardId ??\r\n\t\t(normalizeHeroCardId(player.cardId, cards) === CardIds.SireDenathrius_BG24_HERO_100\r\n\t\t\t? player.questRewardEntities?.[0]?.cardId\r\n\t\t\t: null) ??\r\n\t\thp.cardId;\r\n\treturn hp;\r\n};\r\n\r\nconst buildFinalInputBoard = (\r\n\tplayerInfo: BgsBoardInfo,\r\n\tisPlayer: boolean,\r\n\tcardsData: CardsData,\r\n\tcards: AllCardsService,\r\n): { board: BoardEntity[]; hand: BoardEntity[] } => {\r\n\tconst board = playerInfo.board\r\n\t\t.map((entity) => fixEnchantments(entity, cards))\r\n\t\t.map((entity) => ({\r\n\t\t\t...entity,\r\n\t\t\tinInitialState: true,\r\n\t\t\tscriptDataNum1: cardsData.defaultScriptDataNum(entity.cardId) || entity.scriptDataNum1,\r\n\t\t}))\r\n\t\t.map((entity) => ({ ...addImpliedMechanics(entity, cardsData), friendly: isPlayer } as BoardEntity));\r\n\tconst hand =\r\n\t\tplayerInfo.player.hand\r\n\t\t\t?.map((entity) => ({ ...entity, inInitialState: true }))\r\n\t\t\t.map((entity) => ({ ...addImpliedMechanics(entity, cardsData), friendly: isPlayer } as BoardEntity)) ?? [];\r\n\r\n\treturn { board, hand };\r\n};\r\n"]}
|
package/dist/simulation/auras.js
CHANGED
|
@@ -119,7 +119,7 @@ const setImplicitDataHero = (hero, cardsData, isPlayer, entityIdContainer) => {
|
|
|
119
119
|
...trinket,
|
|
120
120
|
avengeDefault: cardsData.avengeValue(trinket.cardId),
|
|
121
121
|
avengeCurrent: cardsData.avengeValue(trinket.cardId),
|
|
122
|
-
scriptDataNum1: cardsData.defaultScriptDataNum(trinket.cardId),
|
|
122
|
+
scriptDataNum1: cardsData.defaultScriptDataNum(trinket.cardId) || trinket.scriptDataNum1,
|
|
123
123
|
}));
|
|
124
124
|
hero.entityId = hero.entityId || entityIdContainer.entityId--;
|
|
125
125
|
hero.hand = (_d = hero.hand) !== null && _d !== void 0 ? _d : [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auras.js","sourceRo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R,IAAI,CAAC,MAAM,2BAAkF,CAC9F,CAAC;IACJ,CAAC,CAAC,CAAC;IACJ,SAAS,CAAC,QAAQ;SAChB,MAAM,CACN,CAAC,CAAC,EAAE,EAAE,CACL,CAAC,CAAC,MAAM,yBAAkD;QAC1D,CAAC,CAAC,MAAM,0BAA2E,CACpF;SACA,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;QACd,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,yBAAkD,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACjF,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC;QACzC,KAAK,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC;YAC1B,MAAM,EACL,CAAC,CAAC,MAAM,yBAAkD;gBACzD,CAAC;gBACD,CAAC,uBAA8E;YACjF,cAAc,EAAE,CAAC,CAAC,QAAQ;YAC1B,MAAM,EAAE,SAAS,CAAC,WAAW,CAAC,eAAe,EAAE;SAC/C,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AArDW,QAAA,oBAAoB,wBAqD/B","sourcesContent":["/* eslint-disable @typescript-eslint/no-use-before-define */\r\nimport { AllCardsService, CardIds, Race } from '@firestone-hs/reference-data';\r\nimport { BgsPlayerEntity } from '../bgs-player-entity';\r\nimport { BoardEntity } from '../board-entity';\r\nimport { CardsData } from '../cards/cards-data';\r\nimport { updateStealth } from '../keywords/stealth';\r\nimport { hasCorrectTribe } from '../utils';\r\nimport { FullGameState } from './internal-game-state';\r\n\r\nexport const setMissingAuras = (\r\n\tboard: BoardEntity[],\r\n\tboardHero: BgsPlayerEntity,\r\n\tanomalies: readonly string[],\r\n\tallCards: AllCardsService,\r\n): void => {\r\n\tsetMissingMinionsAura(board, boardHero, anomalies, allCards);\r\n\tsetMissingHeroPowerAura(board, boardHero);\r\n\tsetMissingTrinketAura(board, boardHero);\r\n};\r\n\r\nexport const setMissingTrinketAura = (board: BoardEntity[], boardHero: BgsPlayerEntity): void => {\r\n\tfor (const trinket of boardHero.trinkets ?? []) {\r\n\t\tswitch (trinket.cardId) {\r\n\t\t\tcase CardIds.WindrunnerNecklace_BG30_MagicItem_997:\r\n\t\t\tcase CardIds.WindrunnerNecklace_WindrunnerNecklaceToken_BG30_MagicItem_997t:\r\n\t\t\t\tconst enchantment =\r\n\t\t\t\t\ttrinket.cardId === CardIds.WindrunnerNecklace_BG30_MagicItem_997\r\n\t\t\t\t\t\t? CardIds.WindrunnerNecklace_RunningLikeTheWindEnchantment_BG30_MagicItem_997e\r\n\t\t\t\t\t\t: CardIds.WindrunnerNecklace_RunningLikeTheWindEnchantment_BG30_MagicItem_997e2;\r\n\t\t\t\tconst buff = trinket.cardId === CardIds.WindrunnerNecklace_BG30_MagicItem_997 ? 8 : 20;\r\n\t\t\t\tconst target = board[0];\r\n\t\t\t\tif (!!target && !target.enchantments?.find((e) => e.cardId === enchantment)) {\r\n\t\t\t\t\ttarget.attack += buff;\r\n\t\t\t\t\ttarget.enchantments.push({\r\n\t\t\t\t\t\tcardId: enchantment,\r\n\t\t\t\t\t\toriginEntityId: trinket.entityId,\r\n\t\t\t\t\t\ttiming: 0,\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n};\r\n\r\nexport const setMissingHeroPowerAura = (board: BoardEntity[], boardHero: BgsPlayerEntity): void => {\r\n\tfor (const heroPower of boardHero.heroPowers) {\r\n\t\tif (heroPower.cardId === CardIds.TheSmokingGun) {\r\n\t\t\tboard\r\n\t\t\t\t.filter(\r\n\t\t\t\t\t(e) =>\r\n\t\t\t\t\t\t!e.enchantments.find(\r\n\t\t\t\t\t\t\t(ench) => ench.cardId === CardIds.TheSmokingGun_ArmedAndStillSmokingEnchantment,\r\n\t\t\t\t\t\t),\r\n\t\t\t\t)\r\n\t\t\t\t.forEach((e) => {\r\n\t\t\t\t\te.attack += 4;\r\n\t\t\t\t});\r\n\t\t}\r\n\t\tif (heroPower.cardId === CardIds.VolatileVenom) {\r\n\t\t\tboard\r\n\t\t\t\t.filter(\r\n\t\t\t\t\t(e) => !e.enchantments.find((ench) => ench.cardId === CardIds.VolatileVenom_VolatileEnchantment),\r\n\t\t\t\t)\r\n\t\t\t\t.forEach((e) => {\r\n\t\t\t\t\te.attack += 7;\r\n\t\t\t\t\te.health += 7;\r\n\t\t\t\t\te.enchantments.push({\r\n\t\t\t\t\t\tcardId: CardIds.VolatileVenom_VolatileEnchantment,\r\n\t\t\t\t\t\toriginEntityId: undefined,\r\n\t\t\t\t\t\ttiming: 0,\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t}\r\n\t}\r\n};\r\n\r\nconst setMissingMinionsAura = (\r\n\tboard: BoardEntity[],\r\n\tboardHero: BgsPlayerEntity,\r\n\tanomalies: readonly string[],\r\n\tallCards: AllCardsService,\r\n): void => {\r\n\tsetMissingAura(\r\n\t\tboard.filter((e) => hasCorrectTribe(e, boardHero, Race.PIRATE, anomalies, allCards)),\r\n\t\tCardIds.SouthseaCaptainLegacy_BG_NEW1_027,\r\n\t\tCardIds.SouthseaCaptain_YarrrVanillaEnchantment,\r\n\t\t1,\r\n\t\t1,\r\n\t);\r\n\tsetMissingAura(\r\n\t\tboard.filter((e) => hasCorrectTribe(e, boardHero, Race.PIRATE, anomalies, allCards)),\r\n\t\tCardIds.SouthseaCaptainLegacy_TB_BaconUps_136,\r\n\t\tCardIds.SouthseaCaptain_YarrrEnchantment,\r\n\t\t2,\r\n\t\t2,\r\n\t);\r\n\tsetMissingAura(\r\n\t\tboard.filter((e) => hasCorrectTribe(e, boardHero, Race.MURLOC, anomalies, allCards)),\r\n\t\tCardIds.MurlocWarleaderLegacy_BG_EX1_507,\r\n\t\tCardIds.MurlocWarleader_MrgglaarglLegacyEnchantment,\r\n\t\t2,\r\n\t\t0,\r\n\t);\r\n\tsetMissingAura(\r\n\t\tboard.filter((e) => hasCorrectTribe(e, boardHero, Race.MURLOC, anomalies, allCards)),\r\n\t\tCardIds.MurlocWarleaderLegacy_BG_EX1_507,\r\n\t\tCardIds.MurlocWarleader_MrgglaarglEnchantment,\r\n\t\t4,\r\n\t\t0,\r\n\t);\r\n\tsetMissingAura(\r\n\t\tboard.filter((e) => hasCorrectTribe(e, boardHero, Race.DEMON, anomalies, allCards)),\r\n\t\tCardIds.Kathranatir_BG21_039,\r\n\t\tCardIds.Kathranatir_GraspOfKathranatirEnchantment_BG21_039e,\r\n\t\t2,\r\n\t\t0,\r\n\t);\r\n\tsetMissingAura(\r\n\t\tboard.filter((e) => hasCorrectTribe(e, boardHero, Race.DEMON, anomalies, allCards)),\r\n\t\tCardIds.Kathranatir_BG21_039_G,\r\n\t\tCardIds.Kathranatir_GraspOfKathranatirEnchantment_BG21_039_Ge,\r\n\t\t4,\r\n\t\t0,\r\n\t);\r\n\tsetMissingAura(\r\n\t\tboard.filter((e) => e.divineShield),\r\n\t\tCardIds.CyborgDrake_BG25_043,\r\n\t\tCardIds.CyborgDrake_CyborgEnhancementEnchantment_BG25_043e,\r\n\t\t6,\r\n\t\t0,\r\n\t\tfalse,\r\n\t);\r\n\tsetMissingAura(\r\n\t\tboard.filter((e) => e.divineShield),\r\n\t\tCardIds.CyborgDrake_BG25_043_G,\r\n\t\tCardIds.CyborgDrake_CyborgEnhancementEnchantment_BG25_043_Ge,\r\n\t\t12,\r\n\t\t0,\r\n\t\tfalse,\r\n\t);\r\n\tsetMissingAura(\r\n\t\tboard.filter((e) => hasCorrectTribe(e, boardHero, Race.UNDEAD, anomalies, allCards)),\r\n\t\tCardIds.SoreLoser_BG27_030,\r\n\t\tCardIds.SoreLoser_NoImWinningEnchantment_BG27_030e,\r\n\t\tboardHero.tavernTier,\r\n\t\t0,\r\n\t);\r\n\tsetMissingAura(\r\n\t\tboard.filter((e) => hasCorrectTribe(e, boardHero, Race.UNDEAD, anomalies, allCards)),\r\n\t\tCardIds.SoreLoser_BG27_030_G,\r\n\t\tCardIds.SoreLoser_NoImWinningEnchantment_BG27_030e,\r\n\t\t2 * boardHero.tavernTier,\r\n\t\t0,\r\n\t);\r\n};\r\n\r\nconst setMissingAura = (\r\n\tboard: BoardEntity[],\r\n\tminionCardId: string,\r\n\tenchantmentCardId: string,\r\n\tattack: number,\r\n\thealth: number,\r\n\tignoreSelf = true,\r\n\tallCards: AllCardsService = null,\r\n): void => {\r\n\tconst buffers = board.filter((e) => e.cardId === minionCardId);\r\n\tfor (const buffer of buffers) {\r\n\t\tboard\r\n\t\t\t.filter((e) => !e.enchantments.find((ench) => ench.cardId === enchantmentCardId))\r\n\t\t\t.filter((e) => (ignoreSelf ? e.entityId !== buffer.entityId : true))\r\n\t\t\t.forEach((e) => {\r\n\t\t\t\te.attack += attack;\r\n\t\t\t\te.health += health;\r\n\t\t\t});\r\n\t}\r\n};\r\n\r\nexport const setImplicitDataHero = (\r\n\thero: BgsPlayerEntity,\r\n\tcardsData: CardsData,\r\n\tisPlayer: boolean,\r\n\tentityIdContainer: { entityId: number },\r\n): void => {\r\n\tfor (const heroPower of hero.heroPowers) {\r\n\t\tconst avengeValue = cardsData.avengeValue(heroPower.cardId);\r\n\t\tif (avengeValue > 0) {\r\n\t\t\theroPower.avengeCurrent = avengeValue;\r\n\t\t\theroPower.avengeDefault = avengeValue;\r\n\t\t}\r\n\t}\r\n\t// Backward compatibility\r\n\tif (!!hero.questRewards?.length && !Array.isArray(hero.questRewards)) {\r\n\t\thero.questRewards = [hero.questRewards as any];\r\n\t}\r\n\r\n\t// Because Denathrius can send a quest reward as its hero power (I think)\r\n\t// For now deactivating this, until I have a scenario where this matters. It feels like\r\n\t// this should be a display issue only, as quest rewards are also handled in the code\r\n\tconst heroPowerAsReward = null; // hero.cardId === CardIds.SireDenathrius_BG24_HERO_100 ? hero.heroPowers[0]?.cardId : null;\r\n\thero.questRewards = [...(hero.questRewards ?? []), heroPowerAsReward].filter((e) => !!e);\r\n\thero.questRewardEntities = hero.questRewardEntities\r\n\t\t? hero.questRewardEntities.map((reward: any) => ({\r\n\t\t\t\tcardId: reward.CardId,\r\n\t\t\t\tscriptDataNum1: reward.ScriptDataNum1 ?? 0,\r\n\t\t\t\tentityId: entityIdContainer.entityId--,\r\n\t\t\t\tavengeDefault: cardsData.avengeValue(reward.CardId),\r\n\t\t\t\tavengeCurrent: cardsData.avengeValue(reward.CardId),\r\n\t\t }))\r\n\t\t: hero.questRewards.map((reward) => ({\r\n\t\t\t\tcardId: reward,\r\n\t\t\t\tentityId: entityIdContainer.entityId--,\r\n\t\t\t\tavengeCurrent: cardsData.avengeValue(reward),\r\n\t\t\t\tavengeDefault: cardsData.avengeValue(reward),\r\n\t\t\t\tscriptDataNum1: cardsData.defaultScriptDataNum(reward),\r\n\t\t }));\r\n\thero.trinkets = (hero.trinkets ?? []).map((trinket) => ({\r\n\t\t...trinket,\r\n\t\tavengeDefault: cardsData.avengeValue(trinket.cardId),\r\n\t\tavengeCurrent: cardsData.avengeValue(trinket.cardId),\r\n\t\tscriptDataNum1: cardsData.defaultScriptDataNum(trinket.cardId),\r\n\t}));\r\n\t// 0 is not a valid entityId\r\n\thero.entityId = hero.entityId || entityIdContainer.entityId--;\r\n\thero.hand = hero.hand ?? [];\r\n\tif (!hero.globalInfo) {\r\n\t\thero.globalInfo = {};\r\n\t}\r\n\r\n\thero.globalInfo.EternalKnightsDeadThisGame = hero.globalInfo.EternalKnightsDeadThisGame ?? 0;\r\n\thero.globalInfo.SanlaynScribesDeadThisGame = hero.globalInfo.SanlaynScribesDeadThisGame ?? 0;\r\n\thero.globalInfo.BeastsSummonedThisGame = hero.globalInfo.BeastsSummonedThisGame ?? 0;\r\n\thero.globalInfo.MagnetizedThisGame = hero.globalInfo.MagnetizedThisGame ?? 0;\r\n\thero.globalInfo.PiratesSummonedThisGame = hero.globalInfo.PiratesSummonedThisGame ?? 0;\r\n\thero.globalInfo.BattlecriesTriggeredThisGame = hero.globalInfo.BattlecriesTriggeredThisGame ?? 0;\r\n\thero.globalInfo.BeetleAttackBuff = hero.globalInfo.BeetleAttackBuff ?? 0;\r\n\thero.globalInfo.BeetleHealthBuff = hero.globalInfo.BeetleHealthBuff ?? 0;\r\n\thero.globalInfo.ElementalAttackBuff = hero.globalInfo.ElementalAttackBuff ?? 0;\r\n\thero.globalInfo.ElementalHealthBuff = hero.globalInfo.ElementalHealthBuff ?? 0;\r\n\thero.globalInfo.TavernSpellAttackBuff = hero.globalInfo.TavernSpellAttackBuff ?? 0;\r\n\thero.globalInfo.TavernSpellHealthBuff = hero.globalInfo.TavernSpellHealthBuff ?? 0;\r\n\thero.globalInfo.MutatedLasherAttackBuff = hero.globalInfo.MutatedLasherAttackBuff ?? 0;\r\n\thero.globalInfo.MutatedLasherHealthBuff = hero.globalInfo.MutatedLasherHealthBuff ?? 0;\r\n\thero.globalInfo.TavernSpellsCastThisGame = hero.globalInfo.TavernSpellsCastThisGame ?? 0;\r\n\thero.globalInfo.SpellsCastThisGame = hero.globalInfo.SpellsCastThisGame ?? 0;\r\n\thero.globalInfo.UndeadAttackBonus = hero.globalInfo.UndeadAttackBonus ?? 0;\r\n\thero.globalInfo.FrostlingBonus = hero.globalInfo.FrostlingBonus ?? 0;\r\n\thero.globalInfo.BloodGemAttackBonus =\r\n\t\t(hero.globalInfo.BloodGemAttackBonus ?? 0) +\r\n\t\t// Not sure why, but this isn't reflected in the player enchant\r\n\t\t(hero.questRewardEntities?.filter((e) => e.cardId === CardIds.EndlessBloodMoon).length ?? 0);\r\n\thero.globalInfo.BloodGemHealthBonus =\r\n\t\t(hero.globalInfo.BloodGemHealthBonus ?? 0) +\r\n\t\t(hero.questRewardEntities?.filter((e) => e.cardId === CardIds.EndlessBloodMoon).length ?? 0);\r\n\thero.globalInfo.GoldrinnBuffAtk = hero.globalInfo.GoldrinnBuffAtk ?? 0;\r\n\thero.globalInfo.GoldrinnBuffHealth = hero.globalInfo.GoldrinnBuffHealth ?? 0;\r\n};\r\n\r\nexport const clearStealthIfNeeded = (\r\n\tboard: BoardEntity[],\r\n\thero: BgsPlayerEntity,\r\n\totherBoard: BoardEntity[],\r\n\totherHero: BgsPlayerEntity,\r\n\tgameState: FullGameState,\r\n): void => {\r\n\t// https://twitter.com/DCalkosz/status/1562194944688660481?s=20&t=100I8IVZmBKgYQWkdK8nIA\r\n\tif (board.every((entity) => entity.stealth && !entity.attack)) {\r\n\t\tboard.forEach((e) => updateStealth(e, false, board, hero, otherHero, gameState));\r\n\t}\r\n\tif (otherBoard.every((entity) => entity.stealth && !entity.attack)) {\r\n\t\totherBoard.forEach((e) => updateStealth(e, false, otherBoard, otherHero, hero, gameState));\r\n\t}\r\n\tif (board.every((e) => e.stealth) && otherBoard.every((e) => e.stealth)) {\r\n\t\tboard.forEach((e) => updateStealth(e, false, board, hero, otherHero, gameState));\r\n\t\totherBoard.forEach((e) => updateStealth(e, false, otherBoard, otherHero, hero, gameState));\r\n\t}\r\n};\r\n\r\nexport const updateBoardwideAuras = (\r\n\tboard: BoardEntity[],\r\n\tboardHero: BgsPlayerEntity,\r\n\tgameState: FullGameState,\r\n): void => {\r\n\tif (board.length === 0) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tboard\r\n\t\t.filter((entity) =>\r\n\t\t\tentity.enchantments.some(\r\n\t\t\t\t(ench) =>\r\n\t\t\t\t\tench.cardId === CardIds.WindrunnerNecklace_RunningLikeTheWindEnchantment_BG30_MagicItem_997e ||\r\n\t\t\t\t\tench.cardId === CardIds.WindrunnerNecklace_RunningLikeTheWindEnchantment_BG30_MagicItem_997e2,\r\n\t\t\t),\r\n\t\t)\r\n\t\t.forEach((e) => {\r\n\t\t\tconst enchantments = e.enchantments.filter(\r\n\t\t\t\t(ench) => ench.cardId === CardIds.WindrunnerNecklace_RunningLikeTheWindEnchantment_BG30_MagicItem_997e,\r\n\t\t\t).length;\r\n\t\t\tconst greaterEnchantments = e.enchantments.filter(\r\n\t\t\t\t(ench) => ench.cardId === CardIds.WindrunnerNecklace_RunningLikeTheWindEnchantment_BG30_MagicItem_997e2,\r\n\t\t\t).length;\r\n\t\t\te.attack = Math.max(0, e.attack - enchantments * 8 - greaterEnchantments * 15);\r\n\t\t\te.enchantments = e.enchantments\r\n\t\t\t\t.filter(\r\n\t\t\t\t\t(ench) =>\r\n\t\t\t\t\t\tench.cardId !== CardIds.WindrunnerNecklace_RunningLikeTheWindEnchantment_BG30_MagicItem_997e,\r\n\t\t\t\t)\r\n\t\t\t\t.filter(\r\n\t\t\t\t\t(ench) =>\r\n\t\t\t\t\t\tench.cardId !== CardIds.WindrunnerNecklace_RunningLikeTheWindEnchantment_BG30_MagicItem_997e2,\r\n\t\t\t\t);\r\n\t\t});\r\n\tboardHero.trinkets\r\n\t\t.filter(\r\n\t\t\t(t) =>\r\n\t\t\t\tt.cardId === CardIds.WindrunnerNecklace_BG30_MagicItem_997 ||\r\n\t\t\t\tt.cardId === CardIds.WindrunnerNecklace_WindrunnerNecklaceToken_BG30_MagicItem_997t,\r\n\t\t)\r\n\t\t.forEach((t) => {\r\n\t\t\tconst buff = t.cardId === CardIds.WindrunnerNecklace_BG30_MagicItem_997 ? 8 : 15;\r\n\t\t\tboard[0].attack = board[0].attack + buff;\r\n\t\t\tboard[0].enchantments.push({\r\n\t\t\t\tcardId:\r\n\t\t\t\t\tt.cardId === CardIds.WindrunnerNecklace_BG30_MagicItem_997\r\n\t\t\t\t\t\t? CardIds.WindrunnerNecklace_RunningLikeTheWindEnchantment_BG30_MagicItem_997e\r\n\t\t\t\t\t\t: CardIds.WindrunnerNecklace_RunningLikeTheWindEnchantment_BG30_MagicItem_997e2,\r\n\t\t\t\toriginEntityId: t.entityId,\r\n\t\t\t\ttiming: gameState.sharedState.currentEntityId++,\r\n\t\t\t});\r\n\t\t});\r\n};\r\n"]}
|
|
1
|
+
{"version":3,"file":"auras.js","sourceRoot":"","sources":["../../src/simulation/auras.ts"],"names":[],"mappings":";;;AACA,iEAA8E;AAI9E,iDAAoD;AACpD,oC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C,CAAC;IACJ,SAAS,CAAC,QAAQ;SAChB,MAAM,CACN,CAAC,CAAC,EAAE,EAAE,CACL,CAAC,CAAC,MAAM,yBAAkD;QAC1D,CAAC,CAAC,MAAM,0BAA2E,CACpF;SACA,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;QACd,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,yBAAkD,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACjF,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC;QACzC,KAAK,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC;YAC1B,MAAM,EACL,CAAC,CAAC,MAAM,yBAAkD;gBACzD,CAAC;gBACD,CAAC,uBAA8E;YACjF,cAAc,EAAE,CAAC,CAAC,QAAQ;YAC1B,MAAM,EAAE,SAAS,CAAC,WAAW,CAAC,eAAe,EAAE;SAC/C,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AArDW,QAAA,oBAAoB,wBAqD/B","sourcesContent":["/* eslint-disable @typescript-eslint/no-use-before-define */\r\nimport { AllCardsService, CardIds, Race } from '@firestone-hs/reference-data';\r\nimport { BgsPlayerEntity } from '../bgs-player-entity';\r\nimport { BoardEntity } from '../board-entity';\r\nimport { CardsData } from '../cards/cards-data';\r\nimport { updateStealth } from '../keywords/stealth';\r\nimport { hasCorrectTribe } from '../utils';\r\nimport { FullGameState } from './internal-game-state';\r\n\r\nexport const setMissingAuras = (\r\n\tboard: BoardEntity[],\r\n\tboardHero: BgsPlayerEntity,\r\n\tanomalies: readonly string[],\r\n\tallCards: AllCardsService,\r\n): void => {\r\n\tsetMissingMinionsAura(board, boardHero, anomalies, allCards);\r\n\tsetMissingHeroPowerAura(board, boardHero);\r\n\tsetMissingTrinketAura(board, boardHero);\r\n};\r\n\r\nexport const setMissingTrinketAura = (board: BoardEntity[], boardHero: BgsPlayerEntity): void => {\r\n\tfor (const trinket of boardHero.trinkets ?? []) {\r\n\t\tswitch (trinket.cardId) {\r\n\t\t\tcase CardIds.WindrunnerNecklace_BG30_MagicItem_997:\r\n\t\t\tcase CardIds.WindrunnerNecklace_WindrunnerNecklaceToken_BG30_MagicItem_997t:\r\n\t\t\t\tconst enchantment =\r\n\t\t\t\t\ttrinket.cardId === CardIds.WindrunnerNecklace_BG30_MagicItem_997\r\n\t\t\t\t\t\t? CardIds.WindrunnerNecklace_RunningLikeTheWindEnchantment_BG30_MagicItem_997e\r\n\t\t\t\t\t\t: CardIds.WindrunnerNecklace_RunningLikeTheWindEnchantment_BG30_MagicItem_997e2;\r\n\t\t\t\tconst buff = trinket.cardId === CardIds.WindrunnerNecklace_BG30_MagicItem_997 ? 8 : 20;\r\n\t\t\t\tconst target = board[0];\r\n\t\t\t\tif (!!target && !target.enchantments?.find((e) => e.cardId === enchantment)) {\r\n\t\t\t\t\ttarget.attack += buff;\r\n\t\t\t\t\ttarget.enchantments.push({\r\n\t\t\t\t\t\tcardId: enchantment,\r\n\t\t\t\t\t\toriginEntityId: trinket.entityId,\r\n\t\t\t\t\t\ttiming: 0,\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n};\r\n\r\nexport const setMissingHeroPowerAura = (board: BoardEntity[], boardHero: BgsPlayerEntity): void => {\r\n\tfor (const heroPower of boardHero.heroPowers) {\r\n\t\tif (heroPower.cardId === CardIds.TheSmokingGun) {\r\n\t\t\tboard\r\n\t\t\t\t.filter(\r\n\t\t\t\t\t(e) =>\r\n\t\t\t\t\t\t!e.enchantments.find(\r\n\t\t\t\t\t\t\t(ench) => ench.cardId === CardIds.TheSmokingGun_ArmedAndStillSmokingEnchantment,\r\n\t\t\t\t\t\t),\r\n\t\t\t\t)\r\n\t\t\t\t.forEach((e) => {\r\n\t\t\t\t\te.attack += 4;\r\n\t\t\t\t});\r\n\t\t}\r\n\t\tif (heroPower.cardId === CardIds.VolatileVenom) {\r\n\t\t\tboard\r\n\t\t\t\t.filter(\r\n\t\t\t\t\t(e) => !e.enchantments.find((ench) => ench.cardId === CardIds.VolatileVenom_VolatileEnchantment),\r\n\t\t\t\t)\r\n\t\t\t\t.forEach((e) => {\r\n\t\t\t\t\te.attack += 7;\r\n\t\t\t\t\te.health += 7;\r\n\t\t\t\t\te.enchantments.push({\r\n\t\t\t\t\t\tcardId: CardIds.VolatileVenom_VolatileEnchantment,\r\n\t\t\t\t\t\toriginEntityId: undefined,\r\n\t\t\t\t\t\ttiming: 0,\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t}\r\n\t}\r\n};\r\n\r\nconst setMissingMinionsAura = (\r\n\tboard: BoardEntity[],\r\n\tboardHero: BgsPlayerEntity,\r\n\tanomalies: readonly string[],\r\n\tallCards: AllCardsService,\r\n): void => {\r\n\tsetMissingAura(\r\n\t\tboard.filter((e) => hasCorrectTribe(e, boardHero, Race.PIRATE, anomalies, allCards)),\r\n\t\tCardIds.SouthseaCaptainLegacy_BG_NEW1_027,\r\n\t\tCardIds.SouthseaCaptain_YarrrVanillaEnchantment,\r\n\t\t1,\r\n\t\t1,\r\n\t);\r\n\tsetMissingAura(\r\n\t\tboard.filter((e) => hasCorrectTribe(e, boardHero, Race.PIRATE, anomalies, allCards)),\r\n\t\tCardIds.SouthseaCaptainLegacy_TB_BaconUps_136,\r\n\t\tCardIds.SouthseaCaptain_YarrrEnchantment,\r\n\t\t2,\r\n\t\t2,\r\n\t);\r\n\tsetMissingAura(\r\n\t\tboard.filter((e) => hasCorrectTribe(e, boardHero, Race.MURLOC, anomalies, allCards)),\r\n\t\tCardIds.MurlocWarleaderLegacy_BG_EX1_507,\r\n\t\tCardIds.MurlocWarleader_MrgglaarglLegacyEnchantment,\r\n\t\t2,\r\n\t\t0,\r\n\t);\r\n\tsetMissingAura(\r\n\t\tboard.filter((e) => hasCorrectTribe(e, boardHero, Race.MURLOC, anomalies, allCards)),\r\n\t\tCardIds.MurlocWarleaderLegacy_BG_EX1_507,\r\n\t\tCardIds.MurlocWarleader_MrgglaarglEnchantment,\r\n\t\t4,\r\n\t\t0,\r\n\t);\r\n\tsetMissingAura(\r\n\t\tboard.filter((e) => hasCorrectTribe(e, boardHero, Race.DEMON, anomalies, allCards)),\r\n\t\tCardIds.Kathranatir_BG21_039,\r\n\t\tCardIds.Kathranatir_GraspOfKathranatirEnchantment_BG21_039e,\r\n\t\t2,\r\n\t\t0,\r\n\t);\r\n\tsetMissingAura(\r\n\t\tboard.filter((e) => hasCorrectTribe(e, boardHero, Race.DEMON, anomalies, allCards)),\r\n\t\tCardIds.Kathranatir_BG21_039_G,\r\n\t\tCardIds.Kathranatir_GraspOfKathranatirEnchantment_BG21_039_Ge,\r\n\t\t4,\r\n\t\t0,\r\n\t);\r\n\tsetMissingAura(\r\n\t\tboard.filter((e) => e.divineShield),\r\n\t\tCardIds.CyborgDrake_BG25_043,\r\n\t\tCardIds.CyborgDrake_CyborgEnhancementEnchantment_BG25_043e,\r\n\t\t6,\r\n\t\t0,\r\n\t\tfalse,\r\n\t);\r\n\tsetMissingAura(\r\n\t\tboard.filter((e) => e.divineShield),\r\n\t\tCardIds.CyborgDrake_BG25_043_G,\r\n\t\tCardIds.CyborgDrake_CyborgEnhancementEnchantment_BG25_043_Ge,\r\n\t\t12,\r\n\t\t0,\r\n\t\tfalse,\r\n\t);\r\n\tsetMissingAura(\r\n\t\tboard.filter((e) => hasCorrectTribe(e, boardHero, Race.UNDEAD, anomalies, allCards)),\r\n\t\tCardIds.SoreLoser_BG27_030,\r\n\t\tCardIds.SoreLoser_NoImWinningEnchantment_BG27_030e,\r\n\t\tboardHero.tavernTier,\r\n\t\t0,\r\n\t);\r\n\tsetMissingAura(\r\n\t\tboard.filter((e) => hasCorrectTribe(e, boardHero, Race.UNDEAD, anomalies, allCards)),\r\n\t\tCardIds.SoreLoser_BG27_030_G,\r\n\t\tCardIds.SoreLoser_NoImWinningEnchantment_BG27_030e,\r\n\t\t2 * boardHero.tavernTier,\r\n\t\t0,\r\n\t);\r\n};\r\n\r\nconst setMissingAura = (\r\n\tboard: BoardEntity[],\r\n\tminionCardId: string,\r\n\tenchantmentCardId: string,\r\n\tattack: number,\r\n\thealth: number,\r\n\tignoreSelf = true,\r\n\tallCards: AllCardsService = null,\r\n): void => {\r\n\tconst buffers = board.filter((e) => e.cardId === minionCardId);\r\n\tfor (const buffer of buffers) {\r\n\t\tboard\r\n\t\t\t.filter((e) => !e.enchantments.find((ench) => ench.cardId === enchantmentCardId))\r\n\t\t\t.filter((e) => (ignoreSelf ? e.entityId !== buffer.entityId : true))\r\n\t\t\t.forEach((e) => {\r\n\t\t\t\te.attack += attack;\r\n\t\t\t\te.health += health;\r\n\t\t\t});\r\n\t}\r\n};\r\n\r\nexport const setImplicitDataHero = (\r\n\thero: BgsPlayerEntity,\r\n\tcardsData: CardsData,\r\n\tisPlayer: boolean,\r\n\tentityIdContainer: { entityId: number },\r\n): void => {\r\n\tfor (const heroPower of hero.heroPowers) {\r\n\t\tconst avengeValue = cardsData.avengeValue(heroPower.cardId);\r\n\t\tif (avengeValue > 0) {\r\n\t\t\theroPower.avengeCurrent = avengeValue;\r\n\t\t\theroPower.avengeDefault = avengeValue;\r\n\t\t}\r\n\t}\r\n\t// Backward compatibility\r\n\tif (!!hero.questRewards?.length && !Array.isArray(hero.questRewards)) {\r\n\t\thero.questRewards = [hero.questRewards as any];\r\n\t}\r\n\r\n\t// Because Denathrius can send a quest reward as its hero power (I think)\r\n\t// For now deactivating this, until I have a scenario where this matters. It feels like\r\n\t// this should be a display issue only, as quest rewards are also handled in the code\r\n\tconst heroPowerAsReward = null; // hero.cardId === CardIds.SireDenathrius_BG24_HERO_100 ? hero.heroPowers[0]?.cardId : null;\r\n\thero.questRewards = [...(hero.questRewards ?? []), heroPowerAsReward].filter((e) => !!e);\r\n\thero.questRewardEntities = hero.questRewardEntities\r\n\t\t? hero.questRewardEntities.map((reward: any) => ({\r\n\t\t\t\tcardId: reward.CardId,\r\n\t\t\t\tscriptDataNum1: reward.ScriptDataNum1 ?? 0,\r\n\t\t\t\tentityId: entityIdContainer.entityId--,\r\n\t\t\t\tavengeDefault: cardsData.avengeValue(reward.CardId),\r\n\t\t\t\tavengeCurrent: cardsData.avengeValue(reward.CardId),\r\n\t\t }))\r\n\t\t: hero.questRewards.map((reward) => ({\r\n\t\t\t\tcardId: reward,\r\n\t\t\t\tentityId: entityIdContainer.entityId--,\r\n\t\t\t\tavengeCurrent: cardsData.avengeValue(reward),\r\n\t\t\t\tavengeDefault: cardsData.avengeValue(reward),\r\n\t\t\t\tscriptDataNum1: cardsData.defaultScriptDataNum(reward),\r\n\t\t }));\r\n\thero.trinkets = (hero.trinkets ?? []).map((trinket) => ({\r\n\t\t...trinket,\r\n\t\tavengeDefault: cardsData.avengeValue(trinket.cardId),\r\n\t\tavengeCurrent: cardsData.avengeValue(trinket.cardId),\r\n\t\tscriptDataNum1: cardsData.defaultScriptDataNum(trinket.cardId) || trinket.scriptDataNum1,\r\n\t}));\r\n\t// 0 is not a valid entityId\r\n\thero.entityId = hero.entityId || entityIdContainer.entityId--;\r\n\thero.hand = hero.hand ?? [];\r\n\tif (!hero.globalInfo) {\r\n\t\thero.globalInfo = {};\r\n\t}\r\n\r\n\thero.globalInfo.EternalKnightsDeadThisGame = hero.globalInfo.EternalKnightsDeadThisGame ?? 0;\r\n\thero.globalInfo.SanlaynScribesDeadThisGame = hero.globalInfo.SanlaynScribesDeadThisGame ?? 0;\r\n\thero.globalInfo.BeastsSummonedThisGame = hero.globalInfo.BeastsSummonedThisGame ?? 0;\r\n\thero.globalInfo.MagnetizedThisGame = hero.globalInfo.MagnetizedThisGame ?? 0;\r\n\thero.globalInfo.PiratesSummonedThisGame = hero.globalInfo.PiratesSummonedThisGame ?? 0;\r\n\thero.globalInfo.BattlecriesTriggeredThisGame = hero.globalInfo.BattlecriesTriggeredThisGame ?? 0;\r\n\thero.globalInfo.BeetleAttackBuff = hero.globalInfo.BeetleAttackBuff ?? 0;\r\n\thero.globalInfo.BeetleHealthBuff = hero.globalInfo.BeetleHealthBuff ?? 0;\r\n\thero.globalInfo.ElementalAttackBuff = hero.globalInfo.ElementalAttackBuff ?? 0;\r\n\thero.globalInfo.ElementalHealthBuff = hero.globalInfo.ElementalHealthBuff ?? 0;\r\n\thero.globalInfo.TavernSpellAttackBuff = hero.globalInfo.TavernSpellAttackBuff ?? 0;\r\n\thero.globalInfo.TavernSpellHealthBuff = hero.globalInfo.TavernSpellHealthBuff ?? 0;\r\n\thero.globalInfo.MutatedLasherAttackBuff = hero.globalInfo.MutatedLasherAttackBuff ?? 0;\r\n\thero.globalInfo.MutatedLasherHealthBuff = hero.globalInfo.MutatedLasherHealthBuff ?? 0;\r\n\thero.globalInfo.TavernSpellsCastThisGame = hero.globalInfo.TavernSpellsCastThisGame ?? 0;\r\n\thero.globalInfo.SpellsCastThisGame = hero.globalInfo.SpellsCastThisGame ?? 0;\r\n\thero.globalInfo.UndeadAttackBonus = hero.globalInfo.UndeadAttackBonus ?? 0;\r\n\thero.globalInfo.FrostlingBonus = hero.globalInfo.FrostlingBonus ?? 0;\r\n\thero.globalInfo.BloodGemAttackBonus =\r\n\t\t(hero.globalInfo.BloodGemAttackBonus ?? 0) +\r\n\t\t// Not sure why, but this isn't reflected in the player enchant\r\n\t\t(hero.questRewardEntities?.filter((e) => e.cardId === CardIds.EndlessBloodMoon).length ?? 0);\r\n\thero.globalInfo.BloodGemHealthBonus =\r\n\t\t(hero.globalInfo.BloodGemHealthBonus ?? 0) +\r\n\t\t(hero.questRewardEntities?.filter((e) => e.cardId === CardIds.EndlessBloodMoon).length ?? 0);\r\n\thero.globalInfo.GoldrinnBuffAtk = hero.globalInfo.GoldrinnBuffAtk ?? 0;\r\n\thero.globalInfo.GoldrinnBuffHealth = hero.globalInfo.GoldrinnBuffHealth ?? 0;\r\n};\r\n\r\nexport const clearStealthIfNeeded = (\r\n\tboard: BoardEntity[],\r\n\thero: BgsPlayerEntity,\r\n\totherBoard: BoardEntity[],\r\n\totherHero: BgsPlayerEntity,\r\n\tgameState: FullGameState,\r\n): void => {\r\n\t// https://twitter.com/DCalkosz/status/1562194944688660481?s=20&t=100I8IVZmBKgYQWkdK8nIA\r\n\tif (board.every((entity) => entity.stealth && !entity.attack)) {\r\n\t\tboard.forEach((e) => updateStealth(e, false, board, hero, otherHero, gameState));\r\n\t}\r\n\tif (otherBoard.every((entity) => entity.stealth && !entity.attack)) {\r\n\t\totherBoard.forEach((e) => updateStealth(e, false, otherBoard, otherHero, hero, gameState));\r\n\t}\r\n\tif (board.every((e) => e.stealth) && otherBoard.every((e) => e.stealth)) {\r\n\t\tboard.forEach((e) => updateStealth(e, false, board, hero, otherHero, gameState));\r\n\t\totherBoard.forEach((e) => updateStealth(e, false, otherBoard, otherHero, hero, gameState));\r\n\t}\r\n};\r\n\r\nexport const updateBoardwideAuras = (\r\n\tboard: BoardEntity[],\r\n\tboardHero: BgsPlayerEntity,\r\n\tgameState: FullGameState,\r\n): void => {\r\n\tif (board.length === 0) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tboard\r\n\t\t.filter((entity) =>\r\n\t\t\tentity.enchantments.some(\r\n\t\t\t\t(ench) =>\r\n\t\t\t\t\tench.cardId === CardIds.WindrunnerNecklace_RunningLikeTheWindEnchantment_BG30_MagicItem_997e ||\r\n\t\t\t\t\tench.cardId === CardIds.WindrunnerNecklace_RunningLikeTheWindEnchantment_BG30_MagicItem_997e2,\r\n\t\t\t),\r\n\t\t)\r\n\t\t.forEach((e) => {\r\n\t\t\tconst enchantments = e.enchantments.filter(\r\n\t\t\t\t(ench) => ench.cardId === CardIds.WindrunnerNecklace_RunningLikeTheWindEnchantment_BG30_MagicItem_997e,\r\n\t\t\t).length;\r\n\t\t\tconst greaterEnchantments = e.enchantments.filter(\r\n\t\t\t\t(ench) => ench.cardId === CardIds.WindrunnerNecklace_RunningLikeTheWindEnchantment_BG30_MagicItem_997e2,\r\n\t\t\t).length;\r\n\t\t\te.attack = Math.max(0, e.attack - enchantments * 8 - greaterEnchantments * 15);\r\n\t\t\te.enchantments = e.enchantments\r\n\t\t\t\t.filter(\r\n\t\t\t\t\t(ench) =>\r\n\t\t\t\t\t\tench.cardId !== CardIds.WindrunnerNecklace_RunningLikeTheWindEnchantment_BG30_MagicItem_997e,\r\n\t\t\t\t)\r\n\t\t\t\t.filter(\r\n\t\t\t\t\t(ench) =>\r\n\t\t\t\t\t\tench.cardId !== CardIds.WindrunnerNecklace_RunningLikeTheWindEnchantment_BG30_MagicItem_997e2,\r\n\t\t\t\t);\r\n\t\t});\r\n\tboardHero.trinkets\r\n\t\t.filter(\r\n\t\t\t(t) =>\r\n\t\t\t\tt.cardId === CardIds.WindrunnerNecklace_BG30_MagicItem_997 ||\r\n\t\t\t\tt.cardId === CardIds.WindrunnerNecklace_WindrunnerNecklaceToken_BG30_MagicItem_997t,\r\n\t\t)\r\n\t\t.forEach((t) => {\r\n\t\t\tconst buff = t.cardId === CardIds.WindrunnerNecklace_BG30_MagicItem_997 ? 8 : 15;\r\n\t\t\tboard[0].attack = board[0].attack + buff;\r\n\t\t\tboard[0].enchantments.push({\r\n\t\t\t\tcardId:\r\n\t\t\t\t\tt.cardId === CardIds.WindrunnerNecklace_BG30_MagicItem_997\r\n\t\t\t\t\t\t? CardIds.WindrunnerNecklace_RunningLikeTheWindEnchantment_BG30_MagicItem_997e\r\n\t\t\t\t\t\t: CardIds.WindrunnerNecklace_RunningLikeTheWindEnchantment_BG30_MagicItem_997e2,\r\n\t\t\t\toriginEntityId: t.entityId,\r\n\t\t\t\ttiming: gameState.sharedState.currentEntityId++,\r\n\t\t\t});\r\n\t\t});\r\n};\r\n"]}
|
|
@@ -11,6 +11,7 @@ const cards_in_hand_1 = require("./cards-in-hand");
|
|
|
11
11
|
const deathrattle_spawns_1 = require("./deathrattle-spawns");
|
|
12
12
|
const remembered_deathrattle_1 = require("./remembered-deathrattle");
|
|
13
13
|
const stats_1 = require("./stats");
|
|
14
|
+
const DEATHRATTLES_REQUIRE_MEMORY = ["BG31_999", "BG31_999_G"];
|
|
14
15
|
const computeDeathrattleMultiplier = (board, boardHero, deadEntity, sharedState) => {
|
|
15
16
|
var _a, _b, _c, _d, _e;
|
|
16
17
|
const rivendare = !!board.find((entity) => entity.cardId === "BG_FP1_031" ||
|
|
@@ -334,12 +335,20 @@ const applyMonstrosity = (monstrosity, deadEntities, boardWithDeadEntities, boar
|
|
|
334
335
|
};
|
|
335
336
|
exports.applyMonstrosity = applyMonstrosity;
|
|
336
337
|
const rememberDeathrattles = (fish, deadEntities, cardsData, allCards, sharedState) => {
|
|
337
|
-
var _a;
|
|
338
|
+
var _a, _b;
|
|
338
339
|
if (!(deadEntities === null || deadEntities === void 0 ? void 0 : deadEntities.length)) {
|
|
339
340
|
return;
|
|
340
341
|
}
|
|
342
|
+
if (((_a = fish.rememberedDeathrattles) === null || _a === void 0 ? void 0 : _a.length) > 100) {
|
|
343
|
+
return;
|
|
344
|
+
}
|
|
341
345
|
const validDeathrattles = deadEntities
|
|
342
|
-
.filter((entity) => {
|
|
346
|
+
.filter((entity) => {
|
|
347
|
+
var _a;
|
|
348
|
+
return ((_a = allCards.getCard(entity.cardId).mechanics) === null || _a === void 0 ? void 0 : _a.includes(reference_data_1.GameTag[reference_data_1.GameTag.DEATHRATTLE])) &&
|
|
349
|
+
!(0, utils_2.isFish)(entity);
|
|
350
|
+
})
|
|
351
|
+
.filter((e) => !DEATHRATTLES_REQUIRE_MEMORY.includes(e.cardId) || e.memory)
|
|
343
352
|
.map((entity) => ({
|
|
344
353
|
cardId: entity.cardId,
|
|
345
354
|
repeats: 1,
|
|
@@ -359,10 +368,11 @@ const rememberDeathrattles = (fish, deadEntities, cardsData, allCards, sharedSta
|
|
|
359
368
|
});
|
|
360
369
|
})
|
|
361
370
|
.filter((enchantment) => (0, simulate_bgs_battle_1.isValidDeathrattleEnchantment)(enchantment.cardId));
|
|
362
|
-
const deadEntityRememberedDeathrattles = (
|
|
371
|
+
const deadEntityRememberedDeathrattles = (_b = deadEntities
|
|
363
372
|
.filter((e) => { var _a; return !!((_a = e.rememberedDeathrattles) === null || _a === void 0 ? void 0 : _a.length); })
|
|
364
373
|
.filter((e) => e.entityId !== fish.rebornFromEntityId)
|
|
365
|
-
.
|
|
374
|
+
.filter((e) => !DEATHRATTLES_REQUIRE_MEMORY.includes(e.cardId) || e.memory)
|
|
375
|
+
.flatMap((e) => e.rememberedDeathrattles)) !== null && _b !== void 0 ? _b : [];
|
|
366
376
|
const newDeathrattles = [...validDeathrattles, ...validEnchantments, ...deadEntityRememberedDeathrattles];
|
|
367
377
|
if (newDeathrattles.length > 0) {
|
|
368
378
|
if ((0, utils_2.isGolden)(fish.cardId, allCards)) {
|