Mercurial > pyntnclick
changeset 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 | 1555677d86f6 |
children | 0fd5796a1562 |
files | Resources/images/crew_quarters/open_safe_full.png Resources/images/items/superconductor_fixed_cursor.png Resources/images/items/superconductor_taped.png Resources/images/items/superconductor_taped_cursor.png gamelib/scenes/bridge.py gamelib/scenes/engine.py sources/art/open_safe_full.xcf sources/art/superconductor_taped.xcf sources/art/superconductor_taped_cursor.xcf |
diffstat | 9 files changed, 23 insertions(+), 0 deletions(-) [+] |
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."
--- a/gamelib/scenes/engine.py Sat Aug 28 21:05:36 2010 +0200 +++ b/gamelib/scenes/engine.py Sat Aug 28 21:24:04 2010 +0200 @@ -196,6 +196,15 @@ return Result("With leverage, the burned-out superconductor snaps out.") def interact_with_superconductor(self, item): + if self.get_data('present'): + return Result("It might help to remove the broken superconductor first") + else: + return Result("You plug in the superconductor, and feel a humm " + "as things kick into life. " + "Unfortunately, it's the wrong size for the socket " + "and just falls out again when you let go.") + + def interact_with_taped_superconductor(self, item): if not self.get_data('present'): self.set_interact('fixed') self.set_data('present', True)