From: Christian Heller <c.heller@plomlompom.de> Date: Mon, 7 Dec 2020 05:58:53 +0000 (+0100) Subject: Widen face and hat. X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/static/%7B%7Bdb.prefix%7D%7D/todo?a=commitdiff_plain;h=88c8acab582aeb25735d86b78defe28441439cba;p=plomrogue2 Widen face and hat. --- diff --git a/plomrogue/commands.py b/plomrogue/commands.py index a36f9e6..7544c06 100644 --- a/plomrogue/commands.py +++ b/plomrogue/commands.py @@ -318,22 +318,26 @@ def cmd_PLAYER_FACE(game, face, connection_id): t = game.get_player(connection_id) if not t: raise GameError('can only draw face when already logged in') - if len(face) != 9: + if len(face) != 18: raise GameError('wrong face string length') game.faces[t.name] = face game.changed = True cmd_PLAYER_FACE.argtypes = 'string' def cmd_GOD_PLAYER_FACE(game, name, face): + if len(face) != 18: + raise GameError('wrong face string length') game.faces[name] = face cmd_GOD_PLAYER_FACE.argtypes = 'string string' def cmd_GOD_PLAYER_HAT(game, name, hat): + if len(hat) != 18: + raise GameError('wrong hat string length') game.hats[name] = hat cmd_GOD_PLAYER_HAT.argtypes = 'string string' def cmd_THING_HAT_DESIGN(game, thing_id, design): - if len(design) != 9: + if len(design) != 18: raise GameError('hat design of wrong length') t = game.get_thing(thing_id) if not t: diff --git a/plomrogue/game.py b/plomrogue/game.py index 5e206b9..47f09d1 100755 --- a/plomrogue/game.py +++ b/plomrogue/game.py @@ -206,7 +206,7 @@ class Game(GameBase): if t.name in self.faces: return self.faces[t.name] else: - return 'O O' + ' v ' + '>-<' + return '/O O\\' + '| oo |' + '\\>--</' return None def send_gamestate(self, connection_id=None): diff --git a/plomrogue/things.py b/plomrogue/things.py index 32d7854..53837e3 100644 --- a/plomrogue/things.py +++ b/plomrogue/things.py @@ -167,7 +167,7 @@ class Thing_BottleSpawner(ThingSpawner): class Thing_Hat(Thing): symbol_hint = 'H' portable = True - design = ' X X ===' + design = ' +--+ ' + ' | | ' + '======' @@ -178,7 +178,7 @@ class Thing_HatRemixer(Thing): import string new_design = '' legal_chars = string.ascii_letters + string.digits + string.punctuation + ' ' - for i in range(9): + for i in range(18): new_design += random.choice(list(legal_chars)) hat.design = new_design self.sound('HAT REMIXER', 'remixing a hat â¦') diff --git a/rogue_chat.html b/rogue_chat.html index 1b5f39d..7d2747e 100644 --- a/rogue_chat.html +++ b/rogue_chat.html @@ -126,8 +126,8 @@ keyboard input/control: <span id="keyboard_control"></span> </div> <script> "use strict"; -let websocket_location = "wss://plomlompom.com/rogue_chat/"; -//let websocket_location = "ws://localhost:8001/"; +//let websocket_location = "wss://plomlompom.com/rogue_chat/"; +let websocket_location = "ws://localhost:8000/"; let mode_helps = { 'play': { @@ -167,7 +167,7 @@ let mode_helps = { 'enter_face': { 'short': 'enter your face', 'intro': '@ enter face line (enter nothing to abort):', - 'long': 'Draw your face as ASCII art. The string you enter must be 9 characters long, and will be divided on display into three lines of three characters each, from top to bottom..' + 'long': 'Draw your face as ASCII art. The string you enter must be 18 characters long, and will be divided on display into 3 lines of 6 characters each, from top to bottom..' }, 'write': { 'short': 'change terrain', @@ -1345,14 +1345,14 @@ let explorer = { } info_to_cache += " / protection: " + protection + "\n"; if (t.hat) { - info_to_cache += t.hat.slice(0, 3) + '\n'; - info_to_cache += t.hat.slice(3, 6) + '\n'; - info_to_cache += t.hat.slice(6, 9) + '\n'; + info_to_cache += t.hat.slice(0, 6) + '\n'; + info_to_cache += t.hat.slice(6, 12) + '\n'; + info_to_cache += t.hat.slice(12, 18) + '\n'; } if (t.face) { - info_to_cache += t.face.slice(0, 3) + '\n'; - info_to_cache += t.face.slice(3, 6) + '\n'; - info_to_cache += t.face.slice(6, 9) + '\n'; + info_to_cache += t.face.slice(0, 6) + '\n'; + info_to_cache += t.face.slice(6, 12) + '\n'; + info_to_cache += t.face.slice(12, 18) + '\n'; } } } @@ -1448,7 +1448,7 @@ tui.inputEl.addEventListener('keydown', (event) => { server.send(['LOGIN', tui.inputEl.value]); tui.inputEl.value = ""; } else if (tui.mode.name == 'enter_face' && event.key == 'Enter') { - if (tui.inputEl.value.length != 9) { + if (tui.inputEl.value.length != 18) { tui.log_msg('? wrong input length, aborting'); } else { server.send(['PLAYER_FACE', tui.inputEl.value]); @@ -1555,7 +1555,7 @@ tui.inputEl.addEventListener('keydown', (event) => { server.send(["TASK:DOOR"]); } else if (event.key === tui.keys.install && tui.task_action_on('install')) { server.send(["TASK:INSTALL"]); - } else if (event.key === tui.keys.install && tui.task_action_on('wear')) { + } else if (event.key === tui.keys.wear && tui.task_action_on('wear')) { server.send(["TASK:WEAR"]); } else if (event.key in tui.movement_keys && tui.task_action_on('move')) { server.send(['TASK:MOVE', tui.movement_keys[event.key]]); diff --git a/rogue_chat_curses.py b/rogue_chat_curses.py index ff00b50..efddaf6 100755 --- a/rogue_chat_curses.py +++ b/rogue_chat_curses.py @@ -49,7 +49,7 @@ mode_helps = { 'enter_face': { 'short': 'enter your face', 'intro': '@ enter face line (enter nothing to abort):', - 'long': 'Draw your face as ASCII art. The string you enter must be 9 characters long, and will be divided on display into three lines of three characters each, from top to bottom..' + 'long': 'Draw your face as ASCII art. The string you enter must be 18 characters long, and will be divided on display into 3 lines of 6 characters each, from top to bottom..' }, 'write': { 'short': 'change terrain', @@ -716,13 +716,13 @@ class TUI: protection = 'none' info_to_cache += ' / protection: %s\n' % protection if hasattr(t, 'hat'): - info_to_cache += t.hat[0:3] + '\n' - info_to_cache += t.hat[3:6] + '\n' - info_to_cache += t.hat[6:9] + '\n' + info_to_cache += t.hat[0:6] + '\n' + info_to_cache += t.hat[6:12] + '\n' + info_to_cache += t.hat[12:18] + '\n' if hasattr(t, 'face'): - info_to_cache += t.face[0:3] + '\n' - info_to_cache += t.face[3:6] + '\n' - info_to_cache += t.face[6:9] + '\n' + info_to_cache += t.face[0:6] + '\n' + info_to_cache += t.face[6:12] + '\n' + info_to_cache += t.face[12:18] + '\n' terrain_char = self.game.map_content[pos_i] terrain_desc = '?' if terrain_char in self.game.terrains: @@ -1069,7 +1069,7 @@ class TUI: self.send('LOGIN ' + quote(self.input_)) self.input_ = "" elif self.mode.name == 'enter_face' and key == '\n': - if len(self.input_) != 9: + if len(self.input_) != 18: self.log_msg('? wrong input length, aborting') else: self.send('PLAYER_FACE %s' % quote(self.input_))