Mercurial > boomslang
diff gamelib/scenes/mess.py @ 146:1be149cc42db
Allow can to be picked up.
author | Simon Cross <hodgestar+bzr@gmail.com> |
---|---|
date | Tue, 24 Aug 2010 23:11:13 +0200 |
parents | ce419fb7ab8a |
children | 5e5d71e40e54 |
line wrap: on
line diff
--- 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):