diff gamelib/scenes/bridge.py @ 399:1cfcd82519b6

You have to duct tape the superconductor
author Stefano Rivera <stefano@rivera.za.net>
date Sat, 28 Aug 2010 21:24:04 +0200
parents 21faf5c8804c
children df3216b369b1
line wrap: on
line diff
--- a/gamelib/scenes/bridge.py	Sat Aug 28 21:05:36 2010 +0200
+++ b/gamelib/scenes/bridge.py	Sat Aug 28 21:24:04 2010 +0200
@@ -200,12 +200,26 @@
                       "heart has stopped. Probably a while ago.")
 
 
+class TapedSuperconductor(Item):
+    "Used for connecting high-powered parts of the ship up"
+
+    INVENTORY_IMAGE = 'superconductor_taped.png'
+    CURSOR = CursorSprite('superconductor_taped_cursor.png')
+
+
 class Superconductor(Item):
     "Used for connecting high-powered parts of the ship up"
 
     INVENTORY_IMAGE = 'superconductor_fixed.png'
     CURSOR = CursorSprite('superconductor_fixed.png')
 
+    def interact_with_duct_tape(self, item, state):
+        taped_superconductor = TapedSuperconductor('taped_superconductor')
+        state.add_item(taped_superconductor)
+        state.replace_inventory_item(self.name, taped_superconductor.name)
+        return Result("You rip off a piece of duct tape and stick it on the superconductor. "
+                      "It almost sticks to itself, but you successfully avoid disaster.")
+
 
 class SuperconductorThing(Thing):
     "Superconductor from the massage chair."