# HG changeset patch # User Stefano Rivera # Date 1283001505 -7200 # Node ID c193cbff785d9b287f7c1ea70822c2108cd181f3 # Parent 7147369cee59d84feaea50db9e2a9ac7b00aa9ab The environment / pipe puzzle is now solveable diff -r 7147369cee59 -r c193cbff785d gamelib/scenes/cryo.py --- 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), } diff -r 7147369cee59 -r c193cbff785d gamelib/scenes/mess.py --- 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"