@firestone-hs/simulate-bgs-battle 1.1.715 → 1.1.717
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cards/impl/bg-spell/blood-gem-quilboar-divine-shield.js +2 -2
- package/dist/cards/impl/bg-spell/blood-gem-quilboar-divine-shield.js.map +1 -1
- package/dist/cards/impl/bg-spell/blood-gem-quilboar-reborn.js +2 -2
- package/dist/cards/impl/bg-spell/blood-gem-quilboar-reborn.js.map +1 -1
- package/dist/cards/impl/bg-spell/blood-gem-quilboar-taunt.js +2 -2
- package/dist/cards/impl/bg-spell/blood-gem-quilboar-taunt.js.map +1 -1
- package/dist/cards/impl/bg-spell/conflagration.js +2 -2
- package/dist/cards/impl/bg-spell/conflagration.js.map +1 -1
- package/dist/cards/impl/bg-spell/deepwater-clan.js +2 -2
- package/dist/cards/impl/bg-spell/deepwater-clan.js.map +1 -1
- package/dist/cards/impl/bg-spell/queens-command.js +2 -2
- package/dist/cards/impl/bg-spell/queens-command.js.map +1 -1
- package/dist/cards/impl/bg-spell/shifting-tide.js.map +1 -1
- package/dist/cards/impl/minion/abyssal-bruiser.js +2 -4
- package/dist/cards/impl/minion/abyssal-bruiser.js.map +1 -1
- package/dist/cards/impl/minion/bristleback-bully.js +1 -3
- package/dist/cards/impl/minion/bristleback-bully.js.map +1 -1
- package/dist/cards/impl/minion/chromadrake-pool.js +5 -5
- package/dist/cards/impl/minion/chromadrake-pool.js.map +1 -1
- package/dist/cards/impl/minion/clunker-junker.js +4 -2
- package/dist/cards/impl/minion/clunker-junker.js.map +1 -1
- package/dist/cards/impl/minion/dead-sea-ravager.js +2 -3
- package/dist/cards/impl/minion/dead-sea-ravager.js.map +1 -1
- package/dist/cards/impl/minion/deepwater-chieftain.js +2 -6
- package/dist/cards/impl/minion/deepwater-chieftain.js.map +1 -1
- package/dist/cards/impl/minion/firelands-fugitive.js +1 -3
- package/dist/cards/impl/minion/firelands-fugitive.js.map +1 -1
- package/dist/cards/impl/minion/ingenious-inventor.js +2 -3
- package/dist/cards/impl/minion/ingenious-inventor.js.map +1 -1
- package/dist/cards/impl/minion/leyline-surfacer.js +2 -6
- package/dist/cards/impl/minion/leyline-surfacer.js.map +1 -1
- package/dist/cards/impl/minion/mummifier.js +1 -1
- package/dist/cards/impl/minion/mummifier.js.map +1 -1
- package/dist/cards/impl/minion/redtusk-thornraiser.js +1 -3
- package/dist/cards/impl/minion/redtusk-thornraiser.js.map +1 -1
- package/dist/cards/impl/minion/tide-raiser.js +1 -1
- package/dist/cards/impl/minion/tide-raiser.js.map +1 -1
- package/dist/cards/impl/minion/vinespeaker.js +1 -2
- package/dist/cards/impl/minion/vinespeaker.js.map +1 -1
- package/dist/cards/impl/minion/wrathscale-rogue.js.map +1 -1
- package/dist/cards/impl/trinket/deathtouch-apple.js +1 -2
- package/dist/cards/impl/trinket/deathtouch-apple.js.map +1 -1
- package/dist/cards/impl/trinket/rylak-portrait.js +1 -2
- package/dist/cards/impl/trinket/rylak-portrait.js.map +1 -1
- package/dist/cards/impl/trinket/sky-golem-portrait-enchantment.js +1 -2
- package/dist/cards/impl/trinket/sky-golem-portrait-enchantment.js.map +1 -1
- package/dist/cards/impl/trinket/sky-golem-portrait.js +2 -3
- package/dist/cards/impl/trinket/sky-golem-portrait.js.map +1 -1
- package/dist/cards/impl/trinket/soul-fermenter.js +6 -3
- package/dist/cards/impl/trinket/soul-fermenter.js.map +1 -1
- package/dist/input-clone.js +1 -1
- package/dist/input-clone.js.map +1 -1
- package/dist/services/card-ids.d.ts +165 -17
- package/dist/services/card-ids.js.map +1 -1
- package/dist/simulate-bgs-battle.js +4 -4
- package/dist/simulate-bgs-battle.js.map +1 -1
- package/dist/simulation/auras.js +4 -2
- package/dist/simulation/auras.js.map +1 -1
- package/dist/simulation/avenge.js +4 -0
- package/dist/simulation/avenge.js.map +1 -1
- package/dist/simulation/blood-gems.js +1 -4
- package/dist/simulation/blood-gems.js.map +1 -1
- package/dist/simulation/reborn.js +25 -23
- package/dist/simulation/reborn.js.map +1 -1
- package/dist/simulation/start-of-combat/soc-trinket.js +1 -1
- package/dist/simulation/start-of-combat/soc-trinket.js.map +1 -1
- package/dist/temp-card-ids.d.ts +1 -12
- package/dist/temp-card-ids.js +1 -12
- package/dist/temp-card-ids.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reborn.js","sourceRoot":"","sources":["../../src/simulation/reborn.ts"],"names":[],"mappings":";;;AAEA,4DAA+F;AAC/F,iEAA4D;AAC5D,8EAA+G;AAE/G,oCAA2C;AAC3C,6DAAqD;AAErD,qCAA+C;AAC/C,mCAAsC;AAE/B,MAAM,qBAAqB,GAAG,CACpC,qBAAoC,EACpC,yBAA0C,EAC1C,UAAuB,EACvB,wBAAgC,EAChC,aAA4B,EAC5B,iBAAkC,EAClC,SAAwB,EACjB,EAAE;;IACT,MAAM,eAAe,GAAG,CAAC,CAAC;IAC1B,IAAI,aAAa,GAAgB,IAAI,CAAC;IACtC,IACC,IAAA,sCAAkB,EAAC,UAAU,CAAC,MAAM,CAAC;SACrC,MAAA,UAAU,CAAC,YAAY,0CAAE,IAAI,CAC5B,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,wBAAuE,CACtF,CAAA,EACA;QACD,aAAa,GAAG,IAAA,qDAAiC,EAAC,UAAU,CAAC,CAAC;KAC9D;IACD,MAAM,kBAAkB,GACvB,UAAU,CAAC,MAAM,IAAI,wBAAwB,IAAI,CAAC;QACjD,CAAC,CAAC,IAAA,kCAAa,EACb,UAAU,CAAC,MAAM,EACjB,eAAe,EACf,qBAAqB,EACrB,yBAAyB,EACzB,aAAa,EACb,iBAAiB,EACjB,SAAS,EACT,UAAU,CAAC,QAAQ,EACnB,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,aAAa,EACb,UAAU,CACT;QACH,CAAC,CAAC,EAAE,CAAC;IACP,IAAI,CAAC,kBAAkB,CAAC,MAAM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AAyB,EACzB,UAAU,GAAG,CAAC,EACd,UAAU,GAAG,CAAC,EACd,SAAS,CACT,CAAC;QACH,CAAC,CAAC,CAAC;KACJ;AACF,CAAC,CAAC;AApKW,QAAA,qBAAqB,yBAoKhC","sourcesContent":["import { BgsPlayerEntity } from '../bgs-player-entity';\r\nimport { BoardEntity } from '../board-entity';\r\nimport { hasAfterReborn, hasRebornEffect, hasRebornSelfEffect } from '../cards/card.interface';\r\nimport { cardMappings } from '../cards/impl/_card-mappings';\r\nimport { buildSinrunnerBlanchyRebornEntity, isSinrunnerBlanchy } from '../cards/impl/minion/sinrunner-blanchy';\r\nimport { CardIds } from '../services/card-ids';\r\nimport { addStatsToBoard } from '../utils';\r\nimport { spawnEntities } from './deathrattle-spawns';\r\nimport { FullGameState } from './internal-game-state';\r\nimport { performEntitySpawns } from './spawns';\r\nimport { modifyStats } from './stats';\r\n\r\nexport const handleRebornForEntity = (\r\n\tboardWithKilledMinion: BoardEntity[],\r\n\tboardWithKilledMinionHero: BgsPlayerEntity,\r\n\tdeadEntity: BoardEntity,\r\n\tdeadMinionIndexFromRight: number,\r\n\topponentBoard: BoardEntity[],\r\n\topponentBoardHero: BgsPlayerEntity,\r\n\tgameState: FullGameState,\r\n): void => {\r\n\tconst numberOfReborns = 1;\r\n\tlet entityToSpawn: BoardEntity = null;\r\n\tif (\r\n\t\tisSinrunnerBlanchy(deadEntity.cardId) ||\r\n\t\tdeadEntity.enchantments?.some(\r\n\t\t\t(e) => e.cardId === CardIds.UltraCapacitor_UltraCapacitorEnchantment_BG31_HERO_801ptje,\r\n\t\t)\r\n\t) {\r\n\t\tentityToSpawn = buildSinrunnerBlanchyRebornEntity(deadEntity);\r\n\t}\r\n\tconst entitiesFromReborn: readonly BoardEntity[] =\r\n\t\tdeadEntity.reborn && deadMinionIndexFromRight >= 0\r\n\t\t\t? spawnEntities(\r\n\t\t\t\t\tdeadEntity.cardId,\r\n\t\t\t\t\tnumberOfReborns,\r\n\t\t\t\t\tboardWithKilledMinion,\r\n\t\t\t\t\tboardWithKilledMinionHero,\r\n\t\t\t\t\topponentBoard,\r\n\t\t\t\t\topponentBoardHero,\r\n\t\t\t\t\tgameState,\r\n\t\t\t\t\tdeadEntity.friendly,\r\n\t\t\t\t\tfalse,\r\n\t\t\t\t\ttrue,\r\n\t\t\t\t\ttrue,\r\n\t\t\t\t\tentityToSpawn,\r\n\t\t\t\t\tdeadEntity,\r\n\t\t\t )\r\n\t\t\t: [];\r\n\tif (!entitiesFromReborn.length) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tif (\r\n\t\tdeadEntity.cardId === CardIds.WannabeGargoyle_BG30_109 ||\r\n\t\tdeadEntity.cardId === CardIds.WannabeGargoyle_BG30_109_G\r\n\t) {\r\n\t\tentitiesFromReborn.forEach((e) => {\r\n\t\t\tconst attack = deadEntity.maxAttack;\r\n\t\t\tconst health = deadEntity.cardId === CardIds.WannabeGargoyle_BG30_109_G ? deadEntity.maxHealth : 1;\r\n\t\t\te.attack = attack;\r\n\t\t\te.health = health;\r\n\t\t});\r\n\t}\r\n\r\n\tfor (const entity of entitiesFromReborn) {\r\n\t\tconst rebornImpl = cardMappings[entity.cardId];\r\n\t\tif (hasRebornSelfEffect(rebornImpl)) {\r\n\t\t\trebornImpl.rebornSelfEffect(entity, {\r\n\t\t\t\trebornEntity: deadEntity,\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}\r\n\t}\r\n\r\n\tfor (const entity of boardWithKilledMinion) {\r\n\t\tconst rebornImpl = cardMappings[entity.cardId];\r\n\t\tif (hasRebornEffect(rebornImpl)) {\r\n\t\t\trebornImpl.rebornEffect(entity, {\r\n\t\t\t\trebornEntity: deadEntity,\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}\r\n\t}\r\n\r\n\tconst entitiesThatWereReborn = performEntitySpawns(\r\n\t\tentitiesFromReborn,\r\n\t\tboardWithKilledMinion,\r\n\t\tboardWithKilledMinionHero,\r\n\t\tdeadEntity,\r\n\t\tdeadMinionIndexFromRight,\r\n\t\topponentBoard,\r\n\t\topponentBoardHero,\r\n\t\tgameState,\r\n\t);\r\n\tentitiesThatWereReborn.forEach((e) => (e.rebornFromEntityId = deadEntity.entityId));\r\n\tconst entityRightToSpawns =\r\n\t\tdeadMinionIndexFromRight === 0\r\n\t\t\t? null\r\n\t\t\t: boardWithKilledMinion[boardWithKilledMinion.length - deadMinionIndexFromRight];\r\n\tentitiesThatWereReborn.forEach((entity) => {\r\n\t\tentity.hasAttacked = deadEntity.hasAttacked > 1 ? 1 : entityRightToSpawns?.hasAttacked ?? undefined;\r\n\t});\r\n\r\n\tfor (const entity of boardWithKilledMinion) {\r\n\t\tconst rebornImpl = cardMappings[entity.cardId];\r\n\t\tif (hasAfterReborn(rebornImpl)) {\r\n\t\t\trebornImpl.afterReborn(entity, {\r\n\t\t\t\trebornEntity: deadEntity,\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}\r\n\t}\r\n\tfor (const trinket of boardWithKilledMinionHero.trinkets ?? []) {\r\n\t\tconst rebornImpl = cardMappings[trinket.cardId];\r\n\t\tif (hasAfterReborn(rebornImpl)) {\r\n\t\t\trebornImpl.afterReborn(trinket, {\r\n\t\t\t\trebornEntity: deadEntity,\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}\r\n\t}\r\n\r\n\t// Arfus\r\n\tboardWithKilledMinion\r\n\t\t.filter(\r\n\t\t\t(e) =>\r\n\t\t\t\te.cardId === CardIds.Arfus_TB_BaconShop_HERO_22_Buddy ||\r\n\t\t\t\te.cardId === CardIds.Arfus_TB_BaconShop_HERO_22_Buddy_G,\r\n\t\t)\r\n\t\t.forEach((arfus) => {\r\n\t\t\tconst multiplier = arfus.cardId === CardIds.Arfus_TB_BaconShop_HERO_22_Buddy_G ? 2 : 1;\r\n\t\t\tconst attackBonus = arfus.attack * multiplier;\r\n\t\t\tentitiesThatWereReborn\r\n\t\t\t\t.filter((e) => e.entityId !== arfus.entityId && e.rebornFromEntityId !== arfus.entityId)\r\n\t\t\t\t.forEach((e) => {\r\n\t\t\t\t\tmodifyStats(e, arfus, attackBonus, 0, boardWithKilledMinion, boardWithKilledMinionHero, gameState);\r\n\t\t\t\t});\r\n\t\t});\r\n\r\n\tconst numberOfTriggersForDeathwhisper = Math.min(entitiesThatWereReborn.length, 1);\r\n\tfor (let i = 0; i < numberOfTriggersForDeathwhisper; i++) {\r\n\t\tboardWithKilledMinion\r\n\t\t\t.filter(\r\n\t\t\t\t(e) =>\r\n\t\t\t\t\te.cardId === CardIds.SisterDeathwhisper_BG25_020 ||\r\n\t\t\t\t\te.cardId === CardIds.SisterDeathwhisper_BG25_020_G,\r\n\t\t\t)\r\n\t\t\t.forEach((e) => {\r\n\t\t\t\tconst multiplier = e.cardId === CardIds.SisterDeathwhisper_BG25_020_G ? 2 : 1;\r\n\t\t\t\taddStatsToBoard(\r\n\t\t\t\t\te,\r\n\t\t\t\t\tboardWithKilledMinion,\r\n\t\t\t\t\tboardWithKilledMinionHero,\r\n\t\t\t\t\tmultiplier * 1,\r\n\t\t\t\t\tmultiplier * 3,\r\n\t\t\t\t\tgameState,\r\n\t\t\t\t);\r\n\t\t\t});\r\n\t}\r\n};\r\n\r\nexport interface RebornEffectInput {\r\n\treadonly rebornEntity: BoardEntity;\r\n\treadonly boardWithKilledMinion: BoardEntity[];\r\n\treadonly boardWithKilledMinionHero: BgsPlayerEntity;\r\n\treadonly opponentBoard: BoardEntity[];\r\n\treadonly opponentBoardHero: BgsPlayerEntity;\r\n\treadonly gameState: FullGameState;\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"reborn.js","sourceRoot":"","sources":["../../src/simulation/reborn.ts"],"names":[],"mappings":";;;AAEA,4DAA+F;AAC/F,iEAA4D;AAC5D,8EAA+G;AAE/G,oCAA2C;AAC3C,6DAAqD;AAErD,qCAA+C;AAC/C,mCAAsC;AAE/B,MAAM,qBAAqB,GAAG,CACpC,qBAAoC,EACpC,yBAA0C,EAC1C,UAAuB,EACvB,wBAAgC,EAChC,aAA4B,EAC5B,iBAAkC,EAClC,SAAwB,EACjB,EAAE;;IACT,MAAM,eAAe,GAAG,CAAC,CAAC;IAC1B,IAAI,aAAa,GAAgB,IAAI,CAAC;IACtC,IACC,IAAA,sCAAkB,EAAC,UAAU,CAAC,MAAM,CAAC;SACrC,MAAA,UAAU,CAAC,YAAY,0CAAE,IAAI,CAC5B,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,wBAAuE,CACtF,CAAA,EACA;QACD,aAAa,GAAG,IAAA,qDAAiC,EAAC,UAAU,CAAC,CAAC;KAC9D;IACD,MAAM,kBAAkB,GACvB,UAAU,CAAC,MAAM,IAAI,wBAAwB,IAAI,CAAC;QACjD,CAAC,CAAC,IAAA,kCAAa,EACb,UAAU,CAAC,MAAM,EACjB,eAAe,EACf,qBAAqB,EACrB,yBAAyB,EACzB,aAAa,EACb,iBAAiB,EACjB,SAAS,EACT,UAAU,CAAC,QAAQ,EACnB,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,aAAa,EACb,UAAU,CACT;QACH,CAAC,CAAC,EAAE,CAAC;IACP,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE;QAC/B,OAAO;KACP;IAED,IACC,UAAU,CAAC,MAAM,eAAqC;QACtD,UAAU,CAAC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AG,CAAC,EACd,UAAU,GAAG,CAAC,EACd,SAAS,CACT,CAAC;QACH,CAAC,CAAC,CAAC;KACJ;AACF,CAAC,CAAC;AAtKW,QAAA,qBAAqB,yBAsKhC","sourcesContent":["import { BgsPlayerEntity } from '../bgs-player-entity';\r\nimport { BoardEntity } from '../board-entity';\r\nimport { hasAfterReborn, hasRebornEffect, hasRebornSelfEffect } from '../cards/card.interface';\r\nimport { cardMappings } from '../cards/impl/_card-mappings';\r\nimport { buildSinrunnerBlanchyRebornEntity, isSinrunnerBlanchy } from '../cards/impl/minion/sinrunner-blanchy';\r\nimport { CardIds } from '../services/card-ids';\r\nimport { addStatsToBoard } from '../utils';\r\nimport { spawnEntities } from './deathrattle-spawns';\r\nimport { FullGameState } from './internal-game-state';\r\nimport { performEntitySpawns } from './spawns';\r\nimport { modifyStats } from './stats';\r\n\r\nexport const handleRebornForEntity = (\r\n\tboardWithKilledMinion: BoardEntity[],\r\n\tboardWithKilledMinionHero: BgsPlayerEntity,\r\n\tdeadEntity: BoardEntity,\r\n\tdeadMinionIndexFromRight: number,\r\n\topponentBoard: BoardEntity[],\r\n\topponentBoardHero: BgsPlayerEntity,\r\n\tgameState: FullGameState,\r\n): void => {\r\n\tconst numberOfReborns = 1;\r\n\tlet entityToSpawn: BoardEntity = null;\r\n\tif (\r\n\t\tisSinrunnerBlanchy(deadEntity.cardId) ||\r\n\t\tdeadEntity.enchantments?.some(\r\n\t\t\t(e) => e.cardId === CardIds.UltraCapacitor_UltraCapacitorEnchantment_BG31_HERO_801ptje,\r\n\t\t)\r\n\t) {\r\n\t\tentityToSpawn = buildSinrunnerBlanchyRebornEntity(deadEntity);\r\n\t}\r\n\tconst entitiesFromReborn: readonly BoardEntity[] =\r\n\t\tdeadEntity.reborn && deadMinionIndexFromRight >= 0\r\n\t\t\t? spawnEntities(\r\n\t\t\t\t\tdeadEntity.cardId,\r\n\t\t\t\t\tnumberOfReborns,\r\n\t\t\t\t\tboardWithKilledMinion,\r\n\t\t\t\t\tboardWithKilledMinionHero,\r\n\t\t\t\t\topponentBoard,\r\n\t\t\t\t\topponentBoardHero,\r\n\t\t\t\t\tgameState,\r\n\t\t\t\t\tdeadEntity.friendly,\r\n\t\t\t\t\tfalse,\r\n\t\t\t\t\ttrue,\r\n\t\t\t\t\ttrue,\r\n\t\t\t\t\tentityToSpawn,\r\n\t\t\t\t\tdeadEntity,\r\n\t\t\t )\r\n\t\t\t: [];\r\n\tif (!entitiesFromReborn.length) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tif (\r\n\t\tdeadEntity.cardId === CardIds.WannabeGargoyle_BG30_109 ||\r\n\t\tdeadEntity.cardId === CardIds.WannabeGargoyle_BG30_109_G\r\n\t) {\r\n\t\tentitiesFromReborn.forEach((e) => {\r\n\t\t\tconst attack = deadEntity.maxAttack;\r\n\t\t\tconst health = deadEntity.cardId === CardIds.WannabeGargoyle_BG30_109_G ? deadEntity.maxHealth : 1;\r\n\t\t\te.attack = attack;\r\n\t\t\te.health = health;\r\n\t\t});\r\n\t}\r\n\r\n\tfor (const entity of entitiesFromReborn) {\r\n\t\tconst rebornImpl = cardMappings[entity.cardId];\r\n\t\tif (hasRebornSelfEffect(rebornImpl)) {\r\n\t\t\trebornImpl.rebornSelfEffect(entity, {\r\n\t\t\t\trebornEntity: deadEntity,\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}\r\n\t}\r\n\r\n\tfor (const entity of boardWithKilledMinion) {\r\n\t\tconst rebornImpl = cardMappings[entity.cardId];\r\n\t\tif (hasRebornEffect(rebornImpl)) {\r\n\t\t\trebornImpl.rebornEffect(entity, {\r\n\t\t\t\trebornEntity: deadEntity,\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}\r\n\t}\r\n\r\n\tconst entitiesThatWereReborn = performEntitySpawns(\r\n\t\tentitiesFromReborn,\r\n\t\tboardWithKilledMinion,\r\n\t\tboardWithKilledMinionHero,\r\n\t\tdeadEntity,\r\n\t\tdeadMinionIndexFromRight,\r\n\t\topponentBoard,\r\n\t\topponentBoardHero,\r\n\t\tgameState,\r\n\t);\r\n\tentitiesThatWereReborn.forEach((e) => (e.rebornFromEntityId = deadEntity.entityId));\r\n\tconst entityRightToSpawns =\r\n\t\tdeadMinionIndexFromRight === 0\r\n\t\t\t? null\r\n\t\t\t: boardWithKilledMinion[boardWithKilledMinion.length - deadMinionIndexFromRight];\r\n\tentitiesThatWereReborn.forEach((entity) => {\r\n\t\tentity.hasAttacked = deadEntity.hasAttacked > 1 ? 1 : entityRightToSpawns?.hasAttacked ?? undefined;\r\n\t});\r\n\r\n\tfor (const rebornEntity of entitiesThatWereReborn) {\r\n\t\tfor (const entity of boardWithKilledMinion) {\r\n\t\t\tconst rebornImpl = cardMappings[entity.cardId];\r\n\t\t\tif (hasAfterReborn(rebornImpl)) {\r\n\t\t\t\trebornImpl.afterReborn(entity, {\r\n\t\t\t\t\trebornEntity: rebornEntity,\r\n\t\t\t\t\tboardWithKilledMinion,\r\n\t\t\t\t\tboardWithKilledMinionHero,\r\n\t\t\t\t\topponentBoard,\r\n\t\t\t\t\topponentBoardHero,\r\n\t\t\t\t\tgameState,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (const trinket of boardWithKilledMinionHero.trinkets ?? []) {\r\n\t\t\tconst rebornImpl = cardMappings[trinket.cardId];\r\n\t\t\tif (hasAfterReborn(rebornImpl)) {\r\n\t\t\t\trebornImpl.afterReborn(trinket, {\r\n\t\t\t\t\trebornEntity: rebornEntity,\r\n\t\t\t\t\tboardWithKilledMinion,\r\n\t\t\t\t\tboardWithKilledMinionHero,\r\n\t\t\t\t\topponentBoard,\r\n\t\t\t\t\topponentBoardHero,\r\n\t\t\t\t\tgameState,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// Arfus\r\n\tboardWithKilledMinion\r\n\t\t.filter(\r\n\t\t\t(e) =>\r\n\t\t\t\te.cardId === CardIds.Arfus_TB_BaconShop_HERO_22_Buddy ||\r\n\t\t\t\te.cardId === CardIds.Arfus_TB_BaconShop_HERO_22_Buddy_G,\r\n\t\t)\r\n\t\t.forEach((arfus) => {\r\n\t\t\tconst multiplier = arfus.cardId === CardIds.Arfus_TB_BaconShop_HERO_22_Buddy_G ? 2 : 1;\r\n\t\t\tconst attackBonus = arfus.attack * multiplier;\r\n\t\t\tentitiesThatWereReborn\r\n\t\t\t\t.filter((e) => e.entityId !== arfus.entityId && e.rebornFromEntityId !== arfus.entityId)\r\n\t\t\t\t.forEach((e) => {\r\n\t\t\t\t\tmodifyStats(e, arfus, attackBonus, 0, boardWithKilledMinion, boardWithKilledMinionHero, gameState);\r\n\t\t\t\t});\r\n\t\t});\r\n\r\n\tconst numberOfTriggersForDeathwhisper = Math.min(entitiesThatWereReborn.length, 1);\r\n\tfor (let i = 0; i < numberOfTriggersForDeathwhisper; i++) {\r\n\t\tboardWithKilledMinion\r\n\t\t\t.filter(\r\n\t\t\t\t(e) =>\r\n\t\t\t\t\te.cardId === CardIds.SisterDeathwhisper_BG25_020 ||\r\n\t\t\t\t\te.cardId === CardIds.SisterDeathwhisper_BG25_020_G,\r\n\t\t\t)\r\n\t\t\t.forEach((e) => {\r\n\t\t\t\tconst multiplier = e.cardId === CardIds.SisterDeathwhisper_BG25_020_G ? 2 : 1;\r\n\t\t\t\taddStatsToBoard(\r\n\t\t\t\t\te,\r\n\t\t\t\t\tboardWithKilledMinion,\r\n\t\t\t\t\tboardWithKilledMinionHero,\r\n\t\t\t\t\tmultiplier * 1,\r\n\t\t\t\t\tmultiplier * 3,\r\n\t\t\t\t\tgameState,\r\n\t\t\t\t);\r\n\t\t\t});\r\n\t}\r\n};\r\n\r\nexport interface RebornEffectInput {\r\n\treadonly rebornEntity: BoardEntity;\r\n\treadonly boardWithKilledMinion: BoardEntity[];\r\n\treadonly boardWithKilledMinionHero: BgsPlayerEntity;\r\n\treadonly opponentBoard: BoardEntity[];\r\n\treadonly opponentBoardHero: BgsPlayerEntity;\r\n\treadonly gameState: FullGameState;\r\n}\r\n"]}
|
|
@@ -66,7 +66,7 @@ const handleStartOfCombatTrinketsForPlayer = (input) => {
|
|
|
66
66
|
: 1;
|
|
67
67
|
for (let i = 0; i < loops; i++) {
|
|
68
68
|
for (const trinket of input.playerEntity.trinkets) {
|
|
69
|
-
(0, soc_action_processor_1.performStartOfCombatAction)(trinket.cardId, trinket, input,
|
|
69
|
+
(0, soc_action_processor_1.performStartOfCombatAction)(trinket.cardId, trinket, input, true);
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
return input.currentAttacker;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"soc-trinket.js","sourceRoot":"","sources":["../../../src/simulation/start-of-combat/soc-trinket.ts"],"names":[],"mappings":";;;AAIA,4DAA8D;AAC9D,iEAAoE;AAG7D,MAAM,2BAA2B,GAAG,CAC1C,YAA6B,EAC7B,WAA0B,EAC1B,cAA+B,EAC/B,aAA4B,EAC5B,eAAuB,EACvB,SAAwB,EACf,EAAE;IACX,IAAI,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,EAAE;QACxB,eAAe,GAAG,oCAAoC,CAAC;YACtD,YAAY,EAAE,YAAY;YAC1B,WAAW,EAAE,WAAW;YACxB,cAAc,EAAE,cAAc;YAC9B,aAAa,EAAE,aAAa;YAC5B,eAAe;YACf,SAAS;YACT,gBAAgB,EAAE,IAAI;SACtB,CAAC,CAAC;QACH,eAAe,GAAG,oCAAoC,CAAC;YACtD,YAAY,EAAE,cAAc;YAC5B,WAAW,EAAE,aAAa;YAC1B,cAAc,EAAE,YAAY;YAC5B,aAAa,EAAE,WAAW;Y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} from '../../bgs-player-entity';\r\nimport { BoardEntity } from '../../board-entity';\r\nimport { CardIds } from '../../services/card-ids';\r\nimport { FullGameState } from '../internal-game-state';\r\nimport { handleSummonsWhenSpace } from '../summon-when-space';\r\nimport { performStartOfCombatAction } from './soc-action-processor';\r\nimport { SoCInput } from './start-of-combat-input';\r\n\r\nexport const handleStartOfCombatTrinkets = (\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\tif (Math.random() < 0.5) {\r\n\t\tcurrentAttacker = handleStartOfCombatTrinketsForPlayer({\r\n\t\t\tplayerEntity: playerEntity,\r\n\t\t\tplayerBoard: playerBoard,\r\n\t\t\topponentEntity: opponentEntity,\r\n\t\t\topponentBoard: opponentBoard,\r\n\t\t\tcurrentAttacker,\r\n\t\t\tgameState,\r\n\t\t\tplayerIsFriendly: true,\r\n\t\t});\r\n\t\tcurrentAttacker = handleStartOfCombatTrinketsForPlayer({\r\n\t\t\tplayerEntity: opponentEntity,\r\n\t\t\tplayerBoard: opponentBoard,\r\n\t\t\topponentEntity: playerEntity,\r\n\t\t\topponentBoard: playerBoard,\r\n\t\t\tcurrentAttacker,\r\n\t\t\tgameState,\r\n\t\t\tplayerIsFriendly: false,\r\n\t\t});\r\n\t} else {\r\n\t\tcurrentAttacker = handleStartOfCombatTrinketsForPlayer({\r\n\t\t\tplayerEntity: opponentEntity,\r\n\t\t\tplayerBoard: opponentBoard,\r\n\t\t\topponentEntity: playerEntity,\r\n\t\t\topponentBoard: playerBoard,\r\n\t\t\tcurrentAttacker,\r\n\t\t\tgameState,\r\n\t\t\tplayerIsFriendly: false,\r\n\t\t});\r\n\t\tcurrentAttacker = handleStartOfCombatTrinketsForPlayer({\r\n\t\t\tplayerEntity: playerEntity,\r\n\t\t\tplayerBoard: playerBoard,\r\n\t\t\topponentEntity: opponentEntity,\r\n\t\t\topponentBoard: opponentBoard,\r\n\t\t\tcurrentAttacker,\r\n\t\t\tgameState,\r\n\t\t\tplayerIsFriendly: true,\r\n\t\t});\r\n\t}\r\n\tconst shouldRecomputeCurrentAttacker = handleSummonsWhenSpace(\r\n\t\tplayerBoard,\r\n\t\tplayerEntity,\r\n\t\topponentBoard,\r\n\t\topponentEntity,\r\n\t\tgameState,\r\n\t);\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\treturn currentAttacker;\r\n};\r\n\r\nconst handleStartOfCombatTrinketsForPlayer = (input: SoCInput): number => {\r\n\tif (input.playerEntity.startOfCombatDone) {\r\n\t\treturn input.currentAttacker;\r\n\t}\r\n\r\n\tconst loops = input.playerEntity.trinkets?.some((t) => t.cardId === CardIds.ValdrakkenWindChimes_BG32_MagicItem_365)\r\n\t\t? 2\r\n\t\t: 1;\r\n\tfor (let i = 0; i < loops; i++) {\r\n\t\tfor (const trinket of input.playerEntity.trinkets) {\r\n\t\t\t// 2026-06-02: https://replays.firestoneapp.com/?reviewId=71a20859-0e12-4c71-a5c9-51fa10c39294&turn=23&action=5\r\n\t\t\t// Soul Fermenter triggers, minions die, new minions spawn, then Baleful Incense triggers\r\n\t\t\tperformStartOfCombatAction(trinket.cardId, trinket, input, true);\r\n\t\t}\r\n\t}\r\n\r\n\treturn input.currentAttacker;\r\n};\r\n"]}
|
package/dist/temp-card-ids.d.ts
CHANGED
|
@@ -1,13 +1,2 @@
|
|
|
1
|
-
export declare const TempCardIds: {
|
|
2
|
-
readonly DeadSeaRavager_BG: "DeadSeaRavager_BG";
|
|
3
|
-
readonly DeadSeaRavager_BG_G: "DeadSeaRavager_BG_G";
|
|
4
|
-
readonly IngeniousInventor_BG: "IngeniousInventor_BG";
|
|
5
|
-
readonly IngeniousInventor_BG_G: "IngeniousInventor_BG_G";
|
|
6
|
-
readonly RylakPortrait: "RylakPortrait";
|
|
7
|
-
readonly SkyGolemPortrait: "SkyGolemPortrait";
|
|
8
|
-
readonly SkyGolemPortraitEnchantment: "SkyGolemPortraitEnchantment";
|
|
9
|
-
readonly VinespeakerPortrait: "VinespeakerPortrait";
|
|
10
|
-
readonly DeathtouchApple: "DeathtouchApple";
|
|
11
|
-
readonly SoulFermenter: "SoulFermenter";
|
|
12
|
-
};
|
|
1
|
+
export declare const TempCardIds: {};
|
|
13
2
|
export type TempCardId = (typeof TempCardIds)[keyof typeof TempCardIds];
|
package/dist/temp-card-ids.js
CHANGED
|
@@ -1,16 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TempCardIds = void 0;
|
|
4
|
-
exports.TempCardIds = {
|
|
5
|
-
DeadSeaRavager_BG: 'DeadSeaRavager_BG',
|
|
6
|
-
DeadSeaRavager_BG_G: 'DeadSeaRavager_BG_G',
|
|
7
|
-
IngeniousInventor_BG: 'IngeniousInventor_BG',
|
|
8
|
-
IngeniousInventor_BG_G: 'IngeniousInventor_BG_G',
|
|
9
|
-
RylakPortrait: 'RylakPortrait',
|
|
10
|
-
SkyGolemPortrait: 'SkyGolemPortrait',
|
|
11
|
-
SkyGolemPortraitEnchantment: 'SkyGolemPortraitEnchantment',
|
|
12
|
-
VinespeakerPortrait: 'VinespeakerPortrait',
|
|
13
|
-
DeathtouchApple: 'DeathtouchApple',
|
|
14
|
-
SoulFermenter: 'SoulFermenter',
|
|
15
|
-
};
|
|
4
|
+
exports.TempCardIds = {};
|
|
16
5
|
//# sourceMappingURL=temp-card-ids.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"temp-card-ids.js","sourceRoot":"","sources":["../src/temp-card-ids.ts"],"names":[],"mappings":";;;AAIa,QAAA,WAAW,GAAG
|
|
1
|
+
{"version":3,"file":"temp-card-ids.js","sourceRoot":"","sources":["../src/temp-card-ids.ts"],"names":[],"mappings":";;;AAIa,QAAA,WAAW,GAAG,EAAW,CAAC","sourcesContent":["/**\r\n * Placeholder card IDs for Battlegrounds cards not yet in @firestone-hs/reference-data.\r\n * Add fake temporary ids here when needed; migrate to CardIds in card-ids.ts once available.\r\n */\r\nexport const TempCardIds = {} as const;\r\n\r\nexport type TempCardId = (typeof TempCardIds)[keyof typeof TempCardIds];\r\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firestone-hs/simulate-bgs-battle",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.717",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"lint": "eslint --color --fix --ext .ts .",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"dist/**/*"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@firestone-hs/reference-data": "^3.0.
|
|
28
|
+
"@firestone-hs/reference-data": "^3.0.196"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/aws-lambda": "8.10.31",
|