Mercurial > boomslang
changeset 134:faac82748f5a
Put the leg inside the cryo unit.
author | Jeremy Thurgood <firxen@gmail.com> |
---|---|
date | Tue, 24 Aug 2010 20:21:07 +0200 |
parents | 0530547a131f |
children | b43599b7f8a2 |
files | gamelib/gamescreen.py gamelib/scenes/cryo.py |
diffstat | 2 files changed, 13 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/gamelib/gamescreen.py Tue Aug 24 19:49:10 2010 +0200 +++ b/gamelib/gamescreen.py Tue Aug 24 20:21:07 2010 +0200 @@ -114,6 +114,12 @@ def mouse_move(self, event): self.state.mouse_move_detail(event.pos) + def show_message(self, message): + # Display the message as a modal dialog + MessageDialog(message, 60).present() + # queue a redraw to show updated state + self.invalidate() + class ToolBar(Row): def __init__(self, items):
--- a/gamelib/scenes/cryo.py Tue Aug 24 19:49:10 2010 +0200 +++ b/gamelib/scenes/cryo.py Tue Aug 24 20:21:07 2010 +0200 @@ -63,12 +63,7 @@ } def interact_without(self): - self.state.add_inventory_item('titanium_leg') - self.set_data('contains_titanium_leg', False) - return Result("The skeletal occupant of this cryo unit has an artificial femur made of titanium. You take it.") - - def is_interactive(self): - return self.get_data('contains_titanium_leg') + return Result(detail_view='cryo_detail') def get_description(self): if self.get_data('contains_titanium_leg'): @@ -169,16 +164,16 @@ NAME = "cryo.titanium_leg" INTERACTS = { - "triangular": InteractImage(50, 50, "triangle.png"), + "leg": InteractImage(50, 50, "triangle.png"), } - INITIAL = "triangular" + INITIAL = "leg" def interact_without(self): - return Result("You interacted.") - - def is_interactive(self): - return True + self.state.add_inventory_item('titanium_leg') + self.state.current_scene.things['cryo.unit.1'].set_data('contains_titanium_leg', False) + self.scene.remove_thing(self) + return Result("The skeletal occupant of this cryo unit has an artificial femur made of titanium. You take it.") class CryoUnitWithCorpse(Scene):