Mercurial > rinkhals
comparison gamelib/animal.py @ 413:bdc4757e0497
Add Sniper Rifle and give guns limited ammunition.
author | Jeremy Thurgood <firxen@gmail.com> |
---|---|
date | Sat, 21 Nov 2009 12:07:01 +0000 |
parents | bdc8bc78a796 |
children | 9096c237928c |
comparison
equal
deleted
inserted
replaced
412:1e24eedbf40f | 413:bdc4757e0497 |
---|---|
222 if not fox: | 222 if not fox: |
223 return | 223 return |
224 self._fix_face(fox.pos) | 224 self._fix_face(fox.pos) |
225 if weapon.hit(gameboard, self, fox): | 225 if weapon.hit(gameboard, self, fox): |
226 fox.damage(gameboard) | 226 fox.damage(gameboard) |
227 | |
228 def reload_weapon(self): | |
229 """If we have a weapon that takes ammunition, reload it.""" | |
230 if not self.weapons(): | |
231 # Nothing to reload | |
232 return | |
233 for weapon in self.weapons(): | |
234 if hasattr(weapon, 'AMMUNITION'): | |
235 weapon.ammunition = weapon.AMMUNITION | |
227 | 236 |
228 class Egg(Animal): | 237 class Egg(Animal): |
229 """An egg""" | 238 """An egg""" |
230 | 239 |
231 def __init__(self, pos): | 240 def __init__(self, pos): |