Mercurial > rinkhals
comparison gamelib/animal.py @ 443:4efe57fcc1d7
Anything off the board is invisible.
author | Jeremy Thurgood <firxen@gmail.com> |
---|---|
date | Sat, 21 Nov 2009 18:59:23 +0000 |
parents | 7b5e4b6dd889 |
children | af2482444945 |
comparison
equal
deleted
inserted
replaced
442:67b32a26dc57 | 443:4efe57fcc1d7 |
---|---|
663 modifier = getattr(watcher.abode.building, 'MODIFY_'+parameter, lambda r: r) | 663 modifier = getattr(watcher.abode.building, 'MODIFY_'+parameter, lambda r: r) |
664 param = modifier(param) | 664 param = modifier(param) |
665 return param | 665 return param |
666 | 666 |
667 def visible(watcher, watchee, gameboard): | 667 def visible(watcher, watchee, gameboard): |
668 if not gameboard.in_bounds(watchee.pos): | |
669 # We can't see anything off the edge of the board. | |
670 return False | |
668 vision_bonus = _get_vision_param('VISION_BONUS', watcher) | 671 vision_bonus = _get_vision_param('VISION_BONUS', watcher) |
669 range_penalty = _get_vision_param('VISION_RANGE_PENALTY', watcher) | 672 range_penalty = _get_vision_param('VISION_RANGE_PENALTY', watcher) |
670 positions = watcher.pos.intermediate_positions(watchee.pos) | 673 positions = watcher.pos.intermediate_positions(watchee.pos) |
671 for pos in positions: | 674 for pos in positions: |
672 building = gameboard.get_building(pos.to_tile_tuple()) | 675 building = gameboard.get_building(pos.to_tile_tuple()) |