Xonotic
accuracy.qh
Go to the documentation of this file.
1 #pragma once
2 
3 #include <common/weapons/_all.qh>
4 #include <common/stats.qh>
5 
22 
23 REPLICATE_INIT(bool, cvar_cl_accuracy_data_share);
24 REPLICATE_INIT(bool, cvar_cl_accuracy_data_receive);
25 
26 .entity accuracy;
27 .float accuracy_frags[REGISTRY_MAX(Weapons)];
28 
29 .float accuracy_hit[REGISTRY_MAX(Weapons)];
30 .float accuracy_fired[REGISTRY_MAX(Weapons)];
31 .float accuracy_cnt_hit[REGISTRY_MAX(Weapons)];
33 
34 
35 // init/free
36 void accuracy_init(entity e);
37 void accuracy_free(entity e);
38 
39 void accuracy_reset(entity e);
40 
41 // force a resend of a player's accuracy stats
42 void accuracy_resend(entity e);
43 
44 // update accuracy stats
45 void accuracy_add(entity e, Weapon w, float fired, float hit);
46 
47 // helper
48 bool accuracy_isgooddamage(entity attacker, entity targ);
49 bool accuracy_canbegooddamage(entity attacker);
void accuracy_init(entity e)
Definition: accuracy.qc:45
void accuracy_reset(entity e)
Definition: accuracy.qc:58
entity() spawn
float accuracy_frags[REGISTRY_MAX(Weapons)]
Definition: accuracy.qh:27
void accuracy_add(entity e, Weapon w, float fired, float hit)
Definition: accuracy.qc:83
entity accuracy
Definition: accuracy.qh:26
float accuracy_cnt_hit[REGISTRY_MAX(Weapons)]
Definition: accuracy.qh:31
float autocvar_sv_accuracy_data_share
Weapon Accuracy stats.
Definition: accuracy.qh:21
#define REGISTRY_MAX(id)
Definition: registry.qh:17
bool accuracy_isgooddamage(entity attacker, entity targ)
Definition: accuracy.qc:112
bool accuracy_canbegooddamage(entity attacker)
Definition: accuracy.qc:132
void accuracy_free(entity e)
Definition: accuracy.qc:53
float accuracy_fired[REGISTRY_MAX(Weapons)]
Definition: accuracy.qh:30
float accuracy_cnt_fired[REGISTRY_MAX(Weapons)]
Definition: accuracy.qh:32
float accuracy_hit[REGISTRY_MAX(Weapons)]
Definition: accuracy.qh:29
void accuracy_resend(entity e)
Definition: accuracy.qc:74
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
Definition: weapon.qh:41
REPLICATE_INIT(bool, cvar_cl_accuracy_data_share)