comparison gamelib/scenes/cryo.py @ 118:e548f4a13741

Add a transition, on general principles
author Neil Muller <neil@dip.sun.ac.za>
date Tue, 24 Aug 2010 15:39:02 +0200
parents 66898d810247
children d5f7cccfdb6c
comparison
equal deleted inserted replaced
117:139864ce8bdb 118:e548f4a13741
94 94
95 def interact_with_titanium_leg(self, item): 95 def interact_with_titanium_leg(self, item):
96 if self.get_data('door') == "ajar": 96 if self.get_data('door') == "ajar":
97 self.open_door() 97 self.open_door()
98 return Result("You wedge the titanium femur into the chain and twist. With a satisfying *snap*, the chain breaks and the door opens.") 98 return Result("You wedge the titanium femur into the chain and twist. With a satisfying *snap*, the chain breaks and the door opens.")
99 else: 99 elif self.get_data('door') == "shut":
100 text = "You bang on the door with the titanium femur. It makes a clanging sound." 100 text = "You bang on the door with the titanium femur. It makes a clanging sound."
101 speech.say(self.name, text) 101 speech.say(self.name, text)
102 return Result(text) 102 return Result(text)
103 else:
104 return Result("You wave the femur in the doorway. Nothing happens.")
103 105
104 def interact_without(self): 106 def interact_without(self):
105 if self.get_data('door') == "shut": 107 if self.get_data('door') == "shut":
106 self.half_open_door() 108 self.half_open_door()
107 return Result("It moves slightly and then stops. A chain on the other side is preventing it from opening completely.") 109 if self.get_data('door') != "open":
110 return Result("It moves slightly and then stops. A chain on the other side is preventing it from opening completely.")
111 else:
112 self.state.set_current_scene('bridge')
113 return Result("you leave the room, hoping to never return.")
108 114
109 def interact_default(self, item): 115 def interact_default(self, item):
110 return Result(random.choice([ 116 return Result(random.choice([
111 "Sadly, this isn't that sort of game.", 117 "Sadly, this isn't that sort of game.",
112 "Your valiant efforts are foiled by the Evil Game Designer.", 118 "Your valiant efforts are foiled by the Evil Game Designer.",
113 "The door resists. Try something else, perhaps?", 119 "The door resists. Try something else, perhaps?",
114 ])) 120 ]))
115 121
116 def is_interactive(self): 122 def is_interactive(self):
117 return self.get_data('door') != "open" 123 return True
118 124
119 def half_open_door(self): 125 def half_open_door(self):
120 self.set_data('door', "ajar") 126 self.set_data('door', "ajar")
121 self.set_interact("ajar") 127 self.set_interact("ajar")
122 128