Changeset 290:664bba9be40a


Ignore:
Timestamp:
Sep 5, 2009, 4:07:48 PM (11 years ago)
Author:
Jeremy Thurgood <firxen@…>
Branch:
default
Convert:
svn:b4e93282-eac8-4b8b-b765-0f5d36de2b68@291
Message:

Fences are eclectic.

Location:
gamelib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • gamelib/animal.py

    r269 r290  
    424424    def _make_hole(self, gameboard):
    425425        """Make a hole in the fence"""
    426         gameboard.tv.set(self.dig_pos.to_tuple(),
    427                 tiles.REVERSE_TILE_MAP['broken fence'])
     426        gameboard.tv.set(self.dig_pos.to_tuple(), gameboard.BROKEN_FENCE)
    428427        self.dig_pos = None
    429428
     
    492491        self.last_steps = []
    493492
     493class Rinkhals(Fox):
     494    """The Rinkhals has eclectic tastes"""
     495    STEALTH = 80
     496    IMAGE_FILE = 'sprites/rinkhals.png'
     497
     498    def _catch_chicken(self, chicken, gameboard):
     499        """The Rinkhals hunts for sport, catch and release style"""
     500        self.closest = None
     501        self.hunting = False
     502        self.last_steps = []
     503
     504    def _make_hole(self, gameboard):
     505        """The Rinkhals eats fences"""
     506        gameboard.tv.set(self.dig_pos.to_tuple(), gameboard.GRASSLAND)
     507        self.dig_pos = None
     508
     509    def damage(self, gameboard):
     510        """The Rinkhals is invincible!"""
     511        return True
     512
    494513def _get_vision_param(parameter, watcher):
    495514    param = getattr(watcher, parameter)
  • gamelib/gameboard.py

    r289 r290  
    288288    BROKEN_FENCE = tiles.REVERSE_TILE_MAP['broken fence']
    289289
     290    # These don't have to add up to 100, but it's easier to think
     291    # about them if they do.
    290292    FOX_WEIGHTINGS = (
    291         (animal.Fox, 60),
     293        (animal.Fox, 59),
    292294        (animal.GreedyFox, 30),
    293295        (animal.NinjaFox, 5),
    294296        (animal.DemoFox, 5),
     297        (animal.Rinkhals, 1),
    295298        )
    296299
Note: See TracChangeset for help on using the changeset viewer.