3 #include <common/weapons/_all.qh>
4 #include <common/stats.qh>
7 * Weapon Accuracy stats
9 * These stats are sent to all the clients to be displayed on the scoreboard
10 * and also to Xonstats.
12 * Note that weapon damage is counted differently from player damage:
13 * - it isn't limited by target's health in case you kill them
14 * - it ignores handicap, shield, strength and similar powerups / buffs
15 * - it doesn't count more than a single full hit if you hit multiple targets
16 * with a single shot in order to never assign more than 100% accuracy per hit
17 * - obviously damage caused by fall, lava, trigger_hurt and telefrags isn't
18 * counted as weapon damage in any way
21 float autocvar_sv_accuracy_data_share = 1;
23 .bool cvar_cl_accuracy_data_share;
24 REPLICATE(cvar_cl_accuracy_data_share, bool, "cl_accuracy_data_share");
25 .bool cvar_cl_accuracy_data_receive;
26 REPLICATE(cvar_cl_accuracy_data_receive, bool, "cl_accuracy_data_receive");
29 .float accuracy_frags[REGISTRY_MAX(Weapons)];
31 .float accuracy_hit[REGISTRY_MAX(Weapons)];
32 .float accuracy_fired[REGISTRY_MAX(Weapons)];
33 .float accuracy_cnt_hit[REGISTRY_MAX(Weapons)];
34 .float accuracy_cnt_fired[REGISTRY_MAX(Weapons)];
38 void accuracy_init(entity e);
39 void accuracy_free(entity e);
41 // force a resend of a player's accuracy stats
42 void accuracy_resend(entity e);
44 // update accuracy stats
45 void accuracy_add(entity e, Weapon w, float fired, float hit);
48 bool accuracy_isgooddamage(entity attacker, entity targ);
49 bool accuracy_canbegooddamage(entity attacker);