- } else if (this.mode.name == 'admin_enter') {
- this.log_msg('@ enter admin password:')
- } else if (this.mode.name == 'control_pw_type') {
- this.log_msg('@ enter protection character for which you want to change the password:')
- } else if (this.mode.name == 'control_tile_type') {
- this.log_msg('@ enter protection character which you want to draw:')
- } else if (this.mode.name == 'admin_thing_protect') {
- this.log_msg('@ enter thing protection character:')
+ } else if (this.mode.name == 'take_thing') {
+ this.log_msg("Portable things in reach for pick-up:");
+ const y = game.player.position[0]
+ const x = game.player.position[1]
+ let select_range = [y.toString() + ':' + x.toString(),
+ (y + 0).toString() + ':' + (x - 1).toString(),
+ (y + 0).toString() + ':' + (x + 1).toString(),
+ (y - 1).toString() + ':' + (x).toString(),
+ (y + 1).toString() + ':' + (x).toString()];
+ if (game.map_geometry == 'Hex') {
+ if (y % 2) {
+ select_range.push((y - 1).toString() + ':' + (x + 1).toString());
+ select_range.push((y + 1).toString() + ':' + (x + 1).toString());
+ } else {
+ select_range.push((y - 1).toString() + ':' + (x - 1).toString());
+ select_range.push((y + 1).toString() + ':' + (x - 1).toString());
+ }
+ };
+ this.selectables = [];
+ for (const t_id in game.things) {
+ const t = game.things[t_id];
+ if (select_range.includes(t.position[0].toString()
+ + ':' + t.position[1].toString())
+ && t.portable) {
+ this.selectables.push(t_id);
+ }
+ };
+ if (this.selectables.length == 0) {
+ this.log_msg('none');
+ terminal.blink_screen();
+ this.switch_mode('play');
+ return;
+ } else {
+ for (let [i, t_id] of this.selectables.entries()) {
+ const t = game.things[t_id];
+ this.log_msg(i + ': ' + explorer.get_thing_info(t));
+ }
+ }
+ } else if (this.mode.name == 'drop_thing') {
+ this.log_msg('Direction to drop thing to:');
+ this.selectables = ['HERE'].concat(Object.values(this.movement_keys));
+ for (let [i, direction] of this.selectables.entries()) {
+ this.log_msg(i + ': ' + direction);
+ };
+ } else if (this.mode.name == 'enter_hat') {
+ this.log_msg('legal characters: ' + game.players_hat_chars);
+ } else if (this.mode.name == 'command_thing') {
+ server.send(['TASK:COMMAND', 'HELP']);