comparison eosd @ 344:eab591728abf

Minor fix in boss rush mode
author Thibaut Girka <thib@sitedethib.com>
date Wed, 04 Jul 2012 23:53:18 +0200
parents 61caded6b4f5
children cca5843c2e95
comparison
equal deleted inserted replaced
343:94fdb6c782c1 344:eab591728abf
32 32
33 33
34 class EoSDGameBossRush(EoSDGame): 34 class EoSDGameBossRush(EoSDGame):
35 def run_iter(self, keystate): 35 def run_iter(self, keystate):
36 for i in range(20): 36 for i in range(20):
37 EoSDGame.run_iter(self, (keystate | 256) if i == 0 else 0) 37 skip = not (self.enemies or self.items or self.lasers
38 or self.bullets or self.cancelled_bullets)
39 if skip:
40 keystate &= ~1
41 EoSDGame.run_iter(self, keystate | 256 if i == 0 else 0)
38 if not self.enemies and self.frame % 90 == 0: 42 if not self.enemies and self.frame % 90 == 0:
39 for player in self.players: 43 for player in self.players:
40 if player.state.power < 128: 44 if player.state.power < 128:
41 player.state.power += 1 45 player.state.power += 1
42 if (self.enemies or self.items 46 if not skip:
43 or self.lasers or self.bullets or self.cancelled_bullets):
44 break 47 break
48
45 49
46 def cleanup(self): 50 def cleanup(self):
47 if not (self.boss or self.msg_wait or self.ecl_runner.boss_wait): 51 if not (self.boss or self.msg_wait or self.ecl_runner.boss_wait):
48 self.enemies = [enemy for enemy in self.enemies 52 self.enemies = [enemy for enemy in self.enemies
49 if enemy.boss_callback != -1 or enemy.frame > 1] 53 if enemy.boss_callback != -1 or enemy.frame > 1]
50 self.lasers = [laser for laser in self.lasers if laser.frame > 1] 54 self.lasers = [laser for laser in self.lasers if laser.frame > 1]
51 self.bullets = [bullet for bullet in self.bullets if bullet.frame > 1] 55 self.bullets = [bullet for bullet in self.bullets if bullet.frame > 1]
52 self.players_lasers = [(laser if laser and laser.frame > 1 else None) for laser in self.players_lasers]
53 self.players_bullets = [bullet for bullet in self.players_bullets if bullet.frame > 1]
54 EoSDGame.cleanup(self) 56 EoSDGame.cleanup(self)
55 57
56 58
57 59
58 def main(path, data, stage_num, rank, character, replay, boss_rush, fps_limit, single_buffer, debug): 60 def main(path, data, stage_num, rank, character, replay, boss_rush, fps_limit, single_buffer, debug):