Mercurial > pyntnclick
comparison gamelib/scenes/map.py @ 603:3ce19d33b51f pyntnclick
Rename state to game to not cause confusion with the other state
author | Neil Muller <neil@dip.sun.ac.za> |
---|---|
date | Sat, 11 Feb 2012 20:09:47 +0200 |
parents | 4e9178215e75 |
children | d6ded808cc33 |
comparison
equal
deleted
inserted
replaced
602:1aac5a3b17e1 | 603:3ce19d33b51f |
---|---|
38 self.set_data('implant', False) | 38 self.set_data('implant', False) |
39 ai1 = make_jim_dialog( | 39 ai1 = make_jim_dialog( |
40 "Under the terms of the emergency conscription " | 40 "Under the terms of the emergency conscription " |
41 "act, I have downloaded the ship's schematics to your " | 41 "act, I have downloaded the ship's schematics to your " |
42 "neural implant to help you navigate around the ship.", | 42 "neural implant to help you navigate around the ship.", |
43 self.state) | 43 self.game) |
44 if ai1: | 44 if ai1: |
45 return ai1, make_jim_dialog("Prisoner %s, you are a " | 45 return ai1, make_jim_dialog("Prisoner %s, you are a " |
46 "class 1 felon. Obtaining access to the ship's schematics " | 46 "class 1 felon. Obtaining access to the ship's schematics " |
47 "constitutes a level 2 offence and carries a minimal penalty " | 47 "constitutes a level 2 offence and carries a minimal penalty " |
48 "of an additional 3 years on your sentence." % PLAYER_ID, | 48 "of an additional 3 years on your sentence." % PLAYER_ID, |
49 self.state) | 49 self.game) |
50 | 50 |
51 | 51 |
52 class DoorThing(Thing): | 52 class DoorThing(Thing): |
53 | 53 |
54 # name of destination | 54 # name of destination |
55 DEST = None | 55 DEST = None |
56 | 56 |
57 def interact(self, _item): | 57 def interact(self, _item): |
58 """Go to destination.""" | 58 """Go to destination.""" |
59 if self.DEST in self.state.scenes: | 59 if self.DEST in self.game.scenes: |
60 self.state.set_current_scene(self.DEST) | 60 self.game.set_current_scene(self.DEST) |
61 | 61 |
62 | 62 |
63 class ToCryo(DoorThing): | 63 class ToCryo(DoorThing): |
64 "Way to cryo room." | 64 "Way to cryo room." |
65 | 65 |
122 } | 122 } |
123 | 123 |
124 INITIAL = 'door' | 124 INITIAL = 'door' |
125 | 125 |
126 def interact(self, item): | 126 def interact(self, item): |
127 if not self.state.is_in_inventory('helmet'): | 127 if not self.game.is_in_inventory('helmet'): |
128 return Result('The airlock refuses to open. The automated' | 128 return Result('The airlock refuses to open. The automated' |
129 ' voice says: "Hull breach beyond this door. Personnel' | 129 ' voice says: "Hull breach beyond this door. Personnel' |
130 ' must be equipped for vacuum before entry."') | 130 ' must be equipped for vacuum before entry."') |
131 else: | 131 else: |
132 return super(ToEngine, self).interact(item) | 132 return super(ToEngine, self).interact(item) |