@firestone-hs/simulate-bgs-battle 1.1.628 → 1.1.629
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.
|
@@ -7,18 +7,19 @@ exports.ExpertTechnician = {
|
|
|
7
7
|
deathrattleSpawn: (minion, input) => {
|
|
8
8
|
const loops = minion.cardId === "BG33_370_G" ? 2 : 1;
|
|
9
9
|
for (let i = 0; i < loops; i++) {
|
|
10
|
-
const
|
|
11
|
-
|
|
10
|
+
const newAttacker = input.boardWithDeadEntity.filter((e) => e.health > 0 && !e.definitelyDead)[0];
|
|
11
|
+
const newTarget = input.deadEntity.lastAffectedByEntity;
|
|
12
|
+
if (!(newAttacker === null || newAttacker === void 0 ? void 0 : newAttacker.attack) || !newTarget || newTarget.health <= 0 || newTarget.definitelyDead) {
|
|
12
13
|
continue;
|
|
13
14
|
}
|
|
14
15
|
const previousHasAttacked = minion.hasAttacked;
|
|
15
16
|
const previousWindfury = minion.windfury;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
(0, attack_1.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
newAttacker.attackImmediately = true;
|
|
18
|
+
newAttacker.windfury = false;
|
|
19
|
+
(0, attack_1.doFullAttack)(newAttacker, input.boardWithDeadEntity, input.boardWithDeadEntityHero, newTarget, input.otherBoard, input.otherBoardHero, input.gameState);
|
|
20
|
+
newAttacker.hasAttacked = previousHasAttacked;
|
|
21
|
+
newAttacker.attackImmediately = false;
|
|
22
|
+
newAttacker.windfury = previousWindfury;
|
|
22
23
|
}
|
|
23
24
|
return null;
|
|
24
25
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expert-technician.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/expert-technician.ts"],"names":[],"mappings":";;;AAEA,
|
|
1
|
+
{"version":3,"file":"expert-technician.js","sourceRoot":"","sources":["../../../../src/cards/impl/minion/expert-technician.ts"],"names":[],"mappings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GAAG,gBAAgB,CAAC;SACxC;QACD,OAAO,IAAI,CAAC;IACb,CAAC;CACD,CAAC","sourcesContent":["import { BoardEntity } from '../../../board-entity';\r\nimport { CardIds } from '../../../services/card-ids';\r\nimport { doFullAttack } from '../../../simulation/attack';\r\nimport { DeathrattleTriggeredInput } from '../../../simulation/deathrattle-on-trigger';\r\nimport { DeathrattleSpawnCard } from '../../card.interface';\r\n\r\nexport const ExpertTechnician: DeathrattleSpawnCard = {\r\n\tcardIds: [CardIds.ExpertTechnician_BG33_370, CardIds.ExpertTechnician_BG33_370_G],\r\n\tdeathrattleSpawn: (minion: BoardEntity, input: DeathrattleTriggeredInput) => {\r\n\t\tconst loops = minion.cardId === CardIds.ExpertTechnician_BG33_370_G ? 2 : 1;\r\n\t\tfor (let i = 0; i < loops; i++) {\r\n\t\t\tconst newAttacker = input.boardWithDeadEntity.filter((e) => e.health > 0 && !e.definitelyDead)[0];\r\n\t\t\tconst newTarget = input.deadEntity.lastAffectedByEntity;\r\n\t\t\tif (!newAttacker?.attack || !newTarget || newTarget.health <= 0 || newTarget.definitelyDead) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tconst previousHasAttacked = minion.hasAttacked;\r\n\t\t\tconst previousWindfury = minion.windfury;\r\n\t\t\tnewAttacker.attackImmediately = true;\r\n\t\t\tnewAttacker.windfury = false;\r\n\t\t\tdoFullAttack(\r\n\t\t\t\tnewAttacker,\r\n\t\t\t\tinput.boardWithDeadEntity,\r\n\t\t\t\tinput.boardWithDeadEntityHero,\r\n\t\t\t\tnewTarget,\r\n\t\t\t\tinput.otherBoard,\r\n\t\t\t\tinput.otherBoardHero,\r\n\t\t\t\tinput.gameState,\r\n\t\t\t);\r\n\t\t\t// simulateAttack(\r\n\t\t\t// \tinput.boardWithDeadEntity,\r\n\t\t\t// \tinput.boardWithDeadEntityHero,\r\n\t\t\t// \tinput.otherBoard,\r\n\t\t\t// \tinput.otherBoardHero,\r\n\t\t\t// \tinput.gameState,\r\n\t\t\t// );\r\n\t\t\tnewAttacker.hasAttacked = previousHasAttacked;\r\n\t\t\tnewAttacker.attackImmediately = false;\r\n\t\t\tnewAttacker.windfury = previousWindfury;\r\n\t\t}\r\n\t\treturn null;\r\n\t},\r\n};\r\n"]}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firestone-hs/simulate-bgs-battle",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.629",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"lint": "eslint --color --fix --ext .ts .",
|
|
7
7
|
"test-board": "ts-node test/full-game/full-test.ts",
|
|
8
|
-
"test-board-ss": "node --stack-size=
|
|
8
|
+
"test-board-ss": "node --stack-size=100 --trace-uncaught -r ts-node/register test/full-game/full-test.ts",
|
|
9
9
|
"test-board-prof": "node --inspect-brk -r ts-node/register test/full-game/full-test.ts",
|
|
10
10
|
"build": "webpack --color",
|
|
11
11
|
"build-tsc": "rm -rf dist && tsc",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"dist/**/*"
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@firestone-hs/reference-data": "^
|
|
27
|
+
"@firestone-hs/reference-data": "^3.0.152"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/aws-lambda": "8.10.31",
|