Mercurial > touhou
comparison pytouhou/game/player.pyx @ 492:887de1309491
Add friendly fire in netplay.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Sat, 21 Sep 2013 20:26:39 +0200 |
parents | 8038f1957b71 |
children | 6be9c99a3a24 |
comparison
equal
deleted
inserted
replaced
491:2276229282fd | 492:887de1309491 |
---|---|
25 class GameOver(Exception): | 25 class GameOver(Exception): |
26 pass | 26 pass |
27 | 27 |
28 | 28 |
29 cdef class PlayerState: | 29 cdef class PlayerState: |
30 def __init__(self, long character=0, long score=0, long power=0, | 30 def __init__(self, long number, long character=0, long score=0, |
31 long lives=2, long bombs=3, long continues=0): | 31 long power=0, long lives=2, long bombs=3, long continues=0): |
32 self.number = number | |
32 self.character = character # ReimuA/ReimuB/MarisaA/MarisaB/... | 33 self.character = character # ReimuA/ReimuB/MarisaA/MarisaB/... |
33 | 34 |
34 self.score = score | 35 self.score = score |
35 self.effective_score = score | 36 self.effective_score = score |
36 self.lives = lives | 37 self.lives = lives |
159 if shot_type == 2: | 160 if shot_type == 2: |
160 #TODO: triple-check acceleration! | 161 #TODO: triple-check acceleration! |
161 bullets.append(Bullet((x, y), bullet_type, 0, | 162 bullets.append(Bullet((x, y), bullet_type, 0, |
162 shot.angle, shot.speed, | 163 shot.angle, shot.speed, |
163 (-1, 0, 0, 0, 0.15, -pi/2., 0., 0.), | 164 (-1, 0, 0, 0, 0.15, -pi/2., 0., 0.), |
164 16, self, self._game, player_bullet=True, | 165 16, self, self._game, player=self.state.number, |
165 damage=shot.damage, hitbox=shot.hitbox)) | 166 damage=shot.damage, hitbox=shot.hitbox)) |
166 else: | 167 else: |
167 bullets.append(Bullet((x, y), bullet_type, 0, | 168 bullets.append(Bullet((x, y), bullet_type, 0, |
168 shot.angle, shot.speed, | 169 shot.angle, shot.speed, |
169 (0, 0, 0, 0, 0., 0., 0., 0.), | 170 (0, 0, 0, 0, 0., 0., 0., 0.), |
170 0, self, self._game, player_bullet=True, | 171 0, self, self._game, player=self.state.number, |
171 damage=shot.damage, hitbox=shot.hitbox)) | 172 damage=shot.damage, hitbox=shot.hitbox)) |
172 | 173 |
173 | 174 |
174 cpdef update(self, long keystate): | 175 cpdef update(self, long keystate): |
175 cdef double dx, dy | 176 cdef double dx, dy |