comparison pytouhou/vm/eclrunner.py @ 177:6e8653ff2b23

Fix boss mode and don’t suicide the boss when she just want to kill the other enemies.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sun, 23 Oct 2011 01:53:44 -0700
parents 2f3665a77f11
children 0bd5e5f19a73
comparison
equal deleted inserted replaced
176:80a4c7ed43b3 177:6e8653ff2b23
717 717
718 718
719 @instruction(96) 719 @instruction(96)
720 def kill_enemies(self): 720 def kill_enemies(self):
721 for enemy in self._game.enemies: 721 for enemy in self._game.enemies:
722 if enemy.touchable: 722 if enemy.touchable and not enemy.boss:
723 enemy.life = 0 723 enemy.life = 0
724 724
725 725
726 @instruction(97) 726 @instruction(97)
727 def set_anim(self, sprite_index): 727 def set_anim(self, sprite_index):
738 def set_death_anim(self, sprite_index): 738 def set_death_anim(self, sprite_index):
739 self._enemy.death_anim = sprite_index % 256 #TODO 739 self._enemy.death_anim = sprite_index % 256 #TODO
740 740
741 741
742 @instruction(101) 742 @instruction(101)
743 def set_boss_mode(self, unknown): 743 def set_boss_mode(self, value):
744 #TODO: unknown 744 #TODO: if there are multiple boss, spawned by a 95,
745 self._game.boss = self._enemy 745 # only the last one has her life displayed,
746 # but standard enemies are blocked only until any of them is killed.
747 if value == 0:
748 self._enemy.boss = True
749 self._game.boss = self._enemy
750 elif value == -1:
751 self._enemy.boss = False
752 self._game.boss = None
753 else:
754 raise Exception #TODO
746 755
747 756
748 @instruction(103) 757 @instruction(103)
749 def set_hitbox(self, width, height, depth): 758 def set_hitbox(self, width, height, depth):
750 self._enemy.hitbox = (width, height) 759 self._enemy.hitbox = (width, height)