Mercurial > pyntnclick
diff gamelib/scenes/map.py @ 466:af2a23b9787d
You can now use doors while wielding things.
author | Jeremy Thurgood <firxen@gmail.com> |
---|---|
date | Sun, 29 Aug 2010 01:43:55 +0200 |
parents | b1e38ac3abb1 |
children | a9925aaf5f61 821b322e903b |
line wrap: on
line diff
--- 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.")