@firestone-hs/simulate-bgs-battle 1.1.365 → 1.1.366
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/bgs-player-entity.d.ts +1 -1
- package/dist/bgs-player-entity.js.map +1 -1
- package/dist/simulation/attack.js +8 -3
- package/dist/simulation/attack.js.map +1 -1
- package/dist/simulation/avenge.js +0 -1
- package/dist/simulation/avenge.js.map +1 -1
- package/dist/simulation/reborn.js +7 -0
- package/dist/simulation/reborn.js.map +1 -1
- package/dist/simulation/start-of-combat.js +17 -2
- package/dist/simulation/start-of-combat.js.map +1 -1
- package/dist/utils.js +1 -1
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@ export interface BgsPlayerEntity {
|
|
|
7
7
|
readonly tavernTier: number;
|
|
8
8
|
readonly heroPowerId?: string | undefined | null;
|
|
9
9
|
readonly heroPowerUsed: boolean;
|
|
10
|
-
readonly heroPowerInfo?: number;
|
|
10
|
+
readonly heroPowerInfo?: number | string;
|
|
11
11
|
readonly heroPowerInfo2?: number;
|
|
12
12
|
friendly?: boolean;
|
|
13
13
|
entityId?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bgs-player-entity.js","sourceRoot":"","sources":["../src/bgs-player-entity.ts"],"names":[],"mappings":"","sourcesContent":["import { BoardEntity } from './board-entity';\r\nimport { BoardSecret } from './board-secret';\r\n\r\nexport interface BgsPlayerEntity {\r\n\treadonly cardId: string;\r\n\treadonly nonGhostCardId?: string;\r\n\treadonly hpLeft: number;\r\n\treadonly tavernTier: number;\r\n\treadonly heroPowerId?: string | undefined | null;\r\n\treadonly heroPowerUsed: boolean;\r\n\treadonly heroPowerInfo?: number;\r\n\treadonly heroPowerInfo2?: number;\r\n\tfriendly?: boolean;\r\n\tentityId?: number;\r\n\tquestRewards?: readonly string[];\r\n\tquestRewardEntities?: readonly {\r\n\t\tcardId: string;\r\n\t\tavengeDefault?: number;\r\n\t\tavengeCurrent?: number;\r\n\t}[];\r\n\thand?: BoardEntity[];\r\n\tsecrets?: BoardSecret[];\r\n\tavengeCurrent?: number;\r\n\tavengeDefault?: number;\r\n\tglobalInfo?: BgsPlayerGlobalInfo;\r\n\r\n\tdeadEyeDamageDone?: number;\r\n\trapidReanimationMinion?: BoardEntity;\r\n\trapidReanimationIndexFromRight?: number;\r\n}\r\n\r\nexport interface BgsPlayerGlobalInfo {\r\n\tEternalKnightsDeadThisGame?: number;\r\n\tUndeadAttackBonus?: number;\r\n\tChoralAttackBuff?: number;\r\n\tChoralHealthBuff?: number;\r\n\tFrostlingBonus?: number;\r\n\tBloodGemAttackBonus?: number;\r\n\tBloodGemHealthBonus?: number;\r\n\tGoldrinnBuffAtk?: number;\r\n\tGoldrinnBuffHealth?: number;\r\n\tTavernSpellsCastThisGame?: number;\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"bgs-player-entity.js","sourceRoot":"","sources":["../src/bgs-player-entity.ts"],"names":[],"mappings":"","sourcesContent":["import { BoardEntity } from './board-entity';\r\nimport { BoardSecret } from './board-secret';\r\n\r\nexport interface BgsPlayerEntity {\r\n\treadonly cardId: string;\r\n\treadonly nonGhostCardId?: string;\r\n\treadonly hpLeft: number;\r\n\treadonly tavernTier: number;\r\n\treadonly heroPowerId?: string | undefined | null;\r\n\treadonly heroPowerUsed: boolean;\r\n\treadonly heroPowerInfo?: number | string;\r\n\treadonly heroPowerInfo2?: number;\r\n\tfriendly?: boolean;\r\n\tentityId?: number;\r\n\tquestRewards?: readonly string[];\r\n\tquestRewardEntities?: readonly {\r\n\t\tcardId: string;\r\n\t\tavengeDefault?: number;\r\n\t\tavengeCurrent?: number;\r\n\t}[];\r\n\thand?: BoardEntity[];\r\n\tsecrets?: BoardSecret[];\r\n\tavengeCurrent?: number;\r\n\tavengeDefault?: number;\r\n\tglobalInfo?: BgsPlayerGlobalInfo;\r\n\r\n\tdeadEyeDamageDone?: number;\r\n\trapidReanimationMinion?: BoardEntity;\r\n\trapidReanimationIndexFromRight?: number;\r\n}\r\n\r\nexport interface BgsPlayerGlobalInfo {\r\n\tEternalKnightsDeadThisGame?: number;\r\n\tUndeadAttackBonus?: number;\r\n\tChoralAttackBuff?: number;\r\n\tChoralHealthBuff?: number;\r\n\tFrostlingBonus?: number;\r\n\tBloodGemAttackBonus?: number;\r\n\tBloodGemHealthBonus?: number;\r\n\tGoldrinnBuffAtk?: number;\r\n\tGoldrinnBuffHealth?: number;\r\n\tTavernSpellsCastThisGame?: number;\r\n}\r\n"]}
|
|
@@ -24,6 +24,7 @@ const simulateAttack = (attackingBoard, attackingBoardHero, defendingBoard, defe
|
|
|
24
24
|
attackingEntity.attacking = true;
|
|
25
25
|
const attackingEntityIndex = attackingBoard.indexOf(attackingEntity);
|
|
26
26
|
const attackingEntitiesToTheLeft = attackingBoard.slice(0, attackingEntityIndex);
|
|
27
|
+
const isAttackingImmediately = attackingEntity.attackImmediately;
|
|
27
28
|
const numberOfAttacks = attackingEntity.windfury ? 2 : 1;
|
|
28
29
|
for (let i = 0; i < numberOfAttacks; i++) {
|
|
29
30
|
if (attackingBoard.length === 0 || defendingBoard.length === 0) {
|
|
@@ -41,7 +42,9 @@ const simulateAttack = (attackingBoard, attackingBoardHero, defendingBoard, defe
|
|
|
41
42
|
}
|
|
42
43
|
attackingEntity.attacking = false;
|
|
43
44
|
attackingEntity.hasAttacked = 1;
|
|
44
|
-
|
|
45
|
+
if (!isAttackingImmediately) {
|
|
46
|
+
attackingEntitiesToTheLeft.forEach((entity) => (entity.hasAttacked = 2));
|
|
47
|
+
}
|
|
45
48
|
}
|
|
46
49
|
};
|
|
47
50
|
exports.simulateAttack = simulateAttack;
|
|
@@ -685,12 +688,14 @@ const applyOnBeingAttackedBuffs = (attackerEntity, attackerBoard, attackerHero,
|
|
|
685
688
|
const indexFromRight = defendingBoard.length - (defendingBoard.indexOf(defendingEntity) + 1);
|
|
686
689
|
(0, spawns_1.performEntitySpawns)(candidateEntities, defendingBoard, defendingPlayerEntity, defendingEntity, indexFromRight, attackerBoard, attackerHero, gameState);
|
|
687
690
|
}
|
|
688
|
-
if ((secretTriggered = (_c = defendingPlayerEntity.secrets) === null || _c === void 0 ? void 0 : _c.find((secret) => !secret.triggered && (secret === null || secret === void 0 ? void 0 : secret.cardId) === "TB_Bacon_Secrets_02")) != null
|
|
691
|
+
if ((secretTriggered = (_c = defendingPlayerEntity.secrets) === null || _c === void 0 ? void 0 : _c.find((secret) => !secret.triggered && (secret === null || secret === void 0 ? void 0 : secret.cardId) === "TB_Bacon_Secrets_02")) != null &&
|
|
692
|
+
defendingBoard.length < 7) {
|
|
689
693
|
secretTriggered.triggered = true;
|
|
690
694
|
const candidateEntities = (0, deathrattle_spawns_1.spawnEntities)("EX1_554t", 3, defendingBoard, defendingPlayerEntity, attackerBoard, attackerHero, gameState.allCards, gameState.cardsData, gameState.sharedState, gameState.spectator, defendingEntity.friendly, false);
|
|
691
695
|
(0, spawns_1.performEntitySpawns)(candidateEntities, defendingBoard, defendingPlayerEntity, defendingEntity, 0, attackerBoard, attackerHero, gameState);
|
|
692
696
|
}
|
|
693
|
-
if ((secretTriggered = (_d = defendingPlayerEntity.secrets) === null || _d === void 0 ? void 0 : _d.find((secret) => !secret.triggered && (secret === null || secret === void 0 ? void 0 : secret.cardId) === "TB_Bacon_Secrets_01")) != null
|
|
697
|
+
if ((secretTriggered = (_d = defendingPlayerEntity.secrets) === null || _d === void 0 ? void 0 : _d.find((secret) => !secret.triggered && (secret === null || secret === void 0 ? void 0 : secret.cardId) === "TB_Bacon_Secrets_01")) != null &&
|
|
698
|
+
defendingBoard.length < 7) {
|
|
694
699
|
secretTriggered.triggered = true;
|
|
695
700
|
const candidateEntities = (0, deathrattle_spawns_1.spawnEntities)("BG_EX1_170", 1, defendingBoard, defendingPlayerEntity, attackerBoard, attackerHero, gameState.allCards, gameState.cardsData, gameState.sharedState, gameState.spectator, defendingEntity.friendly, false);
|
|
696
701
|
(0, spawns_1.performEntitySpawns)(candidateEntities, defendingBoard, defendingPlayerEntity, defendingEntity, 0, attackerBoard, attackerHero, gameState);
|