X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=xonstat%2Ftemplates%2Faccuracy.mako;h=55736d006fe9043aec1976ff2f06b06a5699969f;hb=6a8be9076cc94690b63a80b687225aced9bb6fc0;hp=46e014161546620fda761cd18dc87db9102e01d8;hpb=c6d2531d1393c223341a50cb4848b748c1844c6a;p=xonotic%2Fxonstat.git
diff --git a/xonstat/templates/accuracy.mako b/xonstat/templates/accuracy.mako
old mode 100755
new mode 100644
index 46e0141..55736d0
--- a/xonstat/templates/accuracy.mako
+++ b/xonstat/templates/accuracy.mako
@@ -10,41 +10,46 @@
## [3] = Max damage
## [4] = Hit
## [5] = Fired
+## [6] = Frags
-
-
- |
- Weapon |
- Hit |
- Fired |
- Hit % |
- Actual Damage |
- Potential Damage |
- Damage % |
-
-% for weapon_stat in weapon_stats:
-<%
-if weapon_stat[3] > 0:
- damage_pct = round(float(weapon_stat[2])/weapon_stat[3]*100, 2)
-else:
- damage_pct = 0
-if weapon_stat[5] > 0:
- hit_pct = round(float(weapon_stat[4])/weapon_stat[5]*100, 2)
-else:
- hit_pct = 0
-%>
-
- ## Note: the name of the image must match up with the weapon_cd
- ## entry of that weapon, else this won't work
- |
- ${weapon_stat[0]} |
- ${weapon_stat[4]} |
- ${weapon_stat[5]} |
- ${hit_pct}% |
- ${weapon_stat[2]} |
- ${weapon_stat[3]} |
- ${damage_pct}% |
-
-% endfor
+
+
+ |
+ Weapon |
+ Frags |
+ Accuracy |
+ Damage |
+
+
+ <%
+ total_damage = 0
+ for weapon_stat in weapon_stats:
+ total_damage += weapon_stat[2]
+ if total_damage == 0:
+ total_damage = 1
+ %>
+
+ % for weapon_stat in weapon_stats:
+ <%
+ if weapon_stat[3] > 0:
+ damage_pct = round(float(weapon_stat[2])/weapon_stat[3]*100, 2)
+ else:
+ damage_pct = 0
+
+ if weapon_stat[5] > 0:
+ hit_pct = round(float(weapon_stat[4])/weapon_stat[5]*100, 2)
+ else:
+ hit_pct = 0
+ %>
+
+ ## Note: the name of the image must match up with the weapon_cd
+ ## entry of that weapon, else this won't work
+ |
+ ${weapon_stat[0]} |
+ ${weapon_stat[6]} |
+ ${weapon_stat[4]}/${weapon_stat[5]} (${hit_pct}%) |
+ ${weapon_stat[2]} (${round(float(weapon_stat[2])/total_damage*100, 2)}%) |
+
+ % endfor
%def>