count rerolls

This commit is contained in:
2025-05-11 03:31:37 +02:00
parent 3f4abed839
commit 12d57b9797

View File

@@ -83,6 +83,7 @@ type Game = {
logOwnerFinalJokers: string[] // Log owner's final jokers logOwnerFinalJokers: string[] // Log owner's final jokers
opponentFinalJokers: string[] // Opponent's final jokers opponentFinalJokers: string[] // Opponent's final jokers
events: LogEvent[] events: LogEvent[]
rerolls: number
} }
// Helper to initialize a new game object // Helper to initialize a new game object
@@ -111,6 +112,7 @@ const initGame = (id: number, startDate: Date): Game => ({
logOwnerFinalJokers: [], logOwnerFinalJokers: [],
opponentFinalJokers: [], opponentFinalJokers: [],
events: [], events: [],
rerolls: 0,
}) })
// Helper to format duration // Helper to format duration
@@ -471,6 +473,7 @@ export default function LogParser() {
}) })
} }
} }
currentGame.rerolls++
} else if (lineLower.includes('usedcard')) { } else if (lineLower.includes('usedcard')) {
// Log owner used card // Log owner used card
const match = line.match(/card:([^,\n]+)/i) const match = line.match(/card:([^,\n]+)/i)
@@ -662,6 +665,10 @@ export default function LogParser() {
: 'Guest'}{' '} : 'Guest'}{' '}
({ownerLabel}) ({ownerLabel})
</p> </p>
<p>
<strong>Rerolls:</strong>{' '}
{game.rerolls || 'Unknown'}
</p>
<p> <p>
<strong>Deck:</strong> {game.deck || 'Unknown'} <strong>Deck:</strong> {game.deck || 'Unknown'}
</p> </p>