comparison 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
comparison
equal deleted inserted replaced
493:26c082870dcf 494:6be9c99a3a24
201 return self._enemy.y 201 return self._enemy.y
202 elif value == -10017: 202 elif value == -10017:
203 return self._enemy.z 203 return self._enemy.z
204 elif value == -10018: 204 elif value == -10018:
205 player = self._enemy.select_player() 205 player = self._enemy.select_player()
206 return player.state.x 206 return player.x
207 elif value == -10019: 207 elif value == -10019:
208 player = self._enemy.select_player() 208 player = self._enemy.select_player()
209 return player.state.y 209 return player.y
210 elif value == -10021: 210 elif value == -10021:
211 return self._enemy.get_player_angle() 211 return self._enemy.get_player_angle()
212 elif value == -10022: 212 elif value == -10022:
213 return self._enemy.frame 213 return self._enemy.frame
214 elif value == -10024: 214 elif value == -10024:
215 return self._enemy.life 215 return self._enemy.life
216 elif value == -10025: 216 elif value == -10025:
217 return self._enemy.select_player().state.character #TODO 217 return self._enemy.select_player().character #TODO
218 raise NotImplementedError(value) #TODO 218 raise NotImplementedError(value) #TODO
219 else: 219 else:
220 return value 220 return value
221 221
222 222
930 raise Exception #TODO 930 raise Exception #TODO
931 931
932 932
933 @instruction(119) 933 @instruction(119)
934 def drop_some_bonus(self, number): 934 def drop_some_bonus(self, number):
935 if self._enemy.select_player().state.power < 128: 935 if self._enemy.select_player().power < 128:
936 if number > 0: 936 if number > 0:
937 #TODO: find the real formula in the binary. 937 #TODO: find the real formula in the binary.
938 self._game.drop_bonus(self._enemy.x - 64 + self._game.prng.rand_double() * 128, 938 self._game.drop_bonus(self._enemy.x - 64 + self._game.prng.rand_double() * 128,
939 self._enemy.y - 64 + self._game.prng.rand_double() * 128, 939 self._enemy.y - 64 + self._game.prng.rand_double() * 128,
940 2) 940 2)
979 elif function == 3: # Patchouli’s dual sign spellcards 979 elif function == 3: # Patchouli’s dual sign spellcards
980 values = [[0, 3, 1], 980 values = [[0, 3, 1],
981 [2, 3, 4], 981 [2, 3, 4],
982 [1, 4, 0], 982 [1, 4, 0],
983 [4, 2, 3]] 983 [4, 2, 3]]
984 character = self._enemy.select_player().state.character 984 character = self._enemy.select_player().character
985 self.variables[1:4] = values[character] 985 self.variables[1:4] = values[character]
986 elif function == 4: 986 elif function == 4:
987 if arg == 1: 987 if arg == 1:
988 self._game.time_stop = True 988 self._game.time_stop = True
989 else: 989 else: