Changeset 77:65958516c7d9


Ignore:
Timestamp:
Sep 1, 2009, 10:40:57 AM (11 years ago)
Author:
Simon Cross <hodgestar@…>
Branch:
default
Convert:
svn:b4e93282-eac8-4b8b-b765-0f5d36de2b68@78
Message:

Implement separate fence repair cost (currently 25 groats).

Location:
gamelib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • gamelib/constants.py

    r66 r77  
    2424BUY_PRICE_FENCE = 50
    2525SELL_PRICE_FENCE = 25
     26REPAIR_PRICE_FENCE = 25
    2627
    2728TOOL_SELL_CHICKEN = 1
  • gamelib/gameboard.py

    r73 r77  
    175175        if this_tile not in [self.GRASSLAND, self.BROKEN_FENCE]:
    176176            return
    177         if self.cash < constants.BUY_PRICE_FENCE:
     177        if this_tile == self.GRASSLAND:
     178            cost = constants.BUY_PRICE_FENCE
     179        else:
     180            cost = constants.REPAIR_PRICE_FENCE
     181        if self.cash < cost:
    178182            print "You can't afford a fence."
    179183            return
    180         self.add_cash(-constants.BUY_PRICE_FENCE)
     184        self.add_cash(-cost)
    181185        self.tv.set(tile_pos, self.FENCE)
    182186
Note: See TracChangeset for help on using the changeset viewer.