diff pytouhou/vm/eclrunner.py @ 494:6be9c99a3a24

Merge PlayerState into Player, fix player respawn position.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Mon, 14 Oct 2013 12:11:01 +0200
parents 59bd29568753
children 3da7395f39e3
line wrap: on
line diff
--- a/pytouhou/vm/eclrunner.py
+++ b/pytouhou/vm/eclrunner.py
@@ -203,10 +203,10 @@ class ECLRunner(object):
                 return self._enemy.z
             elif value == -10018:
                 player = self._enemy.select_player()
-                return player.state.x
+                return player.x
             elif value == -10019:
                 player = self._enemy.select_player()
-                return player.state.y
+                return player.y
             elif value == -10021:
                 return self._enemy.get_player_angle()
             elif value == -10022:
@@ -214,7 +214,7 @@ class ECLRunner(object):
             elif value == -10024:
                 return self._enemy.life
             elif value == -10025:
-                return self._enemy.select_player().state.character #TODO
+                return self._enemy.select_player().character #TODO
             raise NotImplementedError(value) #TODO
         else:
             return value
@@ -932,7 +932,7 @@ class ECLRunner(object):
 
     @instruction(119)
     def drop_some_bonus(self, number):
-        if self._enemy.select_player().state.power < 128:
+        if self._enemy.select_player().power < 128:
             if number > 0:
                 #TODO: find the real formula in the binary.
                 self._game.drop_bonus(self._enemy.x - 64 + self._game.prng.rand_double() * 128,
@@ -981,7 +981,7 @@ class ECLRunner(object):
                       [2, 3, 4],
                       [1, 4, 0],
                       [4, 2, 3]]
-            character = self._enemy.select_player().state.character
+            character = self._enemy.select_player().character
             self.variables[1:4] = values[character]
         elif function == 4:
             if arg == 1: