changeset 426:d34be925b9fc

Fix SIMPLIFY for chickens and eggs. Clean-up greedy fox cost overriding.
author Simon Cross <hodgestar@gmail.com>
date Sat, 21 Nov 2009 15:58:54 +0000
parents 1d0cc37b4e14
children e89a1afe4e84
files gamelib/animal.py
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/gamelib/animal.py	Sat Nov 21 15:55:32 2009 +0000
+++ b/gamelib/animal.py	Sat Nov 21 15:58:54 2009 +0000
@@ -168,6 +168,8 @@
     DEATH_SOUND = 'kill-chicken.ogg'
     IMAGE_FILE = 'sprites/chkn.png'
 
+    SIMPLIFY = Animal.SIMPLIFY + ['eggs']
+
     def __init__(self, pos):
         Animal.__init__(self, pos)
         self.eggs = []
@@ -278,6 +280,8 @@
 
     IMAGE_FILE = 'sprites/equip_egg.png'
 
+    SIMPLIFY = Animal.SIMPLIFY + ['timer']
+
     def __init__(self, pos):
         Animal.__init__(self, pos)
         self.timer = 2
@@ -608,10 +612,7 @@
     CONFIG_NAME = 'sapper fox'
 
     costs = Fox.costs.copy()
-
-    def __init__(self, pos):
-        Fox.__init__(self, pos)
-        self.costs['fence'] = 2 # We don't worry about fences
+    costs['fence'] = 2
 
     def _dig(self, gameboard, dig_pos):
         """Setup dig parameters, to be overridden if needed"""