home · contact · privacy
Improve pick-up listing messages.
[plomrogue2] / rogue_chat_curses.py
index 1f93dd808b690d488b0cf9f93fd3ed80a72fa50e..c6954bfce2b8ba502e170968cc5ec953c7f0e75a 100755 (executable)
@@ -38,7 +38,7 @@ mode_helps = {
     },
     'take_thing': {
         'short': 'take thing',
-        'intro': '',
+        'intro': 'Pick up a thing in reach by entering its index number.  Enter nothing to abort.',
         'long': 'You see a list of things which you could pick up.  Enter the target thing\'s index, or, to leave, nothing.'
     },
     'admin_thing_protect': {
@@ -623,11 +623,23 @@ class TUI:
             else:
                 self.log_msg('@ enter username')
         elif self.mode.name == 'take_thing':
-            self.log_msg('selectable things:')
+            self.log_msg('Things in reach for pick-up:')
             player = self.game.get_thing(self.game.player_id)
+            select_range = [player.position,
+                            player.position + YX(0,-1),
+                            player.position + YX(0, 1),
+                            player.position + YX(-1, 0),
+                            player.position + YX(1, 0)]
+            if type(self.game.map_geometry) == MapGeometryHex:
+                if player.position.y % 2:
+                    select_range += [player.position + YX(-1, 1),
+                                     player.position + YX(1, 1)]
+                else:
+                    select_range += [player.position + YX(-1, -1),
+                                     player.position + YX(1, -1)]
             self.selectables = [t for t in self.game.things
                                 if t != player and t.type_ != 'Player'
-                                and t.position == player.position]
+                                and t.position in select_range]
             if len(self.selectables) == 0:
                 self.log_msg('none')
             else: