diff gamelib/animal.py @ 216:962934b8c7dc

Implement UI part of egg selling
author Neil Muller <drnlmuller@gmail.com>
date Fri, 04 Sep 2009 22:04:04 +0000
parents fe1e9c18d4d7
children 9a6ac9c9ff46
line wrap: on
line diff
--- a/gamelib/animal.py	Fri Sep 04 22:01:20 2009 +0000
+++ b/gamelib/animal.py	Fri Sep 04 22:04:04 2009 +0000
@@ -143,13 +143,19 @@
         """See if the chicken lays an egg"""
         if not self.egg:
             self.egg = Egg(self.pos)
+            self.equip(equipment.NestEgg())
+
+    def remove_egg(self):
+        """Clean up the egg state"""
+        self.egg = None
+        self.unequip_by_name("nestegg")
 
     def hatch(self):
         """See if we have an egg to hatch"""
         if self.egg:
             chick = self.egg.hatch()
             if chick:
-                self.egg = None
+                self.remove_egg()
             return chick
         return None