# HG changeset patch # User Emmanuel Gil Peyrot # Date 1314749528 25200 # Node ID f305c0e406d66e3fc847983546b0cd2c27aebd53 # Parent b3bd421bb895b1f5afcdf18edcc6c9ba9d0305fc Handle all move_to_* ECL instructions. diff --git a/pytouhou/formats/ecl.py b/pytouhou/formats/ecl.py --- a/pytouhou/formats/ecl.py +++ b/pytouhou/formats/ecl.py @@ -62,9 +62,9 @@ class ECL(object): 50: ('ff', 'set_random_angle_ex'), 51: ('ff', 'set_speed_towards_player'), 52: ('iff', None), - 56: ('iffi', None), - 57: ('ifff', 'move_to'), - 59: ('iffi', 'move_to2'), + 56: ('ifff', 'move_to_linear'), + 57: ('ifff', 'move_to_decel'), + 59: ('iffi', 'move_to_accel'), 61: ('i', 'stop_in'), 63: ('i', 'stop_in_accel'), 65: ('ffff', 'set_screen_box'), diff --git a/pytouhou/vm/eclrunner.py b/pytouhou/vm/eclrunner.py --- a/pytouhou/vm/eclrunner.py +++ b/pytouhou/vm/eclrunner.py @@ -380,13 +380,18 @@ class ECLRunner(object): self._enemy.angle = self._enemy.get_player_angle(self._enemy.select_player(self._game_state.players)) + @instruction(56) + def move_to_linear(self, duration, x, y, z): + self._enemy.move_to(duration, x, y, z, lambda x: x) + + @instruction(57) - def move_to(self, duration, x, y, z): + def move_to_decel(self, duration, x, y, z): self._enemy.move_to(duration, x, y, z, lambda x: 2. * x - x ** 2) @instruction(59) - def move_to2(self, duration, x, y, z): + def move_to_accel(self, duration, x, y, z): self._enemy.move_to(duration, x, y, z, lambda x: x ** 2)