X-Git-Url: https://plomlompom.com/repos/day?a=blobdiff_plain;f=rogue_chat.html;h=41cf365c0a5f88fe71dad7977a1e1e6aa12f4d03;hb=35714a1e0616ada0be5929d5fb8100047e46cdd2;hp=573e295874411a5a8ebe319adbddb7472dbd4b1a;hpb=b42a49ec09d08e8f37ea52ad6b74fb10c5c5b01d;p=plomrogue2
diff --git a/rogue_chat.html b/rogue_chat.html
index 573e295..41cf365 100644
--- a/rogue_chat.html
+++ b/rogue_chat.html
@@ -57,6 +57,7 @@ keyboard input/control:
+
@@ -99,6 +100,7 @@ keyboard input/control:
drop thing:
open/close:
consume:
+install:
@@ -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',
@@ -488,6 +491,11 @@ let server = {
tui.mode_take_thing.legal = game.tasks.includes('PICK_UP');
} else if (tokens[0] === 'THING_TYPE') {
game.thing_types[tokens[1]] = tokens[2]
+ } else if (tokens[0] === 'THING_CARRYING') {
+ let t = game.get_thing(tokens[1], false);
+ if (t) {
+ t.carrying = true;
+ };
} else if (tokens[0] === 'TERRAIN') {
game.terrains[tokens[1]] = tokens[2]
} else if (tokens[0] === 'MAP') {
@@ -659,6 +667,7 @@ let tui = {
'drop_thing': 'DROP',
'move': 'MOVE',
'door': 'DOOR',
+ 'install': 'INSTALL',
'command': 'COMMAND',
'consume': 'INTOXICATE',
},
@@ -669,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",
@@ -994,6 +1003,9 @@ let tui = {
if (used_positions.includes(t.position.toString())) {
meta_char = '+';
};
+ if (t.carrying) {
+ meta_char = '$';
+ }
map_lines_split[t.position[0]][t.position[1]] = symbol + meta_char;
used_positions.push(t.position.toString());
}
@@ -1504,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) {
@@ -1623,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();
};