Skip to content

Commit 3e11e84

Browse files
committed
Cubeo: Add too many dice message
1 parent 56e8256 commit 3e11e84

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

locales/en/apgames.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3259,6 +3259,7 @@
32593259
"BAD_MOVE_strict": "When moving, the die must move its full distance (though it may backtrack at any point), end in a space that keeps the formation connected, and it must change the formation (meaning you can't move such that you simply create a rotation or reflection of the starting formation).",
32603260
"BAD_PLACE": "You may only place new dice such that they share an edge with at least one of your own dice and do not share *any* edges with opposing dice. The die must also be able to be slid into the formation from the outside.",
32613261
"INITIAL_INSTRUCTIONS": "Click an empty cell to place a new die or one of your own dice to start a move or merge.",
3262+
"MAX_DICE": "You may only have six dice on the board.",
32623263
"PINNED": "Pinned dice can't act."
32633264
},
32643265
"dagnacht": {

src/games/cubeo.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,9 +322,15 @@ export class CubeoGame extends GameBase {
322322

323323
// validate placements
324324
if (m.startsWith("+")) {
325-
result.valid = false;
326-
result.message = i18next.t("apgames:validation.cubeo.BAD_PLACE");
327-
return result;
325+
if (this.diceInHand(this.currplayer) === 0) {
326+
result.valid = false;
327+
result.message = i18next.t("apgames:validation.cubeo.MAX_DICE");
328+
return result;
329+
} else {
330+
result.valid = false;
331+
result.message = i18next.t("apgames:validation.cubeo.BAD_PLACE");
332+
return result;
333+
}
328334
}
329335
// then moves and merges
330336
else {

0 commit comments

Comments
 (0)