From abeb69971c88925af5fd177c643763b63d21f8c2 Mon Sep 17 00:00:00 2001 From: Jacob Egner Date: Sun, 24 May 2026 13:03:12 -0500 Subject: [PATCH 1/2] Add move-card progress punctuation to piece indicator --- e2e/piece-indicator-animation.spec.ts | 7 ++++++- src/components/PlayArea.tsx | 16 ++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/e2e/piece-indicator-animation.spec.ts b/e2e/piece-indicator-animation.spec.ts index 8c15ed7..7a3544e 100644 --- a/e2e/piece-indicator-animation.spec.ts +++ b/e2e/piece-indicator-animation.spec.ts @@ -43,7 +43,12 @@ const seedRedoWithIndicatorChange = async (page: Page): Promise = const isNormalPlayer = pieceId === 'player1' || pieceId === 'player2'; const texts = [] as string[]; if (isNormalPlayer) { - texts.push(Math.floor(state.pieceMoveCards(pieceId)).toString()); + const moveCards = state.pieceMoveCards(pieceId); + const roundedDownMoveCards = Math.floor(moveCards); + const roundedThirdsProgress = ((Math.round(moveCards * 3) % 3) + 3) % 3; + const lootActionsAwayFromNextFullMoveCard = (3 - roundedThirdsProgress) % 3; + const suffix = lootActionsAwayFromNextFullMoveCard === 1 ? ':' : lootActionsAwayFromNextFullMoveCard === 2 ? '.' : ''; + texts.push(`${roundedDownMoveCards}${suffix}`); } texts.push(pieceLabels[pieceId]); texts.push(state.pieceAttackStrength(pieceId).toString()); diff --git a/src/components/PlayArea.tsx b/src/components/PlayArea.tsx index c34817d..447e4f3 100644 --- a/src/components/PlayArea.tsx +++ b/src/components/PlayArea.tsx @@ -77,8 +77,17 @@ const getLivePieceIndicators = (gameState: GameStateHandle | null, pieceId: Piec return { top: null, bottom: null }; } const isNormalPlayer = pieceId === 'player1' || pieceId === 'player2'; + const getNormalPlayerMoveCardIndicator = () => { + const moveCards = gameState.pieceMoveCards(pieceId); + const roundedDownMoveCards = Math.floor(moveCards); + const roundedThirdsProgress = ((Math.round(moveCards * 3) % 3) + 3) % 3; + const lootActionsAwayFromNextFullMoveCard = (3 - roundedThirdsProgress) % 3; + const suffix = + lootActionsAwayFromNextFullMoveCard === 1 ? ':' : lootActionsAwayFromNextFullMoveCard === 2 ? '.' : ''; + return `${formatPlayerInteger(roundedDownMoveCards)}${suffix}`; + }; return { - top: isNormalPlayer ? formatPlayerInteger(Math.floor(gameState.pieceMoveCards(pieceId))) : null, + top: isNormalPlayer ? getNormalPlayerMoveCardIndicator() : null, bottom: formatPlayerInteger(gameState.pieceAttackStrength(pieceId)), }; }; @@ -4144,7 +4153,10 @@ function PlayArea() {

Piece Indicators

The small numbers on the pieces give quick reminders of movement and attack strength.