Skip to content

Commit

Permalink
fix(core): copy behavior for joker effects
Browse files Browse the repository at this point in the history
Fix a bug where joker constellations like [The Idol, Blueprint, The Idol] would count The Idol four instead of three times.
  • Loading branch information
kleinfreund committed Apr 10, 2024
1 parent 001ae55 commit 9bda527
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib/balatro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,8 @@ function scoreJokerCardEffect (effect: JokerCardEffect | undefined, { state, sco
.map(({ index }) => state.jokers[index + 1])
.filter(notNullish)

for (const { name } of blueprintTargets) {
if (name === joker.name) triggers.push(`Blueprint copying ${joker.name}`)
for (const { index } of blueprintTargets) {
if (index === joker.index) triggers.push(`Blueprint copying ${joker.name}`)
}

// Increase triggers from Brainstorm
Expand All @@ -344,8 +344,8 @@ function scoreJokerCardEffect (effect: JokerCardEffect | undefined, { state, sco
.map(() => state.jokers[0])
.filter(notNullish)

for (const { name } of brainstormTargets) {
if (name === joker.name) triggers.push(`Brainstorm copying ${joker.name}`)
for (const { index } of brainstormTargets) {
if (index === joker.index) triggers.push(`Brainstorm copying ${joker.name}`)
}

for (let trigger = 0; trigger < triggers.length; trigger++) {
Expand Down

0 comments on commit 9bda527

Please sign in to comment.