Mercurial > pyntnclick
comparison gamelib/scenes/cryo.py @ 375:c80a1bd291d1
Only give vandalism warning once
author | Stefano Rivera <stefano@rivera.za.net> |
---|---|
date | Sat, 28 Aug 2010 18:02:49 +0200 |
parents | a95bfba3acd5 |
children | 41ee3fc71404 |
comparison
equal
deleted
inserted
replaced
374:277a7a0c2cea | 375:c80a1bd291d1 |
---|---|
20 FOLDER = "cryo" | 20 FOLDER = "cryo" |
21 BACKGROUND = "cryo_room.png" | 21 BACKGROUND = "cryo_room.png" |
22 | 22 |
23 INITIAL_DATA = { | 23 INITIAL_DATA = { |
24 'accessible': True, | 24 'accessible': True, |
25 'greet' : True | 25 'greet' : True, |
26 'vandalism_warn': True, | |
26 } | 27 } |
27 | 28 |
28 # sounds that will be played randomly as background noise | 29 # sounds that will be played randomly as background noise |
29 MUSIC = [ | 30 MUSIC = [ |
30 'drip1.ogg', | 31 'drip1.ogg', |
154 | 155 |
155 INITIAL = "fixed" | 156 INITIAL = "fixed" |
156 | 157 |
157 INITIAL_DATA = { | 158 INITIAL_DATA = { |
158 'fixed': True, | 159 'fixed': True, |
159 } | 160 } |
160 | 161 |
161 def interact_with_machete(self, item): | 162 def interact_with_machete(self, item): |
162 if self.get_data('fixed'): | 163 if self.get_data('fixed'): |
163 self.set_data('fixed', False) | 164 self.set_data('fixed', False) |
164 pipe = TubeFragment('tube_fragment') | 165 pipe = TubeFragment('tube_fragment') |
165 self.state.add_item(pipe) | 166 self.state.add_item(pipe) |
166 self.state.add_inventory_item(pipe.name) | 167 self.state.add_inventory_item(pipe.name) |
167 self.set_interact("chopped") | 168 self.set_interact("chopped") |
168 return (Result("It takes more effort than one would expect, but " | 169 responses = [Result("It takes more effort than one would expect, but " |
169 "eventually the pipe is separated from the wall."), | 170 "eventually the pipe is separated from the wall.")] |
170 make_jim_dialog("Prisoner %s. Vandalism is an offence " | 171 if self.state.current_scene.get_data('vandalism_warn'): |
171 "punishable by a minimum of an additional 6 months " | 172 self.state.current_scene.set_data('vandalism_warn', False) |
172 "to your sentence" % PLAYER_ID, self.state)) | 173 responses.append(make_jim_dialog( |
174 ("Prisoner %s. Vandalism is an offence punishable by a " | |
175 "minimum of an additional 6 months to your sentence" | |
176 ) % PLAYER_ID, self.state)) | |
177 return responses | |
173 | 178 |
174 def is_interactive(self): | 179 def is_interactive(self): |
175 return self.get_data('fixed') | 180 return self.get_data('fixed') |
176 | 181 |
177 def interact_without(self): | 182 def interact_without(self): |