comparison pytouhou/vm/eclrunner.py @ 171:2f3665a77f11

Add support for the last unknown value of the enemy spawning.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Thu, 20 Oct 2011 06:34:35 -0700
parents c4b4f7c068f2
children 6e8653ff2b23
comparison
equal deleted inserted replaced
170:e7902309305c 171:2f3665a77f11
59 59
60 self.processes[:] = (process for process in self.processes 60 self.processes[:] = (process for process in self.processes
61 if process.run_iteration()) 61 if process.run_iteration())
62 62
63 63
64 def _pop_enemy(self, sub, instr_type, x, y, z, life, bonus_dropped, unknown2, unknown3): 64 def _pop_enemy(self, sub, instr_type, x, y, z, life, bonus_dropped, die_score):
65 if instr_type & 4: 65 if instr_type & 4:
66 if x < -990: #102h.exe@0x411820 66 if x < -990: #102h.exe@0x411820
67 x = self._game.prng.rand_double() * 368 67 x = self._game.prng.rand_double() * 368
68 if y < -990: #102h.exe@0x41184b 68 if y < -990: #102h.exe@0x41184b
69 y = self._game.prng.rand_double() * 416 69 y = self._game.prng.rand_double() * 416
70 if z < -990: #102h.exe@0x411881 70 if z < -990: #102h.exe@0x411881
71 y = self._game.prng.rand_double() * 800 71 y = self._game.prng.rand_double() * 800
72 enemy = self._game.new_enemy((x, y), life, instr_type, bonus_dropped) 72 enemy = self._game.new_enemy((x, y), life, instr_type, bonus_dropped, die_score)
73 process = ECLRunner(self._ecl, sub, enemy, self._game) 73 process = ECLRunner(self._ecl, sub, enemy, self._game)
74 self.processes.append(process) 74 self.processes.append(process)
75 process.run_iteration() 75 process.run_iteration()
76 76
77 77
78 @instruction(0) 78 @instruction(0)
79 @instruction(2) 79 @instruction(2)
80 @instruction(4) 80 @instruction(4)
81 @instruction(6) 81 @instruction(6)
82 def pop_enemy(self, sub, instr_type, x, y, z, life, bonus_dropped, unknown2, unknown3): 82 def pop_enemy(self, sub, instr_type, x, y, z, life, bonus_dropped, die_score):
83 if self._game.boss: 83 if self._game.boss:
84 return 84 return
85 self._pop_enemy(sub, instr_type, x, y, z, life, bonus_dropped, unknown2, unknown3) 85 self._pop_enemy(sub, instr_type, x, y, z, life, bonus_dropped, die_score)
86 86
87 87
88 88
89 89
90 class ECLRunner(object): 90 class ECLRunner(object):
710 #TODO: give the spellcard bonus. 710 #TODO: give the spellcard bonus.
711 self._game.change_bullets_into_star_items() 711 self._game.change_bullets_into_star_items()
712 712
713 713
714 @instruction(95) 714 @instruction(95)
715 def pop_enemy(self, sub, x, y, z, life, bonus_dropped, unknown2): 715 def pop_enemy(self, sub, x, y, z, life, bonus_dropped, die_score):
716 self._game.ecl_runner._pop_enemy(sub, 0, self._getval(x), self._getval(y), 0, life, bonus_dropped, unknown2, 0) # TODO: check about unknown values 716 self._game.ecl_runner._pop_enemy(sub, 0, self._getval(x), self._getval(y), 0, life, bonus_dropped, die_score)
717 717
718 718
719 @instruction(96) 719 @instruction(96)
720 def kill_enemies(self): 720 def kill_enemies(self):
721 for enemy in self._game.enemies: 721 for enemy in self._game.enemies: