diff --git a/locales/en/apgames.json b/locales/en/apgames.json index f6d925c70..54b72be40 100644 --- a/locales/en/apgames.json +++ b/locales/en/apgames.json @@ -3208,7 +3208,7 @@ "INITIAL_INSTRUCTIONS": "Click one of your pieces to select it.", "INITIAL_INSTRUCTIONS_PIE": "Click one of your pieces to select it, or use the pie rule to swap sides.", "NOT_ADJACENT": "A piece can only move to an adjacent empty cell.", - "NO_PASS": "You cannot pass in this game.", + "NO_PASS": "You cannot pass in this game. Swapping sides (the pie rule) is only available to the second player, right after the first move.", "PARTIAL": "Click an adjacent empty cell to move the selected piece there.", "PIE": "Use the pie rule and swap sides.", "PIE_UNAVAILABLE": "The pie rule can only be used by the second player right after the first move." diff --git a/src/games/selfo.ts b/src/games/selfo.ts index ed1b4f378..a09e40114 100644 --- a/src/games/selfo.ts +++ b/src/games/selfo.ts @@ -11,7 +11,7 @@ export const gameApgamesEn = { INITIAL_INSTRUCTIONS: "Click one of your pieces to select it.", INITIAL_INSTRUCTIONS_PIE: "Click one of your pieces to select it, or use the pie rule to swap sides.", NOT_ADJACENT: "A piece can only move to an adjacent empty cell.", - NO_PASS: "You cannot pass in this game.", + NO_PASS: "You cannot pass in this game. Swapping sides (the pie rule) is only available to the second player, right after the first move.", PARTIAL: "Click an adjacent empty cell to move the selected piece there.", PIE: "Use the pie rule and swap sides.", PIE_UNAVAILABLE: "The pie rule can only be used by the second player right after the first move.", @@ -218,7 +218,7 @@ export class SelfoGame extends GameBase { }, ], categories: ["goal>connect", "mechanic>move", "mechanic>random>setup", "board>shape>hex", "board>connect>hex", "components>simple>1per"], - flags: ["experimental", "pie", "random-start", "custom-buttons"], + flags: ["experimental", "pie", "random-start"], variants: [ { uid: "r2f5", group: "board" }, { uid: "#board" }, @@ -341,15 +341,6 @@ export class SelfoGame extends GameBase { return !this.gameover && this.stack.length === 2 && this.currplayer === 2; } - /** The pie rule is offered as a button on the second player's first turn. */ - public getButtons(): Array<{label: string; move: string}> { - if (this.isPieTurn()) { - // the button sends "pass" (like Asli's pie button), which is accepted as "pie" - return [{label: "apgames:buttons.swap", move: "pass"}]; - } - return []; - } - public moves(player?: playerid): string[] { if (this.gameover) { return []; } if (player === undefined) { diff --git a/test/games/selfo.test.ts b/test/games/selfo.test.ts index 098a589d8..14430ff61 100644 --- a/test/games/selfo.test.ts +++ b/test/games/selfo.test.ts @@ -179,16 +179,7 @@ describe("Selfo", () => { expect(game.validateMove("pie").valid).to.be.true; }); - it("shows a pie button only on that turn", () => { - const game = new SelfoGame(undefined, ["r2f5"]); - expect(game.getButtons()).to.deep.equal([]); - game.move(firstMove(game)); - expect(game.getButtons()).to.deep.equal([{label: "apgames:buttons.swap", move: "pass"}]); - game.move("pie"); - expect(game.getButtons()).to.deep.equal([]); - }); - - it("accepts the pie button's pass and plays it as pie", () => { + it("plays the generic Pass button as pie on the pie turn", () => { const game = new SelfoGame(undefined, ["r2f5"]); expect(game.handleClick("", -1, -1, "_btn_pass").valid).to.be.false; game.move(firstMove(game));