Xonotic
selection.qh
Go to the documentation of this file.
1 #pragma once
2 
3 #include <common/weapons/_all.qh>
4 #include <common/stats.qh>
5 
9 
10 .int selectweapon; // last selected weapon of the player
11 
12 .WepSet dual_weapons;
13 
14 // switch between weapons
15 void Send_WeaponComplain(entity e, float wpn, float type);
16 
18 bool client_hasweapon(entity this, Weapon wpn, .entity weaponentity, float andammo, bool complain);
19 
21 float W_GetCycleWeapon(entity this, string weaponorder, float dir, float imp, float complain, float skipmissing, .entity weaponentity);
22 
23 #define w_getbestweapon(ent,wepent) REGISTRY_GET(Weapons, W_GetCycleWeapon(ent, CS_CVAR(ent).cvar_cl_weaponpriority, 0, -1, false, true, wepent))
24 
25 void W_SwitchWeapon_Force(Player this, Weapon w, .entity weaponentity);
26 
27 // perform weapon to attack (weaponstate and attack_finished check is here)
28 void W_SwitchToOtherWeapon(entity this, .entity weaponentity);
29 bool W_SwitchWeapon(entity this, Weapon imp, .entity weaponentity); // returns false if the player does not have the weapon
30 void W_SwitchWeapon_TryOthers(entity this, Weapon imp, .entity weaponentity);
31 
32 void W_CycleWeapon(entity this, string weaponorder, float dir, .entity weaponentity);
33 
34 void W_NextWeaponOnImpulse(entity this, float imp, .entity weaponentity);
35 
36 // next weapon
37 void W_NextWeapon(entity this, float list, .entity weaponentity);
38 
39 // prev weapon
40 void W_PreviousWeapon(entity this, float list, .entity weaponentity);
41 
42 // previously used if exists and has ammo, (second) best otherwise
43 void W_LastWeapon(entity this, .entity weaponentity);
int int int imp
Definition: impulse.qc:90
WepSet dual_weapons
Definition: selection.qh:12
void W_CycleWeapon(entity this, string weaponorder, float dir,.entity weaponentity)
Definition: selection.qc:302
void W_PreviousWeapon(entity this, float list,.entity weaponentity)
Definition: selection.qc:330
float hasweapon_complain_spam
Definition: selection.qh:17
entity() spawn
void W_SwitchWeapon_TryOthers(entity this, Weapon imp,.entity weaponentity)
Definition: selection.qc:296
void W_LastWeapon(entity this,.entity weaponentity)
Definition: selection.qc:341
void Send_WeaponComplain(entity e, float wpn, float type)
Definition: selection.qc:18
int weaponcomplainindex
Definition: selection.qh:20
bool W_SwitchWeapon(entity this, Weapon imp,.entity weaponentity)
Definition: selection.qc:272
int autocvar_g_showweaponspawns
Definition: selection.qh:6
bool autocvar_g_weaponswitch_debug
Definition: selection.qh:7
entity weaponorder[REGISTRY_MAX(Weapons)]
Definition: weapons.qc:86
bool client_hasweapon(entity this, Weapon wpn,.entity weaponentity, float andammo, bool complain)
Definition: selection.qc:48
void W_NextWeaponOnImpulse(entity this, float imp,.entity weaponentity)
Definition: selection.qc:310
float W_GetCycleWeapon(entity this, string weaponorder, float dir, float imp, float complain, float skipmissing,.entity weaponentity)
Definition: selection.qc:131
void W_NextWeapon(entity this, float list,.entity weaponentity)
void W_SwitchWeapon_Force(Player this, Weapon w,.entity weaponentity)
Definition: selection.qc:243
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
Definition: weapon.qh:41
bool autocvar_g_weaponswitch_debug_alternate
Definition: selection.qh:8
int dir
Definition: impulse.qc:89
int selectweapon
Definition: selection.qh:10
void W_SwitchToOtherWeapon(entity this,.entity weaponentity)
Definition: selection.qc:253