From 9bda527ec95baede2299d4d2b936c4ac8feffb15 Mon Sep 17 00:00:00 2001 From: kleinfreund Date: Wed, 10 Apr 2024 21:22:27 +0200 Subject: [PATCH] fix(core): copy behavior for joker effects Fix a bug where joker constellations like [The Idol, Blueprint, The Idol] would count The Idol four instead of three times. --- src/lib/balatro.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/balatro.ts b/src/lib/balatro.ts index fb89bdf..8a0254e 100644 --- a/src/lib/balatro.ts +++ b/src/lib/balatro.ts @@ -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 @@ -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++) {