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 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_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_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 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 (string order, float complete)
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 (string order)
string W_NumberWeaponOrder (string order)
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)
WepSet WepSet_GetFromStat ()
WepSet WepSet_GetFromStat_InMap ()
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 218 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 273 of file all.qh.

273 #define _W_NET(class, fld, T, wepname) \
274 { \
275 if (++n == i) this.wepvar_##fld = Read_##T(); \
276 }

◆ _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:199

Definition at line 196 of file all.qh.

196 #define _W_PROP(class, fld, T, wepname) \
197 /* static */ T _W_PROP_CVAR(wepname, fld); \
198 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 199 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 246 of file all.qh.

246 #define _W_UPDATE(class, fld, T, wepname) \
247 { \
248 T it = _W_PROP_CVAR(wepname, fld); \
249 b.wepvar_##fld = this.wepvar_##fld; \
250 this.wepvar_##fld = it; \
251 }

◆ DEFAULT_FILENAME

#define DEFAULT_FILENAME   "weapons_dump.cfg"

Definition at line 51 of file all.qh.

◆ G_SHOOTFROMFIXEDORIGIN

#define G_SHOOTFROMFIXEDORIGIN   autocvar_g_shootfromfixedorigin

Definition at line 418 of file all.qh.

Referenced by shotorg_adjust().

◆ REGISTER_WEAPON

◆ W_CONFIG

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

Definition at line 209 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:269

Definition at line 217 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:211

Definition at line 213 of file all.qh.

213 #define W_CONFIG_BOTH(class, fld, T, wepname) \
214 W_CONFIG_PRI(class, fld, T, wepname) \
215 W_CONFIG_SEC(class, fld, T, wepname)

◆ W_CONFIG_END

#define W_CONFIG_END ( )
Value:
}

Definition at line 219 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:218

Definition at line 210 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 211 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 212 of file all.qh.

◆ W_NET

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

Definition at line 263 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 272 of file all.qh.

◆ 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:265

Definition at line 267 of file all.qh.

267 #define W_NET_BOTH(class, fld, T, wepname) \
268 W_NET_PRI(class, fld, T, wepname) \
269 W_NET_SEC(class, fld, T, wepname)

◆ W_NET_END

#define W_NET_END ( )
Value:
}

Definition at line 287 of file all.qh.

◆ 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:273

Definition at line 264 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 265 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 266 of file all.qh.

◆ W_PROP

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

Definition at line 187 of file all.qh.

◆ W_PROP_BEGIN

#define W_PROP_BEGIN ( class)

Definition at line 194 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:189

Definition at line 191 of file all.qh.

191 #define W_PROP_BOTH(class, fld, T, wepname) \
192 W_PROP_PRI(class, fld, T, wepname) \
193 W_PROP_SEC(class, fld, T, wepname)

◆ W_PROP_END

#define W_PROP_END ( )

Definition at line 205 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:196

Definition at line 188 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 189 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 190 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:194
#define W_PROP(class, wepname, fld, T, m)
Definition all.qh:187
#define W_NET(class, wepname, fld, T, m)
Definition all.qh:263
#define W_UPDATE_END()
Definition all.qh:255
#define W_PROP_END()
Definition all.qh:205
#define W_CONFIG_END()
Definition all.qh:219
#define W_CONFIG(class, wepname, fld, T, m)
Definition all.qh:209
#define W_NET_BEGIN(class)
Definition all.qh:272
#define W_UPDATE_BEGIN(class)
Definition all.qh:236
#define W_CONFIG_BEGIN(class)
Definition all.qh:217
#define W_NET_END()
Definition all.qh:287
#define W_UPDATE(class, wepname, fld, T, m)
Definition all.qh:227

Definition at line 179 of file all.qh.

179#define W_PROPS(L, class, prefix) \
180 L(W_PROP_BEGIN, W_PROP, W_PROP_END, class, prefix) \
181 L(W_CONFIG_BEGIN, W_CONFIG, W_CONFIG_END, class, prefix) \
182 L(W_UPDATE_BEGIN, W_UPDATE, W_UPDATE_END, class, prefix) \
183 L(W_NET_BEGIN, W_NET, W_NET_END, class, prefix) \
184 /**/ \
185

◆ W_UPDATE

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

Definition at line 227 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:67
entity baseline
Definition all.qh:235

Definition at line 236 of file all.qh.

236 #define W_UPDATE_BEGIN(class) \
237 METHOD(class, wr_update, void(class this)) \
238 { \
239 noref entity b = this.baseline; \
240 if (!b) \
241 { \
242 b = this.baseline = new_pure(baseline); \
243 b.baseline_target = this; \
244 }

◆ 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:229

Definition at line 231 of file all.qh.

231 #define W_UPDATE_BOTH(class, fld, T, wepname) \
232 W_UPDATE_PRI(class, fld, T, wepname) \
233 W_UPDATE_SEC(class, fld, T, wepname)

◆ W_UPDATE_END

#define W_UPDATE_END ( )
Value:
}

Definition at line 255 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:246

Definition at line 228 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 229 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 230 of file all.qh.

◆ WEP_CVAR

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

Definition at line 321 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_Orb_ExplodeOverTime(), 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:322
#define WEP_CVAR_SEC(wep, name)
Definition all.qh:323

Definition at line 324 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 334 of file all.qh.

Referenced by STATIC_INIT(), and W_FixWeaponOrder().

◆ WEP_IMPULSE_END

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

Definition at line 335 of file all.qh.

Referenced by STATIC_INIT().

◆ WEP_LAST

◆ WEPSET

◆ WepSet_FromWeapon

◆ X

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

Definition at line 160 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)
57 if (a >= 24)
58 {
59 a -= 24;
60 if (REGISTRY_MAX(Weapons) > 48)
61 if (a >= 24)
62 {
63 a -= 24;
64 return '0 0 1' * BIT(a);
65 }
66 return '0 1 0' * BIT(a);
67 }
68 return '1 0 0' * BIT(a);
69}
#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
const int WEP_FIRST
Definition all.qh:326

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 347 of file all.qc.

348{
349 if (name == "")
350 {
351 vector oldmin = this.mins, oldmax = this.maxs;
352 setmodel(this, MDL_Null);
353 setsize(this, oldmin, oldmax);
354 if (this.weaponchild) delete(this.weaponchild);
355 this.weaponchild = NULL;
356 this.movedir = '0 0 0';
357#ifdef SVQC
358 this.spawnorigin = '0 0 0';
359#endif
360 this.oldorigin = '0 0 0';
361 this.anim_fire1 = '0 1 0.01';
362 this.anim_fire2 = '0 1 0.01';
363 this.anim_idle = '0 1 0.01';
364 this.anim_reload = '0 1 0.01';
365 }
366 else
367 {
368 // if there is a child entity, hide it until we're sure we use it
369 if (this.weaponchild) this.weaponchild.model = "";
370 _setmodel(this, W_Model(strcat("v_", name, ".md3")));
371 int v_shot_idx; // used later
372 (v_shot_idx = gettagindex(this, "shot")) || (v_shot_idx = gettagindex(this, "tag_shot"));
373
374 _setmodel(this, W_Model(strcat("h_", name, ".iqm")));
375 // preset some defaults that work great for renamed zym files (which don't need an animinfo)
376 this.anim_fire1 = animfixfps(this, '0 1 0.01', '0 0 0');
377 this.anim_fire2 = animfixfps(this, '1 1 0.01', '0 0 0');
378 this.anim_idle = animfixfps(this, '2 1 0.01', '0 0 0');
379 this.anim_reload = animfixfps(this, '3 1 0.01', '0 0 0');
380
381 // if we have a "weapon" tag, let's attach the v_ model to it ("invisible hand" style model)
382 // if we don't, this is a "real" animated model
383 string t;
384 if ((t = "weapon", gettagindex(this, t)) || (t = "tag_weapon", gettagindex(this, t)))
385 {
386 if (!this.weaponchild)
387 {
388 this.weaponchild = new(weaponchild);
389#ifdef CSQC
390 this.weaponchild.drawmask = MASK_NORMAL;
391 this.weaponchild.renderflags |= RF_VIEWMODEL;
392#endif
393 }
394 _setmodel(this.weaponchild, W_Model(strcat("v_", name, ".md3")));
395 setsize(this.weaponchild, '0 0 0', '0 0 0');
396 setattachment(this.weaponchild, this, t);
397 }
398 else
399 {
400 if (this.weaponchild) delete(this.weaponchild);
401 this.weaponchild = NULL;
402 }
403
404 setsize(this, '0 0 0', '0 0 0');
405 setorigin(this, '0 0 0');
406 this.angles = '0 0 0';
407 this.frame = 0;
408#ifdef SVQC
410#else
412#endif
413 if (v_shot_idx) // v_ model attached to invisible h_ model
414 {
415 this.movedir = gettaginfo(this.weaponchild, v_shot_idx);
416 }
417 else
418 {
419 int idx;
420 if ((idx = gettagindex(this, "shot")) || (idx = gettagindex(this, "tag_shot")))
421 {
422 this.movedir = gettaginfo(this, idx);
423 }
424 else
425 {
426 LOG_WARNF("weapon model %s does not support the 'shot' tag, will display shots TOTALLY wrong",
427 this.model);
428 this.movedir = '0 0 0';
429 }
430 }
431#ifdef SVQC
432 {
433 int idx = 0;
434 // v_ model attached to invisible h_ model
435 if (this.weaponchild
436 && ((idx = gettagindex(this.weaponchild, "shell")) || (idx = gettagindex(this.weaponchild, "tag_shell"))))
437 {
438 this.spawnorigin = gettaginfo(this.weaponchild, idx);
439 }
440 else if ((idx = gettagindex(this, "shell")) || (idx = gettagindex(this, "tag_shell")))
441 {
442 this.spawnorigin = gettaginfo(this, idx);
443 }
444 else
445 {
446 LOG_WARNF("weapon model %s does not support the 'shell' tag, will display casings wrong",
447 this.model);
448 this.spawnorigin = this.movedir;
449 }
450 }
451#endif
452 if (v_shot_idx)
453 {
454 this.oldorigin = '0 0 0'; // use regular attachment
455 }
456 else
457 {
458 int idx;
459 if (this.weaponchild)
460 (idx = gettagindex(this, "weapon")) || (idx = gettagindex(this, "tag_weapon"));
461 else
462 (idx = gettagindex(this, "handle")) || (idx = gettagindex(this, "tag_handle"));
463 if (idx)
464 {
465 this.oldorigin = this.movedir - gettaginfo(this, idx);
466 }
467 else
468 {
469 LOG_WARNF(
470 "weapon model %s does not support the 'handle' tag "
471 "and neither does the v_ model support the 'shot' tag, "
472 "will display muzzle flashes TOTALLY wrong\n",
473 this.model);
474 this.oldorigin = '0 0 0'; // there is no way to recover from this
475 }
476 }
477
478#ifdef SVQC
479 this.viewmodelforclient = this.owner;
480#else
482#endif
483 }
484
485 this.view_ofs = '0 0 0';
486 this.movedir_aligned = this.movedir;
487
488 if (this.movedir.x >= 0)
489 {
490 //int algn = STAT(GUNALIGN, this.owner);
491 int algn = W_GunAlign(this, STAT(GUNALIGN, this.owner));
492 #ifdef SVQC
493 this.m_gunalign = algn;
494 #endif
495 vector v = this.movedir;
496 this.movedir = shotorg_adjust(v, false, false, algn);
497 this.movedir_aligned = shotorg_adjust(v, false, true, algn);
498 this.view_ofs = this.movedir_aligned - v;
499 }
500
501 // shotorg_adjust can give negative .x from shootfromfixedorigin
502 // recheck .x here due to it
503 if (this.movedir.x >= 0)
504 {
505 int compressed_shotorg = compressShotOrigin(this.movedir);
506 // make them match perfectly
507 #ifdef SVQC
508 // null during init
509 if (this.owner) STAT(SHOTORG, this.owner) = compressed_shotorg;
510 #endif
511 this.movedir = decompressShotOrigin(compressed_shotorg);
512 }
513 else
514 {
515 // don't support negative x shotorgs
516 this.movedir = '0 0 0';
517
518 // reset _aligned here too even though as a side effect
519 // g_shootfromfixedorigin can make it reset
520 // it'd be only slightly better if it was checked individually
521 this.movedir_aligned = '0 0 0';
522
523 #ifdef SVQC
524 // null during init
525 if (this.owner) STAT(SHOTORG, this.owner) = 0;
526 #endif
527 }
528
529#ifdef SVQC
530 this.spawnorigin += this.view_ofs; // offset the casings origin by the same amount
531#endif
532
533 // check if an instant weapon switch occurred
534 setorigin(this, this.view_ofs);
535 if (!_anim) return;
536 // reset animstate now
537 this.wframe = WFRAME_IDLE;
538 setanim(this, this.anim_idle, true, false, true);
539}
#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:1248
vector decompressShotOrigin(int f)
Definition util.qc:1275
const float MASK_NORMAL
vector mins
const float RF_VIEWMODEL
vector maxs
vector oldorigin
entity viewmodelforclient
#define gettagindex
ent angles
Definition ent_cs.qc:121
model
Definition ent_cs.qc:139
#define STAT(...)
Definition stats.qh:82
#define LOG_WARNF(...)
Definition log.qh:62
vector movedir
Definition viewloc.qh:18
vector animfixfps(entity e, vector a, vector b)
Definition util.qc:1808
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:92
string W_Model(string w_mdl)
Definition all.qc:232
vector shotorg_adjust(vector vecs, bool y_is_right, bool visual, int algn)
Definition all.qc:262
int m_gunalign
Definition all.qh:385
vector movedir_aligned
Definition all.qh:394
vector anim_reload
Definition all.qh:400
vector anim_fire2
Definition all.qh:398
vector anim_idle
Definition all.qh:399
entity weaponchild
Definition all.qh:376
vector anim_fire1
Definition all.qh:397
WFRAME wframe
Definition all.qh:414
vector spawnorigin
Definition all.qh:391

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 189 of file all.qc.

190{
191 FOREACH(Items, it.netname == ammotype.netname,
192 {
193 return it;
194 });
195 LOG_WARNF("Invalid ammo type %d ", ammotype.m_id);
196 return NULL;
197}
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 199 of file all.qc.

200{
201 FOREACH(Resources, it.netname == ammotype.netname,
202 {
203 return it;
204 });
205 LOG_WARNF("Invalid ammo type %d ", ammotype.m_id);
206 return NULL;
207}
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 210 of file all.qc.

211{
212 // TODO: handle networking via resources
213 switch (ammotype)
214 {
215 case RES_SHELLS: return STAT_SHELLS;
216 case RES_BULLETS: return STAT_NAILS;
217 case RES_ROCKETS: return STAT_ROCKETS;
218 case RES_CELLS: return STAT_CELLS;
219 case RES_FUEL: return STAT_FUEL.m_id;
220 default: return -1;
221 }
222}
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 278 of file all.qh.

279 {
281 for (int i; (i = ReadByte()); )
282 {
283 w.wr_net(w, i);
284 }
285 return true;
286 }
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
Definition weapon.qh:44
int ReadByte()
#define REGISTRY_GET(id, i)
Definition registry.qh:43

References ReadByte(), REGISTRY_GET, and Weapons.

◆ ReadWepSet()

WepSet ReadWepSet ( )

Definition at line 87 of file all.qc.

88 {
89 if (REGISTRY_MAX(Weapons) > 48) return ReadInt72_t();
90 if (REGISTRY_MAX(Weapons) > 24) return ReadInt48_t();
91 return ReadInt24_t() * '1 0 0';
92 }
int ReadInt24_t()
Definition net.qh:355
#define ReadInt48_t()
Definition net.qh:361
#define ReadInt72_t()
Definition net.qh:362

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

◆ REGISTER_WEAPON()

REGISTER_WEAPON ( Null ,
NEW(NullWeapon)  )

◆ REPLICATE_INIT() [1/8]

REPLICATE_INIT ( bool ,
cvar_cl_accuracy_data_receive  )

References entity(), name, 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 262 of file all.qc.

263{
264 string s;
265 if (visual)
266 {
267 vecs = shotorg_adjustfromclient(vecs, y_is_right, algn);
268 }
269 else if (STAT(SHOOTFROMEYE))
270 {
271 vecs.y = vecs.z = 0;
272 }
273 else if (STAT(SHOOTFROMCENTER))
274 {
275 vecs.y = 0;
276 vecs.z -= 2;
277 }
278 else if ((s = G_SHOOTFROMFIXEDORIGIN) != "")
279 {
280 vector v = stov(s);
281 if (y_is_right) v.y = -v.y;
282 if (v.x != 0) vecs.x = v.x;
283 vecs.y = v.y;
284 vecs.z = v.z;
285 }
286 else // just do the same as top
287 {
288 vecs = shotorg_adjustfromclient(vecs, y_is_right, algn);
289 }
290
291 return vecs;
292}
vector stov(string s)
vector shotorg_adjustfromclient(vector vecs, float y_is_right, float algn)
Definition all.qc:240
#define G_SHOOTFROMFIXEDORIGIN
Definition all.qh:418

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 340 of file all.qh.

341{
342 string inaccessible = "";
344 FOREACH(Weapons, true, {
345 WepSet set = it.m_wepset = _WepSet_FromWeapon(it.m_id = i);
346 WEPSET_ALL |= set;
347 if (it.spawnflags & WEP_FLAG_SUPERWEAPON) WEPSET_SUPERWEAPONS |= set;
348 if (it == WEP_Null) continue;
349 if (it.spawnflags & WEP_FLAG_SPECIALATTACK) continue;
350 // TODO: this exists to filter out the Ball Stealer, otherwise we run out of impulses
351 if ((it.spawnflags & WEP_FLAG_MUTATORBLOCKED) && (it.spawnflags & WEP_TYPE_OTHER)) continue;
352
353 it.m_unique_impulse = imp;
354 if (imp <= WEP_IMPULSE_END)
355 localcmd(sprintf("alias weapon_%s \"impulse %d\"\n", it.netname, imp));
356 else
357 inaccessible = strcat(inaccessible, "\n", it.netname);
358 ++imp;
359 });
360 if (inaccessible != "" && autocvar_developer > 0) LOG_TRACEF("Impulse limit exceeded, weapon(s) will not be directly accessible: %s", inaccessible);
361 #ifdef CSQC
362 FOREACH(Weapons, true, it.wr_init(it));
363 #endif
364 #ifdef MENUQC
365 FOREACH(Weapons, (it.spawnflags & WEP_FLAG_HIDDEN) && (it.spawnflags & WEP_FLAG_SPECIALATTACK), it.m_hidden = true);
366 #endif
367 weaponorder_byid = "";
368 for (int i = REGISTRY_MAX(Weapons) - 1; i >= 1; --i)
369 if (REGISTRY_GET(Weapons, i))
372}
#define LOG_TRACEF(...)
Definition log.qh:77
noref int autocvar_developer
Definition log.qh:96
void localcmd(string command,...)
string substring(string s, float start, float length)
string ftos(float f)
string strzone(string s)
int int int imp
Definition impulse.qc:90
#define WEP_IMPULSE_END
Definition all.qh:335
WepSet WEPSET_ALL
Definition all.qh:328
#define WEP_IMPULSE_BEGIN
Definition all.qh:334
WepSet WEPSET_SUPERWEAPONS
Definition all.qh:329
WepSet _WepSet_FromWeapon(int i)
Definition all.qc:53
string weaponorder_byid
Definition weapon.qh:230
const int WEP_FLAG_SUPERWEAPON
Definition weapon.qh:218
const int WEP_FLAG_MUTATORBLOCKED
Definition weapon.qh:219
vector WepSet
Definition weapon.qh:14
const int WEP_FLAG_HIDDEN
Definition weapon.qh:216
const int WEP_TYPE_OTHER
Definition weapon.qh:211
const int WEP_FLAG_SPECIALATTACK
Definition weapon.qh:227

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 30 of file all.qh.

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

References error, FOREACH, NEW, STATIC_INIT, 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()

string W_FixWeaponOrder ( string order,
float complete )

Definition at line 95 of file all.qc.

96{
98}
string fixPriorityList(string order, float from, float to, float subtract, float complete)
Definition util.qc:600
#define WEP_LAST
Definition all.qh:327

References fixPriorityList(), WEP_FIRST, WEP_IMPULSE_BEGIN, and WEP_LAST.

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

◆ W_FixWeaponOrder_AllowIncomplete()

string W_FixWeaponOrder_AllowIncomplete ( entity this,
string order )

Definition at line 161 of file all.qc.

162{
163 return W_FixWeaponOrder(order, 0);
164}
string W_FixWeaponOrder(string order, float complete)
Definition all.qc:95

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 146 of file all.qc.

147{
148 int i;
150 for (i = WEP_FIRST; i <= WEP_LAST; ++i)
153 NULL);
154 o = "";
155 for (i = WEP_FIRST; i <= WEP_LAST; ++i)
158 return substring(o, 1, -1);
159}
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:127
float W_FixWeaponOrder_BuildImpulseList_buf[REGISTRY_MAX(Weapons)]
Definition all.qc:125
float W_FixWeaponOrder_BuildImpulseList_cmp(int i, int j, entity pass)
Definition all.qc:134
string W_FixWeaponOrder_BuildImpulseList_order
Definition all.qc:126

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 166 of file all.qc.

167{
168 if (order == "") order = W_NumberWeaponOrder(cvar_defstring("cl_weaponpriority"));
169 return W_FixWeaponOrder(order, 1);
170}
const string cvar_defstring(string name)
string W_NumberWeaponOrder(string order)
Definition all.qc:120

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 802 of file all.qc.

803{
804 string o = W_FixWeaponOrder_ForceComplete(wo);
806 return o;
807}
string weaponorder_byimpulse
Definition client.qh:62
#define CS_CVAR(this)
Definition state.qh:51
#define strcpy(this, s)
Definition string.qh:52
string W_FixWeaponOrder_ForceComplete(string order)
Definition all.qc:166
string W_FixWeaponOrder_BuildImpulseList(string o)
Definition all.qc:146

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 930 of file all.qc.

931{
932 // TODO: rename all wep primary cvars to g_balance_*_primary_*, vice versa for secondary.
933 // Example exception: g_balance_arc_beam_* (primary)
934 const string wepbal_s = strcat("g_balance_", name, "_");
935 const string pri_dmg_s = cvar_defstring(strcat(wepbal_s, pri, "_damage"));
936 const float pri_rft = stof(cvar_defstring(strcat(wepbal_s, pri, "_refire")));
937 const string sec_dmg_s = cvar_defstring(strcat(wepbal_s, sec, "_damage"));
938 const float sec_rft = stof(cvar_defstring(strcat(wepbal_s, sec, "_refire")));
939 return strcat(_("Default damage stats:"),
942 );
943}
float stof(string val,...)
#define THE_SECONDARY_DOES()
Definition all.qc:894
#define THE_PRIMARY_DOES()
Definition all.qc:890

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 944 of file all.qc.

945{
946 const string wepbal_s = strcat("g_balance_", name, "_");
947 const string pri_dmg_s = cvar_defstring(strcat(wepbal_s, pri, "_damage"));
948 const float pri_rft = stof(cvar_defstring(strcat(wepbal_s, pri, "_refire")));
949 const string pri_shots_s = cvar_defstring(strcat(wepbal_s, pri, "_shots"));
950 const string sec_dmg_s = cvar_defstring(strcat(wepbal_s, sec, "_damage"));
951 const float sec_rft = stof(cvar_defstring(strcat(wepbal_s, sec, "_refire")));
952 const string sec_shots_s = cvar_defstring(strcat(wepbal_s, sec, "_shots"));
953 return strcat(_("Default damage stats:"),
956 );
957}
#define THE_PRIMARY_SHOOTS()
Definition all.qc:891
#define THE_SECONDARY_SHOOTS()
Definition all.qc:895

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 926 of file all.qc.

927{
928 return W_Guide_DPS_onlyOne_unnamed(strcat(name, "_", fire));
929}
string W_Guide_DPS_onlyOne_unnamed(string name)
Definition all.qc:913

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 922 of file all.qc.

923{
925}
string W_Guide_DPS_onlyOne_unnamed_andDirectHit(string name)
Definition all.qc:901

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 913 of file all.qc.

914{
915 const string wepbal_s = strcat("g_balance_", name);
916 const string dmg_s = cvar_defstring(strcat(wepbal_s, "_damage"));
917 const float rft = stof(cvar_defstring(strcat(wepbal_s, "_refire")));
918 return strcat(_("Default damage stats:"),
919 IT_DOES()
920 );
921}
#define IT_DOES()
Definition all.qc:888

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 901 of file all.qc.

902{
903 const string wepbal_s = strcat("g_balance_", name);
904 const string dmg_s = cvar_defstring(strcat(wepbal_s, "_damage"));
905 const float rft = stof(cvar_defstring(strcat(wepbal_s, "_refire")));
906 const string dmg2_s = cvar_defstring(strcat(wepbal_s, "_damage2"));
907 const string dir_dps = sprintf(_("(DPS: %.2f)"), rft <= 0 ? 1337 : stof(dmg2_s) / rft);
908 return strcat(_("Default damage stats:"),
909 IT_DOES(),
910 strcat("\n* ", sprintf(_("A direct hit does %s damage"), COLORED_DAMAGE(dmg2_s)), " ", dir_dps)
911 );
912}
#define COLORED_DAMAGE(dmg)
Definition all.qc:873

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 1001 of file all.qc.

1002{
1003 const string wepbal_s = strcat("g_balance_", name, "_");
1004 const string dmg_s = cvar_defstring(strcat(wepbal_s, fire, "_damage"));
1005 float rft = stof(cvar_defstring(strcat(wepbal_s, fire, "_refire")));
1006 const string shots_s = cvar_defstring(strcat(wepbal_s, shots));
1007 const float num_shots = stof(shots_s);
1008 if (refire2 != "")
1009 rft = (num_shots - 1) * rft + stof(cvar_defstring(strcat(wepbal_s, refire2)));
1010 return strcat(_("Default damage stats:"),
1011 IT_SHOOTS()
1012 );
1013}
#define IT_SHOOTS()
Definition all.qc:889

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 958 of file all.qc.

959{
960 const string wepbal_s = strcat("g_balance_", name, "_");
961 const string sec_dmg_s = cvar_defstring(strcat(wepbal_s, sec, "_damage"));
962 const float sec_rft = stof(cvar_defstring(strcat(wepbal_s, sec, "_refire")));
963 return strcat(_("Default damage stats:"),
965 );
966}

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 1040 of file all.qc.

1041{
1042 const string wepbal_s = strcat("g_balance_", name, "_");
1043 const string pri_dmg_s = cvar_defstring(strcat(wepbal_s, pri, "_damage")); // actually damage per second
1044 const string sec_dmg_s = cvar_defstring(strcat(wepbal_s, sec, "_damage"));
1045 const float sec_rft = stof(cvar_defstring(strcat(wepbal_s, sec, "_refire")));
1046 return strcat(_("Default damage stats:"),
1049 );
1050}
#define THE_PRIMARY_DOES_PERSEC()
Definition all.qc:893

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 985 of file all.qc.

986{
987 const string wepbal_s = strcat("g_balance_", name, "_");
988 const string pri_dmg_s = cvar_defstring(strcat(wepbal_s, pri, "_damage"));
989 float pri_rft = stof(cvar_defstring(strcat(wepbal_s, pri, "_refire")));
990 const string pri_shots_s = cvar_defstring(strcat(wepbal_s, shots));
991 const string sec_dmg_s = cvar_defstring(strcat(wepbal_s, sec, "_damage"));
992 const float sec_rft = stof(cvar_defstring(strcat(wepbal_s, sec, "_refire")));
993 const float num_shots = stof(pri_shots_s);
994 if (refire2 != "")
995 pri_rft = (num_shots - 1) * pri_rft + stof(cvar_defstring(strcat(wepbal_s, refire2)));
996 return strcat(_("Default damage stats:"),
999 );
1000}

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 967 of file all.qc.

968{
969 const string wepbal_s = strcat("g_balance_", name, "_");
970 const string pri_dmg_s = cvar_defstring(strcat(wepbal_s, pri, "_damage"));
971 const float pri_rft = stof(cvar_defstring(strcat(wepbal_s, pri, "_refire")));
972 string sec_dmg_s = cvar_defstring(strcat(wepbal_s, sec, "_damage"));
973 float sec_rft = stof(cvar_defstring(strcat(wepbal_s, sec, "_refire")));
974 const string sec_shots_s = cvar_defstring(strcat(wepbal_s, shots));
975 if (sec_dmg_s == "")
976 sec_dmg_s = pri_dmg_s;
977 const float num_shots = stof(sec_shots_s);
978 if (refire2 != "")
979 sec_rft = (num_shots - 1) * sec_rft + stof(cvar_defstring(strcat(wepbal_s, refire2)));
980 return strcat(_("Default damage stats:"),
983 );
984}
#define THE_SECONDARY_SHOOTS_UPTO()
Definition all.qc:896

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 1014 of file all.qc.

1015{
1016 const string wepbal_s = strcat("g_balance_", name, "_");
1017 const string pri_dmg_s = cvar_defstring(strcat(wepbal_s, pri, "_damage"));
1018 const float pri_rft = stof(cvar_defstring(strcat(wepbal_s, pri, "_refire")));
1019 const string sec_dmg_s = cvar_defstring(strcat(wepbal_s, sec, "_damage"));
1020 float sec_rft = stof(cvar_defstring(strcat(wepbal_s, sec, "_refire")));
1021 const string sec_shots_s = cvar_defstring(strcat(wepbal_s, shots));
1022 const string cmb_dmg_s = cvar_defstring(strcat(wepbal_s, combo, "_damage"));
1023 const float num_shots = stof(sec_shots_s);
1024 float combo_t = max(pri_rft, sec_rft);
1025 if (refire2 != "")
1026 {
1027 const float sec_rft2 = sec_rft;
1028 sec_rft = stof(cvar_defstring(strcat(wepbal_s, refire2)));
1029 combo_t = max(combo_t, num_shots * sec_rft + sec_rft2);
1030 sec_rft = (num_shots - 1) * sec_rft + sec_rft2;
1031 }
1032 const string DPS_combo = sprintf(_("(total DPS: %.2f)"),
1033 combo_t <= 0 ? 1337 : (stof(pri_dmg_s) + stof(sec_dmg_s) * num_shots + stof(cmb_dmg_s)) / combo_t);
1034 return strcat(_("Default damage stats:"),
1036 (sec_variable ? THE_SECONDARY_SHOOTS_UPTO() : THE_SECONDARY_SHOOTS()),
1037 strcat("\n* ", sprintf(_("The combo adds an extra %s damage"), COLORED_DAMAGE(cmb_dmg_s)), " ", DPS_combo)
1038 );
1039}
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 836 of file all.qc.

837{
838 string command, key, keys = "";
839 int n, j;
840 float k;
841 const bool joy_active = cvar("joy_active");
842
843 for (int cmd_type = 0; cmd_type < 2; ++cmd_type)
844 {
845 command = cmd_type
846 ? strcat("weapon_", wep.netname)
847 : strcat("weapon_group_", itos(wep.impulse));
848 n = tokenize(findkeysforcommand(command, 0)); // uses '...' strings
849
850 for (j = 0; j < n; ++j)
851 {
852 k = stof(argv(j));
853 if (k == -1)
854 continue;
855 key = keynumtostring(k);
856 if (!joy_active && startsWith(key, "JOY"))
857 continue;
858
859 key = translate_key(key);
860 if (keys == "")
861 keys = strcat("^3", key);
862 else
863 keys = strcat(keys, "^7, ^3", key);
864 }
865 }
866
867 if (keys == "")
868 return _("This weapon has not been bound directly."); // code may miss some weird bind configs, so say "directly"
869 return sprintf(_("You have bound this weapon to: %s."), strcat(keys, "^7"));
870}
string netname
M: refname : reference name name.
Definition weapon.qh:79
string translate_key(string key)
Definition util.qc:1512
#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:236

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 232 of file all.qc.

233{
234 string output = strcat("models/weapons/", w_mdl);
235 MUTATOR_CALLHOOK(WeaponModel, w_mdl, output);
236 return M_ARGV(1, string);
237}
#define MUTATOR_CALLHOOK(id,...)
Definition base.qh:143
#define M_ARGV(x, type)
Definition events.qh:17

Referenced by CL_WeaponEntity_SetModel().

◆ W_MuzzleFlash()

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

Definition at line 728 of file all.qc.

729{
730 // don't show an exterior muzzle effect for the off-hand
731 if(weaponslot(weaponentity) == 0)
732 {
733 Send_Effect_Except(thiswep.m_muzzleeffect, shotorg, shotdir * 1000, 1, '0 0 0', '0 0 0', actor);
734
735 if(thiswep.m_muzzlemodel != MDL_Null)
736 {
737 W_MuzzleFlash_Model(actor.exteriorweaponentity, thiswep.m_muzzlemodel);
738 W_MuzzleFlash_Model_AttachToShotorg(actor, weaponentity, actor.exteriorweaponentity.muzzle_flash, '5 0 0');
739 }
740 }
741
742 FOREACH_CLIENT(it == actor || (IS_SPEC(it) && it.enemy == actor),
743 {
744 if(!IS_REAL_CLIENT(it))
745 continue;
746 int channel = MSG_ONE;
747 msg_entity = it;
748 WriteHeader(channel, w_muzzleflash);
749 WriteByte(channel, thiswep.m_id);
750 WriteByte(channel, weaponslot(weaponentity));
751 WriteVector(channel, shotorg);
752 });
753}
vector shotorg
Definition aim.qh:10
vector shotdir
Definition aim.qh:11
entity m_muzzlemodel
M: flash model MDL_id_MUZZLEFLASH.
Definition weapon.qh:66
void Send_Effect_Except(entity eff, vector eff_loc, vector eff_vel, int eff_cnt, vector eff_col_min, vector eff_col_max, entity ignore)
Definition all.qc:105
#define IS_SPEC(v)
Definition utils.qh:10
#define FOREACH_CLIENT(cond, body)
Definition utils.qh:50
void W_MuzzleFlash_Model(entity wepent, entity muzzlemodel)
Definition all.qc:703
void W_MuzzleFlash_Model_AttachToShotorg(entity actor,.entity weaponentity, entity flash, vector offset)
Definition all.qc:655
int weaponslot(.entity weaponentity)
Definition weapon.qh:19

References entity(), FOREACH_CLIENT, IS_SPEC, Weapon::m_muzzlemodel, Send_Effect_Except(), 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()

string W_NameWeaponOrder ( string order)

Definition at line 110 of file all.qc.

111{
113}
string mapPriorityList(string order, string(string) mapfunc)
Definition util.qc:642
string W_NameWeaponOrder_MapFunc(string s)
Definition all.qc:99

References mapPriorityList(), and W_NameWeaponOrder_MapFunc().

Referenced by XonoticWeaponsList_draw().

◆ W_NumberWeaponOrder()

string W_NumberWeaponOrder ( string order)

◆ W_PROP_reload()

void W_PROP_reload ( int chan,
entity to )

Definition at line 112 of file all.qh.

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

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:112

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 172 of file all.qc.

173{
174 WepSet result = '0 0 0';
175 for (int j = 0; j < n; ++j)
176 {
178 FOREACH(Weapons, it != WEP_Null, {
179 if (remaining & (it.m_wepset))
180 RandomSelection_AddEnt(it, 1, 1);
181 });
184 remaining &= ~WepSet_FromWeapon(w);
185 }
186 return result;
187}
entity result
Definition promise.qc:43
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:46

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 225 of file all.qc.

226{
227 string output = strcat("weapons/", w_snd);
228 MUTATOR_CALLHOOK(WeaponSound, w_snd, output);
229 return M_ARGV(1, string);
230}

◆ Weapon_from_impulse()

Weapon Weapon_from_impulse ( int imp)

Definition at line 150 of file all.qh.

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

References FOREACH, imp, and Weapons.

Referenced by weapon_byid_handle().

◆ Weapon_from_name()

Weapon Weapon_from_name ( string s)

Definition at line 144 of file all.qh.

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

References FOREACH, Weapon_from_name(), and Weapons.

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

◆ weaponentity_glowmod()

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

Definition at line 378 of file all.qh.

379{
380 vector g;
381 if (!(g = wep.wr_glow(wep, c, wepent))) g = colormapPaletteColor(c & 0x0F, true);
382 return g;
383}
virtual void wr_glow()
(BOTH) weapon specific glow
Definition weapon.qh:125
#define colormapPaletteColor(c, isPants)
Definition color.qh:5

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

Referenced by CL_ExteriorWeaponentity_Think(), and viewmodel_draw().

◆ WepSet_GetFromStat()

WepSet WepSet_GetFromStat ( )

Definition at line 79 of file all.qc.

80 {
81 return STAT(WEAPONS);
82 }

References STAT.

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

◆ WepSet_GetFromStat_InMap()

WepSet WepSet_GetFromStat_InMap ( )

Definition at line 83 of file all.qc.

84 {
85 return STAT(WEAPONSINMAP);
86 }

References STAT.

Referenced by Scoreboard_AccuracyStats_Draw().

◆ wframe_send()

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

Definition at line 588 of file all.qc.

589{
590 if (!IS_REAL_CLIENT(actor)) return;
591 int channel = MSG_ONE;
592 msg_entity = actor;
593 WriteHeader(channel, wframe);
594 WriteByte(channel, wepframe);
595 WriteFloat(channel, attackrate);
596 WriteByte(channel, weaponslot(weaponentity.weaponentity_fld));
597 WriteByte(channel, restartanim);
598 WriteByte(channel, weaponentity.state);
599 WriteFloat(channel, weaponentity.weapon_nextthink);
600}
#define WriteHeader(to, id)
Definition net.qh:221
float MSG_ONE
Definition menudefs.qc:56
void WriteByte(float data, float dest, float desto)
#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 71 of file all.qc.

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

References REGISTRY_MAX, and Weapons.

◆ 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 397 of file all.qh.

Referenced by CL_WeaponEntity_SetModel().

◆ anim_fire2

vector anim_fire2

Definition at line 398 of file all.qh.

Referenced by CL_WeaponEntity_SetModel().

◆ anim_idle

◆ anim_reload

vector anim_reload

Definition at line 400 of file all.qh.

Referenced by CL_WeaponEntity_SetModel().

◆ autocvar_g_shootfromfixedorigin

string autocvar_g_shootfromfixedorigin

Definition at line 417 of file all.qh.

Referenced by FixClientCvars(), and PlayerThink().

◆ autocvar_w_prop_interval

float autocvar_w_prop_interval = 5

Definition at line 109 of file all.qh.

Referenced by W_PROP_reload().

◆ baseline

entity baseline

Definition at line 235 of file all.qh.

◆ baseline_target

entity baseline_target

Definition at line 235 of file all.qh.

◆ exteriorweaponentity

entity exteriorweaponentity

Definition at line 377 of file all.qh.

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

◆ m_gunalign

int m_gunalign

Definition at line 385 of file all.qh.

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

◆ m_unique_impulse

int m_unique_impulse

Definition at line 49 of file all.qh.

◆ m_wepset

WepSet m_wepset

Definition at line 44 of file all.qh.

◆ movedir_aligned

vector movedir_aligned

Definition at line 394 of file all.qh.

Referenced by CL_WeaponEntity_SetModel().

◆ muzzle_flash

entity muzzle_flash

Definition at line 402 of file all.qh.

◆ spawnorigin

vector spawnorigin

◆ weaponchild

entity weaponchild

Definition at line 376 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 328 of file all.qh.

Referenced by STATIC_INIT().

◆ WEPSET_SUPERWEAPONS

◆ wframe