X-Git-Url: https://plomlompom.com/repos/todo?a=blobdiff_plain;f=rogue_chat.html;h=554c5945232f7aac6d57d786b02b206c7f8052cf;hb=6cb3a857a09ae974bf0f510dfa94fb19fba2ce31;hp=3825581359fa615777a3a6709479eb8ccbe593bf;hpb=33adc215597b0fd7553661891a3c84ce16f1955e;p=plomrogue2
diff --git a/rogue_chat.html b/rogue_chat.html
index 3825581..554c594 100644
--- a/rogue_chat.html
+++ b/rogue_chat.html
@@ -22,58 +22,59 @@ keyboard input/control:
button controls for mouse players
- |
- |
- |
+ |
+ |
+ |
- |
+ |
move |
- |
+ |
- |
- |
- |
+ |
+ |
+ |
- |
+ |
-
|
+
|
- |
-
+ | |
+
|
- |
+ |
-
-
-
+
+
+
+
|
- |
+ |
-
-
-
-
-
-
+
+
+
+
+
+
|
- |
+ |
-
-
-
-
+
+
+
+
|
@@ -95,6 +96,7 @@ keyboard input/control:
teleport:
pick up thing:
drop thing:
+open/close:
@@ -200,6 +202,7 @@ let key_descriptions = {
'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',
@@ -427,10 +430,11 @@ let server = {
} 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]
@@ -599,11 +603,13 @@ let tui = {
'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",
@@ -643,6 +649,9 @@ let tui = {
}
};
for (const move_button of document.querySelectorAll('[id*="_move_"]')) {
+ if (move_button.id.startsWith('key_')) {
+ continue;
+ }
move_button.hidden = true;
};
for (const move_button of document.querySelectorAll('[id^="' + geometry_prefix + 'move_"]')) {
@@ -888,8 +897,8 @@ let tui = {
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 = '+';
@@ -1219,16 +1228,16 @@ let explorer = {
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) {
@@ -1379,6 +1388,8 @@ tui.inputEl.addEventListener('keydown', (event) => {
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) {
@@ -1495,6 +1506,9 @@ document.getElementById("drop_thing").onclick = function() {
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();
};