diff gamelib/buildings.py @ 198:355eaae40b1f

Buildings now affect weapon range and accuracy.
author Jeremy Thurgood <firxen@gmail.com>
date Fri, 04 Sep 2009 19:34:01 +0000
parents b400991ccce1
children 696936621a93
line wrap: on
line diff
--- a/gamelib/buildings.py	Fri Sep 04 19:32:30 2009 +0000
+++ b/gamelib/buildings.py	Fri Sep 04 19:34:01 2009 +0000
@@ -51,6 +51,8 @@
 
     IS_BUILDING = True
     GRASSLAND = tiles.REVERSE_TILE_MAP['grassland']
+    MODIFY_KNIFE_RANGE = lambda s, x: 0
+    MODIFY_GUN_RANGE = lambda s, x: -1
 
     def __init__(self, pos):
         """Initial image, tile vid position, size and tile number for building."""
@@ -187,6 +189,7 @@
 
 class DoubleStoryHenHouse(HenHouse):
     """A double story hen house."""
+
     TILE_NO = tiles.REVERSE_TILE_MAP['hendominium']
     BUY_PRICE = 300
     SELL_PRICE = 150
@@ -208,6 +211,10 @@
     NAME = 'Watchtower'
     FLOORS = 1
 
+    MODIFY_GUN_RANGE = lambda s, x: (3*x)/2
+    MODIFY_GUN_BASE_HIT = lambda s, x: x-5
+    MODIFY_GUN_RANGE_PENALTY = lambda s, x: x-1
+
 def is_building(obj):
     """Return true if obj is a build class."""
     return getattr(obj, "IS_BUILDING", False) and hasattr(obj, "NAME")