changeset 76:f305c0e406d6

Handle all move_to_* ECL instructions.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Tue, 30 Aug 2011 17:12:08 -0700
parents b3bd421bb895
children 6fa6d74a049a
files pytouhou/formats/ecl.py pytouhou/vm/eclrunner.py
diffstat 2 files changed, 10 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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'),
--- 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)