@firestone-hs/simulate-bgs-battle 1.1.750 → 1.1.751
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.
|
@@ -8,7 +8,10 @@ exports.BoomInABox = {
|
|
|
8
8
|
startOfCombatTiming: 'start-of-combat',
|
|
9
9
|
startOfCombat: (minion, input) => {
|
|
10
10
|
const mult = minion.cardId === "BG36_620_G" ? 2 : 1;
|
|
11
|
-
const
|
|
11
|
+
const targetsSource = Math.random() < 0.5
|
|
12
|
+
? [...input.playerBoard, ...input.opponentBoard]
|
|
13
|
+
: [...input.opponentBoard, ...input.playerBoard];
|
|
14
|
+
const targets = targetsSource.filter((e) => e !== minion);
|
|
12
15
|
for (let i = 0; i < mult; i++) {
|
|
13
16
|
for (const target of targets) {
|
|
14
17
|
const isSameSide = target.friendly === minion.friendly;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boom-in-a-box.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/boom-in-a-box.ts"],"names":[],"mappings":";;;AASA,uDAAgE;AAIhE,MAAM,MAAM,GAAG,CAAC,CAAC;AAEJ,QAAA,UAAU,GAAsB;IAC5C,OAAO,EAAE,0BAA4D;IACrE,mBAAmB,EAAE,iBAAiB;IACtC,aAAa,EAAE,CAAC,MAAmB,EAAE,KAAe,EAAE,EAAE;QACvD,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,iBAAkC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"boom-in-a-box.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/boom-in-a-box.ts"],"names":[],"mappings":";;;AASA,uDAAgE;AAIhE,MAAM,MAAM,GAAG,CAAC,CAAC;AAEJ,QAAA,UAAU,GAAsB;IAC5C,OAAO,EAAE,0BAA4D;IACrE,mBAAmB,EAAE,iBAAiB;IACtC,aAAa,EAAE,CAAC,MAAmB,EAAE,K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box (Tier 4, 5/10)\r\n * Taunt. Start of Combat: Deal 3 damage to all other minions.\r\n *\r\n * Golden Boom-in-a-Box (Tier 4, 10/20)\r\n * Taunt. Start of Combat: Deal 6 damage to all other minions.\r\n */\r\nimport { BoardEntity } from '../../../board-entity';\r\nimport { CardIds } from '../../../services/card-ids';\r\nimport { dealDamageToMinion } from '../../../simulation/attack';\r\nimport { SoCInput } from '../../../simulation/start-of-combat/start-of-combat-input';\r\nimport { StartOfCombatCard } from '../../card.interface';\r\n\r\nconst damage = 3;\r\n\r\nexport const BoomInABox: StartOfCombatCard = {\r\n\tcardIds: [CardIds.BoomInABox_BG36_620, CardIds.BoomInABox_BG36_620_G],\r\n\tstartOfCombatTiming: 'start-of-combat',\r\n\tstartOfCombat: (minion: BoardEntity, input: SoCInput) => {\r\n\t\tconst mult = minion.cardId === CardIds.BoomInABox_BG36_620_G ? 2 : 1;\r\n\t\t// Looks like the first board is random:\r\n\t\t// - 36.4 (player): https://replays.firestoneapp.com/?reviewId=30aef95c-eb6f-4bfa-826e-4a86416bee52&turn=21&action=1\r\n\t\t// - 36.6 (opponent): https://replays.firestoneapp.com/?reviewId=158f5ad5-b36f-4643-9ccf-ac29bf5d3571&turn=29&action=4\r\n\t\tconst targetsSource =\r\n\t\t\tMath.random() < 0.5\r\n\t\t\t\t? [...input.playerBoard, ...input.opponentBoard]\r\n\t\t\t\t: [...input.opponentBoard, ...input.playerBoard];\r\n\t\tconst targets = targetsSource.filter((e) => e !== minion);\r\n\t\tfor (let i = 0; i < mult; i++) {\r\n\t\t\tfor (const target of targets) {\r\n\t\t\t\tconst isSameSide = target.friendly === minion.friendly;\r\n\t\t\t\tdealDamageToMinion(\r\n\t\t\t\t\ttarget,\r\n\t\t\t\t\tisSameSide ? input.playerBoard : input.opponentBoard,\r\n\t\t\t\t\tisSameSide ? input.playerEntity : input.opponentEntity,\r\n\t\t\t\t\tminion,\r\n\t\t\t\t\tdamage,\r\n\t\t\t\t\tisSameSide ? input.opponentBoard : input.playerBoard,\r\n\t\t\t\t\tisSameSide ? input.opponentEntity : input.playerEntity,\r\n\t\t\t\t\tinput.gameState,\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn { hasTriggered: true, shouldRecomputeCurrentAttacker: true };\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.
|
|
3
|
+
"version": "1.1.751",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"lint": "eslint --color --fix --ext .ts .",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"dist/**/*"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@firestone-hs/reference-data": "^3.0.
|
|
29
|
+
"@firestone-hs/reference-data": "^3.0.209"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/aws-lambda": "8.10.31",
|