Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions locales/en/apgames.json
Original file line number Diff line number Diff line change
Expand Up @@ -5108,6 +5108,7 @@
"INITIAL_INSTRUCTIONS": "Select a friendly piece and use it to jump over another piece, or pass your turn.",
"INSTRUCTIONS": "An action is either a backward movement to an adjacent empty cell or a sequence of short-jumps over pieces of either color. The sequence of jumps must start inside the player's home-base. Each player makes two actions or just passes their turn.",
"NEXT_ACTION": "After moving the first piece, just click on the second stone to start moving or jumping.",
"INCOMPLETE_ACTION": "The first piece did not move; cannot start moving the second piece yet!",
"NONEXISTENT": "Trying to interact with a friendly piece that doesn't exist at {{where}}!",
"ILLEGAL_JUMP": "The sequence of jumps must start inside the player's home-base!",
"TOO_MANY_ACTIONS": "This number of actions is not allowed; only one action is allowed at first, then two.",
Expand Down
7 changes: 7 additions & 0 deletions src/games/halmaclimbers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,13 @@ export class HalmaClimbersGame extends GameBase {
return result;
}

// player didn't move the first piece, and already started with the second
if ( actions.length === 2 && !actions[0].includes("-") ) {
result.valid = false;
result.message = i18next.t("apgames:validation.halmaclimbers.INCOMPLETE_ACTION");
return result;
}

// need to move through all the moves, and check if they follow the rules
// for that we need a copy of the board, to keep the effects of the previous actions
const clone = new Map(this.board);
Expand Down
Loading