# HG changeset patch # User Emmanuel Gil Peyrot # Date 1406372846 -7200 # Node ID 94229756abd9ac333cdd94c113dba01ed9711ee5 # Parent 4233c1c01d90928f06bf3f1a61e20bc3e364fc72 Give extra lives to the player once she has reached a certain score, and increment the default score on continue. diff --git a/pytouhou/game/game.pyx b/pytouhou/game/game.pyx --- a/pytouhou/game/game.pyx +++ b/pytouhou/game/game.pyx @@ -360,10 +360,17 @@ cdef class Game: for player, keystate in zip(self.players, keystates): player.update(keystate) #TODO: differentiate keystates (multiplayer mode) + old_effective_score = player.effective_score #XXX: Why 78910? Is it really the right value? - player.effective_score = min(player.effective_score + 78910, + player.effective_score = min(old_effective_score + 78910, player.score) - #TODO: give extra lives to the player + if self.stage < 7: + for i in [10000000, 20000000, 40000000, 60000000]: + if player.effective_score >= i and old_effective_score < i: + if player.lives < 8: + player.lives += 1 + self.modify_difficulty(+2) + player.play_sound('extend') cdef void update_effects(self): diff --git a/pytouhou/game/player.pyx b/pytouhou/game/player.pyx --- a/pytouhou/game/player.pyx +++ b/pytouhou/game/player.pyx @@ -262,7 +262,7 @@ cdef class Player(Element): self._game.drop_bonus(self.x, self.y, 4, player=self, end_pos=(self._game.prng.rand_double() * 288 + 48, self._game.prng.rand_double() * 192 - 64)) - self.score = 0 + self.score = self.continues_used if self.continues_used <= 9 else 9 self.effective_score = 0 self.lives = 2 #TODO: use the right default. self.bombs = 3 #TODO: use the right default.