Skip to content

Commit

Permalink
fix bugs with lady deathwhisper and sinrunner blanchy
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastientromp committed Jan 21, 2023
1 parent 174c092 commit 1c172a6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@firestone-hs/simulate-bgs-battle",
"version": "1.1.231",
"version": "1.1.233",
"description": "",
"scripts": {
"lint": "eslint --color --fix --ext .ts .",
Expand Down
4 changes: 2 additions & 2 deletions src/simulation/attack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1551,7 +1551,7 @@ const buildBoardAfterRebornSpawns = (
let entityToSpawn: BoardEntity = null;
// TODO: test
if (deadEntity.cardId === CardIds.SinrunnerBlanchy || deadEntity.cardId === CardIds.SinrunnerBlanchyBattlegrounds) {
entityToSpawn = { ...deadEntity, health: deadEntity.maxHealth };
entityToSpawn = { ...deadEntity, health: deadEntity.maxHealth, reborn: false };
}
const entitiesFromReborn: readonly BoardEntity[] =
deadEntity.reborn && deadMinionIndexFromRight >= 0
Expand Down Expand Up @@ -1586,7 +1586,7 @@ const buildBoardAfterRebornSpawns = (
sharedState,
spectator,
);
const numberOfTriggersForDeathwhisper = 1;
const numberOfTriggersForDeathwhisper = Math.min(entitiesFromReborn.length, 1);
for (let i = 0; i < numberOfTriggersForDeathwhisper; i++) {
boardWithKilledMinion
.filter((e) => e.cardId === CardIds.SisterDeathwhisper || e.cardId === CardIds.SisterDeathwhisperBattlegrounds)
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export const buildSingleBoardEntity = (
avengeDefault: cardsData.avengeValue(cardId),
} as BoardEntity);

if (spawnReborn) {
if (spawnReborn && !entityToSpawn) {
newEntity.health = 1;
newEntity.reborn = false;
}
Expand Down

0 comments on commit 1c172a6

Please sign in to comment.