@firestone-hs/simulate-bgs-battle 1.1.553 → 1.1.555
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/minion/battlecruiser.js +12 -5
- package/dist/cards/impl/minion/battlecruiser.js.map +1 -1
- package/dist/cards/impl/minion/captain-bonerender.js +26 -10
- package/dist/cards/impl/minion/captain-bonerender.js.map +1 -1
- package/dist/cards/impl/minion/corrupted-myrmidon.js +1 -1
- package/dist/cards/impl/minion/corrupted-myrmidon.js.map +1 -1
- package/dist/cards/impl/minion/karmic-chameleon.js +12 -12
- package/dist/cards/impl/minion/karmic-chameleon.js.map +1 -1
- package/dist/cards/impl/minion/turquoise-skitterer.js +5 -3
- package/dist/cards/impl/minion/turquoise-skitterer.js.map +1 -1
- package/dist/input-sanitation.js +12 -10
- package/dist/input-sanitation.js.map +1 -1
- package/dist/simulation/spawns.js +3 -0
- package/dist/simulation/spawns.js.map +1 -1
- package/dist/simulation/start-of-combat/soc-illidan-hero-power.js +1 -0
- package/dist/simulation/start-of-combat/soc-illidan-hero-power.js.map +1 -1
- package/dist/simulation/start-of-combat/start-of-combat.js +2 -2
- package/dist/simulation/start-of-combat/start-of-combat.js.map +1 -1
- package/package.json +1 -1
|
@@ -8,20 +8,27 @@ const utils_1 = require("../../../utils");
|
|
|
8
8
|
exports.Battlecruiser = {
|
|
9
9
|
cardIds: ["BG31_HERO_801pt", "BG31_HERO_801pt_G"],
|
|
10
10
|
startOfCombat: (minion, input) => {
|
|
11
|
-
var _a, _b;
|
|
11
|
+
var _a, _b, _c;
|
|
12
12
|
const yamatoCannons = [...((_a = minion.enchantments) !== null && _a !== void 0 ? _a : [])]
|
|
13
13
|
.filter((e) => e.cardId === "BG31_HERO_801ptce");
|
|
14
14
|
if (!(yamatoCannons === null || yamatoCannons === void 0 ? void 0 : yamatoCannons.length)) {
|
|
15
15
|
return false;
|
|
16
16
|
}
|
|
17
|
+
const aliveEntities = input.opponentBoard
|
|
18
|
+
.filter((entity) => entity.health > 0 && !entity.definitelyDead)
|
|
19
|
+
.map((e) => e.entityId);
|
|
20
|
+
const targetEntityId = (_b = (0, utils_1.getRandomMinionWithHighestHealth)(input.opponentBoardBefore.filter((e) => aliveEntities.includes(e.entityId)))) === null || _b === void 0 ? void 0 : _b.entityId;
|
|
21
|
+
const cannonDamage = Math.max(...yamatoCannons.map((e) => e.tagScriptDataNum1));
|
|
17
22
|
for (const yamatoCannon of yamatoCannons) {
|
|
18
|
-
const
|
|
19
|
-
const loops = ((_b = minion.tags) === null || _b === void 0 ? void 0 : _b[reference_data_1.GameTag.BACON_YAMATO_CANNON]) === 1 ? 2 : 1;
|
|
23
|
+
const loops = ((_c = minion.tags) === null || _c === void 0 ? void 0 : _c[reference_data_1.GameTag.BACON_YAMATO_CANNON]) === 1 ? 2 : 1;
|
|
20
24
|
for (let i = 0; i < loops; i++) {
|
|
21
|
-
|
|
25
|
+
let target = input.opponentBoard.find((entity) => entity.entityId === targetEntityId);
|
|
26
|
+
if (!target || target.health <= 0 || target.definitelyDead) {
|
|
27
|
+
target = (0, utils_1.getRandomMinionWithHighestHealth)(input.opponentBoard);
|
|
28
|
+
}
|
|
22
29
|
if (!!target) {
|
|
23
30
|
input.gameState.spectator.registerPowerTarget(minion, target, input.opponentBoard, input.playerEntity, input.opponentEntity);
|
|
24
|
-
(0, attack_1.dealDamageToMinion)(target, input.opponentBoard, input.opponentEntity, minion,
|
|
31
|
+
(0, attack_1.dealDamageToMinion)(target, input.opponentBoard, input.opponentEntity, minion, cannonDamage, input.playerBoard, input.playerEntity, input.gameState);
|
|
25
32
|
}
|
|
26
33
|
}
|
|
27
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"battlecruiser.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/battlecruiser.ts"],"names":[],"mappings":";;;AAAA,iEAAgE;AAEhE,uDAAgE;AAKhE,qDAAwD;AACxD,0CAAkE;AAGrD,Q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,CAAA,EAAE;YAC9B,OAAO;SACP;QAED,MAAM,MAAM,GAAG,KAAK,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7F,IAAI,CAAC,MAAM,EAAE;YACZ,OAAO;SACP;QAED,MAAM,IAAI,GAAG,gBAAgB,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;QAC9F,IAAA,mBAAW,EAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,mBAAmB,EAAE,KAAK,CAAC,uBAAuB,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;QAC3G,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,mBAAmB,CAC5C,MAAM,EACN,MAAM,EACN,KAAK,CAAC,mBAAmB,EACzB,KAAK,CAAC,uBAAuB,EAC7B,KAAK,CAAC,cAAc,CACpB,CAAC;IACH,CAAC;CACD,CAAC","sourcesContent":["import { CardIds, GameTag } from '@firestone-hs/reference-data';\r\nimport { BoardEntity } from '../../../board-entity';\r\nimport { dealDamageToMinion } from '../../../simulation/attack';\r\nimport { DeathrattleTriggeredInput } from '../../../simulation/deathrattle-on-trigger';\r\nimport { OnAttackInput } from '../../../simulation/on-attack';\r\nimport { RebornEffectInput } from '../../../simulation/reborn';\r\nimport { SoCInput } from '../../../simulation/start-of-combat/start-of-combat-input';\r\nimport { modifyStats } from '../../../simulation/stats';\r\nimport { getRandomMinionWithHighestHealth } from '../../../utils';\r\nimport { DeathrattleEffectCard, OnAttackCard, RebornEffectCard, StartOfCombatCard } from '../../card.interface';\r\n\r\nexport const Battlecruiser: StartOfCombatCard & RebornEffectCard & OnAttackCard & DeathrattleEffectCard = {\r\n\tcardIds: [CardIds.LiftOff_BattlecruiserToken_BG31_HERO_801pt, CardIds.Battlecruiser_BG31_HERO_801pt_G],\r\n\tstartOfCombat: (minion: BoardEntity, input: SoCInput) => {\r\n\t\t// Enchantments can appear multiple times???\r\n\t\tconst yamatoCannons = [...(minion.enchantments ?? [])]\r\n\t\t\t// .reverse()\r\n\t\t\t.filter((e) => e.cardId === CardIds.YamatoCannon_YamatoCannonEnchantment_BG31_HERO_801ptce);\r\n\t\tif (!yamatoCannons?.length) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// Still not sure how these should be processed\r\n\t\t// In some cases, it feels like it takes the sum of the damage, in other cases it runs them one after the other\r\n\t\t// (but maybe that's just the replay aggregating the values)\r\n\t\t// I'm not sure about the BACON_YAMATO_CANNON tag; it seems like it indicates multiple cannons, but I'm not sure\r\n\t\t// Other issues: looks like that if there are multiple cannon enchantments but no divine shield, everything is applied to the same target\r\n\t\t// So it looks as if the target is selected first, then everything targets it\r\n\t\t// https://replays.firestoneapp.com/?reviewId=e8f38ab0-3380-4275-88d8-0715d69d3f08&turn=21&action=1\r\n\t\t// Even more than that: the target is the same between multiple battlecruisers\r\n\t\t// https://replays.firestoneapp.com/?reviewId=cbfd6fe9-1a58-400a-a593-6b8852df5427&turn=9&action=0\r\n\t\t// However I'm pretty sure I've seen another behavior\r\n\t\tfor (const yamatoCannon of yamatoCannons) {\r\n\t\t\tconst damage = yamatoCannon.tagScriptDataNum1;\r\n\t\t\tconst loops = minion.tags?.[GameTag.BACON_YAMATO_CANNON] === 1 ? 2 : 1;\r\n\t\t\tfor (let i = 0; i < loops; i++) {\r\n\t\t\t\tconst target = getRandomMinionWithHighestHealth(input.opponentBoard);\r\n\t\t\t\tif (!!target) {\r\n\t\t\t\t\tinput.gameState.spectator.registerPowerTarget(\r\n\t\t\t\t\t\tminion,\r\n\t\t\t\t\t\ttarget,\r\n\t\t\t\t\t\tinput.opponentBoard,\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\tdealDamageToMinion(\r\n\t\t\t\t\t\ttarget,\r\n\t\t\t\t\t\tinput.opponentBoard,\r\n\t\t\t\t\t\tinput.opponentEntity,\r\n\t\t\t\t\t\tminion,\r\n\t\t\t\t\t\tdamage,\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.gameState,\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t},\r\n\trebornEffect: (minion: BoardEntity, input: RebornEffectInput) => {\r\n\t\tconst ultraCapacitors = [...(input.initialEntity.enchantments ?? [])]\r\n\t\t\t// .reverse()\r\n\t\t\t.filter((e) => e.cardId === CardIds.UltraCapacitor_UltraCapacitorEnchantment_BG31_HERO_801ptje);\r\n\t\tif (!ultraCapacitors?.length) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tminion.enchantments = input.initialEntity.enchantments;\r\n\t\tminion.attack = input.initialEntity.maxAttack;\r\n\t\tminion.maxAttack = input.initialEntity.maxAttack;\r\n\t\tminion.health = input.initialEntity.maxHealth;\r\n\t\tminion.maxHealth = input.initialEntity.maxHealth;\r\n\t\tminion.divineShield = input.initialEntity.hadDivineShield;\r\n\t\tminion.taunt = input.initialEntity.taunt;\r\n\t\tminion.windfury = input.initialEntity.windfury;\r\n\t\tminion.poisonous = input.initialEntity.poisonous;\r\n\t},\r\n\tonAnyMinionAttack: (\r\n\t\tminion: BoardEntity,\r\n\t\tinput: OnAttackInput,\r\n\t): {\r\n\t\tdmgDoneByAttacker: number;\r\n\t\tdmgDoneByDefender: number;\r\n\t} => {\r\n\t\tif (minion !== input.attacker) {\r\n\t\t\treturn { dmgDoneByAttacker: 0, dmgDoneByDefender: 0 };\r\n\t\t}\r\n\r\n\t\tconst advancedBallistics = [...(minion.enchantments ?? [])]\r\n\t\t\t// .reverse()\r\n\t\t\t.filter((e) => e.cardId === CardIds.AdvancedBallistics_AdvancedBallisticsEnchantment_BG31_HERO_801ptde);\r\n\t\tif (!advancedBallistics?.length) {\r\n\t\t\treturn { dmgDoneByAttacker: 0, dmgDoneByDefender: 0 };\r\n\t\t}\r\n\r\n\t\tconst buff = advancedBallistics.map((e) => e.tagScriptDataNum1 ?? 0).reduce((a, b) => a + b, 0);\r\n\t\tconst targets = input.attackingBoard.filter((entity) => entity !== minion);\r\n\t\tfor (const target of targets) {\r\n\t\t\tmodifyStats(target, buff, 0, input.attackingBoard, input.attackingHero, input.gameState);\r\n\t\t}\r\n\t\treturn { dmgDoneByAttacker: 0, dmgDoneByDefender: 0 };\r\n\t},\r\n\tdeathrattleEffect: (minion: BoardEntity, input: DeathrattleTriggeredInput) => {\r\n\t\tconst caduceusReactors = [...(minion.enchantments ?? [])]\r\n\t\t\t// .reverse()\r\n\t\t\t.filter((e) => e.cardId === CardIds.CaduceusReactor_CaduceusReactorEnchantment_BG31_HERO_801ptee);\r\n\t\tif (!caduceusReactors?.length) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst target = input.boardWithDeadEntity.filter((e) => e.health > 0 && !e.definitelyDead)[0];\r\n\t\tif (!target) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst buff = caduceusReactors.map((e) => e.tagScriptDataNum1 ?? 0).reduce((a, b) => a + b, 0);\r\n\t\tmodifyStats(target, buff, buff, input.boardWithDeadEntity, input.boardWithDeadEntityHero, input.gameState);\r\n\t\tinput.gameState.spectator.registerPowerTarget(\r\n\t\t\tminion,\r\n\t\t\ttarget,\r\n\t\t\tinput.boardWithDeadEntity,\r\n\t\t\tinput.boardWithDeadEntityHero,\r\n\t\t\tinput.otherBoardHero,\r\n\t\t);\r\n\t},\r\n};\r\n"]}
|
|
1
|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AC,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;QAC9F,IAAA,mBAAW,EAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,mBAAmB,EAAE,KAAK,CAAC,uBAAuB,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;QAC3G,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,mBAAmB,CAC5C,MAAM,EACN,MAAM,EACN,KAAK,CAAC,mBAAmB,EACzB,KAAK,CAAC,uBAAuB,EAC7B,KAAK,CAAC,cAAc,CACpB,CAAC;IACH,CAAC;CACD,CAAC","sourcesContent":["import { CardIds, GameTag } from '@firestone-hs/reference-data';\r\nimport { BoardEntity } from '../../../board-entity';\r\nimport { dealDamageToMinion } from '../../../simulation/attack';\r\nimport { DeathrattleTriggeredInput } from '../../../simulation/deathrattle-on-trigger';\r\nimport { OnAttackInput } from '../../../simulation/on-attack';\r\nimport { RebornEffectInput } from '../../../simulation/reborn';\r\nimport { SoCInput } from '../../../simulation/start-of-combat/start-of-combat-input';\r\nimport { modifyStats } from '../../../simulation/stats';\r\nimport { getRandomMinionWithHighestHealth } from '../../../utils';\r\nimport { DeathrattleEffectCard, OnAttackCard, RebornEffectCard, StartOfCombatCard } from '../../card.interface';\r\n\r\nexport const Battlecruiser: StartOfCombatCard & RebornEffectCard & OnAttackCard & DeathrattleEffectCard = {\r\n\tcardIds: [CardIds.LiftOff_BattlecruiserToken_BG31_HERO_801pt, CardIds.Battlecruiser_BG31_HERO_801pt_G],\r\n\tstartOfCombat: (minion: BoardEntity, input: SoCInput) => {\r\n\t\t// Enchantments can appear multiple times???\r\n\t\tconst yamatoCannons = [...(minion.enchantments ?? [])]\r\n\t\t\t// .reverse()\r\n\t\t\t.filter((e) => e.cardId === CardIds.YamatoCannon_YamatoCannonEnchantment_BG31_HERO_801ptce);\r\n\t\tif (!yamatoCannons?.length) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// Still not sure how these should be processed\r\n\t\t// In some cases, it feels like it takes the sum of the damage, in other cases it runs them one after the other\r\n\t\t// (but maybe that's just the replay aggregating the values)\r\n\t\t// I'm not sure about the BACON_YAMATO_CANNON tag; it seems like it indicates multiple cannons, but I'm not sure\r\n\t\t// Other issues: looks like that if there are multiple cannon enchantments but no divine shield, everything is applied to the same target\r\n\t\t// So it looks as if the target is selected first, then everything targets it\r\n\t\t// https://replays.firestoneapp.com/?reviewId=e8f38ab0-3380-4275-88d8-0715d69d3f08&turn=21&action=1\r\n\t\t// Even more than that: the target is the same between multiple battlecruisers\r\n\t\t// https://replays.firestoneapp.com/?reviewId=cbfd6fe9-1a58-400a-a593-6b8852df5427&turn=9&action=0\r\n\t\t// However I'm pretty sure I've seen another behavior\r\n\t\t// Get the highest health opponent minion at the start of the phase\r\n\t\tconst aliveEntities = input.opponentBoard\r\n\t\t\t.filter((entity) => entity.health > 0 && !entity.definitelyDead)\r\n\t\t\t.map((e) => e.entityId);\r\n\t\tconst targetEntityId = getRandomMinionWithHighestHealth(\r\n\t\t\tinput.opponentBoardBefore.filter((e) => aliveEntities.includes(e.entityId)),\r\n\t\t)?.entityId;\r\n\t\t// const numberOfCannons = yamatoCannons.length;\r\n\t\tconst cannonDamage = Math.max(...yamatoCannons.map((e) => e.tagScriptDataNum1));\r\n\t\tfor (const yamatoCannon of yamatoCannons) {\r\n\t\t\t// const damage = yamatoCannon.tagScriptDataNum1;\r\n\t\t\t// Could this simply be tagScriptDataNum2 on the battlecruiser?\r\n\t\t\t// I don't understand how this relates to the number enchants in the cruiser itself\r\n\t\t\tconst loops = minion.tags?.[GameTag.BACON_YAMATO_CANNON] === 1 ? 2 : 1;\r\n\t\t\tfor (let i = 0; i < loops; i++) {\r\n\t\t\t\tlet target = input.opponentBoard.find((entity) => entity.entityId === targetEntityId);\r\n\t\t\t\tif (!target || target.health <= 0 || target.definitelyDead) {\r\n\t\t\t\t\ttarget = getRandomMinionWithHighestHealth(input.opponentBoard);\r\n\t\t\t\t}\r\n\t\t\t\tif (!!target) {\r\n\t\t\t\t\tinput.gameState.spectator.registerPowerTarget(\r\n\t\t\t\t\t\tminion,\r\n\t\t\t\t\t\ttarget,\r\n\t\t\t\t\t\tinput.opponentBoard,\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\tdealDamageToMinion(\r\n\t\t\t\t\t\ttarget,\r\n\t\t\t\t\t\tinput.opponentBoard,\r\n\t\t\t\t\t\tinput.opponentEntity,\r\n\t\t\t\t\t\tminion,\r\n\t\t\t\t\t\tcannonDamage,\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.gameState,\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t},\r\n\trebornEffect: (minion: BoardEntity, input: RebornEffectInput) => {\r\n\t\tconst ultraCapacitors = [...(input.initialEntity.enchantments ?? [])]\r\n\t\t\t// .reverse()\r\n\t\t\t.filter((e) => e.cardId === CardIds.UltraCapacitor_UltraCapacitorEnchantment_BG31_HERO_801ptje);\r\n\t\tif (!ultraCapacitors?.length) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tminion.enchantments = input.initialEntity.enchantments;\r\n\t\tminion.attack = input.initialEntity.maxAttack;\r\n\t\tminion.maxAttack = input.initialEntity.maxAttack;\r\n\t\tminion.health = input.initialEntity.maxHealth;\r\n\t\tminion.maxHealth = input.initialEntity.maxHealth;\r\n\t\tminion.divineShield = input.initialEntity.hadDivineShield;\r\n\t\tminion.taunt = input.initialEntity.taunt;\r\n\t\tminion.windfury = input.initialEntity.windfury;\r\n\t\tminion.poisonous = input.initialEntity.poisonous;\r\n\t},\r\n\tonAnyMinionAttack: (\r\n\t\tminion: BoardEntity,\r\n\t\tinput: OnAttackInput,\r\n\t): {\r\n\t\tdmgDoneByAttacker: number;\r\n\t\tdmgDoneByDefender: number;\r\n\t} => {\r\n\t\tif (minion !== input.attacker) {\r\n\t\t\treturn { dmgDoneByAttacker: 0, dmgDoneByDefender: 0 };\r\n\t\t}\r\n\r\n\t\tconst advancedBallistics = [...(minion.enchantments ?? [])]\r\n\t\t\t// .reverse()\r\n\t\t\t.filter((e) => e.cardId === CardIds.AdvancedBallistics_AdvancedBallisticsEnchantment_BG31_HERO_801ptde);\r\n\t\tif (!advancedBallistics?.length) {\r\n\t\t\treturn { dmgDoneByAttacker: 0, dmgDoneByDefender: 0 };\r\n\t\t}\r\n\r\n\t\tconst buff = advancedBallistics.map((e) => e.tagScriptDataNum1 ?? 0).reduce((a, b) => a + b, 0);\r\n\t\tconst targets = input.attackingBoard.filter((entity) => entity !== minion);\r\n\t\tfor (const target of targets) {\r\n\t\t\tmodifyStats(target, buff, 0, input.attackingBoard, input.attackingHero, input.gameState);\r\n\t\t}\r\n\t\treturn { dmgDoneByAttacker: 0, dmgDoneByDefender: 0 };\r\n\t},\r\n\tdeathrattleEffect: (minion: BoardEntity, input: DeathrattleTriggeredInput) => {\r\n\t\tconst caduceusReactors = [...(minion.enchantments ?? [])]\r\n\t\t\t// .reverse()\r\n\t\t\t.filter((e) => e.cardId === CardIds.CaduceusReactor_CaduceusReactorEnchantment_BG31_HERO_801ptee);\r\n\t\tif (!caduceusReactors?.length) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst target = input.boardWithDeadEntity.filter((e) => e.health > 0 && !e.definitelyDead)[0];\r\n\t\tif (!target) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst buff = caduceusReactors.map((e) => e.tagScriptDataNum1 ?? 0).reduce((a, b) => a + b, 0);\r\n\t\tmodifyStats(target, buff, buff, input.boardWithDeadEntity, input.boardWithDeadEntityHero, input.gameState);\r\n\t\tinput.gameState.spectator.registerPowerTarget(\r\n\t\t\tminion,\r\n\t\t\ttarget,\r\n\t\t\tinput.boardWithDeadEntity,\r\n\t\t\tinput.boardWithDeadEntityHero,\r\n\t\t\tinput.otherBoardHero,\r\n\t\t);\r\n\t},\r\n};\r\n"]}
|
|
@@ -14,19 +14,20 @@ exports.CaptainBonerender = {
|
|
|
14
14
|
return;
|
|
15
15
|
}
|
|
16
16
|
input.spawned.lastAffectedByEntity = minion;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
.
|
|
17
|
+
let numberOfSpawns = 1;
|
|
18
|
+
for (let i = 0; i < input.board.length; i++) {
|
|
19
|
+
if (input.board[i].cardId !== "BG31_840" &&
|
|
20
|
+
input.board[i].cardId !== "BG31_840_G") {
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
const newSpawns = input.board[i].cardId === "BG31_840_G" ? 2 : 1;
|
|
24
|
+
const spawnsChain = buildSpawnsChain(newSpawns, input.board.slice(i + 1));
|
|
25
|
+
numberOfSpawns += spawnsChain;
|
|
26
|
+
}
|
|
27
|
+
const numberOfCopies = numberOfSpawns - 1;
|
|
24
28
|
const initialCopy = (0, utils_1.copyEntity)(input.spawned);
|
|
25
29
|
const indexFromRight = input.board.length - input.board.indexOf(input.spawned) - 1;
|
|
26
30
|
for (let i = 0; i < numberOfCopies; i++) {
|
|
27
|
-
if (input.board.length >= 7) {
|
|
28
|
-
break;
|
|
29
|
-
}
|
|
30
31
|
const copy = (0, utils_1.copyEntity)(initialCopy);
|
|
31
32
|
(0, add_minion_to_board_1.removeAurasFromSelf)(copy, input.board, input.hero, input.gameState);
|
|
32
33
|
const newMinions = (0, deathrattle_spawns_1.spawnEntities)(copy.cardId, 1, input.board, input.hero, input.otherBoard, input.otherHero, input.gameState, input.hero.friendly, false, false, false, copy);
|
|
@@ -40,4 +41,19 @@ exports.CaptainBonerender = {
|
|
|
40
41
|
}
|
|
41
42
|
},
|
|
42
43
|
};
|
|
44
|
+
const buildSpawnsChain = (numberOfSpawns, board) => {
|
|
45
|
+
let spawns = numberOfSpawns;
|
|
46
|
+
for (let k = 0; k < numberOfSpawns; k++) {
|
|
47
|
+
for (let i = 0; i < board.length; i++) {
|
|
48
|
+
if (board[i].cardId !== "BG31_840" &&
|
|
49
|
+
board[i].cardId !== "BG31_840_G") {
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
const newSpawns = board[i].cardId === "BG31_840_G" ? 2 : 1;
|
|
53
|
+
const spawnsChain = buildSpawnsChain(newSpawns, board.slice(i + 1));
|
|
54
|
+
spawns += spawnsChain;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return spawns;
|
|
58
|
+
};
|
|
43
59
|
//# sourceMappingURL=captain-bonerender.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"captain-bonerender.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/captain-bonerender.ts"],"names":[],"mappings":";;;AAEA,iFAAiG;AACjG,+EAAuE;AACvE,uDAAiE;AACjE,0CAA4C;AAG/B,QAAA,iBAAiB,GAA0B;IACvD,OAAO,EAAE,0BAA0E;IACnF,iBAAiB,EAAE,CAAC,MAAmB,EAAE,KAAwB,EAAE,EAAE;;QAEpE,MAAM,gBAAgB,GAAG,yBAAiB,CAAC,OAAO,CAAC,QAAQ,CAC1D,MAAA,KAAK,CAAC,OAAO,CAAC,oBAAoB,0CAAE,MAAiB,CACrD,CAAC;QACF,IAAI,yBAAiB,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,MAAiB,CAAC,IAAI,gBAAgB,EAAE;YAC5F,OAAO;SACP;QACD,KAAK,CAAC,OAAO,CAAC,oBAAoB,GAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"captain-bonerender.js","sourceRoot":"","sources":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EAAU,EAAE;IAC1F,IAAI,MAAM,GAAG,cAAc,CAAC;IAC5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,cAAc,EAAE,CAAC,EAAE,EAAE;QACxC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACtC,IACC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,eAAuC;gBACtD,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,iBAAyC,EACvD;gBACD,SAAS;aACT;YACD,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,iBAAyC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACnF,MAAM,WAAW,GAAG,gBAAgB,CAAC,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YACpE,MAAM,IAAI,WAAW,CAAC;SACtB;KACD;IACD,OAAO,MAAM,CAAC;AACf,CAAC,CAAC","sourcesContent":["import { CardIds } from '@firestone-hs/reference-data';\r\nimport { BoardEntity } from '../../../board-entity';\r\nimport { OnOtherSpawnInput, removeAurasFromSelf } from '../../../simulation/add-minion-to-board';\r\nimport { spawnEntities } from '../../../simulation/deathrattle-spawns';\r\nimport { performEntitySpawns } from '../../../simulation/spawns';\r\nimport { copyEntity } from '../../../utils';\r\nimport { AfterOtherSpawnedCard } from '../../card.interface';\r\n\r\nexport const CaptainBonerender: AfterOtherSpawnedCard = {\r\n\tcardIds: [CardIds.CaptainBonerender_BG31_840, CardIds.CaptainBonerender_BG31_840_G],\r\n\tafterOtherSpawned: (minion: BoardEntity, input: OnOtherSpawnInput) => {\r\n\t\t// Handle all copies in one go\r\n\t\tconst isAlreadyHandled = CaptainBonerender.cardIds.includes(\r\n\t\t\tinput.spawned.lastAffectedByEntity?.cardId as CardIds,\r\n\t\t);\r\n\t\tif (CaptainBonerender.cardIds.includes(input.spawned.cardId as CardIds) || isAlreadyHandled) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tinput.spawned.lastAffectedByEntity = minion;\r\n\r\n\t\t// Seems weird, but looking at a real game this feels like this is how it works\r\n\t\t// https://replays.firestoneapp.com/?reviewId=b9eeb0a6-f5f1-424f-ba7a-7941d890f6bd&turn=21&action=1\r\n\t\tlet numberOfSpawns = 1;\r\n\t\tfor (let i = 0; i < input.board.length; i++) {\r\n\t\t\tif (\r\n\t\t\t\tinput.board[i].cardId !== CardIds.CaptainBonerender_BG31_840 &&\r\n\t\t\t\tinput.board[i].cardId !== CardIds.CaptainBonerender_BG31_840_G\r\n\t\t\t) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tconst newSpawns = input.board[i].cardId === CardIds.CaptainBonerender_BG31_840_G ? 2 : 1;\r\n\t\t\tconst spawnsChain = buildSpawnsChain(newSpawns, input.board.slice(i + 1));\r\n\t\t\tnumberOfSpawns += spawnsChain;\r\n\t\t}\r\n\t\tconst numberOfCopies = numberOfSpawns - 1;\r\n\t\t// const numberOfCopies = input.board\r\n\t\t// \t.map((e) =>\r\n\t\t// \t\te.cardId === CardIds.CaptainBonerender_BG31_840_G\r\n\t\t// \t\t\t? 2\r\n\t\t// \t\t\t: e.cardId === CardIds.CaptainBonerender_BG31_840\r\n\t\t// \t\t\t? 1\r\n\t\t// \t\t\t: 0,\r\n\t\t// \t)\r\n\t\t// \t.reduce((a, b) => a + b, 0);\r\n\t\t// Do it first, so that modifications like \"attack immediately\" are not reflected in subsequent copies\r\n\t\tconst initialCopy = copyEntity(input.spawned);\r\n\t\t// Technically not necessarily correct, but the main issue is with \"attack immediately\" tokens\r\n\t\t// like Tumbling Assassin, which spawns to the right\r\n\t\tconst indexFromRight = input.board.length - input.board.indexOf(input.spawned) - 1;\r\n\t\tfor (let i = 0; i < numberOfCopies; i++) {\r\n\t\t\t// if (input.board.length >= 7) {\r\n\t\t\t// \tbreak;\r\n\t\t\t// }\r\n\t\t\tconst copy = copyEntity(initialCopy);\r\n\t\t\tremoveAurasFromSelf(copy, input.board, input.hero, input.gameState);\r\n\t\t\tconst newMinions = spawnEntities(\r\n\t\t\t\tcopy.cardId,\r\n\t\t\t\t1,\r\n\t\t\t\tinput.board,\r\n\t\t\t\tinput.hero,\r\n\t\t\t\tinput.otherBoard,\r\n\t\t\t\tinput.otherHero,\r\n\t\t\t\tinput.gameState,\r\n\t\t\t\tinput.hero.friendly,\r\n\t\t\t\tfalse,\r\n\t\t\t\tfalse,\r\n\t\t\t\tfalse,\r\n\t\t\t\tcopy,\r\n\t\t\t);\r\n\t\t\tnewMinions.forEach((spawn) => {\r\n\t\t\t\tspawn.lastAffectedByEntity = minion;\r\n\t\t\t});\r\n\t\t\tconst spawns = performEntitySpawns(\r\n\t\t\t\tnewMinions,\r\n\t\t\t\tinput.board,\r\n\t\t\t\tinput.hero,\r\n\t\t\t\tminion,\r\n\t\t\t\tindexFromRight,\r\n\t\t\t\tinput.otherBoard,\r\n\t\t\t\tinput.otherHero,\r\n\t\t\t\tinput.gameState,\r\n\t\t\t);\r\n\t\t\tspawns.forEach((spawn) => {\r\n\t\t\t\tspawn.lastAffectedByEntity = minion;\r\n\t\t\t});\r\n\t\t}\r\n\t},\r\n};\r\n\r\nconst buildSpawnsChain = (numberOfSpawns: number, board: readonly BoardEntity[]): number => {\r\n\tlet spawns = numberOfSpawns;\r\n\tfor (let k = 0; k < numberOfSpawns; k++) {\r\n\t\tfor (let i = 0; i < board.length; i++) {\r\n\t\t\tif (\r\n\t\t\t\tboard[i].cardId !== CardIds.CaptainBonerender_BG31_840 &&\r\n\t\t\t\tboard[i].cardId !== CardIds.CaptainBonerender_BG31_840_G\r\n\t\t\t) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tconst newSpawns = board[i].cardId === CardIds.CaptainBonerender_BG31_840_G ? 2 : 1;\r\n\t\t\tconst spawnsChain = buildSpawnsChain(newSpawns, board.slice(i + 1));\r\n\t\t\tspawns += spawnsChain;\r\n\t\t}\r\n\t}\r\n\treturn spawns;\r\n};\r\n"]}
|
|
@@ -6,7 +6,7 @@ exports.CorruptedMyrmidon = {
|
|
|
6
6
|
cardIds: ["BG23_012", "BG23_012_G"],
|
|
7
7
|
startOfCombat: (minion, input) => {
|
|
8
8
|
const multiplier = minion.cardId === "BG23_012_G" ? 2 : 1;
|
|
9
|
-
(0, stats_1.modifyStats)(minion, multiplier * minion.
|
|
9
|
+
(0, stats_1.modifyStats)(minion, multiplier * minion.maxAttack, multiplier * minion.maxHealth, input.playerBoard, input.playerEntity, input.gameState);
|
|
10
10
|
input.gameState.spectator.registerPowerTarget(minion, minion, input.playerBoard, input.playerEntity, input.opponentEntity);
|
|
11
11
|
return true;
|
|
12
12
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"corrupted-myrmidon.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/corrupted-myrmidon.ts"],"names":[],"mappings":";;;AAGA,qDAAwD;AAG3C,QAAA,iBAAiB,GAAsB;IACnD,OAAO,EAAE,0BAA0E;IACnF,aAAa,EAAE,CAAC,MAAmB,EAAE,KAAe,EAAE,EAAE;QAEvD,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,iBAAyC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"corrupted-myrmidon.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/corrupted-myrmidon.ts"],"names":[],"mappings":";;;AAGA,qDAAwD;AAG3C,QAAA,iBAAiB,GAAsB;IACnD,OAAO,EAAE,0BAA0E;IACnF,aAAa,EAAE,CAAC,MAAmB,EAAE,KAAe,EAAE,EAAE;QAEvD,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,iBAAyC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAKlF,IAAA,mBAAW,EACV,MAAM,EACN,UAAU,GAAG,MAAM,CAAC,SAAS,EAC7B,UAAU,GAAG,MAAM,CAAC,SAAS,EAC7B,KAAK,CAAC,WAAW,EACjB,KAAK,CAAC,YAAY,EAClB,KAAK,CAAC,SAAS,CACf,CAAC;QACF,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,mBAAmB,CAC5C,MAAM,EACN,MAAM,EACN,KAAK,CAAC,WAAW,EACjB,KAAK,CAAC,YAAY,EAClB,KAAK,CAAC,cAAc,CACpB,CAAC;QACF,OAAO,IAAI,CAAC;IACb,CAAC;CACD,CAAC","sourcesContent":["import { CardIds } 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 { modifyStats } from '../../../simulation/stats';\r\nimport { StartOfCombatCard } from '../../card.interface';\r\n\r\nexport const CorruptedMyrmidon: StartOfCombatCard = {\r\n\tcardIds: [CardIds.CorruptedMyrmidon_BG23_012, CardIds.CorruptedMyrmidon_BG23_012_G],\r\n\tstartOfCombat: (minion: BoardEntity, input: SoCInput) => {\r\n\t\t// We add these stats\r\n\t\tconst multiplier = minion.cardId === CardIds.CorruptedMyrmidon_BG23_012_G ? 2 : 1;\r\n\t\t// Tt remembers the \"max stats\" it had, and adds these, instead of the current ones.\r\n\t\t// // Or alternatively, that the stat gain is computed before other effects happen, then is applied\r\n\t\t// https://replays.firestoneapp.com/?reviewId=10a78c2e-d16d-4593-86c8-15eb4cc81a3e&turn=11&action=1\r\n\t\t// I'll go with the max stats for now, since it's easier to implement\r\n\t\tmodifyStats(\r\n\t\t\tminion,\r\n\t\t\tmultiplier * minion.maxAttack,\r\n\t\t\tmultiplier * minion.maxHealth,\r\n\t\t\tinput.playerBoard,\r\n\t\t\tinput.playerEntity,\r\n\t\t\tinput.gameState,\r\n\t\t);\r\n\t\tinput.gameState.spectator.registerPowerTarget(\r\n\t\t\tminion,\r\n\t\t\tminion,\r\n\t\t\tinput.playerBoard,\r\n\t\t\tinput.playerEntity,\r\n\t\t\tinput.opponentEntity,\r\n\t\t);\r\n\t\treturn true;\r\n\t},\r\n};\r\n"]}
|
|
@@ -7,21 +7,21 @@ exports.KarmicChameleon = {
|
|
|
7
7
|
cardIds: ["BG31_802", "BG31_802_G"],
|
|
8
8
|
baseAvengeValue: (cardId) => 5,
|
|
9
9
|
avenge: (minion, input) => {
|
|
10
|
+
const board = input.board.filter((e) => e.health > 0 && !e.definitelyDead);
|
|
10
11
|
const chameleonIndex = input.board.findIndex((entity) => entity.entityId === minion.entityId);
|
|
11
12
|
if (chameleonIndex > 0) {
|
|
12
|
-
const minionToTheLeft =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
const minionToTheLeft = board[chameleonIndex - 1];
|
|
14
|
+
if (!!minionToTheLeft) {
|
|
15
|
+
const clone = {
|
|
16
|
+
...(0, utils_1.copyEntity)(minionToTheLeft),
|
|
17
|
+
entityId: input.gameState.sharedState.currentEntityId++,
|
|
18
|
+
};
|
|
19
|
+
if (minion.cardId === "BG31_802_G") {
|
|
20
|
+
(0, golden_1.makeMinionGolden)(clone, minion, input.board, input.hero, input.otherBoard, input.otherHero, input.gameState);
|
|
21
|
+
}
|
|
22
|
+
input.board.splice(chameleonIndex, 1, clone);
|
|
23
|
+
input.gameState.spectator.registerPowerTarget(minion, minionToTheLeft, input.board, input.hero, input.otherHero);
|
|
22
24
|
}
|
|
23
|
-
input.gameState.spectator.registerPowerTarget(minion, minionToTheLeft, input.board, input.hero, input.otherHero);
|
|
24
|
-
input.board.splice(chameleonIndex, 1, clone);
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"karmic-chameleon.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/karmic-chameleon.ts"],"names":[],"mappings":";;;AAGA,6DAA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AAC,SAAS,CAAC,SAAS,CAAC,mBAAmB,CAC5C,MAAM,EACN,eAAe,EACf,KAAK,CAAC,KAAK,EACX,KAAK,CAAC,IAAI,EACV,KAAK,CAAC,SAAS,CACf,CAAC;aACF;SACD;IACF,CAAC;CACD,CAAC","sourcesContent":["import { CardIds } from '@firestone-hs/reference-data';\r\nimport { BoardEntity } from '../../../board-entity';\r\nimport { AvengeInput } from '../../../simulation/avenge';\r\nimport { makeMinionGolden } from '../../../simulation/utils/golden';\r\nimport { copyEntity, stringifySimple, stringifySimpleCard } from '../../../utils';\r\nimport { AvengeCard } from '../../card.interface';\r\n\r\nexport const KarmicChameleon: AvengeCard = {\r\n\tcardIds: [CardIds.KarmicChameleon_BG31_802, CardIds.KarmicChameleon_BG31_802_G],\r\n\tbaseAvengeValue: (cardId: string) => 5,\r\n\tavenge: (minion: BoardEntity, input: AvengeInput) => {\r\n\t\tconst board = input.board.filter((e) => e.health > 0 && !e.definitelyDead);\r\n\t\tconst chameleonIndex = input.board.findIndex((entity) => entity.entityId === minion.entityId);\r\n\t\tif (chameleonIndex > 0) {\r\n\t\t\tconst minionToTheLeft = board[chameleonIndex - 1];\r\n\t\t\tif (!!minionToTheLeft) {\r\n\t\t\t\tconst clone: BoardEntity = {\r\n\t\t\t\t\t...copyEntity(minionToTheLeft),\r\n\t\t\t\t\tentityId: input.gameState.sharedState.currentEntityId++,\r\n\t\t\t\t};\r\n\t\t\t\tif (minion.cardId === CardIds.KarmicChameleon_BG31_802_G) {\r\n\t\t\t\t\tmakeMinionGolden(\r\n\t\t\t\t\t\tclone,\r\n\t\t\t\t\t\tminion,\r\n\t\t\t\t\t\tinput.board,\r\n\t\t\t\t\t\tinput.hero,\r\n\t\t\t\t\t\tinput.otherBoard,\r\n\t\t\t\t\t\tinput.otherHero,\r\n\t\t\t\t\t\tinput.gameState,\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t\tinput.board.splice(chameleonIndex, 1, clone);\r\n\t\t\t\tinput.gameState.spectator.registerPowerTarget(\r\n\t\t\t\t\tminion,\r\n\t\t\t\t\tminionToTheLeft,\r\n\t\t\t\t\tinput.board,\r\n\t\t\t\t\tinput.hero,\r\n\t\t\t\t\tinput.otherHero,\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n};\r\n"]}
|
|
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TurquoiseSkitterer = void 0;
|
|
4
4
|
const deathrattle_spawns_1 = require("../../../simulation/deathrattle-spawns");
|
|
5
5
|
const stats_1 = require("../../../simulation/stats");
|
|
6
|
+
const atkBuff = 1;
|
|
7
|
+
const hpBuff = 1;
|
|
6
8
|
exports.TurquoiseSkitterer = {
|
|
7
9
|
cardIds: ["BG31_809", "BG31_809_G"],
|
|
8
10
|
deathrattleSpawn: (deadEntity, input) => {
|
|
@@ -12,13 +14,13 @@ exports.TurquoiseSkitterer = {
|
|
|
12
14
|
deathrattleEffect: (minion, input) => {
|
|
13
15
|
const mult = minion.cardId === "BG31_809_G" ? 2 : 1;
|
|
14
16
|
input.boardWithDeadEntityHero.globalInfo.BeetleAttackBuff =
|
|
15
|
-
input.boardWithDeadEntityHero.globalInfo.BeetleAttackBuff +
|
|
17
|
+
input.boardWithDeadEntityHero.globalInfo.BeetleAttackBuff + atkBuff * mult;
|
|
16
18
|
input.boardWithDeadEntityHero.globalInfo.BeetleHealthBuff =
|
|
17
|
-
input.boardWithDeadEntityHero.globalInfo.BeetleHealthBuff +
|
|
19
|
+
input.boardWithDeadEntityHero.globalInfo.BeetleHealthBuff + hpBuff * mult;
|
|
18
20
|
input.boardWithDeadEntity
|
|
19
21
|
.filter((e) => ["BG28_603t", "BG28_603t_G"].includes(e.cardId))
|
|
20
22
|
.forEach((e) => {
|
|
21
|
-
(0, stats_1.modifyStats)(e,
|
|
23
|
+
(0, stats_1.modifyStats)(e, atkBuff * mult, hpBuff * mult, input.boardWithDeadEntity, input.boardWithDeadEntityHero, input.gameState);
|
|
22
24
|
});
|
|
23
25
|
},
|
|
24
26
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"turquoise-skitterer.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/turquoise-skitterer.ts"],"names":[],"mappings":";;;AAGA,+EAAiF;AACjF,qDAAwD;
|
|
1
|
+
{"version":3,"file":"turquoise-skitterer.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/turquoise-skitterer.ts"],"names":[],"mappings":";;;AAGA,+EAAiF;AACjF,qDAAwD;AAGxD,MAAM,OAAO,GAAG,CAAC,CAAC;AAClB,MAAM,MAAM,GAAG,CAAC,CAAC;AAEJ,QAAA,kBAAkB,GAAiD;IAC/E,OAAO,EAAE,0BAA4E;IACrF,gBAAgB,EAAE,CAAC,UAAuB,EAAE,KAAgC,EAA0B,EAAE;QACvG,MAAM,cAAc,GAAG,UAAU,CAAC,MAAM,iBAA0C,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3F,OAAO,IAAA,4CAAuB,eAA8C,cAAc,EAAE,KAAK,CAAC,CAAC;IACpG,CAAC;IACD,iBAAiB,EAAE,CAAC,MAAmB,EAAE,KAAgC,EAAE,EAAE;QAC5E,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,iBAA0C,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7E,KAAK,CAAC,uBAAuB,CAAC,UAAU,CAAC,gBAAgB;YACxD,KAAK,CAAC,uBAAuB,CAAC,UAAU,CAAC,gBAAgB,GAAG,OAAO,GAAG,IAAI,CAAC;QAC5E,KAAK,CAAC,uBAAuB,CAAC,UAAU,CAAC,gBAAgB;YACxD,KAAK,CAAC,uBAAuB,CAAC,UAAU,CAAC,gBAAgB,GAAG,MAAM,GAAG,IAAI,CAAC;QAC3E,KAAK,CAAC,mBAAmB;aACvB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CACb,4BAAyE,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAiB,CAAC,CACvG;aACA,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;YACd,IAAA,mBAAW,EACV,CAAC,EACD,OAAO,GAAG,IAAI,EACd,MAAM,GAAG,IAAI,EACb,KAAK,CAAC,mBAAmB,EACzB,KAAK,CAAC,uBAAuB,EAC7B,KAAK,CAAC,SAAS,CACf,CAAC;QACH,CAAC,CAAC,CAAC;IACL,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 { modifyStats } from '../../../simulation/stats';\r\nimport { DeathrattleEffectCard, DeathrattleSpawnCard } from '../../card.interface';\r\n\r\nconst atkBuff = 1;\r\nconst hpBuff = 1;\r\n\r\nexport const TurquoiseSkitterer: DeathrattleSpawnCard & DeathrattleEffectCard = {\r\n\tcardIds: [CardIds.TurquoiseSkitterer_BG31_809, CardIds.TurquoiseSkitterer_BG31_809_G],\r\n\tdeathrattleSpawn: (deadEntity: BoardEntity, input: DeathrattleTriggeredInput): readonly BoardEntity[] => {\r\n\t\tconst numberOfSpawns = deadEntity.cardId === CardIds.TurquoiseSkitterer_BG31_809_G ? 2 : 1;\r\n\t\treturn simplifiedSpawnEntities(CardIds.BoonOfBeetles_BeetleToken_BG28_603t, numberOfSpawns, input);\r\n\t},\r\n\tdeathrattleEffect: (minion: BoardEntity, input: DeathrattleTriggeredInput) => {\r\n\t\tconst mult = minion.cardId === CardIds.TurquoiseSkitterer_BG31_809_G ? 2 : 1;\r\n\t\tinput.boardWithDeadEntityHero.globalInfo.BeetleAttackBuff =\r\n\t\t\tinput.boardWithDeadEntityHero.globalInfo.BeetleAttackBuff + atkBuff * mult;\r\n\t\tinput.boardWithDeadEntityHero.globalInfo.BeetleHealthBuff =\r\n\t\t\tinput.boardWithDeadEntityHero.globalInfo.BeetleHealthBuff + hpBuff * mult;\r\n\t\tinput.boardWithDeadEntity\r\n\t\t\t.filter((e) =>\r\n\t\t\t\t[CardIds.BoonOfBeetles_BeetleToken_BG28_603t, CardIds.Beetle_BG28_603t_G].includes(e.cardId as CardIds),\r\n\t\t\t)\r\n\t\t\t.forEach((e) => {\r\n\t\t\t\tmodifyStats(\r\n\t\t\t\t\te,\r\n\t\t\t\t\tatkBuff * mult,\r\n\t\t\t\t\thpBuff * mult,\r\n\t\t\t\t\tinput.boardWithDeadEntity,\r\n\t\t\t\t\tinput.boardWithDeadEntityHero,\r\n\t\t\t\t\tinput.gameState,\r\n\t\t\t\t);\r\n\t\t\t});\r\n\t},\r\n};\r\n"]}
|
package/dist/input-sanitation.js
CHANGED
|
@@ -50,7 +50,7 @@ const buildFinalInput = (battleInput, cards, cardsData) => {
|
|
|
50
50
|
};
|
|
51
51
|
exports.buildFinalInput = buildFinalInput;
|
|
52
52
|
const buildFinalInputForPlayer = (playerInfo, isPlayer, anomalies, cards, cardsData, entityIdContainer) => {
|
|
53
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j
|
|
53
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
54
54
|
if (!playerInfo) {
|
|
55
55
|
return { board: [], hand: [], player: null };
|
|
56
56
|
}
|
|
@@ -62,15 +62,17 @@ const buildFinalInputForPlayer = (playerInfo, isPlayer, anomalies, cards, cardsD
|
|
|
62
62
|
playerInfo.player.friendly = isPlayer;
|
|
63
63
|
playerInfo.player.globalInfo = (_g = playerInfo.player.globalInfo) !== null && _g !== void 0 ? _g : {};
|
|
64
64
|
playerInfo.player.globalInfo.PirateAttackBonus = (_h = playerInfo.player.globalInfo.PirateAttackBonus) !== null && _h !== void 0 ? _h : 0;
|
|
65
|
-
playerInfo.player.heroPowers = (
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
65
|
+
playerInfo.player.heroPowers = ((_j = playerInfo.player.heroPowers) === null || _j === void 0 ? void 0 : _j.length)
|
|
66
|
+
? playerInfo.player.heroPowers.map((hp, index) => sanitizeHeroPower(hp, index, playerInfo.player, cards))
|
|
67
|
+
: [
|
|
68
|
+
{
|
|
69
|
+
cardId: playerInfo.player.heroPowerId,
|
|
70
|
+
entityId: playerInfo.player.heroPowerEntityId,
|
|
71
|
+
used: playerInfo.player.heroPowerUsed,
|
|
72
|
+
info: playerInfo.player.heroPowerInfo,
|
|
73
|
+
info2: playerInfo.player.heroPowerInfo2,
|
|
74
|
+
},
|
|
75
|
+
];
|
|
74
76
|
playerInfo.player.cardId = isGhost ? "TB_BaconShop_HERO_KelThuzad" : playerInfo.player.cardId;
|
|
75
77
|
playerInfo.player.hpLeft = Math.max(1, playerInfo.player.hpLeft);
|
|
76
78
|
(0, auras_1.setMissingAuras)(board, playerInfo.player, anomalies, cards);
|
|
@@ -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,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,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AC,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?.map((hp, index) =>\r\n\t\tsanitizeHeroPower(hp, index, playerInfo.player, cards),\r\n\t) ?? [\r\n\t\t{\r\n\t\t\tcardId: playerInfo.player.heroPowerId,\r\n\t\t\tentityId: playerInfo.player.heroPowerEntityId,\r\n\t\t\tused: playerInfo.player.heroPowerUsed,\r\n\t\t\tinfo: playerInfo.player.heroPowerInfo,\r\n\t\t\tinfo2: playerInfo.player.heroPowerInfo2,\r\n\t\t} as BgsHeroPower,\r\n\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) => ({ ...entity, inInitialState: true }))\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,EA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jB,SAAoB,EACpB,KAAsB,EAC0B,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,EAAE,GAAG,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC;SACtD,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) => ({ ...entity, inInitialState: true }))\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"]}
|
|
@@ -22,6 +22,9 @@ const performEntitySpawns = (candidateEntities, boardWithKilledMinion, boardWith
|
|
|
22
22
|
if (actualAttacker) {
|
|
23
23
|
actualAttacker.attackImmediately = false;
|
|
24
24
|
}
|
|
25
|
+
else {
|
|
26
|
+
newMinion.attackImmediately = false;
|
|
27
|
+
}
|
|
25
28
|
}
|
|
26
29
|
if (newMinion.health > 0 && !newMinion.definitelyDead) {
|
|
27
30
|
spawnedEntities.push(newMinion);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spawns.js","sourceRoot":"","sources":["../../src/simulation/spawns.ts"],"names":[],"mappings":";;;AAEA,+DAAyD;AACzD,qCAA0C;AAE1C,6CAAqD;AAE9C,MAAM,mBAAmB,GAAG,CAClC,iBAAyC,EACzC,qBAAoC,EACpC,yBAA0C,EAC1C,iBAAgD,EAChD,+BAAuC,EACvC,aAA4B,EAC5B,iBAAkC,EAClC,SAAwB,EACxB,cAAc,GAAG,IAAI,EACI,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,CAAC,EAAE,EAAE;QAC7C,MAAM,SAAS,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QAElC,IAAI,qBAAqB,CAAC,MAAM,IAAI,CAAC,EAAE;YACtC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBAC7C,IAAA,kCAAqB,EAAC,YAAY,CAAC,CAAC,CAAC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AC,iBAAiB,EAAE,qBAAqB,EAAE,eAAe,CAAC,CAAC;IACpG,OAAO,eAAe,CAAC;AACxB,CAAC,CAAC;AA9EW,QAAA,mBAAmB,uBA8E9B","sourcesContent":["import { BgsPlayerEntity } from '../bgs-player-entity';\r\nimport { BoardEntity } from '../board-entity';\r\nimport { addMinionToBoard } 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,\r\n\tspawnSourceEntityIndexFromRight: number,\r\n\topponentBoard: BoardEntity[],\r\n\topponentBoardHero: BgsPlayerEntity,\r\n\tgameState: FullGameState,\r\n\tapplySelfAuras = true,\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\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\ttrue,\r\n\t\t\tapplySelfAuras,\r\n\t\t);\r\n\t\tif (newMinion.attackImmediately) {\r\n\t\t\t// console.debug(\r\n\t\t\t// \t'\\nattack immediately\\n',\r\n\t\t\t// \tstringifySimple(boardWithKilledMinion, gameState.allCards),\r\n\t\t\t// \t'\\n',\r\n\t\t\t// \tstringifySimple(opponentBoard, gameState.allCards),\r\n\t\t\t// );\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);\r\n\t\t\t// console.debug(\r\n\t\t\t// \t'after attack immediately\\n',\r\n\t\t\t// \tstringifySimple(boardWithKilledMinion, gameState.allCards),\r\n\t\t\t// \t'\\n',\r\n\t\t\t// \tstringifySimple(opponentBoard, gameState.allCards),\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\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"]}
|
|
@@ -25,6 +25,7 @@ const handlePlayerIllidanHeroPowers = (playerEntity, playerBoard, opponentEntity
|
|
|
25
25
|
for (const heroPower of playerEntity.heroPowers) {
|
|
26
26
|
if (heroPower.cardId === "TB_BaconShop_HP_069" && playerBoard.length > 0) {
|
|
27
27
|
handleIllidanForPlayer(playerBoard, playerEntity, opponentBoard, opponentEntity, gameState, currentAttacker);
|
|
28
|
+
currentAttacker = (currentAttacker + 1) % 2;
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
return currentAttacker;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"soc-illidan-hero-power.js","sourceRoot":"","sources":["../../../src/simulation/start-of-combat/soc-illidan-hero-power.ts"],"names":[],"mappings":";;;AAGA,sCAA+D;AAE/D,oCAAuC;AACvC,4DAA8D;AAEvD,MAAM,uBAAuB,GAAG,CACtC,YAA6B,EAC7B,WAA0B,EAC1B,cAA+B,EAC/B,aAA4B,EAC5B,eAAuB,EACvB,SAAwB,EACf,EAAE;IAIX,IAAI,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,EAAE;QACxB,eAAe,GAAG,6BAA6B,CAC9C,YAAY,EACZ,WAAW,EACX,cAAc,EACd,aAAa,EACb,eAAe,EACf,IAAI,EACJ,SAAS,CACT,CAAC;QACF,eAAe,GAAG,6BAA6B,CAC9C,cAAc,EACd,aAAa,EACb,YAAY,EACZ,WAAW,EACX,eAAe,EACf,KAAK,EACL,SAAS,CACT,CAAC;KACF;SAAM;QACN,eAAe,GAAG,6BAA6B,CAC9C,cAAc,EACd,aAAa,EACb,YAAY,EACZ,WAAW,EACX,eAAe,EACf,KAAK,EACL,SAAS,CACT,CAAC;QACF,eAAe,GAAG,6BAA6B,CAC9C,YAAY,EACZ,WAAW,EACX,cAAc,EACd,aAAa,EACb,eAAe,EACf,IAAI,EACJ,SAAS,CACT,CAAC;KACF;IACD,IAAA,2BAAkB,EAAC,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,SAAS,CAAC,CAAC;IACxF,IAAA,0CAAsB,EAAC,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,SAAS,CAAC,CAAC;IAC5F,OAAO,eAAe,CAAC;AACxB,CAAC,CAAC;AArDW,QAAA,uBAAuB,2BAqDlC;AAEF,MAAM,6BAA6B,GAAG,CACrC,YAA6B,EAC7B,WAA0B,EAC1B,cAA+B,EAC/B,aAA4B,EAC5B,eAAuB,EACvB,QAAiB,EACjB,SAAwB,EACf,EAAE;IACX,IAAI,YAAY,CAAC,MAAM,IAAI,CAAC,EAAE;QAC7B,OAAO,eAAe,CAAC;KACvB;IACD,KAAK,MAAM,SAAS,IAAI,YAAY,CAAC,UAAU,EAAE;QAChD,IAAI,SAAS,CAAC,MAAM,0BAAoB,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE;YAGnE,sBAAsB,CACrB,WAAW,EACX,YAAY,EACZ,aAAa,EACb,cAAc,EACd,SAAS,EACT,eAAe,CACf,CAAC;
|
|
1
|
+
{"version":3,"file":"soc-illidan-hero-power.js","sourceRoot":"","sources":["../../../src/simulation/start-of-combat/soc-illidan-hero-power.ts"],"names":[],"mappings":";;;AAGA,sCAA+D;AAE/D,oCAAuC;AACvC,4DAA8D;AAEvD,MAAM,uBAAuB,GAAG,CACtC,YAA6B,EAC7B,WAA0B,EAC1B,cAA+B,EAC/B,aAA4B,EAC5B,eAAuB,EACvB,SAAwB,EACf,EAAE;IAIX,IAAI,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,EAAE;QACxB,eAAe,GAAG,6BAA6B,CAC9C,YAAY,EACZ,WAAW,EACX,cAAc,EACd,aAAa,EACb,eAAe,EACf,IAAI,EACJ,SAAS,CACT,CAAC;QACF,eAAe,GAAG,6BAA6B,CAC9C,cAAc,E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EAAE,aAAa,EAAE,cAAc,EAAE,SAAS,CAAC,CAAC;QACpF,cAAc,CAAC,WAAW,GAAG,CAAC,CAAC;KAC/B;AAOF,CAAC,CAAC","sourcesContent":["import { CardIds } from '@firestone-hs/reference-data';\r\nimport { BgsPlayerEntity } from '../../bgs-player-entity';\r\nimport { BoardEntity } from '../../board-entity';\r\nimport { processMinionDeath, simulateAttack } from '../attack';\r\nimport { FullGameState } from '../internal-game-state';\r\nimport { modifyStats } from '../stats';\r\nimport { handleSummonsWhenSpace } from '../summon-when-space';\r\n\r\nexport const handleIllidanHeroPowers = (\r\n\tplayerEntity: BgsPlayerEntity,\r\n\tplayerBoard: BoardEntity[],\r\n\topponentEntity: BgsPlayerEntity,\r\n\topponentBoard: BoardEntity[],\r\n\tcurrentAttacker: number,\r\n\tgameState: FullGameState,\r\n): number => {\r\n\t// console.log('current attacker before', currentAttacker);\r\n\t// Apparently it's a toin coss about whether to handle Illidan first or Al'Akir first\r\n\t// Auras are only relevant for Illidan, and already applied there\r\n\tif (Math.random() < 0.5) {\r\n\t\tcurrentAttacker = handlePlayerIllidanHeroPowers(\r\n\t\t\tplayerEntity,\r\n\t\t\tplayerBoard,\r\n\t\t\topponentEntity,\r\n\t\t\topponentBoard,\r\n\t\t\tcurrentAttacker,\r\n\t\t\ttrue,\r\n\t\t\tgameState,\r\n\t\t);\r\n\t\tcurrentAttacker = handlePlayerIllidanHeroPowers(\r\n\t\t\topponentEntity,\r\n\t\t\topponentBoard,\r\n\t\t\tplayerEntity,\r\n\t\t\tplayerBoard,\r\n\t\t\tcurrentAttacker,\r\n\t\t\tfalse,\r\n\t\t\tgameState,\r\n\t\t);\r\n\t} else {\r\n\t\tcurrentAttacker = handlePlayerIllidanHeroPowers(\r\n\t\t\topponentEntity,\r\n\t\t\topponentBoard,\r\n\t\t\tplayerEntity,\r\n\t\t\tplayerBoard,\r\n\t\t\tcurrentAttacker,\r\n\t\t\tfalse,\r\n\t\t\tgameState,\r\n\t\t);\r\n\t\tcurrentAttacker = handlePlayerIllidanHeroPowers(\r\n\t\t\tplayerEntity,\r\n\t\t\tplayerBoard,\r\n\t\t\topponentEntity,\r\n\t\t\topponentBoard,\r\n\t\t\tcurrentAttacker,\r\n\t\t\ttrue,\r\n\t\t\tgameState,\r\n\t\t);\r\n\t}\r\n\tprocessMinionDeath(playerBoard, playerEntity, opponentBoard, opponentEntity, gameState);\r\n\thandleSummonsWhenSpace(playerBoard, playerEntity, opponentBoard, opponentEntity, gameState);\r\n\treturn currentAttacker;\r\n};\r\n\r\nconst handlePlayerIllidanHeroPowers = (\r\n\tplayerEntity: BgsPlayerEntity,\r\n\tplayerBoard: BoardEntity[],\r\n\topponentEntity: BgsPlayerEntity,\r\n\topponentBoard: BoardEntity[],\r\n\tcurrentAttacker: number,\r\n\tfriendly: boolean,\r\n\tgameState: FullGameState,\r\n): number => {\r\n\tif (playerEntity.hpLeft <= 0) {\r\n\t\treturn currentAttacker;\r\n\t}\r\n\tfor (const heroPower of playerEntity.heroPowers) {\r\n\t\tif (heroPower.cardId === CardIds.Wingmen && playerBoard.length > 0) {\r\n\t\t\t// After Illidan triggers, it's always the other opponent's turn\r\n\t\t\t// https://x.com/LoewenMitchell/status/1752714583360639131?s=20\r\n\t\t\thandleIllidanForPlayer(\r\n\t\t\t\tplayerBoard,\r\n\t\t\t\tplayerEntity,\r\n\t\t\t\topponentBoard,\r\n\t\t\t\topponentEntity,\r\n\t\t\t\tgameState,\r\n\t\t\t\tcurrentAttacker,\r\n\t\t\t);\r\n\t\t\t// This is not true anymore: https://replays.firestoneapp.com/?reviewId=7282387d-66cd-458e-8ee1-e04c662e7bad&turn=5&action=1\r\n\t\t\t// currentAttacker = friendly ? 1 : 0;\r\n\t\t\t// In fact there is some adjustment going on: https://replays.firestoneapp.com/?reviewId=929f676f-47f6-494b-9619-df04174a0150&turn=11&action=0\r\n\t\t\t// So trying another logic\r\n\t\t\tcurrentAttacker = (currentAttacker + 1) % 2;\r\n\t\t\t// if (friendly && currentAttacker === 1) {\r\n\t\t\t// \tcurrentAttacker = 0;\r\n\t\t\t// } else if (!friendly && currentAttacker === 0) {\r\n\t\t\t// \tcurrentAttacker = 1;\r\n\t\t\t// }\r\n\t\t\t// friendly = true, currentAttacker = 0 => currentAttacker = 1\r\n\t\t\t// friendly = true, currentAttacker = 1 => currentAttacker = 0\r\n\t\t}\r\n\t}\r\n\treturn currentAttacker;\r\n};\r\n\r\n// TODO: not exactly correct, because of \"attack immediately\", but it's close enough\r\nconst handleIllidanForPlayer = (\r\n\tplayerBoard: BoardEntity[],\r\n\tplayerEntity: BgsPlayerEntity,\r\n\topponentBoard: BoardEntity[],\r\n\topponentEntity: BgsPlayerEntity,\r\n\tgameState: FullGameState,\r\n\tcurrentAttacker: number,\r\n): void => {\r\n\tif (playerEntity.startOfCombatDone) {\r\n\t\treturn;\r\n\t}\r\n\t// Otherwise, if the first minion dies on the attack, and the board has only 2 minions, we\r\n\t// miss the second one\r\n\tconst minionsAtStart = playerBoard.length;\r\n\tconst firstAttacker = playerBoard[0];\r\n\tconst secondAttacker = minionsAtStart > 1 ? playerBoard[playerBoard.length - 1] : null;\r\n\r\n\t// Stats updates\r\n\tmodifyStats(firstAttacker, 2, 1, playerBoard, playerEntity, gameState);\r\n\tgameState.spectator.registerPowerTarget(firstAttacker, firstAttacker, playerBoard, playerEntity, opponentEntity);\r\n\tif (!!secondAttacker && !secondAttacker.definitelyDead && secondAttacker.health > 0) {\r\n\t\tmodifyStats(secondAttacker, 2, 1, playerBoard, playerEntity, gameState);\r\n\t\tgameState.spectator.registerPowerTarget(\r\n\t\t\tsecondAttacker,\r\n\t\t\tsecondAttacker,\r\n\t\t\tplayerBoard,\r\n\t\t\tplayerEntity,\r\n\t\t\topponentEntity,\r\n\t\t);\r\n\t}\r\n\r\n\t// Attacks\r\n\tfirstAttacker.attackImmediately = true;\r\n\tsimulateAttack(playerBoard, playerEntity, opponentBoard, opponentEntity, gameState);\r\n\t// See http://replays.firestoneapp.com/?reviewId=f16b7a49-c2a2-4ac5-a9eb-a75f83246f70&turn=6&action=8\r\n\tfirstAttacker.hasAttacked = 0;\r\n\tif (!!secondAttacker && !secondAttacker.definitelyDead && secondAttacker.health > 0) {\r\n\t\tsecondAttacker.attackImmediately = true;\r\n\t\tsimulateAttack(playerBoard, playerEntity, opponentBoard, opponentEntity, gameState);\r\n\t\tsecondAttacker.hasAttacked = 0;\r\n\t}\r\n\r\n\t// // See http://replays.firestoneapp.com/?reviewId=7e9ec42c-a8f6-43d2-9f39-cc486dfa2395&turn=6&action=5\r\n\t// if (firstAttacker.definitelyDead || firstAttacker.health <= 0) {\r\n\t// \tcurrentAttacker = (currentAttacker + 1) % 2;\r\n\t// }\r\n\t// return currentAttacker;\r\n};\r\n"]}
|
|
@@ -30,8 +30,8 @@ const handleStartOfCombat = (playerEntity, playerBoard, opponentEntity, opponent
|
|
|
30
30
|
'Secret',
|
|
31
31
|
'Minion',
|
|
32
32
|
];
|
|
33
|
-
let playerBoardBefore = playerBoard;
|
|
34
|
-
let opponentBoardBefore = opponentBoard;
|
|
33
|
+
let playerBoardBefore = playerBoard.map((e) => ({ ...e }));
|
|
34
|
+
let opponentBoardBefore = opponentBoard.map((e) => ({ ...e }));
|
|
35
35
|
for (const phase of phases) {
|
|
36
36
|
currentAttacker = handlePhase(phase, playerEntity, playerBoard, playerBoardBefore, opponentEntity, opponentBoard, opponentBoardBefore, currentAttacker, gameState);
|
|
37
37
|
if (phase === 'PreCombatHeroPower') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start-of-combat.js","sourceRoot":"","sources":["../../../src/simulation/start-of-combat/start-of-combat.ts"],"names":[],"mappings":";;;AAIA,oCAAiD;AAEjD,mDAA+D;AAC/D,qDAAiE;AACjE,qEAAmE;AACnE,6CAA0D;AAC1D,2EAAwE;AACxE,yDAAqE;AACrE,6CAA0D;AAC1D,+CAA4D;AASrD,MAAM,mBAAmB,GAAG,CAClC,YAA6B,EAC7B,WAA0B,EAC1B,cAA+B,EAC/B,aAA4B,EAC5B,eAAuB,EACvB,SAAwB,EACf,EAAE;IACX,MAAM,8BAA8B,GAAG,IAAI,CAAC;IAC5C,IAAI,8BAA8B,EAAE;QACnC,eAAe;YACd,WAAW,CAAC,MAAM,GAAG,aAAa,CAAC,MAAM;gBACxC,CAAC,CAAC,CAAC;gBACH,CAAC,CAAC,aAAa,CAAC,MAAM,GAAG,WAAW,CAAC,MAAM;oBAC3C,CAAC,CAAC,CAAC;oBACH,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;KAC9B;IAGD,MAAM,MAAM,GAAkC;QAC7C,aAAa;QACb,WAAW;QACX,SAAS;QAOT,oBAAoB;QACpB,kBAAkB;QAClB,WAAW;QACX,QAAQ;QACR,QAAQ;KACR,CAAC;IACF,IAAI,iBAAiB,GAAG,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"start-of-combat.js","sourceRoot":"","sources":["../../../src/simulation/start-of-combat/start-of-combat.ts"],"names":[],"mappings":";;;AAIA,oCAAiD;AAEjD,mDAA+D;AAC/D,qDAAiE;AACjE,qEAAmE;AACnE,6CAA0D;AAC1D,2EAAwE;AACxE,yDAAqE;AACrE,6CAA0D;AAC1D,+CAA4D;AASrD,MAAM,mBAAmB,GAAG,CAClC,YAA6B,EAC7B,WAA0B,EAC1B,cAA+B,EAC/B,aAA4B,EAC5B,eAAuB,EACvB,SAAwB,EACf,EAAE;IACX,MAAM,8BAA8B,GAAG,IAAI,CAAC;IAC5C,IAAI,8BAA8B,EAAE;QACnC,eAAe;YACd,WAAW,CAAC,MAAM,GAAG,aAAa,CAAC,MAAM;gBACxC,CAAC,CAAC,CAAC;gBACH,CAAC,CAAC,aAAa,CAAC,MAAM,GAAG,WAAW,CAAC,MAAM;oBAC3C,CAAC,CAAC,CAAC;oBACH,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;KAC9B;I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ACf,EAAE;IACX,QAAQ,KAAK,EAAE;QACd,KAAK,aAAa;YACjB,OAAO,IAAA,kDAA+B,EACrC,YAAY,EACZ,WAAW,EACX,cAAc,EACd,aAAa,EACb,eAAe,EACf,SAAS,CACT,CAAC;QACH,KAAK,WAAW;YACf,OAAO,IAAA,4CAA4B,EAClC,YAAY,EACZ,WAAW,EACX,cAAc,EACd,aAAa,EACb,eAAe,EACf,SAAS,CACT,CAAC;QACH,KAAK,SAAS;YACb,OAAO,IAAA,yCAA2B,EACjC,YAAY,EACZ,WAAW,EACX,cAAc,EACd,aAAa,EACb,eAAe,EACf,SAAS,CACT,CAAC;QACH,KAAK,oBAAoB;YACxB,OAAO,IAAA,qDAAyB,EAC/B,YAAY,EACZ,WAAW,EACX,cAAc,EACd,aAAa,EACb,eAAe,EACf,SAAS,CACT,CAAC;QACH,KAAK,kBAAkB;YACtB,OAAO,IAAA,gDAAuB,EAC7B,YAAY,EACZ,WAAW,EACX,cAAc,EACd,aAAa,EACb,eAAe,EACf,SAAS,CACT,CAAC;QACH,KAAK,WAAW;YACf,OAAO,IAAA,8CAA6B,EACnC,YAAY,EACZ,WAAW,EACX,cAAc,EACd,aAAa,EACb,eAAe,EACf,SAAS,CACT,CAAC;QACH,KAAK,QAAQ;YACZ,OAAO,IAAA,uCAA0B,EAChC,YAAY,EACZ,WAAW,EACX,cAAc,EACd,aAAa,EACb,eAAe,EACf,SAAS,CACT,CAAC;QACH,KAAK,QAAQ;YACZ,OAAO,IAAA,uCAA0B,EAChC,YAAY,EACZ,WAAW,EACX,cAAc,EACd,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,SAAS,CACT,CAAC;KACH;AACF,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-use-before-define */\r\nimport { BgsPlayerEntity } from '../../bgs-player-entity';\r\nimport { BoardEntity } from '../../board-entity';\r\nimport { FullGameState } from '../internal-game-state';\r\nimport { applyAfterStatsUpdate } from '../stats';\r\nimport { StartOfCombatPhase } from './phases';\r\nimport { handleStartOfCombatAnomalies } from './soc-anomalies';\r\nimport { handleStartOfCombatHeroPowers } from './soc-hero-power';\r\nimport { handleIllidanHeroPowers } from './soc-illidan-hero-power';\r\nimport { handleStartOfCombatMinions } from './soc-minion';\r\nimport { handlePreCombatHeroPowers } from './soc-pre-combat-hero-power';\r\nimport { handleStartOfCombatQuestRewards } from './soc-quest-reward';\r\nimport { handleStartOfCombatSecrets } from './soc-secret';\r\nimport { handleStartOfCombatTrinkets } from './soc-trinket';\r\n\r\n// TODO 20/04/2024: I'm not too sure about some ordering. The way I understand it, the Start of Combat has\r\n// multiple phases, and in each phase the player order is random\r\n// However, looking at http://replays.firestoneapp.com/?reviewId=a577602e-06f3-4c4b-928d-36ea98c2e6d5&turn=5&action=0,\r\n// it feels that a \"start of combat\" minion effect could trigger before an opponent's hero power effect\r\n// Or is that limited to Bru'kan?\r\n// I feel that I've asked a lot of questions recently, so I don't want to add that one to the list, as the interaction\r\n// is for now pretty marginal\r\nexport const handleStartOfCombat = (\r\n\tplayerEntity: BgsPlayerEntity,\r\n\tplayerBoard: BoardEntity[],\r\n\topponentEntity: BgsPlayerEntity,\r\n\topponentBoard: BoardEntity[],\r\n\tcurrentAttacker: number,\r\n\tgameState: FullGameState,\r\n): number => {\r\n\tconst shouldRecomputeCurrentAttacker = true;\r\n\tif (shouldRecomputeCurrentAttacker) {\r\n\t\tcurrentAttacker =\r\n\t\t\tplayerBoard.length > opponentBoard.length\r\n\t\t\t\t? 0\r\n\t\t\t\t: opponentBoard.length > playerBoard.length\r\n\t\t\t\t? 1\r\n\t\t\t\t: Math.round(Math.random());\r\n\t}\r\n\r\n\t// UPDATE 2024-10-10: changed in 30.6, according to a message from Mitchell on Discord\r\n\tconst phases: readonly StartOfCombatPhase[] = [\r\n\t\t'QuestReward',\r\n\t\t'Anomalies',\r\n\t\t'Trinket',\r\n\t\t// https://twitter.com/DCalkosz/status/1488361384320528388?s=20&t=1ECxRZFdjqwEa2fRsXk32Q\r\n\t\t// There’s a certain order for Start of Combat hero powers, rather than “coin flips” where\r\n\t\t// an unlucky trigger order could mess up some positioning you had planned for your own hero\r\n\t\t// power. “Precombat” (Al’Akir, Y’Shaarj), then Illidan, then others.\r\n\t\t// Update: this seems to have changed: https://x.com/LoewenMitchell/status/1737588920139825335?s=20\r\n\t\t// now you have all hero powers trigger in a first phase, then you have Illidan, and once everything has triggered, you have Tavish\r\n\t\t'PreCombatHeroPower',\r\n\t\t'IllidanHeroPower',\r\n\t\t'HeroPower',\r\n\t\t'Secret',\r\n\t\t'Minion',\r\n\t];\r\n\tlet playerBoardBefore = playerBoard.map((e) => ({ ...e }));\r\n\tlet opponentBoardBefore = opponentBoard.map((e) => ({ ...e }));\r\n\tfor (const phase of phases) {\r\n\t\tcurrentAttacker = handlePhase(\r\n\t\t\tphase,\r\n\t\t\tplayerEntity,\r\n\t\t\tplayerBoard,\r\n\t\t\tplayerBoardBefore,\r\n\t\t\topponentEntity,\r\n\t\t\topponentBoard,\r\n\t\t\topponentBoardBefore,\r\n\t\t\tcurrentAttacker,\r\n\t\t\tgameState,\r\n\t\t);\r\n\t\tif (phase === 'PreCombatHeroPower') {\r\n\t\t\tplayerBoardBefore = playerBoard.map((e) => ({ ...e }));\r\n\t\t\topponentBoardBefore = opponentBoard.map((e) => ({ ...e }));\r\n\t\t}\r\n\t}\r\n\tplayerEntity.startOfCombatDone = true;\r\n\topponentEntity.startOfCombatDone = true;\r\n\tapplyAfterStatsUpdate(gameState);\r\n\treturn currentAttacker;\r\n};\r\n\r\nconst handlePhase = (\r\n\tphase: StartOfCombatPhase,\r\n\tplayerEntity: BgsPlayerEntity,\r\n\tplayerBoard: BoardEntity[],\r\n\tplayerBoardBefore: BoardEntity[],\r\n\topponentEntity: BgsPlayerEntity,\r\n\topponentBoard: BoardEntity[],\r\n\topponentBoardBefore: BoardEntity[],\r\n\tcurrentAttacker: number,\r\n\tgameState: FullGameState,\r\n): number => {\r\n\tswitch (phase) {\r\n\t\tcase 'QuestReward':\r\n\t\t\treturn handleStartOfCombatQuestRewards(\r\n\t\t\t\tplayerEntity,\r\n\t\t\t\tplayerBoard,\r\n\t\t\t\topponentEntity,\r\n\t\t\t\topponentBoard,\r\n\t\t\t\tcurrentAttacker,\r\n\t\t\t\tgameState,\r\n\t\t\t);\r\n\t\tcase 'Anomalies':\r\n\t\t\treturn handleStartOfCombatAnomalies(\r\n\t\t\t\tplayerEntity,\r\n\t\t\t\tplayerBoard,\r\n\t\t\t\topponentEntity,\r\n\t\t\t\topponentBoard,\r\n\t\t\t\tcurrentAttacker,\r\n\t\t\t\tgameState,\r\n\t\t\t);\r\n\t\tcase 'Trinket':\r\n\t\t\treturn handleStartOfCombatTrinkets(\r\n\t\t\t\tplayerEntity,\r\n\t\t\t\tplayerBoard,\r\n\t\t\t\topponentEntity,\r\n\t\t\t\topponentBoard,\r\n\t\t\t\tcurrentAttacker,\r\n\t\t\t\tgameState,\r\n\t\t\t);\r\n\t\tcase 'PreCombatHeroPower':\r\n\t\t\treturn handlePreCombatHeroPowers(\r\n\t\t\t\tplayerEntity,\r\n\t\t\t\tplayerBoard,\r\n\t\t\t\topponentEntity,\r\n\t\t\t\topponentBoard,\r\n\t\t\t\tcurrentAttacker,\r\n\t\t\t\tgameState,\r\n\t\t\t);\r\n\t\tcase 'IllidanHeroPower':\r\n\t\t\treturn handleIllidanHeroPowers(\r\n\t\t\t\tplayerEntity,\r\n\t\t\t\tplayerBoard,\r\n\t\t\t\topponentEntity,\r\n\t\t\t\topponentBoard,\r\n\t\t\t\tcurrentAttacker,\r\n\t\t\t\tgameState,\r\n\t\t\t);\r\n\t\tcase 'HeroPower':\r\n\t\t\treturn handleStartOfCombatHeroPowers(\r\n\t\t\t\tplayerEntity,\r\n\t\t\t\tplayerBoard,\r\n\t\t\t\topponentEntity,\r\n\t\t\t\topponentBoard,\r\n\t\t\t\tcurrentAttacker,\r\n\t\t\t\tgameState,\r\n\t\t\t);\r\n\t\tcase 'Secret':\r\n\t\t\treturn handleStartOfCombatSecrets(\r\n\t\t\t\tplayerEntity,\r\n\t\t\t\tplayerBoard,\r\n\t\t\t\topponentEntity,\r\n\t\t\t\topponentBoard,\r\n\t\t\t\tcurrentAttacker,\r\n\t\t\t\tgameState,\r\n\t\t\t);\r\n\t\tcase 'Minion':\r\n\t\t\treturn handleStartOfCombatMinions(\r\n\t\t\t\tplayerEntity,\r\n\t\t\t\tplayerBoard,\r\n\t\t\t\topponentEntity,\r\n\t\t\t\topponentBoard,\r\n\t\t\t\tcurrentAttacker,\r\n\t\t\t\tplayerBoardBefore,\r\n\t\t\t\topponentBoardBefore,\r\n\t\t\t\tgameState,\r\n\t\t\t);\r\n\t}\r\n};\r\n"]}
|