diff gamelib/scenes/cryo.py @ 328:3cb48621759a

Add uncuttable cryo pipe interact
author Neil Muller <neil@dip.sun.ac.za>
date Sat, 28 Aug 2010 13:57:32 +0200
parents 5031b84fbb4c
children 0bb1ab329bee
line wrap: on
line diff
--- a/gamelib/scenes/cryo.py	Sat Aug 28 13:56:22 2010 +0200
+++ b/gamelib/scenes/cryo.py	Sat Aug 28 13:57:32 2010 +0200
@@ -51,12 +51,13 @@
                 (552, 145, 129, 66),
                 # (643, 199, 38, 233),
                 (636, 82, 165, 60),
-                (756, 127, 52, 393),
                 (140, 135, 112, 73),
                 # (125, 192, 27, 258),
                 (11, 63, 140, 67),
-                (2, 130, 44, 394),
+                #(2, 130, 44, 394),
+                #(756, 127, 52, 393),
                 )))
+        self.add_thing(UncuttableCryoPipes())
 
         # leaks
         self.add_thing(GenericDescThing('cryo.leaks', 2,
@@ -182,10 +183,37 @@
 
     def get_description(self):
         if self.get_data('fixed'):
-            return "These pipes carry cooling fluid to the cryo units."
+            return "These pipes carry cooling fluid to empty cryo units."
         return "There used to be a pipe carrying cooling fluid here"
 
 
+class UncuttableCryoPipes(Thing):
+    "Base class for cryo pipes that can't be cut down."
+
+    NAME = "cryo.pipes.2"
+
+    INTERACTS = {
+        "fixed" : InteractRectUnion((
+                (2, 130, 44, 394),
+                (756, 127, 52, 393),))
+        }
+
+    INITIAL = "fixed"
+
+    def interact_with_machete(self, item):
+        return Result("These pipes carry fuild to the working cryo units."
+                " Chopping them down doesn't seem sensible.")
+
+    def is_interactive(self):
+        return True
+
+    def interact_without(self):
+        return Result("These pipes aren't attached to the wall very solidly.")
+
+    def get_description(self):
+        return "These pipes carry cooling fluid to the working cryo units."
+
+
 class CryoPipe(CloneableItem):
     "After emptying the full can."