Changeset 219:0a84d5aedc5c


Ignore:
Timestamp:
Sep 4, 2009, 10:18:23 PM (11 years ago)
Author:
Neil Muller <drnlmuller@…>
Branch:
default
Convert:
svn:b4e93282-eac8-4b8b-b765-0f5d36de2b68@220
Message:

Remove eggs from chickens placed outside. Fix some bugs with setting the correct image on buttons

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gamelib/gameboard.py

    r218 r219  
    333333            self.add_cash(constants.SELL_PRICE_CHICKEN)
    334334            sound.play_sound("sell-chicken.ogg")
    335             self.remove_chicken(chicken)
    336335            return True
    337336
     
    402401                self.animal_to_place.unequip_by_name("nest")
    403402                self.relocate_animal(self.animal_to_place, tile_pos=tile_pos)
     403                if self.animal_to_place.egg:
     404                    self.animal_to_place.remove_egg()
     405                    self.eggs -= 1
     406                    self.toolbar.update_egg_counter(self.eggs)
    404407
    405408    def relocate_animal(self, chicken, tile_pos=None, place=None):
     
    477480                        # empty the nest (on button)
    478481                        update_button(place.occupant, empty=True)
     482                        self.remove_chicken(place.occupant)
    479483                    else:
    480484                        # Update for equipment changes, etc.
     
    692696                            building.add_occupant(new_chick)
    693697                            self.add_chicken(new_chick)
     698                            new_chick.equip(equipment.Nest())
    694699                        except buildings.BuildingFullError:
    695700                            print "Building full."
Note: See TracChangeset for help on using the changeset viewer.