comparison gamelib/scenes/crew_quarters.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 386475464202
comparison
equal deleted inserted replaced
602:1aac5a3b17e1 603:3ce19d33b51f
64 64
65 def interact_without(self): 65 def interact_without(self):
66 if self.get_data('is_cracked'): 66 if self.get_data('is_cracked'):
67 if self.get_data('has_tape'): 67 if self.get_data('has_tape'):
68 self.set_data('has_tape', False) 68 self.set_data('has_tape', False)
69 self.state.add_inventory_item('duct_tape') 69 self.game.add_inventory_item('duct_tape')
70 self.set_interact('empty_safe') 70 self.set_interact('empty_safe')
71 return Result("Duct tape. It'll stick to everything except " 71 return Result("Duct tape. It'll stick to everything except "
72 "ducts, apparently.") 72 "ducts, apparently.")
73 return Result("The perfectly balanced door swings frictionlessly " 73 return Result("The perfectly balanced door swings frictionlessly "
74 "to and fro. What craftsmanship!") 74 "to and fro. What craftsmanship!")
88 " here."), 88 " here."),
89 make_jim_dialog("Prisoner %s, you have been observed" 89 make_jim_dialog("Prisoner %s, you have been observed"
90 " committing a felony violation. This will go onto" 90 " committing a felony violation. This will go onto"
91 " your permanent record, and your sentence may be" 91 " your permanent record, and your sentence may be"
92 " extended by up to twenty years." 92 " extended by up to twenty years."
93 % PLAYER_ID, self.state)) 93 % PLAYER_ID, self.game))
94 94
95 def get_description(self): 95 def get_description(self):
96 return "Ah, a vintage Knoxx & Co. model QR3. Quaint, but" \ 96 return "Ah, a vintage Knoxx & Co. model QR3. Quaint, but" \
97 " reasonably secure." 97 " reasonably secure."
98 98
117 if not self.get_data('has_bowl'): 117 if not self.get_data('has_bowl'):
118 return Result("What's the point of lugging around a very dead" 118 return Result("What's the point of lugging around a very dead"
119 " fish and a kilogram or so of sand?") 119 " fish and a kilogram or so of sand?")
120 self.set_interact('fish_no_bowl') 120 self.set_interact('fish_no_bowl')
121 self.set_data('has_bowl', False) 121 self.set_data('has_bowl', False)
122 self.state.add_inventory_item('fishbowl') 122 self.game.add_inventory_item('fishbowl')
123 return Result("The fishbowl is useful, but its contents aren't.") 123 return Result("The fishbowl is useful, but its contents aren't.")
124 124
125 def get_description(self): 125 def get_description(self):
126 if self.get_data('has_bowl'): 126 if self.get_data('has_bowl'):
127 return "This fishbowl looks exactly like an old science fiction" \ 127 return "This fishbowl looks exactly like an old science fiction" \
138 CURSOR = CursorSprite('fishbowl.png') 138 CURSOR = CursorSprite('fishbowl.png')
139 NAME = "fishbowl" 139 NAME = "fishbowl"
140 140
141 def interact_with_duct_tape(self, item): 141 def interact_with_duct_tape(self, item):
142 helmet = FishbowlHelmet('helmet') 142 helmet = FishbowlHelmet('helmet')
143 self.state.add_item(helmet) 143 self.game.add_item(helmet)
144 self.state.replace_inventory_item(self.name, helmet.name) 144 self.game.replace_inventory_item(self.name, helmet.name)
145 return Result("You duct tape the edges of the helmet. The seal is" 145 return Result("You duct tape the edges of the helmet. The seal is"
146 " crude, but it will serve as a workable helmet if needed.") 146 " crude, but it will serve as a workable helmet if needed.")
147 147
148 148
149 class FishbowlHelmet(Item): 149 class FishbowlHelmet(Item):
185 } 185 }
186 186
187 INITIAL = 'poster' 187 INITIAL = 'poster'
188 188
189 def interact_without(self): 189 def interact_without(self):
190 self.state.add_inventory_item('escher_poster') 190 self.game.add_inventory_item('escher_poster')
191 self.scene.remove_thing(self) 191 self.scene.remove_thing(self)
192 return Result("This poster will go nicely on your bedroom wall.") 192 return Result("This poster will go nicely on your bedroom wall.")
193 193
194 def get_description(self): 194 def get_description(self):
195 return "A paradoxical poster hangs below the security camera." 195 return "A paradoxical poster hangs below the security camera."