diff gamelib/scenes/bridge.py @ 370:8936c043d7a1

Fix bliken lights description
author Neil Muller <neil@dip.sun.ac.za>
date Sat, 28 Aug 2010 17:39:00 +0200
parents 8a288db78f40
children eef2fca1aa11
line wrap: on
line diff
--- a/gamelib/scenes/bridge.py	Sat Aug 28 17:36:40 2010 +0200
+++ b/gamelib/scenes/bridge.py	Sat Aug 28 17:39:00 2010 +0200
@@ -227,16 +227,25 @@
 
 class BlinkingLights(Thing):
 
+    def __init__(self):
+        super(BlinkingLights, self).__init__()
+        self.description = None
+
     def is_interactive(self):
         return False
 
-    def get_description(self):
-        return random.choice([
+    def leave(self):
+        self.description = random.choice([
             "The lights flash in interesting patterns.",
             "The flashing lights don't mean anything to you.",
             "The console lights flash and flicker.",
             ])
 
+    def get_description(self):
+        if not self.description:
+            self.leave()
+        return self.description
+
 class LeftLights(BlinkingLights):
 
     NAME ='bridge.lights.1'