How to build the king piece
- User
How to build the king piece
- Assistant
To build the King piece (referred to as the "Marshal", symbol
帥) in the Gungi game, we can derive the necessary steps from the provided repository files and code.Key Observations:
-
The Marshal piece is referred to as
帥in the codebase. -
The
symbolToNameMap.tsfile maps this symbol to the name "MARSHAL":tscase '帥': return '[Redacted Person]'; -
The Marshal's placement is tracked in the game state. In
GungiGame.tsx, themarshallPlacedstate is used to check whether the Marshal has been placed:tsxsetMarshallPlaced( orientation === 'black' ? gameState?.stockpile_black.find((x) => x.piece.type === '帥')?.amount === 0 : gameState?.stockpile_white.find((x) => x.piece.type === '帥')?.amount === 0 );This means the Marshal is initially part of the stockpile. When it is successfully placed on the board, its amount in the stockpile reduces to 0.
Steps to Build the King (Marshal) Piece:
From the provided code context, here’s how you can build and place the Marshal piece in the game:
-
Ensure the Marshal is Available in the Stockpile
- The Marshal starts in the player's stockpile (
stockpile_blackorstockpile_whitedepending on the player). - Check the stockpile to confirm the Marshal is present. The
stockpilecontains an array of pieces, each with atypeand anamount. For example:json{ "type": "帥", "amount": 1 } - If
amountis 1, the Marshal is available to be placed. Ifamountis 0, the Marshal has already been placed on the board.
- The Marshal starts in the player's stockpile (
-
Place the Marshal on the Board
- During the Draft Phase, use the PLACE action to position the Marshal on a valid square on the board.
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.