Mercurial > pyntnclick
comparison gamelib/scenes/machine.py @ 306:bd9a760eeb18
Hook up canopener. Fix for replace_inventory changes
author | Neil Muller <neil@dip.sun.ac.za> |
---|---|
date | Sat, 28 Aug 2010 01:28:51 +0200 |
parents | 6d93e04036c9 |
children | 5031b84fbb4c |
comparison
equal
deleted
inserted
replaced
305:75783238f73d | 306:bd9a760eeb18 |
---|---|
115 self.set_data('cans_in_place', 0) | 115 self.set_data('cans_in_place', 0) |
116 self.state.add_inventory_item('tin_pipe') | 116 self.state.add_inventory_item('tin_pipe') |
117 return Result("With high-precision spitzensparken, the cans are welded into a replacement tube.", | 117 return Result("With high-precision spitzensparken, the cans are welded into a replacement tube.", |
118 soundfile='laser.ogg') | 118 soundfile='laser.ogg') |
119 | 119 |
120 def interact_with_dented_can(self, item): | |
121 return self.interact_with_empty_can(item) | |
122 | |
123 def interact_with_empty_can(self, item): | 120 def interact_with_empty_can(self, item): |
124 starting_cans = self.get_data('cans_in_place') | 121 starting_cans = self.get_data('cans_in_place') |
125 if starting_cans < 3: | 122 if starting_cans < 3: |
126 self.state.remove_inventory_item(item.name) | 123 self.state.remove_inventory_item(item.name) |
127 self.set_data('cans_in_place', starting_cans + 1) | 124 self.set_data('cans_in_place', starting_cans + 1) |
182 | 179 |
183 def interact_without(self): | 180 def interact_without(self): |
184 return Result("It looks like it eats fingers. Perhaps a different approach is in order?") | 181 return Result("It looks like it eats fingers. Perhaps a different approach is in order?") |
185 | 182 |
186 def interact_with_titanium_leg(self, item): | 183 def interact_with_titanium_leg(self, item): |
187 self.state.replace_inventory_item(item, self.state.items['machete']) | 184 self.state.replace_inventory_item(item.name, 'machete') |
188 return Result("After much delicate grinding and a few close calls with" | 185 return Result("After much delicate grinding and a few close calls with" |
189 " various body parts, the titanium femur now resembles" | 186 " various body parts, the titanium femur now resembles" |
190 " a machete more than a bone. Nice and sharp, too.", | 187 " a machete more than a bone. Nice and sharp, too.", |
191 soundfile="grinder.ogg") | 188 soundfile="grinder.ogg") |
192 | 189 |