# HG changeset patch # User Emmanuel Gil Peyrot # Date 1337794397 -7200 # Node ID 1a4ffdda87357e9ab41a55f395a97bb090477dec # Parent 9a4119e2cc742f0e6d2101ceaf18b94ba3aa05a1 Cancel the bullets when a boss is killed and transfer them to the score. diff --git a/pytouhou/game/enemy.py b/pytouhou/game/enemy.py --- a/pytouhou/game/enemy.py +++ b/pytouhou/game/enemy.py @@ -350,6 +350,10 @@ class Enemy(object): #TODO: verify if the score is added with all the different flags. self._game.players[0].state.score += self.die_score #TODO: better distribution amongst the players. + #TODO: verify if that should really be there. + if self.boss: + self._game.change_bullets_into_bonus() + if death_flags < 4: if self.bonus_dropped > -1: self.drop_particles(7, 0) diff --git a/pytouhou/game/game.py b/pytouhou/game/game.py --- a/pytouhou/game/game.py +++ b/pytouhou/game/game.py @@ -141,6 +141,19 @@ class Game(object): self.bullets = [] + def change_bullets_into_bonus(self): + player = self.players[0] #TODO + score = 0 + bonus = 2000 + for bullet in self.bullets: + #TODO: display the labels. + score += bonus + bonus += 10 + self.bullets = [] + player.state.score += score + #TODO: display the final bonus score. + + def new_effect(self, pos, anim, anm_wrapper=None): self.effects.append(Effect(pos, anim, anm_wrapper or self.etama4)) diff --git a/pytouhou/vm/eclrunner.py b/pytouhou/vm/eclrunner.py --- a/pytouhou/vm/eclrunner.py +++ b/pytouhou/vm/eclrunner.py @@ -745,7 +745,7 @@ class ECLRunner(object): def end_spellcard(self): #TODO: return everything back to normal #TODO: give the spellcard bonus. - if self._game.spellcard: + if self._game.spellcard is not None: self._game.change_bullets_into_star_items() self._game.spellcard = None self._game.disable_spellcard_effect()