Skip to content

Commit 7e41395

Browse files
committed
Exxit: Add board labels
1 parent 4df4226 commit 7e41395

File tree

4 files changed

+22
-7
lines changed

4 files changed

+22
-7
lines changed

locales/en/apgames.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@
220220
"chase": "Currently, most exchange moves will need to be hand edited. We're working on fixing this.",
221221
"conspirateurs": "In the base game, pieces may move through sanctuaries as part of a multistep jump. They're not frozen until they end their move in a sanctuary. In the strict variant, pieces are frozen as soon as they enter a sanctuary.\n\nIn four-player games, players 1 and 2 are partnered, as are players 3 and 4.",
222222
"entropy": "In this implementation, the players play two games simultaneously but with a single shared stream of randomized pieces. Each player places a piece on their *opponent's* Order board and then makes a move on their *own* Order board; players thus act as both Order and Chaos at the same time. The player with the greatest score wins! Since both players had the exact same placement choices, this provides the cleanest measure of relative skill.",
223-
"exxit": "Because the board is built out as you play in irregular shapes, the hexes are labelled numerically instead of algebraically. We chose this so that the labels wouldn't change as the map grew. Because the labels aren't particularly helpful while you play, they are not displayed on the board. Also, translations of the rules tend to omit certain nuances. This implementation conforms with the original French edition of the rules.",
223+
"exxit": "Translations of the rules tend to omit certain nuances. This implementation conforms with the original French edition of the rules.\n\nBecause the board is built out as you play in irregular shapes, the hexes are labelled numerically instead of algebraically. This ensures that the labels don't change as the map grows.",
224224
"garden": "To make it very clear what happened on a previous turn, each move is displayed over four separate boards. The first board shows the game after the piece was first placed. The second board shows the state after adjacent pieces were flipped. The third board shows any harvests. The fourth board is the final game state and is where you make your moves.\n\nIn our implementation, black is always the \"tome\" or tie-breaker colour. The last player to harvest black will have a `0.1` after their score.",
225225
"gyges": "The goal squares are adjacent to all the cells in the back row. The renderer cannot currently handle \"floating\" cells.",
226226
"homeworlds": "The win condition is what's called \"Sinister Homeworlds.\" You only win by defeating the opponent to your left. If someone else does that, the game continues, but your left-hand opponent now shifts clockwise. For example, in a four-player game, if I'm South, then I win if I eliminate West. But if the North player ends up eliminating West, the game continues, but now my left-hand opponent is North.",

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
},
6363
"dependencies": {
6464
"@abstractplay/recranks": "latest",
65-
"@abstractplay/renderer": "^1.0.0-ci-14158434132.0",
65+
"@abstractplay/renderer": "^1.0.0-ci-14957079323.0",
6666
"@turf/boolean-contains": "^6.5.0",
6767
"@turf/boolean-intersects": "^6.5.0",
6868
"@turf/boolean-point-in-polygon": "^6.5.0",

src/games/exxit.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,6 +809,20 @@ export class ExxitGame extends GameBase {
809809
}
810810
}
811811

812+
const labelGrid: string[][] = [];
813+
for (let row = 0; row < height; row++) {
814+
const node: string[] = [];
815+
for (let col = 0; col < width; col++) {
816+
const found = [...this.board.values()].find(h => h.row + dy === row && h.col + dx === col);
817+
if (found === undefined) {
818+
node.push("");
819+
} else {
820+
node.push(found.uid);
821+
}
822+
}
823+
labelGrid.push(node);
824+
}
825+
812826
// Build piece string
813827
const p2piece: string[] = ["A","B"];
814828
const pieces: string[][] = [];
@@ -831,12 +845,13 @@ export class ExxitGame extends GameBase {
831845

832846
// Build rep
833847
const rep: APRenderRep = {
834-
options: ["hide-labels"],
835848
renderer: "stacking-offset",
836849
board: {
837850
style: (originHex.row + dy) % 2 === 0 ? "hex-even-p" : "hex-odd-p",
838851
width,
839852
height,
853+
labelGrid,
854+
labelOpacity: 0.5,
840855
blocked: blocked as [{row: number; col: number},...{row: number; col: number}[]],
841856
markers: [],
842857
},

0 commit comments

Comments
 (0)