Esempio n. 1
0
    def on_kill(self, e):
        if not self.disableAir[e.attacker]:
            dist = stat_mgr.dist_3d(self.lastPos[e.attacker], e.attacker_pos)
            self.results[e.attacker] += round(dist)
            self.lastPos[e.attacker] = e.attacker_pos

        if not self.disableAir[e.victim]:
            dist = stat_mgr.dist_3d(self.lastPos[e.victim], e.victim_pos)
            self.results[e.victim] += round(dist)
            self.lastPos[e.victim] = e.victim_pos
Esempio n. 2
0
    def on_kill(self, e):
        if not self.disableAir[e.attacker]:
            dist = stat_mgr.dist_3d(self.lastPos[e.attacker], e.attacker_pos)
            self.results[e.attacker] += round(dist)
            self.lastPos[e.attacker] = e.attacker_pos

        if not self.disableAir[e.victim]:
            dist = stat_mgr.dist_3d(self.lastPos[e.victim], e.victim_pos)
            self.results[e.victim] += round(dist)
            self.lastPos[e.victim] = e.victim_pos
Esempio n. 3
0
    def on_heal(self, e):
        if not self.disableAir[e.giver]:
            dist = stat_mgr.dist_3d(self.lastPos[e.giver], e.giver_pos)
            self.results[e.giver] += round(dist)
            self.lastPos[e.giver] = e.giver_pos

        if not self.disableAir[e.receiver]:
            dist = stat_mgr.dist_3d(self.lastPos[e.receiver], e.receiver_pos)
            self.results[e.receiver] += round(dist)
            self.lastPos[e.receiver] = e.receiver_pos
Esempio n. 4
0
    def on_heal(self, e):
        if not self.disableAir[e.giver]:
            dist = stat_mgr.dist_3d(self.lastPos[e.giver], e.giver_pos)
            self.results[e.giver] += round(dist)
            self.lastPos[e.giver] = e.giver_pos

        if not self.disableAir[e.receiver]:
            dist = stat_mgr.dist_3d(self.lastPos[e.receiver], e.receiver_pos)
            self.results[e.receiver] += round(dist)
            self.lastPos[e.receiver] = e.receiver_pos
Esempio n. 5
0
 def on_vehicle_enter(self, e):
     dist = stat_mgr.dist_3d(self.lastPos[e.player], e.player_pos)
     self.results[e.player] += round(dist)
     self.lastPos[e.player] = e.player_pos
     vehicle_type = e.vehicle.vehicle_type
     if vehicle_type == HELICOPTER or vehicle_type == JET:
         self.disableAir[e.player] = True
Esempio n. 6
0
    def on_kill(self, e):

        # Ignore suicides and team kills
        if not e.valid_kill:
            return

        # Ignore empty attackers
        if not e.attacker in self.player_to_pos:
            return

        # Ignore aircraft kills
        vehicle = model_mgr.get_vehicle(e.attacker.vehicle_id)
        if vehicle.group == AIR:
            return

        # Calculate the distance traveled by the attacker to get the kill
        last_pos = self.player_to_pos[e.attacker]
        distance = stat_mgr.dist_3d(last_pos, e.attacker_pos)

        # Increment the distance and kills for the attacker
        self.distance[e.attacker] += round(distance)
        self.kills[e.attacker] += 1
        # Display the average
        self.results[e.attacker] = round(self.distance[e.attacker] / self.kills[e.attacker])

        # Store the current position for next time
        self.player_to_pos[e.attacker] = e.attacker_pos
Esempio n. 7
0
    def on_kill(self, e):

        # Ignore suicides and team kills
        if not e.valid_kill:
            return

        # Ignore empty attackers
        if not e.attacker in self.player_to_pos:
            return

        # Ignore aircraft kills
        vehicle = model_mgr.get_vehicle(e.attacker.vehicle_id)
        if vehicle.group == AIR:
            return

        # Calculate the distance traveled by the attacker to get the kill
        last_pos = self.player_to_pos[e.attacker]
        distance = stat_mgr.dist_3d(last_pos, e.attacker_pos)

        # Increment the distance and kills for the attacker
        self.distance[e.attacker] += round(distance)
        self.kills[e.attacker] += 1
        # Display the average
        self.results[e.attacker] = round(self.distance[e.attacker] /
                                         self.kills[e.attacker])

        # Store the current position for next time
        self.player_to_pos[e.attacker] = e.attacker_pos
Esempio n. 8
0
 def on_vehicle_enter(self, e):
     dist = stat_mgr.dist_3d(self.lastPos[e.player], e.player_pos)
     self.results[e.player] += round(dist)
     self.lastPos[e.player] = e.player_pos
     vehicle_type = e.vehicle.vehicle_type
     if vehicle_type == HELICOPTER or vehicle_type == JET:
         self.disableAir[e.player] = True
Esempio n. 9
0
 def on_vehicle_exit(self, e):
     if self.disableAir[e.player]:
         self.lastPos[e.player] = e.player_pos
         self.disableAir[e.player] = False
         return
     dist = stat_mgr.dist_3d(self.lastPos[e.player], e.player_pos)
     self.results[e.player] += round(dist)
     self.lastPos[e.player] = e.player_pos
Esempio n. 10
0
    def on_vehicle_destroy(self, e):

        vpos = e.vehicle_pos

        for player in model_mgr.get_players():
            dist = stat_mgr.dist_3d(vpos, player.pos)
            if dist < 5:
                self.results[player] += 1
Esempio n. 11
0
    def on_vehicle_destroy(self, e):

        vpos = e.vehicle_pos

        for player in model_mgr.get_players():
            dist = stat_mgr.dist_3d(vpos, player.pos)
            if dist < 5:
                self.results[player] += 1
Esempio n. 12
0
 def on_vehicle_exit(self, e):
     if self.disableAir[e.player]:
         self.lastPos[e.player] = e.player_pos
         self.disableAir[e.player] = False
         return
     dist = stat_mgr.dist_3d(self.lastPos[e.player], e.player_pos)
     self.results[e.player] += round(dist)
     self.lastPos[e.player] = e.player_pos
Esempio n. 13
0
    def on_kill(self, e):

        # Ignore suicides and team kills
        if not e.valid_kill:
            return

        dist = stat_mgr.dist_3d(self.spawn_pos[e.victim], e.victim_pos)
        if dist < 10:
            self.results[e.attacker] += 1
Esempio n. 14
0
    def on_kill(self, e):

        # Ignore suicides and team kills
        if not e.valid_kill:
            return
        
        dist = stat_mgr.dist_3d(self.spawn_pos[e.victim], e.victim_pos)
        if dist < 10:
            self.results[e.attacker] += 1
Esempio n. 15
0
    def on_kill(self, e):

        # Ignore suicides and team kills
        if not e.valid_kill:
            return

        # Make sure only hand carried bullet weapons are used
        if e.weapon.group != SOLDIER or e.weapon.ammo != PRECISION:
            return

        # Update the kill distance for the attacker
        dist = round(stat_mgr.dist_3d(e.attacker_pos, e.victim_pos))
        if dist > self.results[e.attacker]:
            self.results[e.attacker] = dist
Esempio n. 16
0
    def on_kill(self, e):

        # Ignore suicides and team kills
        if not e.valid_kill:
            return

        # Make sure only hand carried bullet weapons are used
        if e.weapon.group != SOLDIER or e.weapon.ammo != PRECISION:
            return

        # Update the kill distance for the attacker
        dist = round(stat_mgr.dist_3d(e.attacker_pos, e.victim_pos))
        if dist > self.results[e.attacker]:
            self.results[e.attacker] = dist
Esempio n. 17
0
    def on_death(self, e):

        if not e.player in self.player_to_pos:
            self.player_to_pos[e.player] = e.player_pos
            return

        last_pos = self.player_to_pos[e.player]
        dist = round(stat_mgr.dist_3d(last_pos, e.player_pos))
        self.distance[e.player] += dist

        self.deaths[e.player] += 1
        
        self.results[e.player] = round(self.distance[e.player] / self.deaths[e.player])

        # Store the current position for next time
        self.player_to_pos[e.player] = e.player_pos
Esempio n. 18
0
    def on_death(self, e):

        if not e.player in self.player_to_pos:
            self.player_to_pos[e.player] = e.player_pos
            return

        last_pos = self.player_to_pos[e.player]
        dist = round(stat_mgr.dist_3d(last_pos, e.player_pos))
        self.distance[e.player] += dist

        self.deaths[e.player] += 1

        self.results[e.player] = round(self.distance[e.player] /
                                       self.deaths[e.player])

        # Store the current position for next time
        self.player_to_pos[e.player] = e.player_pos
Esempio n. 19
0
 def on_death(self, e):
     dist = stat_mgr.dist_3d(self.spawn_pos[e.player], e.player_pos)
     if dist < 10:
         self.results[e.player] += 1
Esempio n. 20
0
 def on_vehicle_destroy(self, e):
     if self.disableAir[e.attacker]:
         return
     dist = stat_mgr.dist_3d(self.lastPos[e.attacker], e.attacker_pos)
     self.results[e.attacker] += round(dist)
     self.lastPos[e.attacker] = e.attacker_pos
Esempio n. 21
0
 def on_death(self, e):
     dist = stat_mgr.dist_3d(self.spawn_pos[e.player], e.player_pos)
     if dist < 10:
         self.results[e.player] += 1
Esempio n. 22
0
 def on_repair(self, e):
     if self.disableAir[e.giver]:
         return
     dist = stat_mgr.dist_3d(self.lastPos[e.giver], e.giver_pos)
     self.results[e.giver] += round(dist)
     self.lastPos[e.giver] = e.giver_pos
Esempio n. 23
0
 def on_kit_pickup(self, e):
     if self.disableAir[e.player]:
         return
     dist = stat_mgr.dist_3d(self.lastPos[e.player], e.player_pos)
     self.results[e.player] += round(dist)
     self.lastPos[e.player] = e.player_pos
Esempio n. 24
0
 def on_kit_pickup(self, e):
     if self.disableAir[e.player]:
         return
     dist = stat_mgr.dist_3d(self.lastPos[e.player], e.player_pos)
     self.results[e.player] += round(dist)
     self.lastPos[e.player] = e.player_pos
Esempio n. 25
0
 def on_repair(self, e):
     if self.disableAir[e.giver]:
         return
     dist = stat_mgr.dist_3d(self.lastPos[e.giver], e.giver_pos)
     self.results[e.giver] += round(dist)
     self.lastPos[e.giver] = e.giver_pos
Esempio n. 26
0
 def on_vehicle_destroy(self, e):
     if self.disableAir[e.attacker]:
         return
     dist = stat_mgr.dist_3d(self.lastPos[e.attacker], e.attacker_pos)
     self.results[e.attacker] += round(dist)
     self.lastPos[e.attacker] = e.attacker_pos