<button id="drop_thing"></button>
<button id="door"></button>
<button id="consume"></button>
+ <button id="switch_to_command_thing"></button>
<button id="teleport"></button>
</td>
</tr>
<li><input id="key_switch_to_edit" type="text" value="E" />
<li><input id="key_switch_to_write" type="text" value="m" />
<li><input id="key_switch_to_name_thing" type="text" value="N" />
+<li><input id="key_switch_to_command_thing" type="text" value="O" />
<li><input id="key_switch_to_password" type="text" value="P" />
<li><input id="key_switch_to_admin_enter" type="text" value="A" />
<li><input id="key_switch_to_control_pw_type" type="text" value="C" />
'short': 'name thing',
'long': 'Give name to/change name of thing here.'
},
+ 'command_thing': {
+ 'short': 'command thing',
+ 'long': 'Enter a command to the thing you carry. Enter nothing to return to play mode.'
+ },
'admin_thing_protect': {
'short': 'change thing protection',
'long': 'Change protection character for thing here.'
} else if (tokens[0] === 'TASKS') {
game.tasks = tokens[1].split(',');
tui.mode_write.legal = game.tasks.includes('WRITE');
+ tui.mode_command_thing.legal = game.tasks.includes('WRITE');
} else if (tokens[0] === 'THING_TYPE') {
game.thing_types[tokens[1]] = tokens[2]
} else if (tokens[0] === 'TERRAIN') {
tui.full_refresh();
} else if (tokens[0] === 'CHAT') {
tui.log_msg('# ' + tokens[1], 1);
+ } else if (tokens[0] === 'REPLY') {
+ tui.log_msg('#MUSICPLAYER: ' + tokens[1], 1);
} else if (tokens[0] === 'PLAYER_ID') {
game.player_id = parseInt(tokens[1]);
} else if (tokens[0] === 'LOGIN_OK') {
mode_portal: new Mode('portal', true, true),
mode_password: new Mode('password', true),
mode_name_thing: new Mode('name_thing', true, true),
+ mode_command_thing: new Mode('command_thing', true),
mode_admin_enter: new Mode('admin_enter', true),
mode_admin: new Mode('admin'),
mode_control_pw_pw: new Mode('control_pw_pw', true),
'drop_thing': 'DROP',
'move': 'MOVE',
'door': 'DOOR',
+ 'command': 'COMMAND',
'consume': 'INTOXICATE',
},
offset: [0,0],
map_lines: [],
init: function() {
this.mode_chat.available_modes = ["play", "study", "edit", "admin_enter"]
- this.mode_play.available_modes = ["chat", "study", "edit", "admin_enter"]
+ this.mode_play.available_modes = ["chat", "study", "edit", "admin_enter",
+ "command_thing"]
this.mode_play.available_actions = ["move", "take_thing", "drop_thing",
"teleport", "door", "consume"];
this.mode_study.available_modes = ["chat", "play", "admin_enter", "edit"]
}
} else if (this.mode.is_single_char_entry) {
this.show_help = true;
+ } else if (this.mode.name == 'command_thing') {
+ server.send(['TASK:COMMAND', 'HELP']);
} else if (this.mode.name == 'admin_enter') {
this.log_msg('@ enter admin password:')
} else if (this.mode.name == 'control_pw_type') {
tui.login_name = tui.inputEl.value;
server.send(['LOGIN', tui.inputEl.value]);
tui.inputEl.value = "";
+ } else if (tui.mode.name == 'command_thing' && event.key == 'Enter') {
+ if (tui.inputEl.value.length == 0) {
+ tui.log_msg('@ aborted');
+ tui.switch_mode('play');
+ } else if (tui.task_action_on('command')) {
+ server.send(['TASK:COMMAND', tui.inputEl.value]);
+ tui.inputEl.value = "";
+ }
} else if (tui.mode.name == 'control_pw_pw' && event.key == 'Enter') {
if (tui.inputEl.value.length == 0) {
tui.log_msg('@ aborted');