home · contact · privacy
Make welcoming message of client slightly more helpful.
[plomrogue2] / rogue_chat.html
index b9673a1320b1ad3eac182cefae95004690989413..f08105023e30b3d062b58e06fb9f52551647cee9 100644 (file)
@@ -16,7 +16,7 @@ terminal rows: <input id="n_rows" type="number" step=4 min=24 value=24 />
 </div>
 <div style="position: relative; display: inline-block;">
 <pre id="terminal"></pre>
-<textarea id="input" style="position: absolute; left: 0; height: 100%; width: 100%; opacity: 0"></textarea>
+<textarea id="input" style="position: absolute; left: 0; height: 100%; width: 100%; opacity: 0; z-index: -1;"></textarea>
 </div>
 <h3>button controls for hard-to-remember keybindings</h3>
 <table id="move_table" style="float: left">
@@ -485,11 +485,13 @@ let server = {
         let tokens = parser.tokenize(event.data);
         if (tokens[0] === 'TURN') {
             game.turn_complete = false;
-            game.turn = parseInt(tokens[1]);
         } else if (tokens[0] === 'OTHER_WIPE') {
             game.portals_new = {};
             explorer.annotations_new = {};
             game.things_new = [];
+        } else if (tokens[0] === 'STATS') {
+            game.bladder_pressure_new = parseInt(tokens[1])
+            game.weariness_new = parseInt(tokens[2])
         } else if (tokens[0] === 'THING') {
             let t = game.get_thing_temp(tokens[4], true);
             t.position = parser.parse_yx(tokens[1]);
@@ -546,6 +548,8 @@ let server = {
             game.things = game.things_new;
             game.player = game.things[game.player_id];
             game.players_hat_chars = game.players_hat_chars_new;
+            game.bladder_pressure = game.bladder_pressure_new
+            game.weariness = game.weariness_new
             game.turn_complete = true;
             if (tui.mode.name == 'post_login_wait') {
                 tui.switch_mode('play');
@@ -566,6 +570,9 @@ let server = {
         } else if (tokens[0] === 'LOGIN_OK') {
             this.send(['GET_GAMESTATE']);
             tui.switch_mode('post_login_wait');
+            tui.log_msg('@ welcome!')
+            tui.log_msg('@ hint: see top of terminal for how to get help.')
+            tui.log_msg('@ hint: enter study mode to understand your environment.')
         } else if (tokens[0] === 'DEFAULT_COLORS') {
             terminal.set_default_colors();
         } else if (tokens[0] === 'RANDOM_COLORS') {
@@ -1210,10 +1217,10 @@ let tui = {
       }
       terminal.write(0, this.window_width, 'MODE: ' + this.mode.short_desc + ' – ' + help);
   },
-  draw_turn_line: function(n) {
-      if (game.turn_complete) {
-          terminal.write(1, this.window_width, 'TURN: ' + game.turn);
-      }
+  draw_stats_line: function(n) {
+      terminal.write(1, this.window_width,
+                     'WEARINESS: ' + game.weariness +
+                     ' BLADDER: ' + game.bladder_pressure);
   },
   draw_history: function() {
       let log_display_lines = [];
@@ -1328,7 +1335,7 @@ let tui = {
         this.draw_input();
     } else {
         this.draw_map();
-        this.draw_turn_line();
+        this.draw_stats_line();
         this.draw_mode_line();
         if (this.mode.shows_info) {
           this.draw_info();
@@ -1368,6 +1375,8 @@ let game = {
         this.portals = {};
         this.portals_new = {};
         this.players_hat_chars = "";
+        this.bladder_pressure = 0;
+        this.bladder_pressure_new = 0;
     },
     get_thing_temp: function(id_, create_if_not_found=false) {
         if (id_ in game.things_new) {