]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/weapons/selection.qh
01c05d3fb945ca1bdc835c0a512f42ee510e2cad
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / weapons / selection.qh
1 #pragma once
2
3 #include <common/weapons/_all.qh>
4 #include <common/stats.qh>
5
6 .int selectweapon; // last selected weapon of the player
7
8 .WepSet dual_weapons;
9
10 // switch between weapons
11 void Send_WeaponComplain(entity e, float wpn, float type);
12
13 .float hasweapon_complain_spam;
14 bool client_hasweapon(entity this, Weapon wpn, .entity weaponentity, float andammo, bool complain);
15
16 .int weaponcomplainindex;
17 float W_GetCycleWeapon(entity this, string weaponorder, float dir, float imp, float complain, float skipmissing, .entity weaponentity);
18
19 #define w_getbestweapon(ent,wepent) REGISTRY_GET(Weapons, W_GetCycleWeapon(ent, CS(ent).cvar_cl_weaponpriority, 0, -1, false, true, wepent))
20
21 void W_SwitchWeapon_Force(Player this, Weapon w, .entity weaponentity);
22
23 // perform weapon to attack (weaponstate and attack_finished check is here)
24 void W_SwitchToOtherWeapon(entity this, .entity weaponentity);
25 bool W_SwitchWeapon(entity this, Weapon imp, .entity weaponentity); // returns false if the player does not have the weapon
26 void W_SwitchWeapon_TryOthers(entity this, Weapon imp, .entity weaponentity);
27
28 void W_CycleWeapon(entity this, string weaponorder, float dir, .entity weaponentity);
29
30 void W_NextWeaponOnImpulse(entity this, float imp, .entity weaponentity);
31
32 // next weapon
33 void W_NextWeapon(entity this, float list, .entity weaponentity);
34
35 // prev weapon
36 void W_PreviousWeapon(entity this, float list, .entity weaponentity);
37
38 // previously used if exists and has ammo, (second) best otherwise
39 void W_LastWeapon(entity this, .entity weaponentity);