+ } 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 directed_moves = {
+ 'HERE': [0, 0], 'LEFT': [0, -1], 'RIGHT': [0, 1]
+ }
+ if (game.map_geometry == 'Square') {
+ directed_moves['UP'] = [-1, 0];
+ directed_moves['DOWN'] = [1, 0];
+ } else if (game.map_geometry == 'Hex') {
+ if (y % 2) {
+ directed_moves['UPLEFT'] = [-1, 0];
+ directed_moves['UPRIGHT'] = [-1, 1];
+ directed_moves['DOWNLEFT'] = [1, 0];
+ directed_moves['DOWNRIGHT'] = [1, 1];
+ } else {
+ directed_moves['UPLEFT'] = [-1, -1];
+ directed_moves['UPRIGHT'] = [-1, 0];
+ directed_moves['DOWNLEFT'] = [1, -1];
+ directed_moves['DOWNRIGHT'] = [1, 0];
+ }
+ }
+ let select_range = {};
+ for (const direction in directed_moves) {
+ const move = directed_moves[direction];
+ select_range[direction] = [y + move[0], x + move[1]];
+ }
+ this.selectables = [];
+ let directions = [];
+ for (const direction in select_range) {
+ for (const t_id in game.things) {
+ const t = game.things[t_id];
+ const position = select_range[direction];
+ if (t.portable
+ && t.position[0] == position[0]
+ && t.position[1] == position[1]) {
+ this.selectables.push(t_id);
+ directions.push(direction);
+ }
+ }
+ }
+ 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];
+ const direction = directions[i];
+ this.log_msg(i + ' ' + direction + ': ' + 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_design') {
+ this.log_msg('@ The design you enter must be '
+ + game.player.carrying.design[0][0] + ' lines of max '
+ + game.player.carrying.design[0][1] + ' characters width each');
+ if (game.player.carrying.type_ == 'Hat') {
+ this.log_msg('@ Legal characters: ' + game.players_hat_chars);
+ this.log_msg('@ (Eat cookies to extend the ASCII characters available for drawing.)');
+ }