comparison 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
comparison
equal deleted inserted replaced
145:ce419fb7ab8a 146:1be149cc42db
1 """Mess where crew eat. Fun stuff.""" 1 """Mess where crew eat. Fun stuff."""
2 2
3 from gamelib.state import Scene, Item, Thing, InteractImage, InteractNoImage 3 from gamelib.state import Scene, Item, Thing, InteractImage, InteractNoImage, Result
4 from gamelib.cursor import CursorSprite 4 from gamelib.cursor import CursorSprite
5 5
6 6
7 class Mess(Scene): 7 class Mess(Scene):
8 8
60 "nocans": InteractNoImage(165, 209, 50, 50), 60 "nocans": InteractNoImage(165, 209, 50, 50),
61 } 61 }
62 62
63 INITIAL = "cans" 63 INITIAL = "cans"
64 64
65 INITIAL_DATA = {
66 "cans": True,
67 }
68
69 def interact_without(self):
70 if self.data['cans']:
71 self.state.add_inventory_item('full_can')
72 self.set_data("cans", False)
73 self.set_interact("nocans")
74 return Result("Best before along time in the past. Better not eat these.")
75
76 def get_description(self):
77 if self.data["cans"]:
78 return "The contents of these cans looks synthetic."
79 else:
80 return "You've pillaged these shelves already."
81
65 82
66 class Tubes(Thing): 83 class Tubes(Thing):
67 84
68 NAME = "mess.tubes" 85 NAME = "mess.tubes"
69 86