Xonotic
Weapon Class Reference

fields which are explicitly/manually set are marked with "M", fields set automatically are marked with "A" More...

+ Inheritance diagram for Weapon:
+ Collaboration diagram for Weapon:

Public Member Functions

 ATTRIB (Weapon, m_canonical_spawnfunc, string)
 the canonical spawnfunc name More...
 
 ATTRIB (Weapon, m_pickup, entity)
 
virtual void Weapon ::display ()
 
virtual void Weapon ::m_spawnfunc_hookreplace ()
 control what happens when this weapon is spawned More...
 
virtual void Weapon ::wr_aim ()
 (SERVER) runs bot aiming code for this weapon More...
 
virtual void Weapon ::wr_checkammo1 ()
 (SERVER) checks ammo for weapon primary More...
 
virtual void Weapon ::wr_checkammo2 ()
 (SERVER) checks ammo for weapon second More...
 
virtual void Weapon ::wr_config ()
 (SERVER) dump weapon cvars to config in data directory (see: sv_cmd dumpweapons) More...
 
virtual void Weapon ::wr_drop ()
 (SERVER) the weapon is dropped More...
 
virtual void Weapon ::wr_glow ()
 (BOTH) weapon specific glow More...
 
virtual void Weapon ::wr_gonethink ()
 (SERVER) logic to run when weapon is lost More...
 
virtual void Weapon ::wr_impacteffect ()
 (CLIENT) impact effect for weapon explosion More...
 
virtual void Weapon ::wr_init ()
 (BOTH) precaches models/sounds used by this weapon, also sets up weapon properties More...
 
virtual void Weapon ::wr_killmessage ()
 (SERVER) notification number for kill message (may inspect w_deathtype for details) More...
 
virtual void Weapon ::wr_pickup ()
 (SERVER) a weapon is picked up More...
 
virtual void Weapon ::wr_playerdeath ()
 (SERVER) called whenever a player dies More...
 
virtual void Weapon ::wr_reload ()
 (SERVER) handles reloading for weapon More...
 
virtual void Weapon ::wr_resetplayer ()
 (SERVER) clears fields that the weapon may use More...
 
virtual void Weapon ::wr_setup ()
 (SERVER) setup weapon data More...
 
virtual void Weapon ::wr_suicidemessage ()
 (SERVER) notification number for suicide message (may inspect w_deathtype for details) More...
 
virtual void Weapon ::wr_think ()
 (SERVER) logic to run every frame More...
 
virtual void Weapon ::wr_update ()
 (SERVER) update cvar based properties More...
 
virtual void Weapon ::wr_viewmodel ()
 (CLIENT) weapon specific view model More...
 
virtual void Weapon ::wr_zoom ()
 (BOTH) weapon specific zoom reticle More...
 
virtual void Weapon ::wr_zoomdir ()
 (CLIENT) check whether the weapon should zoom (special handling) More...
 

Public Attributes

Resource ammo_type = RES_NONE
 M: ammotype : main ammo type. More...
 
float bot_pickupbasevalue = 0
 M: rating : bot weapon priority. More...
 
int impulse = -1
 M: impulse : weapon impulse. More...
 
int m_id = 0
 
string m_name = "AOL CD Thrower"
 M: wepname : human readable name. More...
 
string mdl = ""
 M: modelname : name of model (without g_ v_ or h_ prefixes) More...
 
string model2 = ""
 M: wepimg : "weaponfoobar" side view image file of weapon. More...
 
string netname = ""
 M: refname : reference name name. More...
 
int spawnflags = 0
 M: flags : WEPSPAWNFLAG_... More...
 
string w_crosshair = "gfx/crosshairmoustache"
 M: crosshair : per-weapon crosshair: "CrosshairImage Size". More...
 
float w_crosshair_size = 1
 A: crosshair : per-weapon crosshair size (argument two of "crosshair" field) More...
 
string w_reticle = string_null
 A: reticle : per-weapon zoom reticle. More...
 
vector wpcolor = '0 0 0'
 M: color : waypointsprite color. More...
 

Detailed Description

fields which are explicitly/manually set are marked with "M", fields set automatically are marked with "A"

Definition at line 41 of file weapon.qh.

Member Function Documentation

◆ ATTRIB() [1/2]

Weapon::ATTRIB ( Weapon  ,
m_canonical_spawnfunc  ,
string   
)

the canonical spawnfunc name

◆ ATTRIB() [2/2]

Weapon::ATTRIB ( Weapon  ,
m_pickup  ,
entity   
)

◆ Weapon ::display()

virtual void Weapon::Weapon ::display ( )
inlinevirtual

Definition at line 127 of file weapon.qh.

References cvar_string(), ENDCLASS, entity(), m_name, string_null, and weapon_defaultspawnfunc().

127  {
128  returns(this.m_name, this.model2 ? sprintf("/gfx/hud/%s/%s", cvar_string("menu_skin"), this.model2) : string_null);
129  }
string string_null
Definition: nil.qh:9
string m_name
M: wepname : human readable name.
Definition: weapon.qh:78
string model2
M: wepimg : "weaponfoobar" side view image file of weapon.
Definition: weapon.qh:74
+ Here is the call graph for this function:

◆ Weapon ::m_spawnfunc_hookreplace()

virtual void Weapon::Weapon ::m_spawnfunc_hookreplace ( )
inlinevirtual

control what happens when this weapon is spawned

Definition at line 46 of file weapon.qh.

46 { return this; }

◆ Weapon ::wr_aim()

virtual void Weapon::Weapon ::wr_aim ( )
inlinevirtual

(SERVER) runs bot aiming code for this weapon

Definition at line 91 of file weapon.qh.

91 {}

◆ Weapon ::wr_checkammo1()

virtual void Weapon::Weapon ::wr_checkammo1 ( )
inlinevirtual

(SERVER) checks ammo for weapon primary

Definition at line 87 of file weapon.qh.

87 {return false;}

◆ Weapon ::wr_checkammo2()

virtual void Weapon::Weapon ::wr_checkammo2 ( )
inlinevirtual

(SERVER) checks ammo for weapon second

Definition at line 89 of file weapon.qh.

89 {return false;}

◆ Weapon ::wr_config()

virtual void Weapon::Weapon ::wr_config ( )
inlinevirtual

(SERVER) dump weapon cvars to config in data directory (see: sv_cmd dumpweapons)

Definition at line 109 of file weapon.qh.

109 {}

◆ Weapon ::wr_drop()

virtual void Weapon::Weapon ::wr_drop ( )
inlinevirtual

(SERVER) the weapon is dropped

Definition at line 122 of file weapon.qh.

122 {}

◆ Weapon ::wr_glow()

virtual void Weapon::Weapon ::wr_glow ( )
inlinevirtual

(BOTH) weapon specific glow

Definition at line 120 of file weapon.qh.

120 { return '0 0 0'; }

◆ Weapon ::wr_gonethink()

virtual void Weapon::Weapon ::wr_gonethink ( )
inlinevirtual

(SERVER) logic to run when weapon is lost

Definition at line 107 of file weapon.qh.

107 {}

◆ Weapon ::wr_impacteffect()

virtual void Weapon::Weapon ::wr_impacteffect ( )
inlinevirtual

(CLIENT) impact effect for weapon explosion

Definition at line 103 of file weapon.qh.

103 {}

◆ Weapon ::wr_init()

virtual void Weapon::Weapon ::wr_init ( )
inlinevirtual

(BOTH) precaches models/sounds used by this weapon, also sets up weapon properties

Definition at line 93 of file weapon.qh.

93 {}

◆ Weapon ::wr_killmessage()

virtual void Weapon::Weapon ::wr_killmessage ( )
inlinevirtual

(SERVER) notification number for kill message (may inspect w_deathtype for details)

Definition at line 97 of file weapon.qh.

References NULL.

97 {return NULL;}
#define NULL
Definition: post.qh:17

◆ Weapon ::wr_pickup()

virtual void Weapon::Weapon ::wr_pickup ( )
inlinevirtual

(SERVER) a weapon is picked up

Definition at line 124 of file weapon.qh.

124 {}

◆ Weapon ::wr_playerdeath()

virtual void Weapon::Weapon ::wr_playerdeath ( )
inlinevirtual

(SERVER) called whenever a player dies

Definition at line 105 of file weapon.qh.

105 {}

◆ Weapon ::wr_reload()

virtual void Weapon::Weapon ::wr_reload ( )
inlinevirtual

(SERVER) handles reloading for weapon

Definition at line 99 of file weapon.qh.

99 {}

◆ Weapon ::wr_resetplayer()

virtual void Weapon::Weapon ::wr_resetplayer ( )
inlinevirtual

(SERVER) clears fields that the weapon may use

Definition at line 101 of file weapon.qh.

101 {}

◆ Weapon ::wr_setup()

virtual void Weapon::Weapon ::wr_setup ( )
inlinevirtual

(SERVER) setup weapon data

Definition at line 83 of file weapon.qh.

83 {}

◆ Weapon ::wr_suicidemessage()

virtual void Weapon::Weapon ::wr_suicidemessage ( )
inlinevirtual

(SERVER) notification number for suicide message (may inspect w_deathtype for details)

Definition at line 95 of file weapon.qh.

References NULL.

95 {return NULL;}
#define NULL
Definition: post.qh:17

◆ Weapon ::wr_think()

virtual void Weapon::Weapon ::wr_think ( )
inlinevirtual

(SERVER) logic to run every frame

Definition at line 85 of file weapon.qh.

85 {}

◆ Weapon ::wr_update()

virtual void Weapon::Weapon ::wr_update ( )
inlinevirtual

(SERVER) update cvar based properties

Definition at line 126 of file weapon.qh.

126 {}

◆ Weapon ::wr_viewmodel()

virtual void Weapon::Weapon ::wr_viewmodel ( )
inlinevirtual

(CLIENT) weapon specific view model

Definition at line 118 of file weapon.qh.

References string_null.

118 { return string_null; }
string string_null
Definition: nil.qh:9

◆ Weapon ::wr_zoom()

virtual void Weapon::Weapon ::wr_zoom ( )
inlinevirtual

(BOTH) weapon specific zoom reticle

Definition at line 111 of file weapon.qh.

111  {
112  // no weapon specific image for this weapon
113  return false;
114  }

◆ Weapon ::wr_zoomdir()

virtual void Weapon::Weapon ::wr_zoomdir ( )
inlinevirtual

(CLIENT) check whether the weapon should zoom (special handling)

Definition at line 116 of file weapon.qh.

116 {return false;}

Member Data Documentation

◆ ammo_type

Resource Weapon::ammo_type = RES_NONE

M: ammotype : main ammo type.

Definition at line 48 of file weapon.qh.

Referenced by HUD_Ammo(), notif_arg_item_wepammo(), W_DecreaseAmmo(), W_ThrowNewWeapon(), and weapon_defaultspawnfunc().

◆ bot_pickupbasevalue

float Weapon::bot_pickupbasevalue = 0

M: rating : bot weapon priority.

Definition at line 54 of file weapon.qh.

Referenced by WeaponPickup::WeaponPickup ::WeaponPickup().

◆ impulse

int Weapon::impulse = -1

M: impulse : weapon impulse.

Definition at line 50 of file weapon.qh.

Referenced by client_hasweapon(), W_FixWeaponOrder_BuildImpulseList_cmp(), and W_SwitchWeapon_TryOthers().

◆ m_id

◆ m_name

string Weapon::m_name = "AOL CD Thrower"

M: wepname : human readable name.

Definition at line 78 of file weapon.qh.

Referenced by readplayerstartcvars(), and WeaponPickup::WeaponPickup ::WeaponPickup().

◆ mdl

string Weapon::mdl = ""

M: modelname : name of model (without g_ v_ or h_ prefixes)

Definition at line 58 of file weapon.qh.

Referenced by viewmodel_draw(), and W_WeaponFrame().

◆ model2

string Weapon::model2 = ""

M: wepimg : "weaponfoobar" side view image file of weapon.

WEAPONTODO: Move out of skin files, move to common files

Definition at line 74 of file weapon.qh.

◆ netname

string Weapon::netname = ""

M: refname : reference name name.

Definition at line 76 of file weapon.qh.

Referenced by Obituary_WeaponDeath(), W_DecreaseAmmo(), and weapon_defaultspawnfunc().

◆ spawnflags

int Weapon::spawnflags = 0

M: flags : WEPSPAWNFLAG_...

combined

Definition at line 52 of file weapon.qh.

Referenced by client_hasweapon(), W_SetupShot_Dir_ProjectileSize_Range(), W_WeaponFrame(), and weapon_defaultspawnfunc().

◆ w_crosshair

string Weapon::w_crosshair = "gfx/crosshairmoustache"

M: crosshair : per-weapon crosshair: "CrosshairImage Size".

Definition at line 68 of file weapon.qh.

◆ w_crosshair_size

float Weapon::w_crosshair_size = 1

A: crosshair : per-weapon crosshair size (argument two of "crosshair" field)

Definition at line 70 of file weapon.qh.

◆ w_reticle

string Weapon::w_reticle = string_null

A: reticle : per-weapon zoom reticle.

Definition at line 72 of file weapon.qh.

Referenced by DrawReticle().

◆ wpcolor

vector Weapon::wpcolor = '0 0 0'

M: color : waypointsprite color.

Definition at line 56 of file weapon.qh.

Referenced by DamageText::DamageText_draw2d(), and weapon_defaultspawnfunc().


The documentation for this class was generated from the following file: