Mercurial > fujo
changeset 61:a2a594788501
tengus are strong fighters
| author | Radomir Dopieralski <sheep-devel@sheep.art.pl> |
|---|---|
| date | Wed, 01 Jan 2014 18:15:51 +0100 |
| parents | 2635db8e5a63 |
| children | 3a8cf78bb047 |
| files | fujo/level.py fujo/mobs.py |
| diffstat | 2 files changed, 23 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/fujo/level.py Wed Jan 01 18:10:02 2014 +0100 +++ b/fujo/level.py Wed Jan 01 18:15:51 2014 +0100 @@ -14,7 +14,6 @@ ((1, 22), (5, 7)), ((7, 22), (5, 7)), ((15, 22), (5, 7)), ] MONSTERS = [ - [mobs.Tanuki], [mobs.Bat, mobs.Martian], [mobs.Bat, mobs.Martian, mobs.Kappa, mobs.Tanuki], [mobs.Martian, mobs.Kappa, mobs.Tanuki, mobs.Tengu],
--- a/fujo/mobs.py Wed Jan 01 18:10:02 2014 +0100 +++ b/fujo/mobs.py Wed Jan 01 18:15:51 2014 +0100 @@ -199,6 +199,8 @@ class Tengu(Monster): looks = 2 + damage = 3 + attack = 4 class Kappa(Monster): @@ -207,7 +209,27 @@ class Bat(Monster): looks = 4 - max_health = 1 + damage = 1 + defense = 4 + attack = 1 + max_health = 2 + + def act(self, level): + # Bats are never asleep or angry + for d in xrange(4): + if level.player.pos == dpos(self.pos, d): + level.attack_mob(self, level.player) + self.animation = self.attack_anim(d) + return + possible = [d for d in xrange(4) + if not level.is_blocked(dpos(self.pos, d))] + if possible: + random.shuffle(possible) + d = possible[0] + level.place_mob(self, dpos(self.pos, d)) + self.animation = self.walk_anim(d) + else: + self.animation = self.walk_anim() class Ghost(Monster):
