'intro': '@ enter face line (enter nothing to abort):',
'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..'
},
+ 'enter_hat': {
+ 'short': 'enter your hat',
+ 'intro': '@ enter hat line (enter nothing to abort):',
+ 'long': 'Draw your hat 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',
'intro': '',
game.player_id = player_id
cmd_PLAYER_ID.argtypes = 'int:nonneg'
+def cmd_PLAYERS_HAT_CHARS(game, hat_chars):
+ game.players_hat_chars_new = hat_chars
+cmd_PLAYERS_HAT_CHARS.argtypes = 'string'
+
def cmd_THING(game, yx, thing_type, protection, thing_id, portable, commandable):
t = game.get_thing_temp(thing_id)
if not t:
game.map_content = game.map_content_new
game.map_control_content = game.map_control_content_new
game.player = game.get_thing(game.player_id)
+ game.players_hat_chars = game.players_hat_chars_new
game.turn_complete = True
if game.tui.mode.name == 'post_login_wait':
game.tui.switch_mode('play')
self.register_command(cmd_PORTAL)
self.register_command(cmd_ANNOTATION)
self.register_command(cmd_GAME_STATE_COMPLETE)
+ self.register_command(cmd_PLAYERS_HAT_CHARS)
self.register_command(cmd_ARGUMENT_ERROR)
self.register_command(cmd_GAME_ERROR)
self.register_command(cmd_PLAY_ERROR)
self.register_command(cmd_DEFAULT_COLORS)
self.register_command(cmd_RANDOM_COLORS)
self.map_content = ''
+ self.players_hat_chars = ''
self.player_id = -1
self.annotations = {}
self.annotations_new = {}
mode_take_thing = Mode('take_thing', has_input_prompt=True)
mode_drop_thing = Mode('drop_thing', has_input_prompt=True)
mode_enter_face = Mode('enter_face', has_input_prompt=True)
+ mode_enter_hat = Mode('enter_hat', has_input_prompt=True)
is_admin = False
tile_draw = False
self.mode_control_tile_draw.available_actions = ["move_explorer",
"toggle_tile_draw"]
self.mode_edit.available_modes = ["write", "annotate", "portal",
- "name_thing", "enter_face", "password",
+ "name_thing", "enter_face", "enter_hat", "password",
"chat", "study", "play", "admin_enter"]
self.mode_edit.available_actions = ["move", "flatten", "install",
"toggle_map_mode"]
'switch_to_admin_thing_protect': 'T',
'flatten': 'F',
'switch_to_enter_face': 'f',
+ 'switch_to_enter_hat': 'H',
'switch_to_take_thing': 'z',
'switch_to_drop_thing': 'u',
'teleport': 'p',
['HERE'] + list(self.game.tui.movement_keys.values())
for i in range(len(self.selectables)):
self.log_msg(str(i) + ': ' + self.selectables[i])
+ elif self.mode.name == 'enter_hat':
+ self.log_msg('legal characters: ' + self.game.players_hat_chars)
elif self.mode.name == 'command_thing':
self.send('TASK:COMMAND ' + quote('HELP'))
elif self.mode.name == 'control_pw_pw':
self.send('PLAYER_FACE %s' % quote(self.input_))
self.input_ = ""
self.switch_mode('edit')
+ elif self.mode.name == 'enter_hat' and key == '\n':
+ if len(self.input_) != 18:
+ self.log_msg('? wrong input length, aborting')
+ else:
+ self.send('PLAYER_HAT %s' % quote(self.input_))
+ self.input_ = ""
+ self.switch_mode('edit')
elif self.mode.name == 'take_thing' and key == '\n':
pick_selectable('PICK_UP')
elif self.mode.name == 'drop_thing' and key == '\n':