# HG changeset patch # User Simon Cross # Date 1251801657 0 # Node ID 65958516c7d9ab0ec2e6969358ef3ae8aefb086f # Parent 615a5afaf1a42a0d7e3c6d9734e551188838a777 Implement separate fence repair cost (currently 25 groats). diff -r 615a5afaf1a4 -r 65958516c7d9 gamelib/constants.py --- a/gamelib/constants.py Tue Sep 01 10:15:21 2009 +0000 +++ b/gamelib/constants.py Tue Sep 01 10:40:57 2009 +0000 @@ -23,6 +23,7 @@ SELL_PRICE_CHICKEN = 10 BUY_PRICE_FENCE = 50 SELL_PRICE_FENCE = 25 +REPAIR_PRICE_FENCE = 25 TOOL_SELL_CHICKEN = 1 TOOL_SELL_EGG = 2 diff -r 615a5afaf1a4 -r 65958516c7d9 gamelib/gameboard.py --- a/gamelib/gameboard.py Tue Sep 01 10:15:21 2009 +0000 +++ b/gamelib/gameboard.py Tue Sep 01 10:40:57 2009 +0000 @@ -174,10 +174,14 @@ this_tile = self.tv.get(tile_pos) if this_tile not in [self.GRASSLAND, self.BROKEN_FENCE]: return - if self.cash < constants.BUY_PRICE_FENCE: + if this_tile == self.GRASSLAND: + cost = constants.BUY_PRICE_FENCE + else: + cost = constants.REPAIR_PRICE_FENCE + if self.cash < cost: print "You can't afford a fence." return - self.add_cash(-constants.BUY_PRICE_FENCE) + self.add_cash(-cost) self.tv.set(tile_pos, self.FENCE) def sell_fence(self, tile_pos):