changeset 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 139864ce8bdb
children d5f7cccfdb6c
files gamelib/scenes/cryo.py
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/gamelib/scenes/cryo.py	Tue Aug 24 15:30:51 2010 +0200
+++ b/gamelib/scenes/cryo.py	Tue Aug 24 15:39:02 2010 +0200
@@ -96,15 +96,21 @@
         if self.get_data('door') == "ajar":
             self.open_door()
             return Result("You wedge the titanium femur into the chain and twist. With a satisfying *snap*, the chain breaks and the door opens.")
-        else:
+        elif self.get_data('door') == "shut":
             text = "You bang on the door with the titanium femur. It makes a clanging sound."
             speech.say(self.name, text)
             return Result(text)
+        else:
+            return Result("You wave the femur in the doorway. Nothing happens.")
 
     def interact_without(self):
         if self.get_data('door') == "shut":
             self.half_open_door()
-        return Result("It moves slightly and then stops. A chain on the other side is preventing it from opening completely.")
+        if self.get_data('door') != "open":
+            return Result("It moves slightly and then stops. A chain on the other side is preventing it from opening completely.")
+        else:
+            self.state.set_current_scene('bridge')
+            return Result("you leave the room, hoping to never return.")
 
     def interact_default(self, item):
         return Result(random.choice([
@@ -114,7 +120,7 @@
                     ]))
 
     def is_interactive(self):
-        return self.get_data('door') != "open"
+        return True
 
     def half_open_door(self):
         self.set_data('door', "ajar")