changeset 270:7a9135b88853

Partially fix some of Flandre's spellcards.
author Thibaut Girka <thib@sitedethib.com>
date Tue, 24 Jan 2012 00:19:23 +0100
parents 729382f57ad0
children 80e73b8245a4
files pytouhou/game/enemy.py pytouhou/vm/eclrunner.py
diffstat 2 files changed, 9 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/pytouhou/game/enemy.py
+++ b/pytouhou/game/enemy.py
@@ -36,7 +36,7 @@ class Enemy(object):
 
         self.frame = 0
 
-        self.x, self.y = pos
+        self.x, self.y, self.z = pos
         self.life = 1 if life < 0 else life
         self.max_life = life
         self.touchable = True
@@ -122,7 +122,7 @@ class Enemy(object):
             ox, oy = offset or self.bullet_launch_offset
             launch_pos = self.x + ox, self.y + oy
 
-        if speed < 0.3:
+        if speed < 0.3 and speed != 0.0:
             speed = 0.3
         if speed2 < 0.3:
             speed2 = 0.3
--- a/pytouhou/vm/eclrunner.py
+++ b/pytouhou/vm/eclrunner.py
@@ -72,8 +72,8 @@ class ECLMainRunner(object):
             if y < -990: #102h.exe@0x41184b
                 y = self._game.prng.rand_double() * 416
             if z < -990: #102h.exe@0x411881
-                y = self._game.prng.rand_double() * 800
-        enemy = self._game.new_enemy((x, y), life, instr_type, bonus_dropped, die_score)
+                z = self._game.prng.rand_double() * 800
+        enemy = self._game.new_enemy((x, y, z), life, instr_type, bonus_dropped, die_score)
         process = ECLRunner(self._ecl, sub, enemy, self._game)
         self.processes.append(process)
         process.run_iteration()
@@ -470,7 +470,7 @@ class ECLRunner(object):
     @instruction(45)
     def set_angle_speed(self, angle, speed):
         self._enemy.update_mode = 0
-        self._enemy.angle, self._enemy.speed = angle, speed
+        self._enemy.angle, self._enemy.speed = self._getval(angle), self._getval(speed)
 
 
     @instruction(46)
@@ -737,7 +737,10 @@ class ECLRunner(object):
 
     @instruction(95)
     def pop_enemy(self, sub, x, y, z, life, bonus_dropped, die_score):
-        self._game.ecl_runner._pop_enemy(sub, 0, self._getval(x), self._getval(y), 0, life, bonus_dropped, die_score)
+        self._game.ecl_runner._pop_enemy(sub, 0, self._getval(x),
+                                                 self._getval(y),
+                                                 self._getval(z),
+                                                 life, bonus_dropped, die_score)
 
 
     @instruction(96)