# HG changeset patch # User Simon Cross # Date 1282684273 -7200 # Node ID 1be149cc42db07481caafa8950119de3a3b53447 # Parent ce419fb7ab8a6c73ec8c9b3168b79d0222782ae8 Allow can to be picked up. diff -r ce419fb7ab8a -r 1be149cc42db gamelib/scenes/mess.py --- a/gamelib/scenes/mess.py Tue Aug 24 22:59:46 2010 +0200 +++ b/gamelib/scenes/mess.py Tue Aug 24 23:11:13 2010 +0200 @@ -1,6 +1,6 @@ """Mess where crew eat. Fun stuff.""" -from gamelib.state import Scene, Item, Thing, InteractImage, InteractNoImage +from gamelib.state import Scene, Item, Thing, InteractImage, InteractNoImage, Result from gamelib.cursor import CursorSprite @@ -62,6 +62,23 @@ INITIAL = "cans" + INITIAL_DATA = { + "cans": True, + } + + def interact_without(self): + if self.data['cans']: + self.state.add_inventory_item('full_can') + self.set_data("cans", False) + self.set_interact("nocans") + return Result("Best before along time in the past. Better not eat 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." + class Tubes(Thing):