<h3>button controls for mouse players</h3>
<table id="move_table" style="float: left">
<tr>
- <td style="text-align: right"><button id="hex_move_upleft">up-left</button></td>
- <td style="text-align: center"><button id="square_move_up">up</button></td>
- <td><button id="hex_move_upright">up-right</button></td>
+ <td style="text-align: right"><button id="hex_move_upleft"></button></td>
+ <td style="text-align: center"><button id="square_move_up"></button></td>
+ <td><button id="hex_move_upright"></button></td>
</tr>
<tr>
- <td style="text-align: right;"><button id="square_move_left">left</button><button id="hex_move_left">left</button></td>
+ <td style="text-align: right;"><button id="square_move_left"></button><button id="hex_move_left">left</button></td>
<td stlye="text-align: center;">move</td>
- <td><button id="square_move_right">right</button><button id="hex_move_right">right</button></td>
+ <td><button id="square_move_right"></button><button id="hex_move_right"></button></td>
</tr>
<tr>
- <td><button id="hex_move_downleft">down-left</button></td>
- <td style="text-align: center"><button id="square_move_down">down</button></td>
- <td><button id="hex_move_downright">down-right</button></td>
+ <td><button id="hex_move_downleft"></button></td>
+ <td style="text-align: center"><button id="square_move_down"></button></td>
+ <td><button id="hex_move_downright"></button></td>
</tr>
</table>
<table>
<tr>
- <td><button id="help">help</button></td>
+ <td><button id="help"></button></td>
</tr>
<tr>
- <td><button id="switch_to_chat">chat mode</button><br /></td>
+ <td><button id="switch_to_chat"></button><br /></td>
</tr>
<tr>
- <td><button id="switch_to_study">study mode</button></td>
- <td><button id="toggle_map_mode">toggle map view</button>
+ <td><button id="switch_to_study"></button></td>
+ <td><button id="toggle_map_mode"></button>
</tr>
<tr>
- <td><button id="switch_to_play">play mode</button></td>
+ <td><button id="switch_to_play"></button></td>
<td>
- <button id="take_thing">pick up thing</button>
- <button id="drop_thing">drop thing</button>
- <button id="teleport">teleport</button>
+ <button id="take_thing"></button>
+ <button id="drop_thing"></button>
+ <button id="door"></button>
+ <button id="teleport"></button>
</td>
</tr>
<tr>
- <td><button id="switch_to_edit">world edit mode</button></td>
+ <td><button id="switch_to_edit"></button></td>
<td>
- <button id="switch_to_write">change terrain</button>
- <button id="flatten">flatten surroundings</button>
- <button id="switch_to_annotate">annotate tile</button>
- <button id="switch_to_portal">edit portal</button>
- <button id="switch_to_name_thing">name thing</button>
- <button id="switch_to_password">enter world edit password</button>
+ <button id="switch_to_write"></button>
+ <button id="flatten"></button>
+ <button id="switch_to_annotate"></button>
+ <button id="switch_to_portal"></button>
+ <button id="switch_to_name_thing"></button>
+ <button id="switch_to_password"></button>
</td>
</tr>
<tr>
- <td><button id="switch_to_admin_enter">admin mode</button></td>
+ <td><button id="switch_to_admin_enter"></button></td>
<td>
- <button id="switch_to_control_pw_type">change protection character password</button>
- <button id="switch_to_control_tile_type">change protection areas</button>
- <button id="switch_to_admin_thing_protect">change thing protection</button>
- <button id="toggle_tile_draw">toggle protection character drawing</button>
+ <button id="switch_to_control_pw_type"></button>
+ <button id="switch_to_control_tile_type"></button>
+ <button id="switch_to_admin_thing_protect"></button>
+ <button id="toggle_tile_draw"></button>
</td>
<tr>
</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] === '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 symbol = game.thing_types[t.type_];
let protection = t.protection;
if (protection == '.') {
- protection = 'unprotected';
+ protection = 'none';
}
- info += "THING: " + t.type_ + " / protection: " + protection + " / " + symbol;
+ info += "THING: " + t.type_ + " / " + symbol;
if (t.player_char) {
info += t.player_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();
};