# HG changeset patch # User Jeremy Thurgood # Date 1258827301 0 # Node ID 16437cf4a2b8dc012e601132eb25f70728816575 # Parent 95b81e9173994852ab14d0c7cb657e61474c0bce Trees provide a modicum of cover. diff -r 95b81e917399 -r 16437cf4a2b8 gamelib/animal.py --- a/gamelib/animal.py Sat Nov 21 17:55:28 2009 +0000 +++ b/gamelib/animal.py Sat Nov 21 18:15:01 2009 +0000 @@ -11,6 +11,7 @@ import equipment import animations import serializer +import constants class Animal(Sprite, serializer.Simplifiable): """Base class for animals""" @@ -669,8 +670,10 @@ if building and building.BLOCKS_VISION and not (watcher in building.occupants()): return False distance = watcher.pos.dist(watchee.pos) - 1 + # Intervening forests get in the way a bit. + woods = len([pos for pos in positions if gameboard.tv.get(pos.to_tile_tuple()) == gameboard.WOODLAND]) roll = random.randint(1, 100) - return roll > watchee.STEALTH - vision_bonus + range_penalty*distance + return roll > watchee.STEALTH - vision_bonus + range_penalty*distance + constants.WOODLAND_CONCEALMENT*woods # These don't have to add up to 100, but it's easier to think # about them if they do. diff -r 95b81e917399 -r 16437cf4a2b8 gamelib/constants.py --- a/gamelib/constants.py Sat Nov 21 17:55:28 2009 +0000 +++ b/gamelib/constants.py Sat Nov 21 18:15:01 2009 +0000 @@ -40,6 +40,7 @@ # Game constants, still to be made configurable LOGGING_PRICE = 50 +WOODLAND_CONCEALMENT = 10 # Toolbar constants