From 0d6e4ded54a3cff9ec068dc329796b781b9d7e16 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Sun, 25 Oct 2020 05:11:32 +0100 Subject: [PATCH] Prohibit movement over non-dot map cells --- new2/plomrogue/tasks.py | 2 ++ new2/rogue_chat.html | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/new2/plomrogue/tasks.py b/new2/plomrogue/tasks.py index fffb36a..e600122 100644 --- a/new2/plomrogue/tasks.py +++ b/new2/plomrogue/tasks.py @@ -36,6 +36,8 @@ class Task_MOVE(Task): test_pos = self.get_move_target() if test_pos is None: raise GameError('would move out of map') + elif self.thing.game.map[test_pos] != '.': + raise GameError('would move into illegal territory') def do(self): self.thing.position = self.get_move_target() diff --git a/new2/rogue_chat.html b/new2/rogue_chat.html index a3d5095..6b37d6c 100644 --- a/new2/rogue_chat.html +++ b/new2/rogue_chat.html @@ -169,11 +169,12 @@ tui.log_msg("LOGIN USER - register as USER", 3); tui.log_msg("ALL TEXT - send TEXT to all users", 3); tui.log_msg("QUERY USER TEXT - send TEXT to USER", 3); tui.log_msg(""); -tui.log_msg("Use arrow keys to move your avatar", 1); +tui.log_msg("Use arrow keys to move your avatar. You can only move over \".\" map cells.", 1); tui.log_msg(""); tui.log_msg("Use double quotes for strings that contain whitespace, escape them with \\.", 1); tui.log_msg(""); -tui.log_msg("To write on the map, hit Return on a single visible ASCII character in the input prompt", 1); +tui.log_msg("To change the map cell you are standing on, type the desired ASCII character into the prompt and hit Return.", 1); +tui.log_msg(""); document.addEventListener('keydown', (event) => { if (chat.input_line === '') { -- 2.30.2