<td>
<button id="take_thing"></button>
<button id="drop_thing"></button>
+ <button id="door"></button>
<button id="teleport"></button>
</td>
</tr>
<li>teleport: <input id="key_teleport" type="text" value="p" />
<li>pick up thing: <input id="key_take_thing" type="text" value="z" />
<li>drop thing: <input id="key_drop_thing" type="text" value="u" />
+<li>open/close: <input id="key_door" type="text" value="D" />
<li><input id="key_switch_to_chat" type="text" value="t" />
<li><input id="key_switch_to_play" type="text" value="p" />
<li><input id="key_switch_to_study" type="text" value="?" />
'teleport': 'teleport',
'take_thing': 'pick up thing',
'drop_thing': 'drop thing',
+ 'door': 'open/close',
'toggle_map_mode': 'toggle map view',
'toggle_tile_draw': 'toggle protection character drawing',
'hex_move_upleft': 'up-left',
} else if (tokens[0] === 'THING_CHAR') {
let t = game.get_thing(tokens[1], false);
if (t) {
- t.player_char = tokens[2];
+ t.thing_char = tokens[2];
};
} else if (tokens[0] === 'TASKS') {
game.tasks = tokens[1].split(',');
+ console.log(game.tasks);
tui.mode_write.legal = game.tasks.includes('WRITE');
} else if (tokens[0] === 'THING_TYPE') {
game.thing_types[tokens[1]] = tokens[2]
'take_thing': 'PICK_UP',
'drop_thing': 'DROP',
'move': 'MOVE',
+ 'door': 'DOOR',
},
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_actions = ["move", "take_thing", "drop_thing", "teleport"];
+ this.mode_play.available_actions = ["move", "take_thing", "drop_thing",
+ "teleport", "door"];
this.mode_study.available_modes = ["chat", "play", "admin_enter", "edit"]
this.mode_study.available_actions = ["toggle_map_mode", "move_explorer"];
this.mode_admin.available_modes = ["admin_thing_protect", "control_pw_type",
let t = game.things[thing_id];
let symbol = game.thing_types[t.type_];
let meta_char = ' ';
- if (t.player_char) {
- meta_char = t.player_char;
+ if (t.thing_char) {
+ meta_char = t.thing_char;
}
if (used_positions.includes(t.position.toString())) {
meta_char = '+';
let symbol = game.thing_types[t.type_];
let protection = t.protection;
if (protection == '.') {
- protection = 'unprotected';
+ protection = 'none';
}
- info += "THING: " + t.type_ + " / protection: " + protection + " / " + symbol;
- if (t.player_char) {
- info += t.player_char;
+ info += "THING: " + t.type_ + " / " + symbol;
+ if (t.thing_char) {
+ info += t.thing_char;
};
if (t.name_) {
info += " (" + t.name_ + ")";
}
- info += "\n";
+ info += " / protection: " + protection + "\n";
}
}
if (this.position in game.portals) {
server.send(["TASK:PICK_UP"]);
} else if (event.key === tui.keys.drop_thing && tui.task_action_on('drop_thing')) {
server.send(["TASK:DROP"]);
+ } else if (event.key === tui.keys.door && tui.task_action_on('door')) {
+ server.send(["TASK:DOOR"]);
} else if (event.key in tui.movement_keys && tui.task_action_on('move')) {
server.send(['TASK:MOVE', tui.movement_keys[event.key]]);
} else if (event.key === tui.keys.teleport) {
document.getElementById("flatten").onclick = function() {
server.send(['TASK:FLATTEN_SURROUNDINGS', tui.password]);
};
+document.getElementById("door").onclick = function() {
+ server.send(['TASK:DOOR']);
+};
document.getElementById("teleport").onclick = function() {
game.teleport();
};