Commit ea21090b authored by talljosh's avatar talljosh
Browse files

Rogue mines no longer trigger a traceback, and they also no longer kill the...

Rogue mines no longer trigger a traceback, and they also no longer kill the player who launched them.
parent cbaefc6428ae
......@@ -125,7 +125,7 @@ class MineShot(Unit):
def check_collision(self, player):
if not self.stuck:
return False
if not player.dead and not player.isFriendsWithTeam(self.team):
if not player.dead and not player.isFriendsWithTeam(self.team) and player != self.player:
if distance(player.pos, self.pos) < self.TRIGGER_RADIUS:
return True
return False
......@@ -139,6 +139,8 @@ class MineShot(Unit):
for player in self.world.players:
if player.dead or player.isFriendsWithTeam(self.team) or player.is_invulnerable():
continue
if player == self.player:
continue
if distance(player.pos, self.pos) < self.BLAST_RADIUS:
self.world.sendKill(player, MINE_HIT, self.player, maxHits=1)
......
......@@ -253,9 +253,11 @@ class ViewManager(framework.Element):
def drawMines(self, screen):
for mine in self.universe.iter_mines():
#for vector in mine.vectors:
# pygame.draw.line(screen, (0,0,0), mapPosToScreen(mine.pos, self._focus, self.sRect), mapPosToScreen([mine.pos[0] + vector[0] * math.cos(vector[1]), mine.pos[1] + vector[0] * math.sin(vector[1])], self._focus, self.sRect), 2)
pygame.draw.circle(screen, mine.player.team.colour, mapPosToScreen(mine.pos, self._focus, self.sRect), mine.VISUAL_RADIUS)
colour = (255, 255, 255) if not mine.team else mine.team.colour
pygame.draw.circle(
screen, colour,
mapPosToScreen(mine.pos, self._focus, self.sRect),
mine.VISUAL_RADIUS)
def _drawSprites(self, screen):
focus = self._focus
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment