changeset 353:b61dccc7fb42

Detergent + cryo fluid puzzle (currently triangular)
author Stefano Rivera <stefano@rivera.za.net>
date Sat, 28 Aug 2010 16:18:40 +0200
parents 88c1a59b0544
children 09efb8b7c132
files gamelib/scenes/cryo.py gamelib/scenes/engine.py
diffstat 2 files changed, 48 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/gamelib/scenes/cryo.py	Sat Aug 28 15:53:56 2010 +0200
+++ b/gamelib/scenes/cryo.py	Sat Aug 28 16:18:40 2010 +0200
@@ -43,6 +43,7 @@
         self.add_thing(CryoPipeLeft())
         self.add_thing(CryoPipeRightTop())
         self.add_thing(CryoPipeRightBottom())
+        self.add_thing(CryoPools())
 
         # Flavour items
         # pipes
@@ -60,14 +61,6 @@
                 )))
         self.add_thing(UncuttableCryoPipes())
 
-        # leaks
-        self.add_thing(GenericDescThing('cryo.leaks', 2,
-            "Fluid leaks disturbingly from the bulkheads",
-            (
-                (444, 216, 125, 67),
-                (44, 133, 74, 107),
-                )))
-
         # cryo units
         self.add_thing(GenericCryoUnit(2,
             "An empty cryo chamber.",
@@ -423,6 +416,7 @@
     def get_description(self):
         return "This femur looks synthetic."
 
+
 class PlaqueThing(Thing):
     "Plaque on the detailed cryo chamber"
 
@@ -440,6 +434,40 @@
     def get_description(self):
         return "'Prisoner 98cc-764e646391ee. War crimes. 45 years."
 
+
+class FullBottle(Item):
+    INVENTORY_IMAGE = 'triangle.png'
+    CURSOR = CursorSprite('triangle.png')
+
+
+class CryoPools(Thing):
+    "Handy for cooling engines"
+
+    NAME = 'cryo.pool'
+
+    INTERACTS = {
+        'pools': InteractRectUnion((
+                (444, 216, 125, 67),
+                (44, 133, 74, 107),
+                (485, 396, 97, 34),
+        )),
+    }
+
+    INITIAL = 'pools'
+
+    def get_description(self):
+        return "Coolant leaks disturbingly from the bulkheads"
+
+    def interact_without(self):
+        return Result("It's gooey")
+
+    def interact_with_detergent_bottle(self, item):
+        full = FullBottle('full_detergent_bottle')
+        self.state.add_item(full)
+        self.state.replace_inventory_item(item.name, full.name)
+        return Result("You scoop up some coolant and fill the bottle")
+
+
 class CryoCompDetail(Scene):
 
     FOLDER = "cryo"
--- a/gamelib/scenes/engine.py	Sat Aug 28 15:53:56 2010 +0200
+++ b/gamelib/scenes/engine.py	Sat Aug 28 16:18:40 2010 +0200
@@ -249,6 +249,18 @@
     def get_description(self):
         return "The receptacles for the coolant reservoirs."
 
+    def interact_without(self):
+        return Result("You stick your finger in the receptacle. "
+                      "It almost gets stuck")
+
+    def interact_with_full_detergent_bottle(self, item):
+        # TODO: Show full tank interact
+        self.state.remove_inventory_item(item.name)
+        self.state.current_scene.things['engine.cryo_containers'] \
+                  .set_data('filled', True)
+        return Result("You fill the reservoirs. "
+                      "It seems the detergent bottle was just big enough")
+
 
 class CoolingPipes(Thing):
     NAME = 'engine.coolingpipes'