comparison gamelib/scenes/cryo.py @ 209:aeb96ca5f76c

Add more sounds to cryo room
author Neil Muller <neil@dip.sun.ac.za>
date Thu, 26 Aug 2010 14:59:29 +0200
parents 6c84eb5ff80a
children eb101b6fb3dd
comparison
equal deleted inserted replaced
208:7a2cb054010d 209:aeb96ca5f76c
25 25
26 # sounds that will be played randomly as background noise 26 # sounds that will be played randomly as background noise
27 MUSIC = [ 27 MUSIC = [
28 'drip1.ogg', 28 'drip1.ogg',
29 'drip2.ogg', 29 'drip2.ogg',
30 'drip3.ogg',
30 'creaking.ogg', 31 'creaking.ogg',
31 'silent.ogg', 32 'silent.ogg',
32 'silent.ogg', 33 'silent.ogg',
33 ] 34 ]
34 35
169 170
170 def interact_without(self): 171 def interact_without(self):
171 return Result(detail_view='cryo_detail') 172 return Result(detail_view='cryo_detail')
172 173
173 def interact_with_titanium_leg(self, item): 174 def interact_with_titanium_leg(self, item):
174 return Result("You hit the chamber that used to hold this very leg. Nothing happens as a result.") 175 return Result("You hit the chamber that used to hold this very leg. Nothing happens as a result.",
176 soundfile="clang2.ogg")
175 177
176 def get_description(self): 178 def get_description(self):
177 if self.get_data('contains_titanium_leg'): 179 if self.get_data('contains_titanium_leg'):
178 return "A broken cryo chamber, with a poor unfortunate corpse inside." 180 return "A broken cryo chamber, with a poor unfortunate corpse inside."
179 return "A broken cryo chamber. The corpse inside is missing a leg." 181 return "A broken cryo chamber. The corpse inside is missing a leg."
195 def interact_with_titanium_leg(self, item): 197 def interact_with_titanium_leg(self, item):
196 return Result(random.choice([ 198 return Result(random.choice([
197 "You bang on the chamber with the titanium femur. Nothing much happens", 199 "You bang on the chamber with the titanium femur. Nothing much happens",
198 "Hitting the cryo unit with the femur doesn't achieve anything", 200 "Hitting the cryo unit with the femur doesn't achieve anything",
199 "You hit the chamber with the femur. Nothing happens.", 201 "You hit the chamber with the femur. Nothing happens.",
200 ])) 202 ]), soundfile="clang2.ogg")
201 203
202 204
203 class CryoRoomDoor(Thing): 205 class CryoRoomDoor(Thing):
204 "Door to the cryo room." 206 "Door to the cryo room."
205 207
218 } 220 }
219 221
220 def interact_with_titanium_leg(self, item): 222 def interact_with_titanium_leg(self, item):
221 if self.get_data('door') == "ajar": 223 if self.get_data('door') == "ajar":
222 self.open_door() 224 self.open_door()
223 return Result("You wedge the titanium femur into the chain and twist. With a satisfying *snap*, the chain breaks and the door opens.") 225 return Result("You wedge the titanium femur into the chain and twist. With a satisfying *snap*, the chain breaks and the door opens.", soundfile='break.ogg')
224 elif self.get_data('door') == "shut": 226 elif self.get_data('door') == "shut":
225 text = "You bang on the door with the titanium femur. It makes a clanging sound." 227 text = "You bang on the door with the titanium femur. It makes a clanging sound."
226 speech.say(self.name, text) 228 speech.say(self.name, text)
227 return Result(text, soundfile='clang.ogg') 229 return Result(text, soundfile='clang.ogg')
228 else: 230 else:
230 232
231 def interact_without(self): 233 def interact_without(self):
232 if self.get_data('door') == "shut": 234 if self.get_data('door') == "shut":
233 self.half_open_door() 235 self.half_open_door()
234 if self.get_data('door') != "open": 236 if self.get_data('door') != "open":
235 return Result("It moves slightly and then stops. A chain on the other side is preventing it from opening completely.") 237 return Result("It moves slightly and then stops. A chain on the other side is preventing it from opening completely.", soundfile='chain.ogg')
236 else: 238 else:
237 self.state.set_current_scene('map') 239 self.state.set_current_scene('map')
238 return None 240 return None
239 241
240 def interact_default(self, item): 242 def interact_default(self, item):