diff --git a/src/lib/calculateScore.test.ts b/src/lib/calculateScore.test.ts index dc38667..751963c 100644 --- a/src/lib/calculateScore.test.ts +++ b/src/lib/calculateScore.test.ts @@ -49,6 +49,7 @@ describe('calculateScore', async () => { (await import('./test-files/033.ts')).default('Run from 2024-04-10 16:52 UTC'), (await import('./test-files/034.ts')).default('Run from 2024-04-09 19:20 UTC'), (await import('./test-files/035.ts')).default('https://www.youtube.com/watch?v=hcZF7NJGuPE'), + (await import('./test-files/036.ts')).default('Regression test for #17'), ])('$message', ({ initialState, expected }) => { const score = calculateScore(getState(initialState)) diff --git a/src/lib/calculateScore.ts b/src/lib/calculateScore.ts index 895816d..3bdcb90 100644 --- a/src/lib/calculateScore.ts +++ b/src/lib/calculateScore.ts @@ -205,7 +205,8 @@ function getScore (state: State, playedHand: HandName, scoringCards: Card[], luc case 'steel': { score.push({ multiplier: ['*', 1.5], - phase: 'held-cards', card, + phase: 'held-cards', + card, type: 'enhancement', trigger, }) @@ -327,14 +328,6 @@ function getHeldCardTriggers ({ state, card }: { state: State, card: Card }): st triggers.push(name) break } - case 'Seltzer': { - triggers.push(name) - break - } - case 'Sock and Buskin': { - if (isFaceCard(card, state.jokerSet.has('Pareidolia'))) triggers.push(name) - break - } } } diff --git a/src/lib/data.ts b/src/lib/data.ts index d171dbb..508769e 100644 --- a/src/lib/data.ts +++ b/src/lib/data.ts @@ -89,8 +89,6 @@ export const PLAYED_CARD_RETRIGGER_JOKER_NAMES: JokerName[] = [ 'Hack', ] export const HELD_CARD_RETRIGGER_JOKER_NAMES: JokerName[] = [ - 'Seltzer', - 'Sock and Buskin', 'Mime', ] diff --git a/src/lib/test-files/036.ts b/src/lib/test-files/036.ts new file mode 100644 index 0000000..1c4ee90 --- /dev/null +++ b/src/lib/test-files/036.ts @@ -0,0 +1,28 @@ +import type { TestCase } from '#lib/calculateScore.test.ts' + +export default (message: string): TestCase => { + return { + message, + initialState: { + cards: [ + { played: true, rank: 'Queen', suit: 'Diamonds' }, + { rank: 'Queen', suit: 'Hearts', enhancement: 'steel' }, + ], + jokers: [ + { name: 'Sock and Buskin' }, + { name: 'Seltzer' }, + ], + }, + expected: { + hand: 'High Card', + scoringCards: [ + { rank: 'Queen', suit: 'Diamonds' }, + ], + scores: [ + { score: '52.5', formattedScore: '53', luck: 'none' }, + { score: '52.5', formattedScore: '53', luck: 'average' }, + { score: '52.5', formattedScore: '53', luck: 'all' }, + ], + }, + } +}