# HG changeset patch # User Emmanuel Gil Peyrot # Date 1350853361 -7200 # Node ID eef492100f4cec526db54d41ca9fbe440d2a7fd4 # Parent ac2891afb0bbca78a91ec4b96e94e6f8c32705f7 Add "explosion", instruction 118. diff --git a/pytouhou/formats/ecl.py b/pytouhou/formats/ecl.py --- a/pytouhou/formats/ecl.py +++ b/pytouhou/formats/ecl.py @@ -134,7 +134,7 @@ class ECL(object): 115: ('i', 'set_timeout'), 116: ('i', 'set_timeout_callback'), 117: ('i', 'set_touchable'), - 118: ('iihh', None), + 118: ('iIbbbb', 'drop_particles'), 119: ('i', 'drop_bonus'), 120: ('i', 'set_automatic_orientation'), 121: ('ii', 'call_special_function'), diff --git a/pytouhou/vm/eclrunner.py b/pytouhou/vm/eclrunner.py --- a/pytouhou/vm/eclrunner.py +++ b/pytouhou/vm/eclrunner.py @@ -904,6 +904,33 @@ class ECLRunner(object): self._enemy.touchable = bool(value) + @instruction(118) + def drop_particles(self, anim, number, a, b, c, d): + #TODO: find the utility of the other values. + + if number == 0 or number > 640: #TODO: remove that hardcoded 640, and verify it. + number = 640 + + if anim == -1: + return + if 0 <= anim <= 2: + self._game.new_effect((self._enemy.x, self._enemy.y), anim + 3, number=number) + elif anim == 3: + self._game.new_particle((self._enemy.x, self._enemy.y), 6, 256, number=number) #TODO: make it go back a bit at the end. + elif 4 <= anim <= 15: + self._game.new_particle((self._enemy.x, self._enemy.y), anim + 5, 192, number=number) + elif anim == 16: + self._game.new_effect((self._enemy.x, self._enemy.y), 0, self._game.spellcard_effect_anm_wrapper, number=number) + elif anim == 17: + self._game.new_particle((self._enemy.x, self._enemy.y), anim - 10, 640, number=number, reverse=True, duration=60) + elif anim == 18: + self._game.new_particle((self._enemy.x, self._enemy.y), anim - 10, 640, number=number, reverse=True, duration=240) + elif anim == 19: + self._game.new_effect((self._enemy.x, self._enemy.y), anim - 10, number=number) + else: + raise Exception #TODO + + @instruction(119) def drop_some_bonus(self, number): if self._enemy.select_player().state.power < 128: