class PlayerWeaponStat(object):
+ def __init__(self):
+ self.fired = 0
+ self.max = 0
+ self.hit = 0
+ self.actual = 0
+ self.frags = 0
+
def __repr__(self):
return "<PlayerWeaponStat(%s, %s, %s)>" % (self.player_weapon_stats_id, self.player_id, self.game_id)
if 'acc-' + weapon_cd + '-cnt-fired' in player_events:
pwstat.fired = int(round(float(
player_events['acc-' + weapon_cd + '-cnt-fired'])))
- if is_doubled:
- pwstat.fired = pwstat.fired/2
if 'acc-' + weapon_cd + '-fired' in player_events:
pwstat.max = int(round(float(
player_events['acc-' + weapon_cd + '-fired'])))
- if is_doubled:
- pwstat.max = pwstat.max/2
if 'acc-' + weapon_cd + '-cnt-hit' in player_events:
pwstat.hit = int(round(float(
player_events['acc-' + weapon_cd + '-cnt-hit'])))
- if is_doubled:
- pwstat.hit = pwstat.hit/2
if 'acc-' + weapon_cd + '-hit' in player_events:
pwstat.actual = int(round(float(
player_events['acc-' + weapon_cd + '-hit'])))
- if is_doubled:
- pwstat.actual = pwstat.actual/2
if 'acc-' + weapon_cd + '-frags' in player_events:
pwstat.frags = int(round(float(
player_events['acc-' + weapon_cd + '-frags'])))
- if is_doubled:
- pwstat.frags = pwstat.frags/2
+
+ if is_doubled:
+ pwstat.fired = pwstat.fired/2
+ pwstat.max = pwstat.max/2
+ pwstat.hit = pwstat.hit/2
+ pwstat.actual = pwstat.actual/2
+ pwstat.frags = pwstat.frags/2
session.add(pwstat)
pwstats.append(pwstat)