changeset 348:c193cbff785d

The environment / pipe puzzle is now solveable
author Stefano Rivera <stefano@rivera.za.net>
date Sat, 28 Aug 2010 15:18:25 +0200
parents 7147369cee59
children 0cc6ee8f2827
files gamelib/scenes/cryo.py gamelib/scenes/mess.py
diffstat 2 files changed, 29 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/gamelib/scenes/cryo.py	Sat Aug 28 15:11:27 2010 +0200
+++ b/gamelib/scenes/cryo.py	Sat Aug 28 15:18:25 2010 +0200
@@ -41,7 +41,8 @@
         self.add_thing(CryoRoomDoor())
         self.add_thing(CryoComputer())
         self.add_thing(CryoPipeLeft())
-        self.add_thing(CryoPipeRight())
+        self.add_thing(CryoPipeRightTop())
+        self.add_thing(CryoPipeRightBottom())
 
         # Flavour items
         # pipes
@@ -232,13 +233,23 @@
         }
 
 
-class CryoPipeRight(CryoPipeBase):
-    "Left cryo pipe."
+class CryoPipeRightTop(CryoPipeBase):
+    "Right cryo pipe, top."
+
+    NAME = "cryo.pipe.right.top"
+    INTERACTS = {
+        "fixed": InteractImage(645, 212, "intact_cryo_pipe_right_top.png"),
+        "chopped": InteractNoImage(643, 199, 31, 111),
+        }
 
-    NAME = "cryo.pipe.right"
+
+class CryoPipeRightBottom(CryoPipeBase):
+    "Right cryo pipe, bottom."
+
+    NAME = "cryo.pipe.right.bottom"
     INTERACTS = {
-        "fixed": InteractImage(645, 211, "intact_cryo_pipe_right.png"),
-        "chopped": InteractNoImage(643, 199, 38, 233),
+        "fixed": InteractImage(644, 333, "intact_cryo_pipe_right_bottom.png"),
+        "chopped": InteractNoImage(644, 333, 31, 107),
         }
 
 
--- a/gamelib/scenes/mess.py	Sat Aug 28 15:11:27 2010 +0200
+++ b/gamelib/scenes/mess.py	Sat Aug 28 15:18:25 2010 +0200
@@ -153,8 +153,6 @@
 
     INITIAL_DATA = {
         "status": "blocked",
-        "pipes_replaced": 0,
-        "fixed": False,
         }
 
     def get_description(self):
@@ -162,6 +160,8 @@
             return "The broccoli seems to have become entangled with something."
         elif self.get_data("status") == "broken":
             return "These broken pipes look important."
+        elif self.get_data("status") == "replaced":
+            return "The pipes have been repaired but are the repairs aren't airtight, yet"
         else:
             return "Your fix looks like it's holding up well."
 
@@ -176,29 +176,28 @@
                           soundfile='chopping.ogg')
         elif self.get_data("status") == "broken":
             return Result("It looks broken enough already.")
+        elif self.get_data("status") == "replaced":
+            return Result("Cutting holes won't repair the leaks.")
         else:
             return Result("After all that effort fixing it, chopping it to "
                           "bits doesn't seem very smart.")
 
-    def interact_with_pipe(self, item):
+    def interact_with_cryo_pipes_three(self, item):
         if self.get_data("status") == "blocked":
             return Result("It would get lost in the fronds.")
         else:
-            self.data['pipes_replaced'] += 1
             self.state.remove_inventory_item(item.name)
-            return Result({
-                    1: "The pipe slots neatly into place, but doesn't make an airtight seal.",
-                    2: "This pipe is a little looser than the first. It definitely needs to be taped up.",
-                    3: "The final pipe fits snugly, but won't hold under pressure.",
-                    }[self.get_data('pipes_replaced')])
+            self.set_data('status', 'replaced')
+            # TODO: An interact image for fixed but untaped pipes
+            return Result(
+                "The pipes slot neatly into place, but don't make an airtight seal."
+            )
 
     def interact_with_duct_tape(self, item):
         if self.get_data("status") == "broken":
             return Result("It would get lost in the fronds.")
-        elif self.get_data("fixed"):
+        elif self.get_data("status") == 'fixed':
             return Result("There's quite enough tape on the ducting already.")
-        elif self.get_data("pipes_replaced") < 3:
-            return Result("All the pipes need to be in place before they can be taped up.")
         else:
             self.set_data("fixed", True)
             self.set_data("status", "fixed")
@@ -208,6 +207,7 @@
                           " airtight and ready to hold pressure. Who'd've thought duct"
                           " tape could actually be used to tape ducts?")
 
+
 class DetergentThing(Thing):
 
     NAME = "mess.detergent"