@firestone-hs/simulate-bgs-battle 1.1.702 → 1.1.703

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.
@@ -16,7 +16,7 @@ exports.BananaSlamma = {
16
16
  return;
17
17
  }
18
18
  const mult = slam.cardId === "BG26_802_G" ? 3 : 2;
19
- (0, stats_1.setEntityStats)(spawned, spawned.attack * mult, 0, board, hero, gameState);
19
+ (0, stats_1.setEntityStats)(spawned, spawned.attack * mult, spawned.health, board, hero, gameState);
20
20
  gameState.spectator.registerPowerTarget(slam, spawned, board, null, null);
21
21
  },
22
22
  };
@@ -1 +1 @@
1
- {"version":3,"file":"banana-slamma.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/banana-slamma.ts"],"names":[],"mappings":";;;AAAA,iEAAoD;AAKpD,qDAA2D;AAC3D,0CAAiD;AAGpC,QAAA,YAAY,GAA0B;IAClD,OAAO,EAAE,0BAAgE;IACzE,iBAAiB,EAAE,CAAC,MAAkC,EAAE,KAAwB,EAAE,EAAE;QACnF,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;QAClD,MAAM,IAAI,GAAG,MAAqB,CAAC;QACnC,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,QAAQ,KAAK,IAAI,CAAC,QAAQ,EAAE;YACnD,OAAO;SACP;QACD,IAAI,CAAC,IAAA,uBAAe,EAAC,OAAO,EAAE,IAAI,EAAE,qBAAI,CAAC,KAAK,EAAE,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC,QAAQ,CAAC,EAAE;YACzF,OAAO;SACP;QACD,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,iBAAoC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACrE,IAAA,sBAAc,EAAC,OAAO,EAAE,OAAO,CAAC,MAAM,GAAG,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,IAAuB,EAAE,SAAS,CAAC,CAAC;QAC7F,SAAS,CAAC,SAAS,CAAC,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAC3E,CAAC;CACD,CAAC","sourcesContent":["import { Race } from '@firestone-hs/reference-data';\r\nimport { BgsPlayerEntity, BoardTrinket } from '../../../bgs-player-entity';\r\nimport { BoardEntity } from '../../../board-entity';\r\nimport { CardIds } from '../../../services/card-ids';\r\nimport { OnOtherSpawnInput } from '../../../simulation/add-minion-to-board';\r\nimport { setEntityStats } from '../../../simulation/stats';\r\nimport { hasCorrectTribe } from '../../../utils';\r\nimport { AfterOtherSpawnedCard } from '../../card.interface';\r\n\r\nexport const BananaSlamma: AfterOtherSpawnedCard = {\r\n\tcardIds: [CardIds.BananaSlamma_BG26_802, CardIds.BananaSlamma_BG26_802_G],\r\n\tafterOtherSpawned: (minion: BoardEntity | BoardTrinket, input: OnOtherSpawnInput) => {\r\n\t\tconst { spawned, board, hero, gameState } = input;\r\n\t\tconst slam = minion as BoardEntity;\r\n\t\tif (!spawned || spawned.entityId === slam.entityId) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (!hasCorrectTribe(spawned, hero, Race.BEAST, gameState.anomalies, gameState.allCards)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tconst mult = slam.cardId === CardIds.BananaSlamma_BG26_802_G ? 3 : 2;\r\n\t\tsetEntityStats(spawned, spawned.attack * mult, 0, board, hero as BgsPlayerEntity, gameState);\r\n\t\tgameState.spectator.registerPowerTarget(slam, spawned, board, null, null);\r\n\t},\r\n};\r\n"]}
1
+ {"version":3,"file":"banana-slamma.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/banana-slamma.ts"],"names":[],"mappings":";;;AAAA,iEAAoD;AAKpD,qDAA2D;AAC3D,0CAAiD;AAGpC,QAAA,YAAY,GAA0B;IAClD,OAAO,EAAE,0BAAgE;IACzE,iBAAiB,EAAE,CAAC,MAAkC,EAAE,KAAwB,EAAE,EAAE;QACnF,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;QAClD,MAAM,IAAI,GAAG,MAAqB,CAAC;QACnC,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,QAAQ,KAAK,IAAI,CAAC,QAAQ,EAAE;YACnD,OAAO;SACP;QACD,IAAI,CAAC,IAAA,uBAAe,EAAC,OAAO,EAAE,IAAI,EAAE,qBAAI,CAAC,KAAK,EAAE,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC,QAAQ,CAAC,EAAE;YACzF,OAAO;SACP;QACD,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,iBAAoC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACrE,IAAA,sBAAc,EAAC,OAAO,EAAE,OAAO,CAAC,MAAM,GAAG,IAAI,EAAE,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,IAAuB,EAAE,SAAS,CAAC,CAAC;QAC1G,SAAS,CAAC,SAAS,CAAC,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAC3E,CAAC;CACD,CAAC","sourcesContent":["import { Race } from '@firestone-hs/reference-data';\r\nimport { BgsPlayerEntity, BoardTrinket } from '../../../bgs-player-entity';\r\nimport { BoardEntity } from '../../../board-entity';\r\nimport { CardIds } from '../../../services/card-ids';\r\nimport { OnOtherSpawnInput } from '../../../simulation/add-minion-to-board';\r\nimport { setEntityStats } from '../../../simulation/stats';\r\nimport { hasCorrectTribe } from '../../../utils';\r\nimport { AfterOtherSpawnedCard } from '../../card.interface';\r\n\r\nexport const BananaSlamma: AfterOtherSpawnedCard = {\r\n\tcardIds: [CardIds.BananaSlamma_BG26_802, CardIds.BananaSlamma_BG26_802_G],\r\n\tafterOtherSpawned: (minion: BoardEntity | BoardTrinket, input: OnOtherSpawnInput) => {\r\n\t\tconst { spawned, board, hero, gameState } = input;\r\n\t\tconst slam = minion as BoardEntity;\r\n\t\tif (!spawned || spawned.entityId === slam.entityId) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (!hasCorrectTribe(spawned, hero, Race.BEAST, gameState.anomalies, gameState.allCards)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tconst mult = slam.cardId === CardIds.BananaSlamma_BG26_802_G ? 3 : 2;\r\n\t\tsetEntityStats(spawned, spawned.attack * mult, spawned.health, board, hero as BgsPlayerEntity, gameState);\r\n\t\tgameState.spectator.registerPowerTarget(slam, spawned, board, null, null);\r\n\t},\r\n};\r\n"]}
@@ -7,11 +7,14 @@ const utils_2 = require("../../../utils");
7
7
  exports.TimewarpedMagnanimoose = {
8
8
  cardIds: ["BG34_Giant_619", "BG34_Giant_619_G"],
9
9
  deathrattleSpawn: (minion, input) => {
10
- const playerInitialState = input.gameState.gameState.playerInitial;
10
+ var _a;
11
11
  const loops = minion.cardId === "BG34_Giant_619_G" ? 2 : 1;
12
12
  const spawned = [];
13
13
  for (let i = 0; i < loops; i++) {
14
- const randomMinion = (0, utils_1.pickRandom)(playerInitialState.board);
14
+ const randomMinion = (_a = (0, utils_1.pickRandom)(input.gameState.gameState.playerInitial.board)) !== null && _a !== void 0 ? _a : (0, utils_1.pickRandom)(input.gameState.gameState.opponentInitial.board);
15
+ if (!randomMinion) {
16
+ return [];
17
+ }
15
18
  const clone = (0, utils_2.copyEntity)(randomMinion);
16
19
  spawned.push(...(0, deathrattle_spawns_1.simplifiedSpawnEntities)(clone.cardId, 1, input, clone));
17
20
  }
@@ -1 +1 @@
1
- {"version":3,"file":"timewarped-magnanimoose.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/timewarped-magnanimoose.ts"],"names":[],"mappings":";;;AAEA,mDAAqD;AAErD,+EAAiF;AACjF,0CAA4C;AAG/B,QAAA,sBAAsB,GAAyB;IAC3D,OAAO,EAAE,sCAAgG;IACzG,gBAAgB,EAAE,CAAC,MAAmB,EAAE,KAAgC,EAAE,EAAE;QAC3E,MAAM,kBAAkB,GAAG,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,aAAa,CAAC;QACnE,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,uBAAoD,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACxF,MAAM,OAAO,GAAG,EAAE,CAAC;QACnB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE;YAE/B,MAAM,YAAY,GAAG,IAAA,kBAAU,EAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;YAC1D,MAAM,KAAK,GAAG,IAAA,kBAAU,EAAC,YAAY,CAAC,CAAC;YACvC,OAAO,CAAC,IAAI,CAAC,GAAG,IAAA,4CAAuB,EAAC,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;SACxE;QACD,OAAO,OAAO,CAAC;IAChB,CAAC;CACD,CAAC","sourcesContent":["import { BoardEntity } from '../../../board-entity';\r\nimport { CardIds } from '../../../services/card-ids';\r\nimport { pickRandom } from '../../../services/utils';\r\nimport { DeathrattleTriggeredInput } from '../../../simulation/deathrattle-on-trigger';\r\nimport { simplifiedSpawnEntities } from '../../../simulation/deathrattle-spawns';\r\nimport { copyEntity } from '../../../utils';\r\nimport { DeathrattleSpawnCard } from '../../card.interface';\r\n\r\nexport const TimewarpedMagnanimoose: DeathrattleSpawnCard = {\r\n\tcardIds: [CardIds.TimewarpedMagnanimoose_BG34_Giant_619, CardIds.TimewarpedMagnanimoose_BG34_Giant_619_G],\r\n\tdeathrattleSpawn: (minion: BoardEntity, input: DeathrattleTriggeredInput) => {\r\n\t\tconst playerInitialState = input.gameState.gameState.playerInitial;\r\n\t\tconst loops = minion.cardId === CardIds.TimewarpedMagnanimoose_BG34_Giant_619_G ? 2 : 1;\r\n\t\tconst spawned = [];\r\n\t\tfor (let i = 0; i < loops; i++) {\r\n\t\t\t// We don't know the opponents warbands, so we pick something from our own warband instead, as a proxy\r\n\t\t\tconst randomMinion = pickRandom(playerInitialState.board);\r\n\t\t\tconst clone = copyEntity(randomMinion);\r\n\t\t\tspawned.push(...simplifiedSpawnEntities(clone.cardId, 1, input, clone));\r\n\t\t}\r\n\t\treturn spawned;\r\n\t},\r\n};\r\n"]}
1
+ {"version":3,"file":"timewarped-magnanimoose.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/timewarped-magnanimoose.ts"],"names":[],"mappings":";;;AAEA,mDAAqD;AAErD,+EAAiF;AACjF,0CAA4C;AAG/B,QAAA,sBAAsB,GAAyB;IAC3D,OAAO,EAAE,sCAAgG;IACzG,gBAAgB,EAAE,CAAC,MAAmB,EAAE,KAAgC,EAAE,EAAE;;QAC3E,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,uBAAoD,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACxF,MAAM,OAAO,GAAG,EAAE,CAAC;QACnB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE;YAE/B,MAAM,YAAY,GACjB,MAAA,IAAA,kBAAU,EAAC,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,aAAa,CAAC,KAAK,CAAC,mCACzD,IAAA,kBAAU,EAAC,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;YAC7D,IAAI,CAAC,YAAY,EAAE;gBAClB,OAAO,EAAE,CAAC;aACV;YACD,MAAM,KAAK,GAAG,IAAA,kBAAU,EAAC,YAAY,CAAC,CAAC;YACvC,OAAO,CAAC,IAAI,CAAC,GAAG,IAAA,4CAAuB,EAAC,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;SACxE;QACD,OAAO,OAAO,CAAC;IAChB,CAAC;CACD,CAAC","sourcesContent":["import { BoardEntity } from '../../../board-entity';\r\nimport { CardIds } from '../../../services/card-ids';\r\nimport { pickRandom } from '../../../services/utils';\r\nimport { DeathrattleTriggeredInput } from '../../../simulation/deathrattle-on-trigger';\r\nimport { simplifiedSpawnEntities } from '../../../simulation/deathrattle-spawns';\r\nimport { copyEntity } from '../../../utils';\r\nimport { DeathrattleSpawnCard } from '../../card.interface';\r\n\r\nexport const TimewarpedMagnanimoose: DeathrattleSpawnCard = {\r\n\tcardIds: [CardIds.TimewarpedMagnanimoose_BG34_Giant_619, CardIds.TimewarpedMagnanimoose_BG34_Giant_619_G],\r\n\tdeathrattleSpawn: (minion: BoardEntity, input: DeathrattleTriggeredInput) => {\r\n\t\tconst loops = minion.cardId === CardIds.TimewarpedMagnanimoose_BG34_Giant_619_G ? 2 : 1;\r\n\t\tconst spawned = [];\r\n\t\tfor (let i = 0; i < loops; i++) {\r\n\t\t\t// We don't know the opponents warbands, so we pick something from our own warband instead, as a proxy\r\n\t\t\tconst randomMinion =\r\n\t\t\t\tpickRandom(input.gameState.gameState.playerInitial.board) ??\r\n\t\t\t\tpickRandom(input.gameState.gameState.opponentInitial.board);\r\n\t\t\tif (!randomMinion) {\r\n\t\t\t\treturn [];\r\n\t\t\t}\r\n\t\t\tconst clone = copyEntity(randomMinion);\r\n\t\t\tspawned.push(...simplifiedSpawnEntities(clone.cardId, 1, input, clone));\r\n\t\t}\r\n\t\treturn spawned;\r\n\t},\r\n};\r\n"]}
@@ -11,7 +11,7 @@ exports.SlammaSticker = {
11
11
  if (!(0, utils_1.hasCorrectTribe)(spawned, hero, reference_data_1.Race.BEAST, gameState.anomalies, gameState.allCards)) {
12
12
  return;
13
13
  }
14
- (0, stats_1.setEntityStats)(spawned, spawned.attack * 2, 0, board, hero, gameState);
14
+ (0, stats_1.setEntityStats)(spawned, spawned.attack * 2, spawned.health, board, hero, gameState);
15
15
  gameState.spectator.registerPowerTarget(hero, spawned, board, null, null);
16
16
  },
17
17
  };
@@ -1 +1 @@
1
- {"version":3,"file":"slamma-sticker.js","sourceRoot":"","sources":["../../../../src/cards/impl/trinket/slamma-sticker.ts"],"names":[],"mappings":";;;AAAA,iEAAoD;AAIpD,qDAA2D;AAC3D,0CAAiD;AAGpC,QAAA,aAAa,GAA0B;IACnD,OAAO,EAAE,sBAA0C;IACnD,iBAAiB,EAAE,CAAC,QAAsB,EAAE,KAAwB,EAAE,EAAE;QACvE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;QAClD,IAAI,CAAC,IAAA,uBAAe,EAAC,OAAO,EAAE,IAAI,EAAE,qBAAI,CAAC,KAAK,EAAE,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC,QAAQ,CAAC,EAAE;YACzF,OAAO;SACP;QACD,IAAA,sBAAc,EAAC,OAAO,EAAE,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;QACvE,SAAS,CAAC,SAAS,CAAC,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAC3E,CAAC;CACD,CAAC","sourcesContent":["import { Race } from '@firestone-hs/reference-data';\r\nimport { BoardTrinket } from '../../../bgs-player-entity';\r\nimport { CardIds } from '../../../services/card-ids';\r\nimport { OnOtherSpawnInput } from '../../../simulation/add-minion-to-board';\r\nimport { setEntityStats } from '../../../simulation/stats';\r\nimport { hasCorrectTribe } from '../../../utils';\r\nimport { AfterOtherSpawnedCard } from '../../card.interface';\r\n\r\nexport const SlammaSticker: AfterOtherSpawnedCard = {\r\n\tcardIds: [CardIds.SlammaSticker_BG30_MagicItem_540],\r\n\tafterOtherSpawned: (_trinket: BoardTrinket, input: OnOtherSpawnInput) => {\r\n\t\tconst { spawned, board, hero, gameState } = input;\r\n\t\tif (!hasCorrectTribe(spawned, hero, Race.BEAST, gameState.anomalies, gameState.allCards)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tsetEntityStats(spawned, spawned.attack * 2, 0, board, hero, gameState);\r\n\t\tgameState.spectator.registerPowerTarget(hero, spawned, board, null, null);\r\n\t},\r\n};\r\n"]}
1
+ {"version":3,"file":"slamma-sticker.js","sourceRoot":"","sources":["../../../../src/cards/impl/trinket/slamma-sticker.ts"],"names":[],"mappings":";;;AAAA,iEAAoD;AAIpD,qDAA2D;AAC3D,0CAAiD;AAGpC,QAAA,aAAa,GAA0B;IACnD,OAAO,EAAE,sBAA0C;IACnD,iBAAiB,EAAE,CAAC,QAAsB,EAAE,KAAwB,EAAE,EAAE;QACvE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;QAClD,IAAI,CAAC,IAAA,uBAAe,EAAC,OAAO,EAAE,IAAI,EAAE,qBAAI,CAAC,KAAK,EAAE,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC,QAAQ,CAAC,EAAE;YACzF,OAAO;SACP;QACD,IAAA,sBAAc,EAAC,OAAO,EAAE,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;QACpF,SAAS,CAAC,SAAS,CAAC,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAC3E,CAAC;CACD,CAAC","sourcesContent":["import { Race } from '@firestone-hs/reference-data';\r\nimport { BoardTrinket } from '../../../bgs-player-entity';\r\nimport { CardIds } from '../../../services/card-ids';\r\nimport { OnOtherSpawnInput } from '../../../simulation/add-minion-to-board';\r\nimport { setEntityStats } from '../../../simulation/stats';\r\nimport { hasCorrectTribe } from '../../../utils';\r\nimport { AfterOtherSpawnedCard } from '../../card.interface';\r\n\r\nexport const SlammaSticker: AfterOtherSpawnedCard = {\r\n\tcardIds: [CardIds.SlammaSticker_BG30_MagicItem_540],\r\n\tafterOtherSpawned: (_trinket: BoardTrinket, input: OnOtherSpawnInput) => {\r\n\t\tconst { spawned, board, hero, gameState } = input;\r\n\t\tif (!hasCorrectTribe(spawned, hero, Race.BEAST, gameState.anomalies, gameState.allCards)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tsetEntityStats(spawned, spawned.attack * 2, spawned.health, board, hero, gameState);\r\n\t\tgameState.spectator.registerPowerTarget(hero, spawned, board, null, null);\r\n\t},\r\n};\r\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firestone-hs/simulate-bgs-battle",
3
- "version": "1.1.702",
3
+ "version": "1.1.703",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "lint": "eslint --color --fix --ext .ts .",