Mercurial > touhou
comparison pytouhou/vm/eclrunner.py @ 564:a0fa01cd9f70
Make Enemy.get_angle able to target any Element, not only Player.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Thu, 12 Jun 2014 18:41:01 +0200 |
parents | bcff39c920ab |
children | e4c9eafab6d0 |
comparison
equal
deleted
inserted
replaced
563:ab0a5580bc40 | 564:a0fa01cd9f70 |
---|---|
204 return player.x | 204 return player.x |
205 elif value == -10019: | 205 elif value == -10019: |
206 player = self._enemy.select_player() | 206 player = self._enemy.select_player() |
207 return player.y | 207 return player.y |
208 elif value == -10021: | 208 elif value == -10021: |
209 return self._enemy.get_player_angle() | 209 player = self._enemy.select_player() |
210 return self._enemy.get_angle(player) | |
210 elif value == -10022: | 211 elif value == -10022: |
211 return self._enemy.frame | 212 return self._enemy.frame |
212 elif value == -10024: | 213 elif value == -10024: |
213 return self._enemy.life | 214 return self._enemy.life |
214 elif value == -10025: | 215 elif value == -10025: |
486 | 487 |
487 | 488 |
488 @instruction(51) | 489 @instruction(51) |
489 def target_player(self, unknown, speed): | 490 def target_player(self, unknown, speed): |
490 #TODO: unknown | 491 #TODO: unknown |
492 player = self._enemy.select_player() | |
493 | |
491 self._enemy.update_mode = 0 | 494 self._enemy.update_mode = 0 |
492 self._enemy.speed = speed | 495 self._enemy.speed = speed |
493 self._enemy.angle = self._enemy.get_player_angle() | 496 self._enemy.angle = self._enemy.get_angle(player) |
494 | 497 |
495 | 498 |
496 @instruction(52) | 499 @instruction(52) |
497 def move_in_decel(self, duration, angle, speed): | 500 def move_in_decel(self, duration, angle, speed): |
498 self._enemy.angle, self._enemy.speed = angle, speed | 501 self._enemy.angle, self._enemy.speed = angle, speed |