+ draw_help: function() {
+ let movement_keys_desc = Object.keys(this.movement_keys).join(',');
+ let content = this.mode.name + " mode help (hit any key to disappear)\n\n" + this.mode.help_intro + "\n\n";
+ if (this.mode == mode_play) {
+ content += "Available actions:\n";
+ if (game.tasks.includes('MOVE')) {
+ content += "[" + movement_keys_desc + "] – move player\n";
+ }
+ if (game.tasks.includes('FLATTEN_SURROUNDINGS')) {
+ content += "[" + tui.keys.flatten + "] – flatten player's surroundings\n";
+ }
+ content += '\nOther modes available from here:\n';
+ content += '[' + this.keys.switch_to_edit + '] – terrain edit mode\n';
+ content += '[' + this.keys.switch_to_password + '] – terrain password edit mode\n';
+ content += '[' + this.keys.switch_to_chat + '] – chat mode\n';
+ content += '[' + this.keys.switch_to_study + '] – study mode\n';
+ } else if (this.mode == mode_study) {
+ content += "Available actions:\n";
+ content += '[' + movement_keys_desc + '] – move question mark\n';
+ content += '[' + this.keys.toggle_map_mode + '] – toggle view between terrain, and password protection areas\n';
+ content += '\nOther modes available from here:';
+ content += '[' + this.keys.switch_to_chat + '] – chat mode\n';
+ content += '[' + this.keys.switch_to_play + '] – play mode\n';
+ content += '[' + this.keys.switch_to_portal + '] – portal mode\n';
+ content += '[' + this.keys.switch_to_annotate + '] – annotation mode\n';
+ } else if (this.mode == mode_chat) {
+ content += '/nick NAME – re-name yourself to NAME\n';
+ content += '/msg USER TEXT – send TEXT to USER\n';
+ content += '/' + this.keys.switch_to_play + ' or /play – switch to play mode\n';
+ content += '/' + this.keys.switch_to_study + ' or /study – switch to study mode\n';
+ }
+ let start_x = 0;
+ if (!this.mode.has_input_prompt) {
+ start_x = this.window_width
+ }
+ terminal.drawBox(0, start_x, terminal.rows, this.window_width);
+ let lines = this.msg_into_lines_of_width(content, this.window_width);
+ for (let y = 0, i = 0; y < terminal.rows && i < lines.length; y++, i++) {
+ terminal.write(y, start_x, lines[i]);
+ }
+ },