From 8755434e50f4e34cc135b0e939894472d7b331a4 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 17 Dec 2022 20:22:36 +0100 Subject: Stone Kremlin. --- rules.js | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) (limited to 'rules.js') diff --git a/rules.js b/rules.js index 54282bb..a1ecda7 100644 --- a/rules.js +++ b/rules.js @@ -3821,27 +3821,40 @@ function goto_stone_kremlin() { log("Stone Kremlin.") - if (count_walls() > 0) + if (count_walls() > 0) { game.state = "stone_kremlin" - else + game.count = 1 + } else { end_stone_kremlin() + } } states.stone_kremlin = { prompt() { - if (count_walls() === 4) { - view.prompt = `Stone Kremlin: You must remove one Walls marker.` + let here = get_lord_locale(game.command) + if (game.count > 0) { + if (count_walls() === 4) { + view.prompt = `Stone Kremlin: Move one Walls marker.` + } else { + view.prompt = `Stone Kremlin: Place or move Walls.` + gen_action_locale(here) + } + for (let loc of game.locales.walls) + gen_action_locale(loc) } else { - view.prompt = `Stone Kremlin: You may remove one Walls marker.` - view.actions.pass = 1 + view.prompt = `Stone Kremlin: Place Walls.` + gen_action_locale(here) } - for (let wall of game.locales.walls) - gen_action_locale(wall) }, locale(loc) { - log(`Removed Walls at %${loc}.`) - remove_walls(loc) - end_stone_kremlin() + let here = get_lord_locale(game.command) + if (loc !== here) { + log(`Removed Walls at %${loc}.`) + remove_walls(loc) + game.count = 0 + } else { + end_stone_kremlin() + } }, pass() { end_stone_kremlin() -- cgit v1.2.3