changeset 175:3d3efc5648cc

Allow multiple cans to be picked up
author Stefano Rivera <stefano@rivera.za.net>
date Wed, 25 Aug 2010 13:55:20 +0200
parents a2d041e0ab83
children c6ea3b11514c
files gamelib/scenes/mess.py
diffstat 1 files changed, 14 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/gamelib/scenes/mess.py	Wed Aug 25 13:18:51 2010 +0200
+++ b/gamelib/scenes/mess.py	Wed Aug 25 13:55:20 2010 +0200
@@ -1,5 +1,7 @@
 """Mess where crew eat. Fun stuff."""
 
+from random import choice
+
 from gamelib.state import Scene, Item, Thing, InteractImage, InteractNoImage, Result
 from gamelib.cursor import CursorSprite
 
@@ -78,21 +80,24 @@
     INITIAL = "cans"
 
     INITIAL_DATA = {
-        "cans": True,
+        'taken_one': False,
     }
 
     def interact_without(self):
-        if self.data['cans']:
-            self.state.add_inventory_item('full_can')
-            self.set_data("cans", False)
-            self.set_interact("nocans")
+        self.state.add_inventory_item('full_can')
+        if not self.data['taken_one']:
+            self.set_data('taken_one', True)
             return Result("Best before along time in the past. Better not eat these.")
+        else:
+            return Result(choice((
+                'Another can of imitation chicken? Great.',
+                'Mmmm. Nutritious Bacteria Stew.',
+                "The label has rusted off, I don't want to know what's inside.",
+                "I hope I don't get hungry enough to open these.",
+            )))
 
     def get_description(self):
-        if self.data["cans"]:
-            return "The contents of these cans looks synthetic."
-        else:
-            return "You've pillaged these shelves already."
+        return "The contents of these cans looks synthetic."
 
 
 class Tubes(Thing):