Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
all.qh File Reference
#include <common/command/_mod.qh>
#include <common/stats.qh>
#include "config.qh"
#include "weapon.qh"
#include "calculations.qh"
#include "projectiles.qh"
#include <common/models/all.qh>
#include <common/effects/all.qh>
#include <common/util.qh>
#include <server/bot/api.qh>
#include "all.inc"
Include dependency graph for all.qh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  NullWeapon

Macros

#define _W_CONFIG(class, fld, T, wepname)
#define _W_NET(class, fld, T, wepname)
#define _W_PROP(class, fld, T, wepname)
#define _W_PROP_CVAR(wepname, fld)
#define _W_UPDATE(class, fld, T, wepname)
#define DEFAULT_FILENAME   "weapons_dump.cfg"
#define G_SHOOTFROMFIXEDORIGIN   autocvar_g_shootfromfixedorigin
#define Read_float()
#define Read_int()
#define Read_string()
#define REGISTER_WEAPON(id, inst)
#define W_CONFIG(class, wepname, fld, T, m)
#define W_CONFIG_BEGIN(class)
#define W_CONFIG_BOTH(class, fld, T, wepname)
#define W_CONFIG_END()
#define W_CONFIG_NONE(class, fld, T, wepname)
#define W_CONFIG_PRI(class, fld, T, wepname)
#define W_CONFIG_SEC(class, fld, T, wepname)
#define W_FixWeaponOrder(order, complete)
#define W_NameWeaponOrder(order)
#define W_NET(class, wepname, fld, T, m)
#define W_NET_BEGIN(class)
#define W_NET_BOTH(class, fld, T, wepname)
#define W_NET_END()
#define W_NET_NONE(class, fld, T, wepname)
#define W_NET_PRI(class, fld, T, wepname)
#define W_NET_SEC(class, fld, T, wepname)
#define W_NumberWeaponOrder(order)
#define W_PROP(class, wepname, fld, T, m)
#define W_PROP_BEGIN(class)
#define W_PROP_BOTH(class, fld, T, wepname)
#define W_PROP_END()
#define W_PROP_NONE(class, fld, T, wepname)
#define W_PROP_PRI(class, fld, T, wepname)
#define W_PROP_SEC(class, fld, T, wepname)
#define W_PROPS(L, class, prefix)
#define W_UPDATE(class, wepname, fld, T, m)
#define W_UPDATE_BEGIN(class)
#define W_UPDATE_BOTH(class, fld, T, wepname)
#define W_UPDATE_END()
#define W_UPDATE_NONE(class, fld, T, wepname)
#define W_UPDATE_PRI(class, fld, T, wepname)
#define W_UPDATE_SEC(class, fld, T, wepname)
#define WEP_CVAR(wep, name)
#define WEP_CVAR_BOTH(wep, isprimary, name)
#define WEP_CVAR_PRI(wep, name)
#define WEP_CVAR_SEC(wep, name)
#define WEP_IMPULSE_BEGIN   230
#define WEP_IMPULSE_END   bound(WEP_IMPULSE_BEGIN, WEP_IMPULSE_BEGIN + (REGISTRY_COUNT(Weapons) - 1) - 1, 253)
#define WEP_LAST   (REGISTRY_COUNT(Weapons) - 1)
#define WEPSET(id)
#define WepSet_FromWeapon(it)
#define WepSet_GetFromStat()
#define WepSet_GetFromStat_InMap()
#define X(fld, T)

Functions

WepSet _WepSet_FromWeapon (int i)
void CL_WeaponEntity_SetModel (entity this, string name, bool _anim)
 supported formats:
entity GetAmmoItem (Resource ammotype)
entity GetAmmoResource (Ammo ammotype)
int GetAmmoStat (Resource ammotype)
 NET_HANDLE (WeaponUpdate, bool isnew)
WepSet ReadWepSet ()
 REGISTER_WEAPON (Null, NEW(NullWeapon))
 REPLICATE_INIT (bool, cvar_cl_accuracy_data_receive)
 REPLICATE_INIT (bool, cvar_cl_accuracy_data_share)
 REPLICATE_INIT (bool, cvar_cl_weapon_switch_fallback_to_impulse)
 REPLICATE_INIT (bool, cvar_cl_weapon_switch_reload)
 REPLICATE_INIT (int, cvar_cl_gunalign)
 REPLICATE_INIT (int, cvar_cl_weaponimpulsemode)
 REPLICATE_INIT (string, cvar_cl_weaponpriorities[10])
 REPLICATE_INIT (string, cvar_cl_weaponpriority)
vector shotorg_adjust (vector vecs, bool y_is_right, bool visual, int algn)
 STATIC_INIT (register_weapons_done)
 STATIC_INIT (WeaponPickup)
 STATIC_INIT_LATE (W_PROP_reloader)
 void (Weapon this, int) wr_net
string W_FixWeaponOrder_AllowIncomplete (entity this, string order)
string W_FixWeaponOrder_BuildImpulseList (string o)
string W_FixWeaponOrder_ForceComplete (string order)
string W_FixWeaponOrder_ForceComplete_AndBuildImpulseList (entity this, string wo)
string W_Guide_DPS (string name, string pri, string sec)
string W_Guide_DPS_bothMultishot (string name, string pri, string sec)
string W_Guide_DPS_onlyOne (string name, string fire)
string W_Guide_DPS_onlyOne_andDirectHit (string name, string fire)
string W_Guide_DPS_onlyOne_unnamed (string name)
string W_Guide_DPS_onlyOne_unnamed_andDirectHit (string name)
string W_Guide_DPS_onlyOneMultishot (string name, string fire, string shots, string refire2)
string W_Guide_DPS_onlySecondary (string name, string sec)
string W_Guide_DPS_primaryDPS (string name, string pri, string sec)
string W_Guide_DPS_primaryMultishot (string name, string pri, string sec, string shots, string refire2)
string W_Guide_DPS_secondaryMultishot (string name, string pri, string sec, string shots, string refire2, bool sec_variable)
string W_Guide_DPS_secondaryMultishotWithCombo (string name, string pri, string sec, string shots, string refire2, string combo, bool sec_variable)
string W_Guide_Keybinds (Weapon wep)
string W_Model (string w_mdl)
void W_MuzzleFlash (Weapon thiswep, entity actor,.entity weaponentity, vector shotorg, vector shotdir)
string W_NameWeaponOrder_MapFunc (string s)
string W_NumberWeaponOrder_MapFunc (string s)
void W_PROP_reload (int chan, entity to)
void W_PROP_think (entity this)
WepSet W_RandomWeapons (entity e, WepSet remaining, int n)
string W_Sound (string w_snd)
Weapon Weapon_from_impulse (int imp)
Weapon Weapon_from_name (string s)
vector weaponentity_glowmod (Weapon wep, int c, entity wepent)
void wframe_send (entity actor, entity weaponentity, int wepframe, float attackrate, bool restartanim)
void WriteWepSet (float dest, WepSet w)
float float float X (reload_ammo, float) const .float reloading_ammo
 X (reload_time, float) const .float reloading_time
 X (switchdelay_drop, float) X(switchdelay_raise
float X (weaponreplace, string) X(weaponstartoverride
float float X (weaponstart, float) X(weaponthrowable

Variables

vector anim_fire1
vector anim_fire2
vector anim_idle
vector anim_reload
string autocvar_g_shootfromfixedorigin
float autocvar_w_prop_interval = 5
entity baseline
entity baseline_target
entity exteriorweaponentity
int m_gunalign
int m_unique_impulse
WepSet m_wepset
vector movedir_aligned
entity muzzle_flash
vector spawnorigin
entity weaponchild
string weaponname
const int WEP_FIRST = 1
WepSet WEPSET_ALL
WepSet WEPSET_SUPERWEAPONS
WFRAME wframe

Macro Definition Documentation

◆ _W_CONFIG

#define _W_CONFIG ( class,
fld,
T,
wepname )
Value:
if (#wepname == this.netname) WEP_CONFIG_WRITE_CVARS(wepname, fld, T);
string netname
Definition powerups.qc:20
#define WEP_CONFIG_WRITE_CVARS(wepname, name, T)
Definition config.qh:15

Definition at line 229 of file all.qh.

◆ _W_NET

#define _W_NET ( class,
fld,
T,
wepname )
Value:
{ \
if (++n == i) \
this.wepvar_##fld = Read_##T(); \
}

Definition at line 287 of file all.qh.

287 #define _W_NET(class, fld, T, wepname) \
288 { \
289 if (++n == i) \
290 this.wepvar_##fld = Read_##T(); \
291 }

◆ _W_PROP

#define _W_PROP ( class,
fld,
T,
wepname )
Value:
/* static */ T _W_PROP_CVAR(wepname, fld); \
ATTRIB(class, wepvar_##fld, T, _W_PROP_CVAR(wepname, fld));
#define _W_PROP_CVAR(wepname, fld)
Definition all.qh:210

Definition at line 207 of file all.qh.

207 #define _W_PROP(class, fld, T, wepname) \
208 /* static */ T _W_PROP_CVAR(wepname, fld); \
209 ATTRIB(class, wepvar_##fld, T, _W_PROP_CVAR(wepname, fld));

◆ _W_PROP_CVAR

#define _W_PROP_CVAR ( wepname,
fld )
Value:
autocvar_g_balance_##wepname##_##fld

Definition at line 210 of file all.qh.

◆ _W_UPDATE

#define _W_UPDATE ( class,
fld,
T,
wepname )
Value:
{ \
T it = _W_PROP_CVAR(wepname, fld); \
b.wepvar_##fld = this.wepvar_##fld; \
this.wepvar_##fld = it; \
}

Definition at line 257 of file all.qh.

257 #define _W_UPDATE(class, fld, T, wepname) \
258 { \
259 T it = _W_PROP_CVAR(wepname, fld); \
260 b.wepvar_##fld = this.wepvar_##fld; \
261 this.wepvar_##fld = it; \
262 }

◆ DEFAULT_FILENAME

#define DEFAULT_FILENAME   "weapons_dump.cfg"

Definition at line 53 of file all.qh.

◆ G_SHOOTFROMFIXEDORIGIN

#define G_SHOOTFROMFIXEDORIGIN   autocvar_g_shootfromfixedorigin

Definition at line 445 of file all.qh.

Referenced by shotorg_adjust().

◆ Read_float

#define Read_float ( )
Value:
#define ReadFloat()
Definition net.qh:348

Definition at line 182 of file all.qh.

◆ Read_int

#define Read_int ( )
Value:
int ReadInt24_t()
Definition net.qh:337

Definition at line 181 of file all.qh.

◆ Read_string

#define Read_string ( )
Value:
#define ReadString

Definition at line 183 of file all.qh.

◆ REGISTER_WEAPON

◆ W_CONFIG

#define W_CONFIG ( class,
wepname,
fld,
T,
m )
Value:
W_CONFIG_##m(class, fld, T, wepname)

Definition at line 220 of file all.qh.

◆ W_CONFIG_BEGIN

#define W_CONFIG_BEGIN ( class)
Value:
METHOD(class, wr_config, void(class this)) {
#define METHOD(cname, name, prototype)
Definition oo.qh:274

Definition at line 228 of file all.qh.

◆ W_CONFIG_BOTH

#define W_CONFIG_BOTH ( class,
fld,
T,
wepname )
Value:
W_CONFIG_PRI(class, fld, T, wepname) \
W_CONFIG_SEC(class, fld, T, wepname)
#define W_CONFIG_PRI(class, fld, T, wepname)
Definition all.qh:222

Definition at line 224 of file all.qh.

224 #define W_CONFIG_BOTH(class, fld, T, wepname) \
225 W_CONFIG_PRI(class, fld, T, wepname) \
226 W_CONFIG_SEC(class, fld, T, wepname)

◆ W_CONFIG_END

#define W_CONFIG_END ( )
Value:
}

Definition at line 230 of file all.qh.

◆ W_CONFIG_NONE

#define W_CONFIG_NONE ( class,
fld,
T,
wepname )
Value:
_W_CONFIG(class, fld, T, wepname)
#define _W_CONFIG(class, fld, T, wepname)
Definition all.qh:229

Definition at line 221 of file all.qh.

◆ W_CONFIG_PRI

#define W_CONFIG_PRI ( class,
fld,
T,
wepname )
Value:
_W_CONFIG(class, primary_##fld, T, wepname)

Definition at line 222 of file all.qh.

◆ W_CONFIG_SEC

#define W_CONFIG_SEC ( class,
fld,
T,
wepname )
Value:
_W_CONFIG(class, secondary_##fld, T, wepname)

Definition at line 223 of file all.qh.

◆ W_FixWeaponOrder

#define W_FixWeaponOrder ( order,
complete )
Value:
string fixPriorityList(string order, float from, float to, float subtract, float complete)
Definition util.qc:600
#define WEP_LAST
Definition all.qh:345
const int WEP_FIRST
Definition all.qh:344
#define WEP_IMPULSE_BEGIN
Definition all.qh:352

Definition at line 483 of file all.qh.

Referenced by LocalCommand_sendcvar(), W_FixWeaponOrder_AllowIncomplete(), W_FixWeaponOrder_ForceComplete(), and XonoticWeaponsList_draw().

◆ W_NameWeaponOrder

#define W_NameWeaponOrder ( order)
Value:
string mapPriorityList(string order, string(string) mapfunc)
Definition util.qc:642
string W_NameWeaponOrder_MapFunc(string s)
Definition all.qc:90

Definition at line 481 of file all.qh.

Referenced by XonoticWeaponsList_draw().

◆ W_NET

#define W_NET ( class,
wepname,
fld,
T,
m )
Value:
W_NET_##m(class, fld, T, wepname)

Definition at line 274 of file all.qh.

◆ W_NET_BEGIN

#define W_NET_BEGIN ( class)
Value:
METHOD(class, wr_net, void(class this, int i)) \
{ \
int n = 0;

Definition at line 283 of file all.qh.

283 #define W_NET_BEGIN(class) \
284 METHOD(class, wr_net, void(class this, int i)) \
285 { \
286 int n = 0;

◆ W_NET_BOTH

#define W_NET_BOTH ( class,
fld,
T,
wepname )
Value:
W_NET_PRI(class, fld, T, wepname) \
W_NET_SEC(class, fld, T, wepname)
#define W_NET_PRI(class, fld, T, wepname)
Definition all.qh:276

Definition at line 278 of file all.qh.

278 #define W_NET_BOTH(class, fld, T, wepname) \
279 W_NET_PRI(class, fld, T, wepname) \
280 W_NET_SEC(class, fld, T, wepname)

◆ W_NET_END

#define W_NET_END ( )
Value:
}

Definition at line 292 of file all.qh.

292 #define W_NET_END() \
293 }

◆ W_NET_NONE

#define W_NET_NONE ( class,
fld,
T,
wepname )
Value:
_W_NET(class, fld, T, wepname)
#define _W_NET(class, fld, T, wepname)
Definition all.qh:287

Definition at line 275 of file all.qh.

◆ W_NET_PRI

#define W_NET_PRI ( class,
fld,
T,
wepname )
Value:
_W_NET(class, primary_##fld, T, wepname)

Definition at line 276 of file all.qh.

◆ W_NET_SEC

#define W_NET_SEC ( class,
fld,
T,
wepname )
Value:
_W_NET(class, secondary_##fld, T, wepname)

Definition at line 277 of file all.qh.

◆ W_NumberWeaponOrder

#define W_NumberWeaponOrder ( order)

◆ W_PROP

#define W_PROP ( class,
wepname,
fld,
T,
m )
Value:
W_PROP_##m(class, fld, T, wepname)

Definition at line 198 of file all.qh.

◆ W_PROP_BEGIN

#define W_PROP_BEGIN ( class)

Definition at line 205 of file all.qh.

◆ W_PROP_BOTH

#define W_PROP_BOTH ( class,
fld,
T,
wepname )
Value:
W_PROP_PRI(class, fld, T, wepname) \
W_PROP_SEC(class, fld, T, wepname)
#define W_PROP_PRI(class, fld, T, wepname)
Definition all.qh:200

Definition at line 202 of file all.qh.

202 #define W_PROP_BOTH(class, fld, T, wepname) \
203 W_PROP_PRI(class, fld, T, wepname) \
204 W_PROP_SEC(class, fld, T, wepname)

◆ W_PROP_END

#define W_PROP_END ( )

Definition at line 216 of file all.qh.

◆ W_PROP_NONE

#define W_PROP_NONE ( class,
fld,
T,
wepname )
Value:
_W_PROP(class, fld, T, wepname)
#define _W_PROP(class, fld, T, wepname)
Definition all.qh:207

Definition at line 199 of file all.qh.

◆ W_PROP_PRI

#define W_PROP_PRI ( class,
fld,
T,
wepname )
Value:
_W_PROP(class, primary_##fld, T, wepname)

Definition at line 200 of file all.qh.

◆ W_PROP_SEC

#define W_PROP_SEC ( class,
fld,
T,
wepname )
Value:
_W_PROP(class, secondary_##fld, T, wepname)

Definition at line 201 of file all.qh.

◆ W_PROPS

#define W_PROPS ( L,
class,
prefix )
Value:
L(W_PROP_BEGIN, W_PROP, W_PROP_END, class, prefix) \
L(W_CONFIG_BEGIN, W_CONFIG, W_CONFIG_END, class, prefix) \
L(W_UPDATE_BEGIN, W_UPDATE, W_UPDATE_END, class, prefix) \
L(W_NET_BEGIN, W_NET, W_NET_END, class, prefix) \
\
#define W_PROP_BEGIN(class)
Definition all.qh:205
#define W_PROP(class, wepname, fld, T, m)
Definition all.qh:198
#define W_NET(class, wepname, fld, T, m)
Definition all.qh:274
#define W_UPDATE_END()
Definition all.qh:266
#define W_PROP_END()
Definition all.qh:216
#define W_CONFIG_END()
Definition all.qh:230
#define W_CONFIG(class, wepname, fld, T, m)
Definition all.qh:220
#define W_NET_BEGIN(class)
Definition all.qh:283
#define W_UPDATE_BEGIN(class)
Definition all.qh:247
#define W_CONFIG_BEGIN(class)
Definition all.qh:228
#define W_NET_END()
Definition all.qh:292
#define W_UPDATE(class, wepname, fld, T, m)
Definition all.qh:238

Definition at line 190 of file all.qh.

190#define W_PROPS(L, class, prefix) \
191 L(W_PROP_BEGIN, W_PROP, W_PROP_END, class, prefix) \
192 L(W_CONFIG_BEGIN, W_CONFIG, W_CONFIG_END, class, prefix) \
193 L(W_UPDATE_BEGIN, W_UPDATE, W_UPDATE_END, class, prefix) \
194 L(W_NET_BEGIN, W_NET, W_NET_END, class, prefix) \
195 /**/ \
196

◆ W_UPDATE

#define W_UPDATE ( class,
wepname,
fld,
T,
m )
Value:
W_UPDATE_##m(class, fld, T, wepname)

Definition at line 238 of file all.qh.

◆ W_UPDATE_BEGIN

#define W_UPDATE_BEGIN ( class)
Value:
METHOD(class, wr_update, void(class this)) \
{ \
noref entity b = this.baseline; \
if (!b) \
{ \
b = this.baseline = new_pure(baseline); \
b.baseline_target = this; \
}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
#define new_pure(class)
purely logical entities (not linked to the area grid)
Definition oo.qh:66
entity baseline
Definition all.qh:246

Definition at line 247 of file all.qh.

247 #define W_UPDATE_BEGIN(class) \
248 METHOD(class, wr_update, void(class this)) \
249 { \
250 noref entity b = this.baseline; \
251 if (!b) \
252 { \
253 b = this.baseline = new_pure(baseline); \
254 b.baseline_target = this; \
255 }

◆ W_UPDATE_BOTH

#define W_UPDATE_BOTH ( class,
fld,
T,
wepname )
Value:
W_UPDATE_PRI(class, fld, T, wepname) \
W_UPDATE_SEC(class, fld, T, wepname)
#define W_UPDATE_PRI(class, fld, T, wepname)
Definition all.qh:240

Definition at line 242 of file all.qh.

242 #define W_UPDATE_BOTH(class, fld, T, wepname) \
243 W_UPDATE_PRI(class, fld, T, wepname) \
244 W_UPDATE_SEC(class, fld, T, wepname)

◆ W_UPDATE_END

#define W_UPDATE_END ( )
Value:
}

Definition at line 266 of file all.qh.

◆ W_UPDATE_NONE

#define W_UPDATE_NONE ( class,
fld,
T,
wepname )
Value:
_W_UPDATE(class, fld, T, wepname)
#define _W_UPDATE(class, fld, T, wepname)
Definition all.qh:257

Definition at line 239 of file all.qh.

◆ W_UPDATE_PRI

#define W_UPDATE_PRI ( class,
fld,
T,
wepname )
Value:
_W_UPDATE(class, primary_##fld, T, wepname)

Definition at line 240 of file all.qh.

◆ W_UPDATE_SEC

#define W_UPDATE_SEC ( class,
fld,
T,
wepname )
Value:
_W_UPDATE(class, secondary_##fld, T, wepname)

Definition at line 241 of file all.qh.

◆ WEP_CVAR

#define WEP_CVAR ( wep,
name )
Value:
(wep.wepvar_##name)
string name
Definition menu.qh:30

Definition at line 339 of file all.qh.

Referenced by Arc_GetHeat_Percent(), Arc_Smoke(), Draw_ArcBeam(), electro_orb_draw(), GetAmmoConsumption(), havocbot_movetogoal(), HUD_Crosshair(), MachineGun_Heat(), MachineGun_Update_Spread(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), NET_HANDLE(), PlayerThink(), Porto_Draw(), vortex_glowcolor(), W_Arc_Attack(), W_Arc_Attack_Bolt(), W_Arc_Beam(), W_Arc_Beam_Think(), W_Arc_Bolt_Explode(), W_Arc_Bolt_Touch(), W_Devastator_Attack(), W_Devastator_DoRemoteExplode(), W_Devastator_Explode(), W_Devastator_RemoteExplode(), W_Devastator_Think(), W_Electro_ExplodeCombo(), W_Electro_ExplodeComboThink(), W_Electro_Orb_Damage(), W_Electro_TriggerCombo(), W_MachineGun_Attack(), W_MachineGun_Attack_Auto(), W_MachineGun_Attack_Burst(), W_MachineGun_Attack_Frame(), W_MineLayer_Attack(), W_MineLayer_Damage(), W_MineLayer_DoRemoteExplode(), W_MineLayer_Explode(), W_MineLayer_ProximityExplode(), W_MineLayer_RemoteExplode(), W_MineLayer_Think(), W_Mortar_Attack(), W_Mortar_Attack2(), W_OverkillMachineGun_Attack_Auto(), W_OverkillNex_Attack(), W_OverkillRocketPropelledChainsaw_Explode(), W_Seeker_Fire_Flac(), W_Seeker_Fire_Missile(), W_Seeker_Fire_Tag(), W_Seeker_Flac_Explode(), W_Seeker_Missile_Explode(), W_Seeker_Missile_Think(), W_Seeker_Tag_Touch(), W_Seeker_Tracker_Think(), W_Seeker_Vollycontroller_Think(), W_Tuba_NoteOn(), W_Tuba_NoteThink(), W_Vortex_Attack(), W_Vortex_Charge(), weapon_defaultspawnfunc(), and weapon_prepareattack_checkammo().

◆ WEP_CVAR_BOTH

#define WEP_CVAR_BOTH ( wep,
isprimary,
name )
Value:
((isprimary) ? WEP_CVAR_PRI(wep, name) : WEP_CVAR_SEC(wep, name))
#define WEP_CVAR_PRI(wep, name)
Definition all.qh:340
#define WEP_CVAR_SEC(wep, name)
Definition all.qh:341

Definition at line 342 of file all.qh.

Referenced by W_Crylink_LinkExplode(), W_Crylink_LinkJoinEffect_Think(), W_Crylink_Touch(), W_HLAC_Touch(), W_OverkillNex_Attack(), W_Porto_Attack(), W_Rifle_FireBullet(), and W_Vortex_Attack().

◆ WEP_CVAR_PRI

◆ WEP_CVAR_SEC

◆ WEP_IMPULSE_BEGIN

#define WEP_IMPULSE_BEGIN   230

Definition at line 352 of file all.qh.

Referenced by STATIC_INIT().

◆ WEP_IMPULSE_END

#define WEP_IMPULSE_END   bound(WEP_IMPULSE_BEGIN, WEP_IMPULSE_BEGIN + (REGISTRY_COUNT(Weapons) - 1) - 1, 253)

Definition at line 353 of file all.qh.

Referenced by STATIC_INIT().

◆ WEP_LAST

◆ WEPSET

◆ WepSet_FromWeapon

◆ WepSet_GetFromStat

#define WepSet_GetFromStat ( )
Value:
STAT(WEAPONS)
#define STAT(...)
Definition stats.qh:94

Definition at line 14 of file all.qh.

Referenced by HUD_Weapons(), MUTATOR_HOOKFUNCTION(), and Scoreboard_AccuracyAndItemStats_Draw().

◆ WepSet_GetFromStat_InMap

#define WepSet_GetFromStat_InMap ( )
Value:
STAT(WEAPONSINMAP)

Definition at line 15 of file all.qh.

Referenced by Scoreboard_AccuracyAndItemStats_Draw().

◆ X

#define X ( fld,
T )
Value:
.T fld; .T wepvar_##fld = fld;

Definition at line 162 of file all.qh.

Function Documentation

◆ _WepSet_FromWeapon()

WepSet _WepSet_FromWeapon ( int i)

Definition at line 53 of file all.qc.

54{
55 a -= WEP_FIRST;
56 if (REGISTRY_MAX(Weapons) > 24 && a >= 24)
57 {
58 a -= 24;
59 if (REGISTRY_MAX(Weapons) > 48 && a >= 24)
60 {
61 a -= 24;
62 return '0 0 1' * BIT(a);
63 }
64 return '0 1 0' * BIT(a);
65 }
66 return '1 0 0' * BIT(a);
67}
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
Definition bits.qh:8
#define REGISTRY_MAX(id)
Definition registry.qh:17

References BIT, REGISTRY_MAX, Weapons, and WEP_FIRST.

Referenced by STATIC_INIT().

◆ CL_WeaponEntity_SetModel()

void CL_WeaponEntity_SetModel ( entity this,
string name,
bool _anim )

supported formats:

  1. simple animated model, muzzle flash handling on h_ model: h_tuba.dpm, h_tuba.dpm.framegroups - invisible model controlling the animation tags: shot = muzzle end (shot origin, also used for muzzle flashes) shell = casings ejection point (must be on the right hand side of the gun) weapon = attachment for v_tuba.md3 v_tuba.md3 - first and third person model g_tuba.md3 - pickup model
  2. simple animated model, muzzle flash handling on v_ model: h_tuba.dpm, h_tuba.dpm.framegroups - invisible model controlling the animation tags: weapon = attachment for v_tuba.md3 v_tuba.md3 - first and third person model tags: shot = muzzle end (shot origin, also used for muzzle flashes) shell = casings ejection point (must be on the right hand side of the gun) g_tuba.md3 - pickup model
  3. fully animated model, muzzle flash handling on h_ model: h_tuba.dpm, h_tuba.dpm.framegroups - animated first person model tags: shot = muzzle end (shot origin, also used for muzzle flashes) shell = casings ejection point (must be on the right hand side of the gun) handle = corresponding to the origin of v_tuba.md3 (used for muzzle flashes) v_tuba.md3 - third person model g_tuba.md3 - pickup model
  4. fully animated model, muzzle flash handling on v_ model: h_tuba.dpm, h_tuba.dpm.framegroups - animated first person model tags: shot = muzzle end (shot origin) shell = casings ejection point (must be on the right hand side of the gun) v_tuba.md3 - third person model tags: shot = muzzle end (for muzzle flashes) g_tuba.md3 - pickup model

writes: this.origin, this.angles this.weaponchild this.movedir, this.view_ofs, this.movedir_aligned this.spawnorigin (SVQC only) attachment stuff anim stuff to free: call again with "" remove the ent

Definition at line 320 of file all.qc.

321{
322 if (name == "")
323 {
324 vector oldmin = this.mins;
325 vector oldmax = this.maxs;
326 setmodel(this, MDL_Null);
327 setsize(this, oldmin, oldmax);
328 if (this.weaponchild)
329 delete(this.weaponchild);
330 this.weaponchild = NULL;
331 this.movedir = '0 0 0';
332#ifdef SVQC
333 this.spawnorigin = '0 0 0';
334#endif
335 this.oldorigin = '0 0 0';
336 this.anim_fire1 = '0 1 0.01';
337 this.anim_fire2 = '0 1 0.01';
338 this.anim_idle = '0 1 0.01';
339 this.anim_reload = '0 1 0.01';
340 }
341 else
342 {
343 // if there is a child entity, hide it until we're sure we use it
344 if (this.weaponchild)
345 this.weaponchild.model = "";
346 _setmodel(this, W_Model(strcat("v_", name, ".md3")));
347 int v_shot_idx;
348 (v_shot_idx = gettagindex(this, "shot")) || (v_shot_idx = gettagindex(this, "tag_shot"));
349
350 _setmodel(this, W_Model(strcat("h_", name, ".iqm")));
351 // preset some defaults that work great for renamed zym files (which don't need an animinfo)
352 this.anim_fire1 = animfixfps(this, '0 1 0.01', '0 0 0');
353 this.anim_fire2 = animfixfps(this, '1 1 0.01', '0 0 0');
354 this.anim_idle = animfixfps(this, '2 1 0.01', '0 0 0');
355 this.anim_reload = animfixfps(this, '3 1 0.01', '0 0 0');
356
357 // if we have a "weapon" tag, let's attach the v_ model to it ("invisible hand" style model)
358 // if we don't, this is a "real" animated model
359 string t;
360 if ((t = "weapon", gettagindex(this, t)) || (t = "tag_weapon", gettagindex(this, t)))
361 {
362 if (!this.weaponchild)
363 {
364 this.weaponchild = new(weaponchild);
365#ifdef CSQC
366 this.weaponchild.drawmask = MASK_NORMAL;
367 this.weaponchild.renderflags |= RF_VIEWMODEL;
368#endif
369 }
370 _setmodel(this.weaponchild, W_Model(strcat("v_", name, ".md3")));
371 setsize(this.weaponchild, '0 0 0', '0 0 0');
372 setattachment(this.weaponchild, this, t);
373 }
374 else
375 {
376 if (this.weaponchild)
377 delete(this.weaponchild);
378 this.weaponchild = NULL;
379 }
380
381 setsize(this, '0 0 0', '0 0 0');
382 setorigin(this, '0 0 0');
383 this.angles = '0 0 0';
384 this.frame = 0;
385#ifdef SVQC
387#else
389#endif
390 if (v_shot_idx) // v_ model attached to invisible h_ model
391 this.movedir = gettaginfo(this.weaponchild, v_shot_idx);
392 else
393 {
394 int idx;
395 if ((idx = gettagindex(this, "shot")) || (idx = gettagindex(this, "tag_shot")))
396 this.movedir = gettaginfo(this, idx);
397 else
398 {
399 LOG_WARNF("weapon model %s does not support the 'shot' tag, will display shots TOTALLY wrong",
400 this.model);
401 this.movedir = '0 0 0';
402 }
403 }
404#ifdef SVQC
405 {
406 int idx = 0;
407 // v_ model attached to invisible h_ model
408 if (this.weaponchild
409 && ((idx = gettagindex(this.weaponchild, "shell")) || (idx = gettagindex(this.weaponchild, "tag_shell"))))
410 this.spawnorigin = gettaginfo(this.weaponchild, idx);
411 else if ((idx = gettagindex(this, "shell")) || (idx = gettagindex(this, "tag_shell")))
412 this.spawnorigin = gettaginfo(this, idx);
413 else
414 {
415 LOG_WARNF("weapon model %s does not support the 'shell' tag, will display casings wrong",
416 this.model);
417 this.spawnorigin = this.movedir;
418 }
419 }
420#endif
421 if (v_shot_idx)
422 this.oldorigin = '0 0 0'; // use regular attachment
423 else
424 {
425 int idx;
426 if (this.weaponchild)
427 (idx = gettagindex(this, "weapon")) || (idx = gettagindex(this, "tag_weapon"));
428 else
429 (idx = gettagindex(this, "handle")) || (idx = gettagindex(this, "tag_handle"));
430 if (idx)
431 this.oldorigin = this.movedir - gettaginfo(this, idx);
432 else
433 {
434 LOG_WARNF(
435 "weapon model %s does not support the 'handle' tag "
436 "and neither does the v_ model support the 'shot' tag, "
437 "will display muzzle flashes TOTALLY wrong\n",
438 this.model);
439 this.oldorigin = '0 0 0'; // there is no way to recover from this
440 }
441 }
442
443#ifdef SVQC
444 this.viewmodelforclient = this.owner;
445#else
447#endif
448 }
449
450 this.view_ofs = '0 0 0';
451 this.movedir_aligned = this.movedir;
452
453 if (this.movedir.x >= 0)
454 {
455 //int algn = STAT(GUNALIGN, this.owner);
456 int algn = W_GunAlign(this, STAT(GUNALIGN, this.owner));
457 #ifdef SVQC
458 this.m_gunalign = algn;
459 #endif
460 vector v = this.movedir;
461 this.movedir = shotorg_adjust(v, false, false, algn);
462 this.movedir_aligned = shotorg_adjust(v, false, true, algn);
463 this.view_ofs = this.movedir_aligned - v;
464 }
465
466 // shotorg_adjust can give negative .x from shootfromfixedorigin
467 // recheck .x here due to it
468 if (this.movedir.x >= 0)
469 {
470 int compressed_shotorg = compressShotOrigin(this.movedir);
471 // make them match perfectly
472 #ifdef SVQC
473 // null during init
474 if (this.owner)
475 STAT(SHOTORG, this.owner) = compressed_shotorg;
476 #endif
477 this.movedir = decompressShotOrigin(compressed_shotorg);
478 }
479 else
480 {
481 // don't support negative x shotorgs
482 this.movedir = '0 0 0';
483
484 // reset _aligned here too even though as a side effect
485 // g_shootfromfixedorigin can make it reset
486 // it'd be only slightly better if it was checked individually
487 this.movedir_aligned = '0 0 0';
488
489 #ifdef SVQC
490 // null during init
491 if (this.owner)
492 STAT(SHOTORG, this.owner) = 0;
493 #endif
494 }
495
496#ifdef SVQC
497 this.spawnorigin += this.view_ofs; // offset the casings origin by the same amount
498#endif
499
500 // check if an instant weapon switch occurred
501 setorigin(this, this.view_ofs);
502 if (!_anim)
503 return;
504 // reset animstate now
505 this.wframe = WFRAME_IDLE;
506 setanim(this, this.anim_idle, true, false, true);
507}
#define setanim(...)
Definition anim.qh:45
float frame
primary framegroup animation (strength = 1 - lerpfrac - lerpfrac3 - lerpfrac4)
Definition anim.qh:6
int W_GunAlign(entity this, int preferred_align)
entity owner
Definition main.qh:87
float renderflags
Definition main.qh:111
#define setmodel(this, m)
Definition model.qh:26
float compressShotOrigin(vector v)
Definition util.qc:1350
vector decompressShotOrigin(int f)
Definition util.qc:1377
const float MASK_NORMAL
vector mins
const float RF_VIEWMODEL
vector maxs
vector oldorigin
entity viewmodelforclient
#define gettagindex
ent angles
Definition ent_cs.qc:146
model
Definition ent_cs.qc:164
#define LOG_WARNF(...)
Definition log.qh:59
vector movedir
Definition viewloc.qh:18
vector animfixfps(entity e, vector a, vector b)
Definition util.qc:1907
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
#define NULL
Definition post.qh:14
#define gettaginfo
Definition post.qh:32
vector view_ofs
Definition progsdefs.qc:151
vector
Definition self.qh:96
string W_Model(string w_mdl)
Definition all.qc:212
vector shotorg_adjust(vector vecs, bool y_is_right, bool visual, int algn)
Definition all.qc:239
int m_gunalign
Definition all.qh:412
vector movedir_aligned
Definition all.qh:421
vector anim_reload
Definition all.qh:427
vector anim_fire2
Definition all.qh:425
vector anim_idle
Definition all.qh:426
entity weaponchild
Definition all.qh:402
vector anim_fire1
Definition all.qh:424
WFRAME wframe
Definition all.qh:441
vector spawnorigin
Definition all.qh:418

References angles, anim_fire1, anim_fire2, anim_idle, anim_reload, animfixfps(), compressShotOrigin(), decompressShotOrigin(), entity(), frame, gettagindex, gettaginfo, LOG_WARNF, m_gunalign, MASK_NORMAL, maxs, mins, model, movedir, movedir_aligned, name, NULL, oldorigin, owner, renderflags, RF_VIEWMODEL, setanim, setmodel, shotorg_adjust(), spawnorigin, STAT, strcat(), vector, view_ofs, viewmodelforclient, W_GunAlign(), W_Model(), weaponchild, and wframe.

Referenced by CL_Weapon_GetShotOrg(), CL_Weaponentity_Think(), and viewmodel_draw().

◆ GetAmmoItem()

entity GetAmmoItem ( Resource ammotype)

Definition at line 175 of file all.qc.

176{
177 FOREACH(Items, it.netname == ammotype.netname, return it);
178 LOG_WARNF("Invalid ammo type %d ", ammotype.m_id);
179 return NULL;
180}
string netname
Definition resources.qh:27
#define FOREACH(list, cond, body)
Definition iter.qh:19

References entity(), FOREACH, LOG_WARNF, Resource::netname, and NULL.

Referenced by ammo_pickupevalfunc().

◆ GetAmmoResource()

entity GetAmmoResource ( Ammo ammotype)

Definition at line 182 of file all.qc.

183{
184 FOREACH(Resources, it.netname == ammotype.netname, return it);
185 LOG_WARNF("Invalid ammo type %d ", ammotype.m_id);
186 return NULL;
187}
int m_id
Definition item.qh:127

References entity(), FOREACH, LOG_WARNF, GameItem::m_id, and NULL.

◆ GetAmmoStat()

int GetAmmoStat ( Resource ammotype)

Definition at line 190 of file all.qc.

191{
192 // TODO: handle networking via resources
193 switch (ammotype)
194 {
195 case RES_SHELLS: return STAT_SHELLS;
196 case RES_BULLETS: return STAT_NAILS;
197 case RES_ROCKETS: return STAT_ROCKETS;
198 case RES_CELLS: return STAT_CELLS;
199 case RES_FUEL: return STAT_FUEL.m_id;
200 default: return -1;
201 }
202}
const float STAT_CELLS
const float STAT_ROCKETS
const float STAT_SHELLS
const float STAT_NAILS

References STAT_CELLS, STAT_NAILS, STAT_ROCKETS, and STAT_SHELLS.

Referenced by DrawAmmoItem(), and Weapons_Draw().

◆ NET_HANDLE()

NET_HANDLE ( WeaponUpdate ,
bool isnew )

Definition at line 295 of file all.qh.

296 {
298 for (int i; (i = ReadByte()); )
299 w.wr_net(w, i);
300 return true;
301 }
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
Definition weapon.qh:37
#define ReadRegistered(r)
Definition net.qh:290
int ReadByte()

References ReadByte(), ReadRegistered, and Weapons.

◆ ReadWepSet()

WepSet ReadWepSet ( )

Definition at line 80 of file all.qc.

81{
82 if (REGISTRY_MAX(Weapons) > 48)
83 return ReadInt72_t();
84 if (REGISTRY_MAX(Weapons) > 24)
85 return ReadInt48_t();
86 return vec3(ReadInt24_t(), 0, 0);
87}
#define ReadInt48_t()
Definition net.qh:343
#define ReadInt72_t()
Definition net.qh:344
#define vec3(_x, _y, _z)
Definition vector.qh:100

References ReadInt24_t(), ReadInt48_t, ReadInt72_t, REGISTRY_MAX, vec3, and Weapons.

Referenced by net_handle_ServerWelcome().

◆ REGISTER_WEAPON()

REGISTER_WEAPON ( Null ,
NEW(NullWeapon)  )

◆ REPLICATE_INIT() [1/8]

REPLICATE_INIT ( bool ,
cvar_cl_accuracy_data_receive  )

References entity(), shotdir, shotorg, and vector.

◆ REPLICATE_INIT() [2/8]

REPLICATE_INIT ( bool ,
cvar_cl_accuracy_data_share  )

◆ REPLICATE_INIT() [3/8]

REPLICATE_INIT ( bool ,
cvar_cl_weapon_switch_fallback_to_impulse  )

◆ REPLICATE_INIT() [4/8]

REPLICATE_INIT ( bool ,
cvar_cl_weapon_switch_reload  )

◆ REPLICATE_INIT() [5/8]

REPLICATE_INIT ( int ,
cvar_cl_gunalign  )

◆ REPLICATE_INIT() [6/8]

REPLICATE_INIT ( int ,
cvar_cl_weaponimpulsemode  )

◆ REPLICATE_INIT() [7/8]

REPLICATE_INIT ( string ,
cvar_cl_weaponpriorities [10] )

◆ REPLICATE_INIT() [8/8]

REPLICATE_INIT ( string ,
cvar_cl_weaponpriority  )

◆ shotorg_adjust()

vector shotorg_adjust ( vector vecs,
bool y_is_right,
bool visual,
int algn )

Definition at line 239 of file all.qc.

240{
241 string s;
242 if (visual)
243 vecs = shotorg_adjustfromclient(vecs, y_is_right, algn);
244 else if (STAT(SHOOTFROMEYE))
245 vecs.y = vecs.z = 0;
246 else if (STAT(SHOOTFROMCENTER))
247 {
248 vecs.y = 0;
249 vecs.z -= 2;
250 }
251 else if ((s = G_SHOOTFROMFIXEDORIGIN) != "")
252 {
253 vector v = stov(s);
254 if (y_is_right)
255 v.y = -v.y;
256 if (v.x != 0)
257 vecs.x = v.x;
258 vecs.y = v.y;
259 vecs.z = v.z;
260 }
261 else // just do the same as top
262 vecs = shotorg_adjustfromclient(vecs, y_is_right, algn);
263
264 return vecs;
265}
vector stov(string s)
vector shotorg_adjustfromclient(vector vecs, float y_is_right, float algn)
Definition all.qc:220
#define G_SHOOTFROMFIXEDORIGIN
Definition all.qh:445

References G_SHOOTFROMFIXEDORIGIN, shotorg_adjustfromclient(), STAT, stov(), and vector.

Referenced by CL_WeaponEntity_SetModel(), and PRECACHE().

◆ STATIC_INIT() [1/2]

STATIC_INIT ( register_weapons_done )

Definition at line 358 of file all.qh.

359{
360 string inaccessible = "";
362 FOREACH(Weapons, true,
363 {
364 WepSet set = it.m_wepset = _WepSet_FromWeapon(it.m_id = i);
365 WEPSET_ALL |= set;
366 if (it.spawnflags & WEP_FLAG_SUPERWEAPON)
367 WEPSET_SUPERWEAPONS |= set;
368 if (it == WEP_Null)
369 continue;
370 if (it.spawnflags & WEP_FLAG_SPECIALATTACK)
371 continue;
372 // TODO: this exists to filter out the Ball Stealer, otherwise we run out of impulses
373 if ((it.spawnflags & WEP_FLAG_MUTATORBLOCKED) && (it.spawnflags & WEP_TYPE_OTHER))
374 continue;
375
376 it.m_unique_impulse = imp;
377#ifdef CSQC
378 if (imp <= WEP_IMPULSE_END)
379 localcmd(sprintf("alias weapon_%s \"impulse %d\"\n", it.netname, imp)); // keep xonotic-client.cfg up to date
380 else
381#endif
382 inaccessible = strcat(inaccessible, "\n", it.netname);
383 ++imp;
384 });
385 if (inaccessible != "" && autocvar_developer > 0)
386 LOG_TRACEF("Impulse limit exceeded, weapon(s) will not be directly accessible: %s", inaccessible);
387 #ifdef CSQC
388 FOREACH(Weapons, true, it.wr_init(it));
389 #endif
390 #ifdef MENUQC
391 FOREACH(Weapons, (it.spawnflags & WEP_FLAG_HIDDEN) && (it.spawnflags & WEP_FLAG_SPECIALATTACK), it.m_hidden = true);
392 #endif
393 weaponorder_byid = "";
394 for (int i = REGISTRY_MAX(Weapons) - 1; i >= 1; --i)
395 if (REGISTRY_GET(Weapons, i))
398}
#define LOG_TRACEF(...)
Definition log.qh:75
noref int autocvar_developer
Definition log.qh:93
void localcmd(string command,...)
string substring(string s, float start, float length)
string ftos(float f)
string strzone(string s)
#define REGISTRY_GET(id, i)
Definition registry.qh:62
int int int imp
Definition impulse.qc:90
#define WEP_IMPULSE_END
Definition all.qh:353
WepSet WEPSET_ALL
Definition all.qh:346
WepSet WEPSET_SUPERWEAPONS
Definition all.qh:347
WepSet _WepSet_FromWeapon(int i)
Definition all.qc:53
string weaponorder_byid
Definition weapon.qh:267
const int WEP_FLAG_SUPERWEAPON
powerup timer
Definition weapon.qh:255
const int WEP_FLAG_MUTATORBLOCKED
hides from impulse 99 etc. (mutators are allowed to clear this flag)
Definition weapon.qh:256
const int WEP_FLAG_HIDDEN
hides from menu
Definition weapon.qh:253
vector WepSet
Definition weapon.qh:14
const int WEP_TYPE_OTHER
not for damaging people
Definition weapon.qh:248
const int WEP_FLAG_SPECIALATTACK
special attack (not a true weapon); NOTE: if this flag is set then WEP_FLAG_HIDDEN must be set as wel...
Definition weapon.qh:264

References _WepSet_FromWeapon(), autocvar_developer, FOREACH, ftos(), imp, localcmd(), LOG_TRACEF, REGISTRY_GET, REGISTRY_MAX, STATIC_INIT, strcat(), strzone(), substring(), weaponorder_byid, Weapons, WEP_FLAG_HIDDEN, WEP_FLAG_MUTATORBLOCKED, WEP_FLAG_SPECIALATTACK, WEP_FLAG_SUPERWEAPON, WEP_IMPULSE_BEGIN, WEP_IMPULSE_END, WEP_TYPE_OTHER, WEPSET_ALL, and WEPSET_SUPERWEAPONS.

◆ STATIC_INIT() [2/2]

STATIC_INIT ( WeaponPickup )

Definition at line 31 of file all.qh.

32{
33 FOREACH(Weapons, true,
34 {
35 if ((it.spawnflags & WEP_FLAG_SPECIALATTACK) && !(it.spawnflags & WEP_FLAG_HIDDEN))
36 error(sprintf("Special attack \"%s\" without WEP_FLAG_HIDDEN flag set.", it.m_name));
37 it.m_pickup = NEW(WeaponPickup, it);
38 });
39}
#define NEW(cname,...)
Definition oo.qh:120
#define error
Definition pre.qh:6

References error, FOREACH, NEW, Weapons, WEP_FLAG_HIDDEN, and WEP_FLAG_SPECIALATTACK.

◆ STATIC_INIT_LATE()

STATIC_INIT_LATE ( W_PROP_reloader )

Definition at line 128 of file all.qh.

129{
130 entity e = W_PROP_reloader = new_pure(W_PROP_reloader);
132 W_PROP_think(e);
133}
#define setthink(e, f)
void W_PROP_think(entity this)
Definition all.qh:123

References entity(), new_pure, setthink, and W_PROP_think().

◆ void()

void ( Weapon this,
int  )

◆ W_FixWeaponOrder_AllowIncomplete()

string W_FixWeaponOrder_AllowIncomplete ( entity this,
string order )

Definition at line 145 of file all.qc.

146{
147 return W_FixWeaponOrder(order, 0);
148}
#define W_FixWeaponOrder(order, complete)
Definition all.qh:483

References entity(), and W_FixWeaponOrder.

Referenced by REPLICATE(), REPLICATE(), REPLICATE(), REPLICATE(), REPLICATE(), REPLICATE(), REPLICATE(), REPLICATE(), REPLICATE(), and REPLICATE().

◆ W_FixWeaponOrder_BuildImpulseList()

string W_FixWeaponOrder_BuildImpulseList ( string o)

Definition at line 131 of file all.qc.

132{
133 int i;
135 for (i = WEP_FIRST; i <= WEP_LAST; ++i)
138 o = "";
139 for (i = WEP_FIRST; i <= WEP_LAST; ++i)
142 return substring(o, 1, -1);
143}
string string_null
Definition nil.qh:9
ERASEABLE void heapsort(int n, swapfunc_t swap, comparefunc_t cmp, entity pass)
Definition sort.qh:9
void W_FixWeaponOrder_BuildImpulseList_swap(int i, int j, entity pass)
Definition all.qc:112
float W_FixWeaponOrder_BuildImpulseList_buf[REGISTRY_MAX(Weapons)]
Definition all.qc:110
float W_FixWeaponOrder_BuildImpulseList_cmp(int i, int j, entity pass)
Definition all.qc:118
string W_FixWeaponOrder_BuildImpulseList_order
Definition all.qc:111

References ftos(), heapsort(), NULL, strcat(), string_null, substring(), W_FixWeaponOrder_BuildImpulseList_buf, W_FixWeaponOrder_BuildImpulseList_cmp(), W_FixWeaponOrder_BuildImpulseList_order, W_FixWeaponOrder_BuildImpulseList_swap(), WEP_FIRST, and WEP_LAST.

Referenced by HUD_Weapons(), and W_FixWeaponOrder_ForceComplete_AndBuildImpulseList().

◆ W_FixWeaponOrder_ForceComplete()

string W_FixWeaponOrder_ForceComplete ( string order)

Definition at line 150 of file all.qc.

151{
152 if (order == "")
153 order = W_NumberWeaponOrder(cvar_defstring("cl_weaponpriority"));
154 return W_FixWeaponOrder(order, 1);
155}
const string cvar_defstring(string name)
#define W_NumberWeaponOrder(order)
Definition all.qh:482

References cvar_defstring(), W_FixWeaponOrder, and W_NumberWeaponOrder.

Referenced by HUD_Weapons(), and W_FixWeaponOrder_ForceComplete_AndBuildImpulseList().

◆ W_FixWeaponOrder_ForceComplete_AndBuildImpulseList()

string W_FixWeaponOrder_ForceComplete_AndBuildImpulseList ( entity this,
string wo )

Definition at line 769 of file all.qc.

770{
771 string o = W_FixWeaponOrder_ForceComplete(wo);
773 return o;
774}
string weaponorder_byimpulse
Definition client.qh:62
#define CS_CVAR(this)
Definition state.qh:51
#define strcpy(this, s)
Definition string.qh:51
string W_FixWeaponOrder_ForceComplete(string order)
Definition all.qc:150
string W_FixWeaponOrder_BuildImpulseList(string o)
Definition all.qc:131

References CS_CVAR, entity(), strcpy, W_FixWeaponOrder_BuildImpulseList(), W_FixWeaponOrder_ForceComplete(), and weaponorder_byimpulse.

Referenced by REPLICATE().

◆ W_Guide_DPS()

string W_Guide_DPS ( string name,
string pri,
string sec )

Definition at line 897 of file all.qc.

898{
899 // TODO: rename all wep primary cvars to g_balance_*_primary_*, vice versa for secondary.
900 // Example exception: g_balance_arc_beam_* (primary)
901 const string wepbal_s = strcat("g_balance_", name, "_");
902 const string pri_dmg_s = cvar_defstring(strcat(wepbal_s, pri, "_damage"));
903 const float pri_rft = stof(cvar_defstring(strcat(wepbal_s, pri, "_refire")));
904 const string sec_dmg_s = cvar_defstring(strcat(wepbal_s, sec, "_damage"));
905 const float sec_rft = stof(cvar_defstring(strcat(wepbal_s, sec, "_refire")));
906 return strcat(_("Default damage stats:"),
909 );
910}
float stof(string val,...)
#define THE_SECONDARY_DOES()
Definition all.qc:861
#define THE_PRIMARY_DOES()
Definition all.qc:857

References cvar_defstring(), name, stof(), strcat(), THE_PRIMARY_DOES, and THE_SECONDARY_DOES.

◆ W_Guide_DPS_bothMultishot()

string W_Guide_DPS_bothMultishot ( string name,
string pri,
string sec )

Definition at line 911 of file all.qc.

912{
913 const string wepbal_s = strcat("g_balance_", name, "_");
914 const string pri_dmg_s = cvar_defstring(strcat(wepbal_s, pri, "_damage"));
915 const float pri_rft = stof(cvar_defstring(strcat(wepbal_s, pri, "_refire")));
916 const string pri_shots_s = cvar_defstring(strcat(wepbal_s, pri, "_shots"));
917 const string sec_dmg_s = cvar_defstring(strcat(wepbal_s, sec, "_damage"));
918 const float sec_rft = stof(cvar_defstring(strcat(wepbal_s, sec, "_refire")));
919 const string sec_shots_s = cvar_defstring(strcat(wepbal_s, sec, "_shots"));
920 return strcat(_("Default damage stats:"),
923 );
924}
#define THE_PRIMARY_SHOOTS()
Definition all.qc:858
#define THE_SECONDARY_SHOOTS()
Definition all.qc:862

References cvar_defstring(), name, stof(), strcat(), THE_PRIMARY_SHOOTS, and THE_SECONDARY_SHOOTS.

◆ W_Guide_DPS_onlyOne()

string W_Guide_DPS_onlyOne ( string name,
string fire )

Definition at line 893 of file all.qc.

894{
895 return W_Guide_DPS_onlyOne_unnamed(strcat(name, "_", fire));
896}
string W_Guide_DPS_onlyOne_unnamed(string name)
Definition all.qc:880

References name, strcat(), and W_Guide_DPS_onlyOne_unnamed().

◆ W_Guide_DPS_onlyOne_andDirectHit()

string W_Guide_DPS_onlyOne_andDirectHit ( string name,
string fire )

Definition at line 889 of file all.qc.

890{
892}
string W_Guide_DPS_onlyOne_unnamed_andDirectHit(string name)
Definition all.qc:868

References name, strcat(), and W_Guide_DPS_onlyOne_unnamed_andDirectHit().

◆ W_Guide_DPS_onlyOne_unnamed()

string W_Guide_DPS_onlyOne_unnamed ( string name)

Definition at line 880 of file all.qc.

881{
882 const string wepbal_s = strcat("g_balance_", name);
883 const string dmg_s = cvar_defstring(strcat(wepbal_s, "_damage"));
884 const float rft = stof(cvar_defstring(strcat(wepbal_s, "_refire")));
885 return strcat(_("Default damage stats:"),
886 IT_DOES()
887 );
888}
#define IT_DOES()
Definition all.qc:855

References cvar_defstring(), IT_DOES, name, stof(), and strcat().

Referenced by W_Guide_DPS_onlyOne().

◆ W_Guide_DPS_onlyOne_unnamed_andDirectHit()

string W_Guide_DPS_onlyOne_unnamed_andDirectHit ( string name)

Definition at line 868 of file all.qc.

869{
870 const string wepbal_s = strcat("g_balance_", name);
871 const string dmg_s = cvar_defstring(strcat(wepbal_s, "_damage"));
872 const float rft = stof(cvar_defstring(strcat(wepbal_s, "_refire")));
873 const string dmg2_s = cvar_defstring(strcat(wepbal_s, "_damage2"));
874 const string dir_dps = sprintf(_("(DPS: %.2f)"), rft <= 0 ? 1337 : stof(dmg2_s) / rft);
875 return strcat(_("Default damage stats:"),
876 IT_DOES(),
877 strcat("\n* ", sprintf(_("A direct hit does %s damage"), COLORED_DAMAGE(dmg2_s)), " ", dir_dps)
878 );
879}
#define COLORED_DAMAGE(dmg)
Definition all.qc:840

References COLORED_DAMAGE, cvar_defstring(), IT_DOES, name, stof(), and strcat().

Referenced by W_Guide_DPS_onlyOne_andDirectHit().

◆ W_Guide_DPS_onlyOneMultishot()

string W_Guide_DPS_onlyOneMultishot ( string name,
string fire,
string shots,
string refire2 )

Definition at line 968 of file all.qc.

969{
970 const string wepbal_s = strcat("g_balance_", name, "_");
971 const string dmg_s = cvar_defstring(strcat(wepbal_s, fire, "_damage"));
972 float rft = stof(cvar_defstring(strcat(wepbal_s, fire, "_refire")));
973 const string shots_s = cvar_defstring(strcat(wepbal_s, shots));
974 const float num_shots = stof(shots_s);
975 if (refire2 != "")
976 rft = (num_shots - 1) * rft + stof(cvar_defstring(strcat(wepbal_s, refire2)));
977 return strcat(_("Default damage stats:"),
978 IT_SHOOTS()
979 );
980}
#define IT_SHOOTS()
Definition all.qc:856

References cvar_defstring(), IT_SHOOTS, name, stof(), and strcat().

◆ W_Guide_DPS_onlySecondary()

string W_Guide_DPS_onlySecondary ( string name,
string sec )

Definition at line 925 of file all.qc.

926{
927 const string wepbal_s = strcat("g_balance_", name, "_");
928 const string sec_dmg_s = cvar_defstring(strcat(wepbal_s, sec, "_damage"));
929 const float sec_rft = stof(cvar_defstring(strcat(wepbal_s, sec, "_refire")));
930 return strcat(_("Default damage stats:"),
932 );
933}

References cvar_defstring(), name, stof(), strcat(), and THE_SECONDARY_DOES.

◆ W_Guide_DPS_primaryDPS()

string W_Guide_DPS_primaryDPS ( string name,
string pri,
string sec )

Definition at line 1007 of file all.qc.

1008{
1009 const string wepbal_s = strcat("g_balance_", name, "_");
1010 const string pri_dmg_s = cvar_defstring(strcat(wepbal_s, pri, "_damage")); // actually damage per second
1011 const string sec_dmg_s = cvar_defstring(strcat(wepbal_s, sec, "_damage"));
1012 const float sec_rft = stof(cvar_defstring(strcat(wepbal_s, sec, "_refire")));
1013 return strcat(_("Default damage stats:"),
1016 );
1017}
#define THE_PRIMARY_DOES_PERSEC()
Definition all.qc:860

References cvar_defstring(), name, stof(), strcat(), THE_PRIMARY_DOES_PERSEC, and THE_SECONDARY_DOES.

◆ W_Guide_DPS_primaryMultishot()

string W_Guide_DPS_primaryMultishot ( string name,
string pri,
string sec,
string shots,
string refire2 )

Definition at line 952 of file all.qc.

953{
954 const string wepbal_s = strcat("g_balance_", name, "_");
955 const string pri_dmg_s = cvar_defstring(strcat(wepbal_s, pri, "_damage"));
956 float pri_rft = stof(cvar_defstring(strcat(wepbal_s, pri, "_refire")));
957 const string pri_shots_s = cvar_defstring(strcat(wepbal_s, shots));
958 const string sec_dmg_s = cvar_defstring(strcat(wepbal_s, sec, "_damage"));
959 const float sec_rft = stof(cvar_defstring(strcat(wepbal_s, sec, "_refire")));
960 const float num_shots = stof(pri_shots_s);
961 if (refire2 != "")
962 pri_rft = (num_shots - 1) * pri_rft + stof(cvar_defstring(strcat(wepbal_s, refire2)));
963 return strcat(_("Default damage stats:"),
966 );
967}

References cvar_defstring(), name, stof(), strcat(), THE_PRIMARY_SHOOTS, and THE_SECONDARY_DOES.

◆ W_Guide_DPS_secondaryMultishot()

string W_Guide_DPS_secondaryMultishot ( string name,
string pri,
string sec,
string shots,
string refire2,
bool sec_variable )

Definition at line 934 of file all.qc.

935{
936 const string wepbal_s = strcat("g_balance_", name, "_");
937 const string pri_dmg_s = cvar_defstring(strcat(wepbal_s, pri, "_damage"));
938 const float pri_rft = stof(cvar_defstring(strcat(wepbal_s, pri, "_refire")));
939 string sec_dmg_s = cvar_defstring(strcat(wepbal_s, sec, "_damage"));
940 float sec_rft = stof(cvar_defstring(strcat(wepbal_s, sec, "_refire")));
941 const string sec_shots_s = cvar_defstring(strcat(wepbal_s, shots));
942 if (sec_dmg_s == "")
943 sec_dmg_s = pri_dmg_s;
944 const float num_shots = stof(sec_shots_s);
945 if (refire2 != "")
946 sec_rft = (num_shots - 1) * sec_rft + stof(cvar_defstring(strcat(wepbal_s, refire2)));
947 return strcat(_("Default damage stats:"),
950 );
951}
#define THE_SECONDARY_SHOOTS_UPTO()
Definition all.qc:863

References cvar_defstring(), name, stof(), strcat(), THE_PRIMARY_DOES, THE_SECONDARY_SHOOTS, and THE_SECONDARY_SHOOTS_UPTO.

◆ W_Guide_DPS_secondaryMultishotWithCombo()

string W_Guide_DPS_secondaryMultishotWithCombo ( string name,
string pri,
string sec,
string shots,
string refire2,
string combo,
bool sec_variable )

Definition at line 981 of file all.qc.

982{
983 const string wepbal_s = strcat("g_balance_", name, "_");
984 const string pri_dmg_s = cvar_defstring(strcat(wepbal_s, pri, "_damage"));
985 const float pri_rft = stof(cvar_defstring(strcat(wepbal_s, pri, "_refire")));
986 const string sec_dmg_s = cvar_defstring(strcat(wepbal_s, sec, "_damage"));
987 float sec_rft = stof(cvar_defstring(strcat(wepbal_s, sec, "_refire")));
988 const string sec_shots_s = cvar_defstring(strcat(wepbal_s, shots));
989 const string cmb_dmg_s = cvar_defstring(strcat(wepbal_s, combo, "_damage"));
990 const float num_shots = stof(sec_shots_s);
991 float combo_t = max(pri_rft, sec_rft);
992 if (refire2 != "")
993 {
994 const float sec_rft2 = sec_rft;
995 sec_rft = stof(cvar_defstring(strcat(wepbal_s, refire2)));
996 combo_t = max(combo_t, num_shots * sec_rft + sec_rft2);
997 sec_rft = (num_shots - 1) * sec_rft + sec_rft2;
998 }
999 const string DPS_combo = sprintf(_("(total DPS: %.2f)"),
1000 combo_t <= 0 ? 1337 : (stof(pri_dmg_s) + stof(sec_dmg_s) * num_shots + stof(cmb_dmg_s)) / combo_t);
1001 return strcat(_("Default damage stats:"),
1003 (sec_variable ? THE_SECONDARY_SHOOTS_UPTO() : THE_SECONDARY_SHOOTS()),
1004 strcat("\n* ", sprintf(_("The combo adds an extra %s damage"), COLORED_DAMAGE(cmb_dmg_s)), " ", DPS_combo)
1005 );
1006}
float max(float f,...)

References COLORED_DAMAGE, cvar_defstring(), max(), name, stof(), strcat(), THE_PRIMARY_DOES, THE_SECONDARY_SHOOTS, and THE_SECONDARY_SHOOTS_UPTO.

◆ W_Guide_Keybinds()

string W_Guide_Keybinds ( Weapon wep)

Definition at line 803 of file all.qc.

804{
805 string command, key, keys = "";
806 int n, j;
807 float k;
808 const bool joy_active = cvar("joy_active");
809
810 for (int cmd_type = 0; cmd_type < 2; ++cmd_type)
811 {
812 command = cmd_type
813 ? strcat("weapon_", wep.netname)
814 : strcat("weapon_group_", itos(wep.impulse));
815 n = tokenize(findkeysforcommand(command, 0)); // uses '...' strings
816
817 for (j = 0; j < n; ++j)
818 {
819 k = stof(argv(j));
820 if (k == -1)
821 continue;
822 key = keynumtostring(k);
823 if (!joy_active && startsWith(key, "JOY"))
824 continue;
825
826 key = translate_key(key);
827 if (keys == "")
828 keys = strcat("^3", key);
829 else
830 keys = strcat(keys, "^7, ^3", key);
831 }
832 }
833
834 if (keys == "")
835 return _("This weapon has not been bound directly."); // code may miss some weird bind configs, so say "directly"
836 return sprintf(_("You have bound this weapon to: %s."), strcat(keys, "^7"));
837}
string netname
M: refname : reference name name.
Definition weapon.qh:79
string translate_key(string key)
Definition util.qc:1612
#define itos(i)
Definition int.qh:6
float cvar(string name)
string keynumtostring(float keynum)
float tokenize(string s)
string argv(float n)
float impulse
Definition progsdefs.qc:158
#define startsWith(haystack, needle)
Definition string.qh:234

References argv(), cvar(), Weapon::impulse, itos, keynumtostring(), Weapon::netname, startsWith, stof(), strcat(), tokenize(), and translate_key().

◆ W_Model()

string W_Model ( string w_mdl)

Definition at line 212 of file all.qc.

213{
214 string output = strcat("models/weapons/", w_mdl);
215 MUTATOR_CALLHOOK(WeaponModel, w_mdl, output);
216 return M_ARGV(1, string);
217}
#define MUTATOR_CALLHOOK(name,...)
Definition base.qh:186
#define M_ARGV(idx, type)
Definition base.qh:153

Referenced by CL_WeaponEntity_SetModel().

◆ W_MuzzleFlash()

void W_MuzzleFlash ( Weapon thiswep,
entity actor,
.entity weaponentity,
vector shotorg,
vector shotdir )

Definition at line 694 of file all.qc.

695{
696 // don't show an exterior muzzle effect for the off-hand
697 if (weaponslot(weaponentity) == 0)
698 {
699 Send_Effect_Core(thiswep.m_muzzleeffect, shotorg, shotdir * 1000, 1, '0 0 0', '0 0 0', -1, -1, -1, actor);
700
701 if (thiswep.m_muzzlemodel != MDL_Null)
702 {
703 W_MuzzleFlash_Model(actor.exteriorweaponentity, thiswep.m_muzzlemodel);
704 W_MuzzleFlash_Model_AttachToShotorg(actor, weaponentity, actor.exteriorweaponentity.muzzle_flash, '5 0 0');
705 }
706 }
707
708 FOREACH_CLIENT(it == actor || (IS_SPEC(it) && it.enemy == actor),
709 {
710 if (!IS_REAL_CLIENT(it))
711 continue;
712 int channel = MSG_ONE;
713 msg_entity = it;
714 WriteHeader(channel, w_muzzleflash);
715 WriteRegistered(Weapons, channel, thiswep);
716 WriteByte(channel, weaponslot(weaponentity));
717 WriteVector(channel, shotorg);
718 });
719}
vector shotorg
Definition aim.qh:10
vector shotdir
Definition aim.qh:11
entity m_muzzlemodel
M: flash model MDL_id_MUZZLEFLASH.
Definition weapon.qh:64
void Send_Effect_Core(entity eff, vector eff_loc, vector eff_vel, int eff_cnt, vector eff_col_min, vector eff_col_max, float eff_alpha_min, float eff_alpha_max, float eff_alpha_fade, entity ignore)
Definition all.qc:74
#define IS_SPEC(v)
Definition utils.qh:10
#define FOREACH_CLIENT(cond, body)
Definition utils.qh:52
void W_MuzzleFlash_Model(entity wepent, entity muzzlemodel)
Definition all.qc:669
void W_MuzzleFlash_Model_AttachToShotorg(entity actor,.entity weaponentity, entity flash, vector offset)
Definition all.qc:623
int weaponslot(.entity weaponentity)
Definition weapon.qh:19

References entity(), FOREACH_CLIENT, IS_SPEC, Weapon::m_muzzlemodel, Send_Effect_Core(), shotdir, shotorg, vector, W_MuzzleFlash_Model(), W_MuzzleFlash_Model_AttachToShotorg(), and weaponslot().

Referenced by FireGrapplingHook(), W_Arc_Attack_Bolt(), W_Blaster_Attack(), W_Crylink_Attack(), W_Crylink_Attack2(), W_Devastator_Attack(), W_Electro_Attack_Bolt(), W_Electro_Attack_Orb(), W_Fireball_Attack1(), W_Fireball_Attack2(), W_Hagar_Attack(), W_Hagar_Attack2(), W_Hagar_Attack2_Load_Release(), W_HLAC_Attack(), W_HLAC_Attack2(), W_MachineGun_Attack(), W_MachineGun_Attack_Auto(), W_MachineGun_Attack_Burst(), W_MineLayer_Attack(), W_Mortar_Attack(), W_Mortar_Attack2(), W_OverkillHeavyMachineGun_Attack_Auto(), W_OverkillMachineGun_Attack_Auto(), W_OverkillRocketPropelledChainsaw_Attack(), W_Rifle_FireBullet(), W_RocketMinsta_Attack(), W_Seeker_Fire_Flac(), W_Seeker_Fire_Missile(), W_Shotgun_Attack(), W_Vaporizer_Attack(), and W_Vortex_Attack().

◆ W_NameWeaponOrder_MapFunc()

string W_NameWeaponOrder_MapFunc ( string s)

Definition at line 90 of file all.qc.

91{
92 int i = stof(s);
93 if (s == "0" || i)
94 {
96 if (wi != WEP_Null)
97 return wi.netname;
98 }
99 return s;
100}

References entity(), REGISTRY_GET, stof(), and Weapons.

◆ W_NumberWeaponOrder_MapFunc()

string W_NumberWeaponOrder_MapFunc ( string s)

Definition at line 102 of file all.qc.

103{
104 if (s == "0" || stof(s))
105 return s;
106 FOREACH(Weapons, it != WEP_Null && (it.netname == s || it.m_deprecated_netname == s), return ftos(i));
107 return s;
108}

References FOREACH, ftos(), stof(), and Weapons.

◆ W_PROP_reload()

void W_PROP_reload ( int chan,
entity to )

Definition at line 110 of file all.qh.

111{
112 W_PROP_reloader.nextthink = time + autocvar_w_prop_interval;
113 msg_entity = to;
114 FOREACH(Weapons, true,
115 {
116 it.wr_update(it);
117 void(Weapon, int) f = it.wr_net;
118 if (f)
119 f(it, chan);
120 });
121}
float time
entity msg_entity
Definition progsdefs.qc:63
void
Definition self.qh:76
float autocvar_w_prop_interval
Definition all.qh:107

References autocvar_w_prop_interval, entity(), FOREACH, msg_entity, time, void, and Weapons.

Referenced by ClientInit_SendEntity(), and W_PROP_think().

◆ W_PROP_think()

void W_PROP_think ( entity this)

Definition at line 123 of file all.qh.

124{
126}
float MSG_ALL
Definition menudefs.qc:57
void W_PROP_reload(int chan, entity to)
Definition all.qh:110

References entity(), MSG_ALL, NULL, and W_PROP_reload().

Referenced by STATIC_INIT_LATE().

◆ W_RandomWeapons()

WepSet W_RandomWeapons ( entity e,
WepSet remaining,
int n )

Definition at line 157 of file all.qc.

158{
159 WepSet result = '0 0 0';
160 for (int j = 0; j < n; ++j)
161 {
163 FOREACH(Weapons, it != WEP_Null,
164 {
165 if (remaining & (it.m_wepset))
166 RandomSelection_AddEnt(it, 1, 1);
167 });
170 remaining &= ~WepSet_FromWeapon(w);
171 }
172 return result;
173}
entity result
Definition promise.qc:45
ERASEABLE void RandomSelection_Init()
Definition random.qc:4
#define RandomSelection_AddEnt(e, weight, priority)
Definition random.qh:14
entity RandomSelection_chosen_ent
Definition random.qh:5
#define WepSet_FromWeapon(it)
Definition all.qh:48

References entity(), FOREACH, RandomSelection_AddEnt, RandomSelection_chosen_ent, RandomSelection_Init(), result, Weapons, and WepSet_FromWeapon.

Referenced by MUTATOR_HOOKFUNCTION(), and MUTATOR_HOOKFUNCTION().

◆ W_Sound()

string W_Sound ( string w_snd)

Definition at line 205 of file all.qc.

206{
207 string output = strcat("weapons/", w_snd);
208 MUTATOR_CALLHOOK(WeaponSound, w_snd, output);
209 return M_ARGV(1, string);
210}

◆ Weapon_from_impulse()

Weapon Weapon_from_impulse ( int imp)

Definition at line 151 of file all.qh.

152{
153 FOREACH(Weapons, it != WEP_Null && it.m_unique_impulse == imp, return it);
154 return WEP_Null;
155}

References FOREACH, imp, and Weapons.

Referenced by weapon_byid_handle().

◆ Weapon_from_name()

Weapon Weapon_from_name ( string s)

Definition at line 145 of file all.qh.

146{
147 FOREACH(Weapons, it != WEP_Null && it.netname == s, return it);
148 return WEP_Null;
149}

References FOREACH, and Weapons.

Referenced by readplayerstartcvars(), W_Apply_Weaponreplace(), and weapon_defaultspawnfunc().

◆ weaponentity_glowmod()

vector weaponentity_glowmod ( Weapon wep,
int c,
entity wepent )

Definition at line 404 of file all.qh.

405{
406 vector g = wep.wr_glow(wep, c, wepent);
407 if (!g)
408 g = colormapPaletteColor(c & 0x0F, true);
409 return g;
410}
virtual void wr_glow()
(BOTH) weapon specific glow
Definition weapon.qh:137
#define colormapPaletteColor(c, isPants)
Definition color.qh:5

References colormapPaletteColor, entity(), vector, and Weapon::wr_glow().

Referenced by CL_ExteriorWeaponentity_Think(), and viewmodel_draw().

◆ wframe_send()

void wframe_send ( entity actor,
entity weaponentity,
int wepframe,
float attackrate,
bool restartanim )

Definition at line 556 of file all.qc.

557{
558 if (!IS_REAL_CLIENT(actor))
559 return;
560 int channel = MSG_ONE;
561 msg_entity = actor;
562 WriteHeader(channel, wframe);
563 WriteByte(channel, wepframe);
564 WriteFloat(channel, attackrate);
565 WriteByte(channel, weaponslot(weaponentity.weaponentity_fld));
566 WriteByte(channel, restartanim);
567 WriteByte(channel, weaponentity.state);
568 WriteFloat(channel, weaponentity.weapon_nextthink);
569}
WriteByte(chan, ent.angles.y/DEC_FACTOR)
#define WriteHeader(to, id)
Definition net.qh:265
float MSG_ONE
Definition menudefs.qc:56
#define IS_REAL_CLIENT(v)
Definition utils.qh:17

References entity(), IS_REAL_CLIENT, msg_entity, MSG_ONE, weaponslot(), wframe, WriteByte(), and WriteHeader.

Referenced by weapon_thinkf().

◆ WriteWepSet()

void WriteWepSet ( float dest,
WepSet w )

Definition at line 69 of file all.qc.

70{
71 if (REGISTRY_MAX(Weapons) > 48)
72 WriteInt72_t(dst, w);
73 else if (REGISTRY_MAX(Weapons) > 24)
74 WriteInt48_t(dst, w);
75 else
76 WriteInt24_t(dst, w.x);
77}

References REGISTRY_MAX, and Weapons.

Referenced by SendWelcomeMessage().

◆ X() [1/5]

float float float X ( reload_ammo ,
float  ) const

◆ X() [2/5]

X ( reload_time ,
float  ) const

References reload_time.

◆ X() [3/5]

X ( switchdelay_drop ,
float  )

◆ X() [4/5]

float X ( weaponreplace ,
string  )

References X.

◆ X() [5/5]

float float X ( weaponstart ,
float  )

References X.

Variable Documentation

◆ anim_fire1

vector anim_fire1

Definition at line 424 of file all.qh.

Referenced by CL_WeaponEntity_SetModel().

◆ anim_fire2

vector anim_fire2

Definition at line 425 of file all.qh.

Referenced by CL_WeaponEntity_SetModel().

◆ anim_idle

◆ anim_reload

vector anim_reload

Definition at line 427 of file all.qh.

Referenced by CL_WeaponEntity_SetModel().

◆ autocvar_g_shootfromfixedorigin

string autocvar_g_shootfromfixedorigin

Definition at line 444 of file all.qh.

Referenced by FixClientCvars(), and PlayerThink().

◆ autocvar_w_prop_interval

float autocvar_w_prop_interval = 5

Definition at line 107 of file all.qh.

Referenced by W_PROP_reload().

◆ baseline

entity baseline

Definition at line 246 of file all.qh.

◆ baseline_target

entity baseline_target

Definition at line 246 of file all.qh.

◆ exteriorweaponentity

entity exteriorweaponentity

Definition at line 403 of file all.qh.

Referenced by CL_SpawnWeaponentity(), PutObserverInServer(), and PutPlayerInServer().

◆ m_gunalign

int m_gunalign

Definition at line 412 of file all.qh.

Referenced by CL_WeaponEntity_SetModel(), W_GunAlign(), and W_ResetGunAlign().

◆ m_unique_impulse

int m_unique_impulse

Definition at line 51 of file all.qh.

◆ m_wepset

WepSet m_wepset

Definition at line 46 of file all.qh.

◆ movedir_aligned

vector movedir_aligned

Definition at line 421 of file all.qh.

Referenced by CL_WeaponEntity_SetModel().

◆ muzzle_flash

entity muzzle_flash

Definition at line 429 of file all.qh.

◆ spawnorigin

vector spawnorigin

◆ weaponchild

entity weaponchild

Definition at line 402 of file all.qh.

Referenced by CL_WeaponEntity_SetModel(), CL_Weaponentity_Think(), and FixIntermissionClient().

◆ weaponname

◆ WEP_FIRST

◆ WEPSET_ALL

WepSet WEPSET_ALL

Definition at line 346 of file all.qh.

Referenced by STATIC_INIT().

◆ WEPSET_SUPERWEAPONS

◆ wframe