comparison pytouhou/vm/eclrunner.py @ 302:34ea45d95489

Fix ECL instruction 119.
author Thibaut Girka <thib@sitedethib.com>
date Sat, 10 Mar 2012 20:31:49 +0100
parents e04e402e6380
children f3099ebf4f61
comparison
equal deleted inserted replaced
301:6f1ca1cb5238 302:34ea45d95489
971 @instruction(119) 971 @instruction(119)
972 def drop_some_bonus(self, number): 972 def drop_some_bonus(self, number):
973 if self._enemy.select_player().state.power < 128: 973 if self._enemy.select_player().state.power < 128:
974 if number > 0: 974 if number > 0:
975 #TODO: find the real formula in the binary. 975 #TODO: find the real formula in the binary.
976 self._game.drop_bonus(self._enemy.x - 64 + self._game.prng.rand_uint16() % 128, 976 self._game.drop_bonus(self._enemy.x - 64 + self._game.prng.rand_double() * 128,
977 self._enemy.y - 64 + self._game.prng.rand_uint16() % 128, 977 self._enemy.y - 64 + self._game.prng.rand_double() * 128,
978 2) 978 2)
979 for i in xrange(number - 1): 979 for i in xrange(number - 1):
980 self._game.drop_bonus(self._enemy.x - 64 + self._game.prng.rand_uint16() % 128, 980 self._game.drop_bonus(self._enemy.x - 64 + self._game.prng.rand_double() * 128,
981 self._enemy.y - 64 + self._game.prng.rand_uint16() % 128, 981 self._enemy.y - 64 + self._game.prng.rand_double() * 128,
982 0) 982 0)
983 else: 983 else:
984 for i in xrange(number): 984 for i in xrange(number):
985 self._game.drop_bonus(self._enemy.x - 64 + self._game.prng.rand_uint16() % 128, 985 self._game.drop_bonus(self._enemy.x - 64 + self._game.prng.rand_double() * 128,
986 self._enemy.y - 64 + self._game.prng.rand_uint16() % 128, 986 self._enemy.y - 64 + self._game.prng.rand_double() * 128,
987 1) 987 1)
988 988
989 989
990 @instruction(120) 990 @instruction(120)
991 def set_automatic_orientation(self, flags): 991 def set_automatic_orientation(self, flags):