# HG changeset patch # User Emmanuel Gil Peyrot # Date 1319360024 25200 # Node ID 6e8653ff2b233f194b0b204c0c3242ae473626ef # Parent 80a4c7ed43b30027d55078f9f2bf7245ebaf67f6 Fix boss mode and don’t suicide the boss when she just want to kill the other enemies. diff --git a/pytouhou/game/enemy.py b/pytouhou/game/enemy.py --- a/pytouhou/game/enemy.py +++ b/pytouhou/game/enemy.py @@ -41,6 +41,7 @@ class Enemy(object): self.touchable = True self.damageable = True self.death_flags = 0 + self.boss = False self.extended_bullet_attributes = (0, 0, 0, 0, 0., 0., 0., 0.) self.bullet_attributes = None self.bullet_launch_offset = (0, 0) diff --git a/pytouhou/vm/eclrunner.py b/pytouhou/vm/eclrunner.py --- a/pytouhou/vm/eclrunner.py +++ b/pytouhou/vm/eclrunner.py @@ -719,7 +719,7 @@ class ECLRunner(object): @instruction(96) def kill_enemies(self): for enemy in self._game.enemies: - if enemy.touchable: + if enemy.touchable and not enemy.boss: enemy.life = 0 @@ -740,9 +740,18 @@ class ECLRunner(object): @instruction(101) - def set_boss_mode(self, unknown): - #TODO: unknown - self._game.boss = self._enemy + def set_boss_mode(self, value): + #TODO: if there are multiple boss, spawned by a 95, + # only the last one has her life displayed, + # but standard enemies are blocked only until any of them is killed. + if value == 0: + self._enemy.boss = True + self._game.boss = self._enemy + elif value == -1: + self._enemy.boss = False + self._game.boss = None + else: + raise Exception #TODO @instruction(103)