"command_thing", "take_thing",
"drop_thing"]
self.mode_play.available_actions = ["move", "teleport", "door", "consume",
- "install", "wear"]
+ "install", "wear", "spin"]
self.mode_study.available_modes = ["chat", "play", "admin_enter", "edit"]
self.mode_study.available_actions = ["toggle_map_mode", "move_explorer"]
self.mode_admin.available_modes = ["admin_thing_protect", "control_pw_type",
'door': 'D',
'install': 'I',
'wear': 'W',
+ 'spin': 'S',
'help': 'h',
'toggle_map_mode': 'L',
'toggle_tile_draw': 'm',
'wear': '(un-)wear',
'door': 'open/close',
'consume': 'consume',
+ 'spin': 'spin',
}
action_tasks = {
'move': 'MOVE',
'command': 'COMMAND',
'consume': 'INTOXICATE',
+ 'spin': 'SPIN',
}
curses.curs_set(False) # hide cursor
self.do_refresh = True
except curses.error:
continue
- self.show_help = False
+ keycode = None
+ if len(key) == 1:
+ keycode = ord(key)
if key == 'KEY_RESIZE':
reset_screen_size()
elif self.mode.has_input_prompt and key == 'KEY_BACKSPACE':
self.input_ = self.input_[:-1]
- elif self.mode.has_input_prompt and key == '\n' and self.input_ == ''\
- and self.mode.name in {'chat', 'command_thing', 'take_thing',
- 'drop_thing', 'admin_enter'}:
- if self.mode.name != 'chat':
+ elif (((not self.mode.is_intro) and keycode == 27) # Escape
+ or (self.mode.has_input_prompt and key == '\n'
+ and self.input_ == ''\
+ and self.mode.name in {'chat', 'command_thing',
+ 'take_thing', 'drop_thing',
+ 'admin_enter'})):
+ if self.mode.name not in {'chat', 'play', 'study', 'edit'}:
self.log_msg('@ aborted')
self.switch_mode('play')
elif self.mode.has_input_prompt and key == '\n' and self.input_ == '/help':
self.send('TASK:INSTALL')
elif key == self.keys['wear'] and task_action_on('wear'):
self.send('TASK:WEAR')
+ elif key == self.keys['spin'] and task_action_on('spin'):
+ self.send('TASK:SPIN')
elif key == self.keys['teleport']:
player = self.game.get_thing(self.game.player_id)
if player.position in self.game.portals: