changeset 344:eab591728abf

Minor fix in boss rush mode
author Thibaut Girka <thib@sitedethib.com>
date Wed, 04 Jul 2012 23:53:18 +0200
parents 94fdb6c782c1
children 2c4589370cc6
files eosd
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/eosd
+++ b/eosd
@@ -34,23 +34,25 @@ from pytouhou.vm.msgrunner import NextSt
 class EoSDGameBossRush(EoSDGame):
     def run_iter(self, keystate):
         for i in range(20):
-            EoSDGame.run_iter(self, (keystate | 256) if i == 0 else 0)
+            skip = not (self.enemies or self.items or self.lasers
+                        or self.bullets or self.cancelled_bullets)
+            if skip:
+                keystate &= ~1
+            EoSDGame.run_iter(self, keystate | 256 if i == 0 else 0)
             if not self.enemies and self.frame % 90 == 0:
                 for player in self.players:
                     if player.state.power < 128:
                         player.state.power += 1
-            if (self.enemies or self.items
-                or self.lasers or self.bullets or self.cancelled_bullets):
+            if not skip:
                 break
 
+
     def cleanup(self):
         if not (self.boss or self.msg_wait or self.ecl_runner.boss_wait):
             self.enemies = [enemy for enemy in self.enemies
                                 if enemy.boss_callback != -1 or enemy.frame > 1]
             self.lasers = [laser for laser in self.lasers if laser.frame > 1]
             self.bullets = [bullet for bullet in self.bullets if bullet.frame > 1]
-            self.players_lasers = [(laser if laser and laser.frame > 1 else None) for laser in self.players_lasers]
-            self.players_bullets = [bullet for bullet in self.players_bullets if bullet.frame > 1]
         EoSDGame.cleanup(self)