Mercurial > touhou
comparison 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 |
comparison
equal
deleted
inserted
replaced
506:08d9e6730364 | 507:507d446dc6cf |
---|---|
394 if damages <= 7: | 394 if damages <= 7: |
395 damages = 1 if damages else 0 | 395 damages = 1 if damages else 0 |
396 else: | 396 else: |
397 damages //= 7 | 397 damages //= 7 |
398 | 398 |
399 nb_players = len(self._game.players) | |
400 if nb_players > 1: | |
401 if damages <= nb_players: | |
402 damages = 1 if damages else 0 | |
403 else: | |
404 damages //= nb_players | |
405 | |
399 # Apply damages | 406 # Apply damages |
400 self.life -= damages | 407 self.life -= damages |
401 | 408 |
402 | 409 |
403 cdef void handle_callbacks(self): | 410 cdef void handle_callbacks(self): |