# HG changeset patch # User Jeremy Thurgood # Date 1252166868 0 # Node ID 664bba9be40abf045844b2efa757a944022d71bf # Parent 37d88a9fc097893a2d0e5fdfebe0eb77c89b6830 Fences are eclectic. diff -r 37d88a9fc097 -r 664bba9be40a gamelib/animal.py --- a/gamelib/animal.py Sat Sep 05 16:05:41 2009 +0000 +++ b/gamelib/animal.py Sat Sep 05 16:07:48 2009 +0000 @@ -423,8 +423,7 @@ def _make_hole(self, gameboard): """Make a hole in the fence""" - gameboard.tv.set(self.dig_pos.to_tuple(), - tiles.REVERSE_TILE_MAP['broken fence']) + gameboard.tv.set(self.dig_pos.to_tuple(), gameboard.BROKEN_FENCE) self.dig_pos = None def move(self, gameboard): @@ -491,6 +490,26 @@ self.hunting = False self.last_steps = [] +class Rinkhals(Fox): + """The Rinkhals has eclectic tastes""" + STEALTH = 80 + IMAGE_FILE = 'sprites/rinkhals.png' + + def _catch_chicken(self, chicken, gameboard): + """The Rinkhals hunts for sport, catch and release style""" + self.closest = None + self.hunting = False + self.last_steps = [] + + def _make_hole(self, gameboard): + """The Rinkhals eats fences""" + gameboard.tv.set(self.dig_pos.to_tuple(), gameboard.GRASSLAND) + self.dig_pos = None + + def damage(self, gameboard): + """The Rinkhals is invincible!""" + return True + def _get_vision_param(parameter, watcher): param = getattr(watcher, parameter) if watcher.abode: diff -r 37d88a9fc097 -r 664bba9be40a gamelib/gameboard.py --- a/gamelib/gameboard.py Sat Sep 05 16:05:41 2009 +0000 +++ b/gamelib/gameboard.py Sat Sep 05 16:07:48 2009 +0000 @@ -287,11 +287,14 @@ WOODLAND = tiles.REVERSE_TILE_MAP['woodland'] BROKEN_FENCE = tiles.REVERSE_TILE_MAP['broken fence'] + # These don't have to add up to 100, but it's easier to think + # about them if they do. FOX_WEIGHTINGS = ( - (animal.Fox, 60), + (animal.Fox, 59), (animal.GreedyFox, 30), (animal.NinjaFox, 5), (animal.DemoFox, 5), + (animal.Rinkhals, 1), ) def __init__(self, main_app):