Mercurial > boomslang
comparison gamelib/scenes/mess.py @ 409:72baf5bfebc6
Support for partial fixed state (pending artwork)
author | Neil Muller <neil@dip.sun.ac.za> |
---|---|
date | Sat, 28 Aug 2010 22:13:19 +0200 |
parents | c81a4faa748e |
children | 1470a69d91ee |
comparison
equal
deleted
inserted
replaced
408:308a433c4713 | 409:72baf5bfebc6 |
---|---|
15 FOLDER = "mess" | 15 FOLDER = "mess" |
16 BACKGROUND = "mess_hall.png" | 16 BACKGROUND = "mess_hall.png" |
17 | 17 |
18 INITIAL_DATA = { | 18 INITIAL_DATA = { |
19 'accessible': True, | 19 'accessible': True, |
20 'life support online': False, | 20 'life support status': 'broken', # broken, replaced, fixed |
21 } | 21 } |
22 | 22 |
23 def __init__(self, state): | 23 def __init__(self, state): |
24 super(Mess, self).__init__(state) | 24 super(Mess, self).__init__(state) |
25 self.add_thing(CansOnShelf()) | 25 self.add_thing(CansOnShelf()) |
145 NAME = "mess.tubes" | 145 NAME = "mess.tubes" |
146 | 146 |
147 INTERACTS = { | 147 INTERACTS = { |
148 "blocked": InteractImage(250, 130, "blocking_broccoli.png"), | 148 "blocked": InteractImage(250, 130, "blocking_broccoli.png"), |
149 "broken": InteractImage(250, 183, "broken_tubes.png"), | 149 "broken": InteractImage(250, 183, "broken_tubes.png"), |
150 "replaced": InteractImage(250, 183, "fixed_tubes.png"), | |
150 "fixed": InteractImage(252, 183, "fixed_tubes.png"), | 151 "fixed": InteractImage(252, 183, "fixed_tubes.png"), |
151 } | 152 } |
152 | 153 |
153 INITIAL = "blocked" | 154 INITIAL = "blocked" |
154 | 155 |
187 if self.get_data("status") == "blocked": | 188 if self.get_data("status") == "blocked": |
188 return Result("It would get lost in the fronds.") | 189 return Result("It would get lost in the fronds.") |
189 else: | 190 else: |
190 self.state.remove_inventory_item(item.name) | 191 self.state.remove_inventory_item(item.name) |
191 self.set_data('status', 'replaced') | 192 self.set_data('status', 'replaced') |
192 # TODO: An interact image for fixed but untaped pipes | 193 self.set_interact("replaced") |
194 self.scene.set_data('life support status', 'replaced') | |
193 return Result( | 195 return Result( |
194 "The pipes slot neatly into place, but don't make an airtight seal." | 196 "The pipes slot neatly into place, but don't make an airtight seal." |
195 ) | 197 ) |
196 | 198 |
197 def interact_with_duct_tape(self, item): | 199 def interact_with_duct_tape(self, item): |
201 return Result("There's quite enough tape on the ducting already.") | 203 return Result("There's quite enough tape on the ducting already.") |
202 else: | 204 else: |
203 self.set_data("fixed", True) | 205 self.set_data("fixed", True) |
204 self.set_data("status", "fixed") | 206 self.set_data("status", "fixed") |
205 self.set_interact("fixed") | 207 self.set_interact("fixed") |
206 self.scene.set_data('life support online', True) | 208 self.scene.set_data('life support status', 'fixed') |
207 # TODO: A less anticlimactic climax? | 209 # TODO: A less anticlimactic climax? |
208 return Result("It takes quite a lot of tape, but eventually everything is" | 210 return Result("It takes quite a lot of tape, but eventually everything is" |
209 " airtight and ready to hold pressure. Who'd've thought duct" | 211 " airtight and ready to hold pressure. Who'd've thought duct" |
210 " tape could actually be used to tape ducts?") | 212 " tape could actually be used to tape ducts?") |
211 | 213 |