+ def get_info(self):
+ if self.info_cached:
+ return self.info_cached
+ pos_i = self.explorer.y * self.game.map_geometry.size.x + self.explorer.x
+ info_to_cache = ''
+ if len(self.game.fov) > pos_i and self.game.fov[pos_i] != '.':
+ info_to_cache += 'outside field of view'
+ else:
+ terrain_char = self.game.map_content[pos_i]
+ terrain_desc = '?'
+ if terrain_char in self.game.terrains:
+ terrain_desc = self.game.terrains[terrain_char]
+ info_to_cache += 'TERRAIN: "%s" / %s\n' % (terrain_char,
+ terrain_desc)
+ protection = self.game.map_control_content[pos_i]
+ if protection == '.':
+ protection = 'unprotected'
+ info_to_cache += 'PROTECTION: %s\n' % protection
+ for t in self.game.things:
+ if t.position == self.explorer:
+ protection = t.protection
+ if protection == '.':
+ protection = 'none'
+ info_to_cache += 'THING: %s / %s' %\
+ (t.type_, self.game.thing_types[t.type_])
+ if hasattr(t, 'thing_char'):
+ info_to_cache += t.thing_char
+ if hasattr(t, 'name'):
+ info_to_cache += ' (%s)' % t.name
+ info_to_cache += ' / protection: %s\n' % protection
+ if self.explorer in self.game.portals:
+ info_to_cache += 'PORTAL: ' +\
+ self.game.portals[self.explorer] + '\n'
+ else:
+ info_to_cache += 'PORTAL: (none)\n'
+ if self.explorer in self.game.annotations:
+ info_to_cache += 'ANNOTATION: ' +\
+ self.game.annotations[self.explorer]
+ self.info_cached = info_to_cache
+ return self.info_cached
+