Mercurial > touhou
comparison pytouhou/game/game.py @ 479:1de67f332f00
Fix several synchro issues
author | Thibaut Girka <thib@sitedethib.com> |
---|---|
date | Wed, 28 Dec 2011 19:42:48 +0100 |
parents | 9d4d52793eca |
children |
comparison
equal
deleted
inserted
replaced
478:884ca91b0854 | 479:1de67f332f00 |
---|---|
93 def disable_effect(self): | 93 def disable_effect(self): |
94 self.effect = None | 94 self.effect = None |
95 | 95 |
96 | 96 |
97 def drop_bonus(self, x, y, _type, end_pos=None): | 97 def drop_bonus(self, x, y, _type, end_pos=None): |
98 player = self.players[0] #TODO | |
99 if _type > 6: | 98 if _type > 6: |
100 return | 99 return |
101 item_type = self.item_types[_type] | 100 item_type = self.item_types[_type] |
102 item = Item((x, y), _type, item_type, self, end_pos=end_pos) | 101 item = Item((x, y), _type, item_type, self, end_pos=end_pos) |
103 self.items.append(item) | 102 self.items.append(item) |
108 if not item.player: | 107 if not item.player: |
109 item.autocollect(player) | 108 item.autocollect(player) |
110 | 109 |
111 | 110 |
112 def change_bullets_into_star_items(self): | 111 def change_bullets_into_star_items(self): |
113 player = self.players[0] #TODO | 112 player = min(self.players, key=lambda x: (x.state.score, x.state.character)) #TODO |
114 item_type = self.item_types[6] | 113 item_type = self.item_types[6] |
115 self.items.extend(Item((bullet.x, bullet.y), 6, item_type, self, player=player) for bullet in self.bullets) | 114 self.items.extend(Item((bullet.x, bullet.y), 6, item_type, self, player=player) for bullet in self.bullets) |
116 self.bullets = [] | 115 self.bullets = [] |
117 | 116 |
118 | 117 |