+ line.push(game.map[i] + ' ');
+ }
+ };
+ map_lines_split.push(line);
+ if (this.map_mode == 'terrain + annotations') {
+ for (const [coordinate, _] of Object.entries(explorer.annotations)) {
+ const yx = coordinate.split(',')
+ map_lines_split[yx[0]][yx[1]] = 'A ';
+ }
+ } else if (this.map_mode == 'terrain + things') {
+ for (const p in game.portals) {
+ let coordinate = p.split(',')
+ let original = map_lines_split[coordinate[0]][coordinate[1]];
+ map_lines_split[coordinate[0]][coordinate[1]] = original[0] + 'P';
+ }
+ let used_positions = [];
+ function draw_thing(t, used_positions) {
+ let symbol = game.thing_types[t.type_];
+ let meta_char = ' ';
+ if (t.thing_char) {
+ meta_char = t.thing_char;
+ }
+ if (used_positions.includes(t.position.toString())) {
+ meta_char = '+';
+ };
+ if (t.carrying) {
+ meta_char = '$';
+ }
+ map_lines_split[t.position[0]][t.position[1]] = symbol + meta_char;
+ used_positions.push(t.position.toString());
+ }
+ for (const thing_id in game.things) {
+ let t = game.things[thing_id];
+ if (t.type_ != 'Player') {
+ draw_thing(t, used_positions);
+ }
+ };
+ for (const thing_id in game.things) {
+ let t = game.things[thing_id];
+ if (t.type_ == 'Player') {
+ draw_thing(t, used_positions);
+ }
+ };
+ }
+ if (tui.mode.shows_info || tui.mode.name == 'control_tile_draw') {
+ map_lines_split[explorer.position[0]][explorer.position[1]] = '??';
+ } else if (tui.map_mode != 'terrain + things') {
+ map_lines_split[game.player.position[0]][game.player.position[1]] = '??';
+ }
+ this.map_lines = []
+ if (game.map_geometry == 'Square') {
+ for (let line_split of map_lines_split) {
+ this.map_lines.push(line_split.join(''));
+ };
+ } else if (game.map_geometry == 'Hex') {
+ let indent = 0
+ for (let line_split of map_lines_split) {
+ this.map_lines.push(' '.repeat(indent) + line_split.join(''));
+ if (indent == 0) {
+ indent = 1;
+ } else {
+ indent = 0;
+ };