comparison pytouhou/vm/eclrunner.py @ 192:5e84dfd153ab

Use the right “random” item drop function.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Thu, 27 Oct 2011 15:17:21 -0700
parents dbe6b7b2d3fc
children 9f58e2a6e950
comparison
equal deleted inserted replaced
191:d2b58a26c908 192:5e84dfd153ab
130 if death_flags < 4: 130 if death_flags < 4:
131 if enm._bonus_dropped >= 0: 131 if enm._bonus_dropped >= 0:
132 enm.drop_particles(7, 0) 132 enm.drop_particles(7, 0)
133 self._game.drop_bonus(enm.x, enm.y, enm._bonus_dropped) 133 self._game.drop_bonus(enm.x, enm.y, enm._bonus_dropped)
134 elif enm._bonus_dropped == -1: 134 elif enm._bonus_dropped == -1:
135 enm.drop_particles(10, 0) 135 if self._game.deaths_count % 3:
136 self._game.drop_bonus(enm.x, enm.y, self._game.prng.rand_uint16() % 2) #TODO: find the formula in the binary. Can be big power sometimes. 136 enm.drop_particles(10, 0)
137 self._game.drop_bonus(enm.x, enm.y, self._game.bonus_list[self._game.next_bonus])
138 self._game.next_bonus = (self._game.next_bonus + 1) % 32
139 else:
140 enm.drop_particles(4, 0)
141 self._game.deaths_count += 1
137 else: 142 else:
138 enm.drop_particles(4, 0) 143 enm.drop_particles(4, 0)
139 144
140 if death_flags == 0: 145 if death_flags == 0:
141 enm._removed = True 146 enm._removed = True