comparison gamelib/animal.py @ 378:71f5897ac5ef

Fences are now buildings, with appropriate (but ugly) UI changes.
author Jeremy Thurgood <firxen@gmail.com>
date Sat, 24 Oct 2009 19:08:54 +0000
parents b3c90e49a6b7
children 1586eccdefe4
comparison
equal deleted inserted replaced
377:0dc9d17c689e 378:71f5897ac5ef
423 self.tick = 5 423 self.tick = 5
424 self.dig_pos = dig_pos 424 self.dig_pos = dig_pos
425 425
426 def _make_hole(self, gameboard): 426 def _make_hole(self, gameboard):
427 """Make a hole in the fence""" 427 """Make a hole in the fence"""
428 gameboard.tv.set(self.dig_pos.to_tuple(), gameboard.BROKEN_FENCE) 428 gameboard.get_building(self.dig_pos.to_tuple()).damage(gameboard.tv)
429 self.dig_pos = None 429 self.dig_pos = None
430 430
431 def move(self, gameboard): 431 def move(self, gameboard):
432 """Foxes will aim to move towards the closest henhouse or free 432 """Foxes will aim to move towards the closest henhouse or free
433 chicken""" 433 chicken"""
503 self.hunting = False 503 self.hunting = False
504 self.last_steps = [] 504 self.last_steps = []
505 505
506 def _make_hole(self, gameboard): 506 def _make_hole(self, gameboard):
507 """The Rinkhals eats fences""" 507 """The Rinkhals eats fences"""
508 gameboard.tv.set(self.dig_pos.to_tuple(), gameboard.GRASSLAND) 508 fence = gameboard.get_building(self.dig_pos.to_tuple())
509 fence.remove(gameboard.tv)
510 gameboard.remove_building(fence)
509 self.dig_pos = None 511 self.dig_pos = None
510 512
511 def damage(self, gameboard): 513 def damage(self, gameboard):
512 """The Rinkhals is invincible!""" 514 """The Rinkhals is invincible!"""
513 return True 515 return True