# HG changeset patch # User Jeremy Thurgood # Date 1283039035 -7200 # Node ID af2a23b9787db39e1303efc30073a53fc977a9cb # Parent 03dcb25d837020f154b2ba1ffa4f819923a676c3 You can now use doors while wielding things. diff -r 03dcb25d8370 -r af2a23b9787d gamelib/scenes/bridge.py --- a/gamelib/scenes/bridge.py Sun Aug 29 01:36:04 2010 +0200 +++ b/gamelib/scenes/bridge.py Sun Aug 29 01:43:55 2010 +0200 @@ -39,7 +39,6 @@ ] INITIAL_DATA = { - 'accessible': True, 'ai status' : 'online', # online, looping, dead 'ai panel' : 'closed', # closed, open, broken } diff -r 03dcb25d8370 -r af2a23b9787d gamelib/scenes/crew_quarters.py --- a/gamelib/scenes/crew_quarters.py Sun Aug 29 01:36:04 2010 +0200 +++ b/gamelib/scenes/crew_quarters.py Sun Aug 29 01:43:55 2010 +0200 @@ -16,10 +16,6 @@ OFFSET = (0, -50) - INITIAL_DATA = { - 'accessible': True, - } - def __init__(self, state): super(CrewQuarters, self).__init__(state) self.add_thing(ToMap()) diff -r 03dcb25d8370 -r af2a23b9787d gamelib/scenes/cryo.py --- a/gamelib/scenes/cryo.py Sun Aug 29 01:36:04 2010 +0200 +++ b/gamelib/scenes/cryo.py Sun Aug 29 01:43:55 2010 +0200 @@ -23,7 +23,6 @@ BACKGROUND = "cryo_room.png" INITIAL_DATA = { - 'accessible': True, 'greet' : True, 'vandalism_warn': True, } @@ -364,8 +363,6 @@ def open_door(self): self.set_data('door', "open") self.set_interact("open") - self.state.scenes['bridge'].set_data('accessible', True) - self.state.scenes['mess'].set_data('accessible', True) def get_description(self): if self.get_data('door') == "open": diff -r 03dcb25d8370 -r af2a23b9787d gamelib/scenes/engine.py --- a/gamelib/scenes/engine.py Sun Aug 29 01:36:04 2010 +0200 +++ b/gamelib/scenes/engine.py Sun Aug 29 01:43:55 2010 +0200 @@ -16,7 +16,6 @@ BACKGROUND = "engine_room.png" INITIAL_DATA = { - 'accessible': True, 'engine online': False, 'greet' : True, } diff -r 03dcb25d8370 -r af2a23b9787d gamelib/scenes/machine.py --- a/gamelib/scenes/machine.py Sun Aug 29 01:36:04 2010 +0200 +++ b/gamelib/scenes/machine.py Sun Aug 29 01:43:55 2010 +0200 @@ -12,10 +12,6 @@ FOLDER = "machine" BACKGROUND = "machine_room.png" - INITIAL_DATA = { - 'accessible': True, - } - def __init__(self, state): super(Machine, self).__init__(state) self.add_thing(ToMap()) diff -r 03dcb25d8370 -r af2a23b9787d gamelib/scenes/map.py --- a/gamelib/scenes/map.py Sun Aug 29 01:36:04 2010 +0200 +++ b/gamelib/scenes/map.py Sun Aug 29 01:43:55 2010 +0200 @@ -21,7 +21,6 @@ BACKGROUND = 'map.png' INITIAL_DATA = { - 'accessible': True, 'implant': True, } @@ -56,16 +55,10 @@ # name of destination DEST = None - def interact_without(self): + def interact(self, _item): """Go to destination.""" if self.DEST in self.state.scenes: - if self.state.scenes[self.DEST].get_data('accessible'): - self.state.set_current_scene(self.DEST) - return Result() - else: - return Result("You can't go there right now.") - else: - return Result("You *could* go there, but it doesn't actually exist.") + self.state.set_current_scene(self.DEST) class ToCryo(DoorThing): @@ -131,13 +124,13 @@ INITIAL = 'door' - def interact_without(self): + def interact(self, item): if not self.state.is_in_inventory('helmet'): return Result('The airlock refuses to open. The automated' ' voice says: "Hull breach beyond this door. Personnel' ' must be equipped for vacuum before entry."') else: - return super(ToEngine, self).interact_without() + return super(ToEngine, self).interact(item) class ToMachine(DoorThing): @@ -187,7 +180,7 @@ INITIAL = 'areas' - def interact_without(self): + def interact(self, _item): return Result("You look in the door, but just see empty space: " "that room appears to have been obliterated by meteors.") @@ -204,7 +197,7 @@ INITIAL = 'areas' - def interact_without(self): + def interact(self, _item): return Result("Peering in through the window, you see that the entire " "chamber is overgrown with giant broccoli. It would " "take you years to cut a path through that.") diff -r 03dcb25d8370 -r af2a23b9787d gamelib/scenes/mess.py --- a/gamelib/scenes/mess.py Sun Aug 29 01:36:04 2010 +0200 +++ b/gamelib/scenes/mess.py Sun Aug 29 01:43:55 2010 +0200 @@ -20,7 +20,6 @@ BACKGROUND = "mess_hall.png" INITIAL_DATA = { - 'accessible': True, 'life support status': 'broken', # broken, replaced, fixed } diff -r 03dcb25d8370 -r af2a23b9787d gamelib/scenes/won.py --- a/gamelib/scenes/won.py Sun Aug 29 01:36:04 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -"""You WON screen""" - -from gamelib.state import Scene, Item, Thing, Result -from gamelib.scenes.game_constants import PLAYER_ID -from gamelib.scenes.scene_widgets import (Door, InteractText, InteractNoImage, - InteractRectUnion, InteractImage, - InteractAnimated, GenericDescThing, - make_jim_dialog) - - -class Won(Scene): - - FOLDER = "won" - BACKGROUND = "won.png" - - INITIAL_DATA = { - 'accessible': False, - } - - def __init__(self, state): - super(Won, self).__init__(state) - - -SCENES = [Won] diff -r 03dcb25d8370 -r af2a23b9787d gamelib/state.py --- a/gamelib/state.py Sun Aug 29 01:36:04 2010 +0200 +++ b/gamelib/state.py Sun Aug 29 01:43:55 2010 +0200 @@ -65,7 +65,6 @@ state.load_scenes("crew_quarters") state.load_scenes("map") state.load_scenes("manual") - state.load_scenes("won") initial_scene = "cryo" if DEBUG_SCENE is None else DEBUG_SCENE state.set_current_scene(initial_scene) state.set_do_enter_leave()