Ignore:
Timestamp:
Nov 21, 2009, 9:40:29 AM (11 years ago)
Author:
Neil Muller <drnlmuller@…>
Branch:
default
Convert:
svn:b4e93282-eac8-4b8b-b765-0f5d36de2b68/trunk/rinkhals@413
Message:

Levels can include starting equipment

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gamelib/gameboard.py

    r405 r408  
    303303        self.fix_buildings()
    304304
    305         cdata = {
    306                 1 : (self.add_start_chickens, None),
    307                 }
     305        cdata = {}
     306        for tn in equipment.EQUIP_MAP:
     307            cdata[tn]  = (self.add_start_chickens, tn)
    308308
    309309        self.tv.run_codes(cdata, (0,0,width,height))
     
    938938        self.toolbar.update_cash_counter(self.cash)
    939939
    940     def add_start_chickens(self, _map, tile, _value):
     940    def add_start_chickens(self, _map, tile, value):
    941941        """Add chickens as specified by the code layer"""
    942942        chick = animal.Chicken((tile.tx, tile.ty))
     943        for equip_cls in equipment.EQUIP_MAP[value]:
     944            item = equip_cls()
     945            chick.equip(item)
    943946        self.add_chicken(chick)
    944947
Note: See TracChangeset for help on using the changeset viewer.