home · contact · privacy
Make doors installable/uninstallable.
[plomrogue2] / rogue_chat.html
index 0c0cb307c65366d9ff1d6ec0de0c45f55230bf6f..41cf365c0a5f88fe71dad7977a1e1e6aa12f4d03 100644 (file)
@@ -57,6 +57,7 @@ keyboard input/control: <span id="keyboard_control"></span>
       <button id="consume"></button>
       <button id="switch_to_command_thing"></button>
       <button id="teleport"></button>
+      <button id="install"></button>
     </td>
   </tr>
   <tr>
@@ -99,6 +100,7 @@ keyboard input/control: <span id="keyboard_control"></span>
 <li>drop thing: <input id="key_drop_thing" type="text" value="u" />
 <li>open/close: <input id="key_door" type="text" value="D" />
 <li>consume: <input id="key_consume" type="text" value="C" />
+<li>install: <input id="key_install" type="text" value="I" />
 <li><input id="key_switch_to_take_thing" type="text" value="z" />
 <li><input id="key_switch_to_chat" type="text" value="t" />
 <li><input id="key_switch_to_play" type="text" value="p" />
@@ -236,6 +238,7 @@ let key_descriptions = {
     'drop_thing': 'drop thing',
     'door': 'open/close',
     'consume': 'consume',
+    'install': 'install',
     'toggle_map_mode': 'toggle map view',
     'toggle_tile_draw': 'toggle protection character drawing',
     'hex_move_upleft': 'up-left',
@@ -664,6 +667,7 @@ let tui = {
       'drop_thing': 'DROP',
       'move': 'MOVE',
       'door': 'DOOR',
+      'install': 'INSTALL',
       'command': 'COMMAND',
       'consume': 'INTOXICATE',
   },
@@ -674,7 +678,7 @@ let tui = {
       this.mode_play.available_modes = ["chat", "study", "edit", "admin_enter",
                                         "command_thing", "take_thing"]
       this.mode_play.available_actions = ["move", "drop_thing",
-                                          "teleport", "door", "consume"];
+                                          "teleport", "door", "consume", "install"];
       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",
@@ -1512,6 +1516,8 @@ tui.inputEl.addEventListener('keydown', (event) => {
               server.send(["TASK:INTOXICATE"]);
           } else if (event.key === tui.keys.door && tui.task_action_on('door')) {
               server.send(["TASK:DOOR"]);
+          } else if (event.key === tui.keys.install && tui.task_action_on('install')) {
+              server.send(["TASK:INSTALL"]);
           } 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) {
@@ -1631,6 +1637,9 @@ document.getElementById("door").onclick = function() {
 document.getElementById("consume").onclick = function() {
     server.send(['TASK:INTOXICATE']);
 };
+document.getElementById("install").onclick = function() {
+    server.send(['TASK:INSTALL']);
+};
 document.getElementById("teleport").onclick = function() {
     game.teleport();
 };