Mercurial > rinkhals
comparison gamelib/gameboard.py @ 193:db246683d5da
Selling eggs now works
author | Neil Muller <drnlmuller@gmail.com> |
---|---|
date | Fri, 04 Sep 2009 18:45:06 +0000 |
parents | a490ee2ef446 |
children | 5ec222ca07cd |
comparison
equal
deleted
inserted
replaced
192:a490ee2ef446 | 193:db246683d5da |
---|---|
304 do_sell(chick) | 304 do_sell(chick) |
305 | 305 |
306 | 306 |
307 def sell_egg(self, tile_pos): | 307 def sell_egg(self, tile_pos): |
308 def do_sell(chicken): | 308 def do_sell(chicken): |
309 # Placeholde | 309 if chicken.egg: |
310 # We sell the egg | |
311 self.add_cash(constants.SELL_PRICE_CHICKEN) | |
312 sound.play_sound("sell-chicken.ogg") | |
313 chicken.egg = None | |
314 self.eggs -= 1 | |
315 self.toolbar.update_egg_counter(self.eggs) | |
316 # Force update | |
317 self.toolbar.chsize() | |
310 return False | 318 return False |
319 | |
311 building = self.get_building(tile_pos) | 320 building = self.get_building(tile_pos) |
312 if building and building.NAME in buildings.HENHOUSES: | 321 if building and building.NAME in buildings.HENHOUSES: |
313 self.open_building_dialog(building) | 322 self.open_building_dialog(building, do_sell) |
314 | 323 |
315 def place_animal(self, tile_pos): | 324 def place_animal(self, tile_pos): |
316 """Handle an TOOL_PLACE_ANIMALS click. | 325 """Handle an TOOL_PLACE_ANIMALS click. |
317 | 326 |
318 This will either select an animal or | 327 This will either select an animal or |