Mercurial > touhou
diff pytouhou/game/enemy.pyx @ 507:507d446dc6cf
Divide the damages inflicted by the number of players.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Sun, 17 Nov 2013 17:36:47 +0100 |
parents | 3da7395f39e3 |
children | 292fea5c584e |
line wrap: on
line diff
--- a/pytouhou/game/enemy.pyx +++ b/pytouhou/game/enemy.pyx @@ -396,6 +396,13 @@ cdef class Enemy(Element): else: damages //= 7 + nb_players = len(self._game.players) + if nb_players > 1: + if damages <= nb_players: + damages = 1 if damages else 0 + else: + damages //= nb_players + # Apply damages self.life -= damages