Mercurial > rinkhals
diff gamelib/equipment.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 | 9d31cfc3afde |
children | 67d10f7e0159 |
line wrap: on
line diff
--- a/gamelib/equipment.py Fri Sep 04 19:32:30 2009 +0000 +++ b/gamelib/equipment.py Fri Sep 04 19:34:01 2009 +0000 @@ -35,9 +35,12 @@ DRAW_LAYER = 10 def _get_parameter(self, parameter, wielder): - mod_attr = 'MODIFY_%s_%s' % (self.TYPE, parameter) param = getattr(self, parameter) - return getattr(wielder.abode, mod_attr, lambda r: r)(param) + if wielder.abode: + mod_attr = 'MODIFY_%s_%s' % (self.TYPE, parameter) + modifier = getattr(wielder.abode.building, mod_attr, lambda r: r) + param = modifier(param) + return param def in_range(self, gameboard, wielder, target): """Can the lucky wielder hit the potentially unlucky target with this?"""