comparison pytouhou/games/eosd.py @ 230:1c24a6d93c1b

Improve find_character_defs, clean up a bit, and disable attack types 2 and 3 for now
author Thibaut Girka <thib@sitedethib.com>
date Fri, 30 Dec 2011 19:10:49 +0100
parents 5afc75f71fed
children c417bb6c98bf
comparison
equal deleted inserted replaced
229:5afc75f71fed 230:1c24a6d93c1b
49 ItemType(etama3, 4, 11), #Full power 49 ItemType(etama3, 4, 11), #Full power
50 ItemType(etama3, 5, 12), #1up 50 ItemType(etama3, 5, 12), #1up
51 ItemType(etama3, 6, 13)] #Star 51 ItemType(etama3, 6, 13)] #Star
52 52
53 characters = resource_loader.get_eosd_characters('102h.exe') 53 characters = resource_loader.get_eosd_characters('102h.exe')
54 print characters[0]
55 54
56 #eosd_characters = [ReimuA, ReimuB, MarisaA, MarisaB] 55 #eosd_characters = [ReimuA, ReimuB, MarisaA, MarisaB]
57 players = [] 56 players = []
58 for player in player_states: 57 for player in player_states:
59 #players.append(eosd_characters[player.character](player, self, resource_loader)) 58 #players.append(eosd_characters[player.character](player, self, resource_loader))
133 132
134 bullets = self._game.players_bullets 133 bullets = self._game.players_bullets
135 nb_bullets_max = self._game.nb_bullets_max 134 nb_bullets_max = self._game.nb_bullets_max
136 135
137 for shot in sht.shots[power]: 136 for shot in sht.shots[power]:
137 if shot.type in (2, 3): # TODO: Those shot types aren't handled yet
138 continue
139
138 if self.fire_time % shot.interval == shot.delay: 140 if self.fire_time % shot.interval == shot.delay:
139 if nb_bullets_max is not None and len(bullets) == nb_bullets_max: 141 if nb_bullets_max is not None and len(bullets) == nb_bullets_max:
140 break 142 break
141 143
142 origin = self.orbs[shot.orb - 1] if shot.orb else self 144 origin = self.orbs[shot.orb - 1] if shot.orb else self
143 x = origin.x + shot.pos[0] 145 x = origin.x + shot.pos[0]
144 y = origin.y + shot.pos[1] 146 y = origin.y + shot.pos[1]
145 147
146 #TODO: find a better way to do that. 148 #TODO: find a better way to do that.
147 bullet_type = BulletType(self.anm_wrapper, shot.sprite % 256, 149 bullet_type = BulletType(self.anm_wrapper, shot.sprite % 256,
148 shot.sprite % 256 + 32, #TODO: find the real cancel anim 150 shot.sprite % 256 + 32, #TODO: find the real cancel anim
149 0, 0, 0, 0.) 151 0, 0, 0, 0.)
150 bullets.append(Bullet((x, y), bullet_type, 0, 152 bullets.append(Bullet((x, y), bullet_type, 0,
151 shot.angle, shot.speed, 153 shot.angle, shot.speed,
152 (0, 0, 0, 0, 0., 0., 0., 0.), 154 (0, 0, 0, 0, 0., 0., 0., 0.),
153 0, self, self._game, player_bullet=True, damage=shot.damage, hitbox=shot.hitbox)) 155 0, self, self._game, player_bullet=True,
156 damage=shot.damage, hitbox=shot.hitbox))
157