diff gamelib/scenes/map.py @ 343:b3bc101171ea

Don't allow access to the engine room without helmet
author Neil Muller <neil@dip.sun.ac.za>
date Sat, 28 Aug 2010 14:43:00 +0200
parents 3b4a78422201
children 782ff7e53928
line wrap: on
line diff
--- a/gamelib/scenes/map.py	Sat Aug 28 14:42:41 2010 +0200
+++ b/gamelib/scenes/map.py	Sat Aug 28 14:43:00 2010 +0200
@@ -130,6 +130,14 @@
 
     INITIAL = "inaccessible"
 
+    def interact_without(self):
+        if not self.state.is_in_inventory('helmet'):
+            return Result("JIM says 'The engine room is in vacumn. I cannot"
+                    " open the airlock unless you have some suitable"
+                    " protective gear", style="JIM")
+        else:
+            return super(ToEngine, self).interact_without()
+
 
 class ToMachine(DoorThing):
     "Way to machine room."