comparison gamelib/scenes/mess.py @ 348:c193cbff785d

The environment / pipe puzzle is now solveable
author Stefano Rivera <stefano@rivera.za.net>
date Sat, 28 Aug 2010 15:18:25 +0200
parents 1208bb5eaf6f
children 2cadb47405a4
comparison
equal deleted inserted replaced
347:7147369cee59 348:c193cbff785d
151 151
152 INITIAL = "blocked" 152 INITIAL = "blocked"
153 153
154 INITIAL_DATA = { 154 INITIAL_DATA = {
155 "status": "blocked", 155 "status": "blocked",
156 "pipes_replaced": 0,
157 "fixed": False,
158 } 156 }
159 157
160 def get_description(self): 158 def get_description(self):
161 if self.get_data('status') == "blocked": 159 if self.get_data('status') == "blocked":
162 return "The broccoli seems to have become entangled with something." 160 return "The broccoli seems to have become entangled with something."
163 elif self.get_data("status") == "broken": 161 elif self.get_data("status") == "broken":
164 return "These broken pipes look important." 162 return "These broken pipes look important."
163 elif self.get_data("status") == "replaced":
164 return "The pipes have been repaired but are the repairs aren't airtight, yet"
165 else: 165 else:
166 return "Your fix looks like it's holding up well." 166 return "Your fix looks like it's holding up well."
167 167
168 def interact_with_machete(self, item): 168 def interact_with_machete(self, item):
169 if self.get_data("status") == "blocked": 169 if self.get_data("status") == "blocked":
174 "the access panel and reveal some broken tubes. " 174 "the access panel and reveal some broken tubes. "
175 "They look important.", 175 "They look important.",
176 soundfile='chopping.ogg') 176 soundfile='chopping.ogg')
177 elif self.get_data("status") == "broken": 177 elif self.get_data("status") == "broken":
178 return Result("It looks broken enough already.") 178 return Result("It looks broken enough already.")
179 elif self.get_data("status") == "replaced":
180 return Result("Cutting holes won't repair the leaks.")
179 else: 181 else:
180 return Result("After all that effort fixing it, chopping it to " 182 return Result("After all that effort fixing it, chopping it to "
181 "bits doesn't seem very smart.") 183 "bits doesn't seem very smart.")
182 184
183 def interact_with_pipe(self, item): 185 def interact_with_cryo_pipes_three(self, item):
184 if self.get_data("status") == "blocked": 186 if self.get_data("status") == "blocked":
185 return Result("It would get lost in the fronds.") 187 return Result("It would get lost in the fronds.")
186 else: 188 else:
187 self.data['pipes_replaced'] += 1
188 self.state.remove_inventory_item(item.name) 189 self.state.remove_inventory_item(item.name)
189 return Result({ 190 self.set_data('status', 'replaced')
190 1: "The pipe slots neatly into place, but doesn't make an airtight seal.", 191 # TODO: An interact image for fixed but untaped pipes
191 2: "This pipe is a little looser than the first. It definitely needs to be taped up.", 192 return Result(
192 3: "The final pipe fits snugly, but won't hold under pressure.", 193 "The pipes slot neatly into place, but don't make an airtight seal."
193 }[self.get_data('pipes_replaced')]) 194 )
194 195
195 def interact_with_duct_tape(self, item): 196 def interact_with_duct_tape(self, item):
196 if self.get_data("status") == "broken": 197 if self.get_data("status") == "broken":
197 return Result("It would get lost in the fronds.") 198 return Result("It would get lost in the fronds.")
198 elif self.get_data("fixed"): 199 elif self.get_data("status") == 'fixed':
199 return Result("There's quite enough tape on the ducting already.") 200 return Result("There's quite enough tape on the ducting already.")
200 elif self.get_data("pipes_replaced") < 3:
201 return Result("All the pipes need to be in place before they can be taped up.")
202 else: 201 else:
203 self.set_data("fixed", True) 202 self.set_data("fixed", True)
204 self.set_data("status", "fixed") 203 self.set_data("status", "fixed")
205 self.set_interact("fixed") 204 self.set_interact("fixed")
206 # TODO: A less anticlimactic climax? 205 # TODO: A less anticlimactic climax?
207 return Result("It takes quite a lot of tape, but eventually everything is" 206 return Result("It takes quite a lot of tape, but eventually everything is"
208 " airtight and ready to hold pressure. Who'd've thought duct" 207 " airtight and ready to hold pressure. Who'd've thought duct"
209 " tape could actually be used to tape ducts?") 208 " tape could actually be used to tape ducts?")
210 209
210
211 class DetergentThing(Thing): 211 class DetergentThing(Thing):
212 212
213 NAME = "mess.detergent" 213 NAME = "mess.detergent"
214 214
215 INTERACTS = { 215 INTERACTS = {