Mercurial > rinkhals
comparison gamelib/equipment.py @ 380:1586eccdefe4
Ripped out legacy animation infrastructure in favour of layered sprites.
author | Jeremy Thurgood <firxen@gmail.com> |
---|---|
date | Sun, 25 Oct 2009 10:56:01 +0000 |
parents | 32149b1d9fd2 |
children | 02a6de5629d6 |
comparison
equal
deleted
inserted
replaced
379:a8a7ada27fa2 | 380:1586eccdefe4 |
---|---|
65 def hit(self, gameboard, wielder, target): | 65 def hit(self, gameboard, wielder, target): |
66 """Is the potentially unlucky target actually unlucky?""" | 66 """Is the potentially unlucky target actually unlucky?""" |
67 if hasattr(self, 'HIT_SOUND'): | 67 if hasattr(self, 'HIT_SOUND'): |
68 sound.play_sound(self.HIT_SOUND) | 68 sound.play_sound(self.HIT_SOUND) |
69 if hasattr(self, 'ANIMATION'): | 69 if hasattr(self, 'ANIMATION'): |
70 gameboard.animations.append(self.ANIMATION(wielder)) | 70 self.ANIMATION(gameboard.tv, wielder) |
71 roll = random.randint(1, 100) | 71 roll = random.randint(1, 100) |
72 base_hit = self._get_parameter('BASE_HIT', wielder) | 72 base_hit = self._get_parameter('BASE_HIT', wielder) |
73 range_penalty = self._get_parameter('RANGE_PENALTY', wielder) | 73 range_penalty = self._get_parameter('RANGE_PENALTY', wielder) |
74 return roll > (100-base_hit) + range_penalty*wielder.pos.dist(target.pos) | 74 return roll > (100-base_hit) + range_penalty*wielder.pos.dist(target.pos) |
75 | 75 |