Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
rifle.qh
Go to the documentation of this file.
1#pragma once
2
3#ifdef GAMEQC
4MODEL(RIFLE_VIEW, W_Model("h_campingrifle.iqm"));
5MODEL(RIFLE_WORLD, W_Model("v_campingrifle.md3"));
6MODEL(RIFLE_ITEM, W_Model("g_campingrifle.md3"));
7
8SOUND(RIFLE_FIRE2, W_Sound("campingrifle_fire2"));
9SOUND(RIFLE_FIRE, W_Sound("campingrifle_fire"));
10#endif
11
13#ifdef SVQC
14/* spawnfunc */ ATTRIB(Rifle, m_canonical_spawnfunc, string, "weapon_rifle");
15/* rating */ ATTRIB(Rifle, bot_pickupbasevalue, float, 7000);
16#endif
17/* ammotype */ ATTRIB(Rifle, ammo_type, Resource, RES_BULLETS);
18/* impulse */ ATTRIB(Rifle, impulse, int, 7);
20/* color */ ATTRIB(Rifle, m_color, vector, '0.886 0.620 0.353');
21#ifdef GAMEQC
22/* modelname */ ATTRIB(Rifle, mdl, string, "campingrifle");
23/* model */ ATTRIB(Rifle, m_model, Model, MDL_RIFLE_ITEM);
24/* flash mdl */ ATTRIB(Rifle, m_muzzlemodel, Model, MDL_Null);
25/* flash eff */ ATTRIB(Rifle, m_muzzleeffect, entity, EFFECT_RIFLE_MUZZLEFLASH);
26#endif
27#ifdef CSQC
28/* crosshair */ ATTRIB(Rifle, w_crosshair, string, "gfx/crosshairrifle");
29/* crosshair */ ATTRIB(Rifle, w_crosshair_size, float, 0.6);
30/* reticle */ ATTRIB(Rifle, w_reticle, string, "gfx/reticle_nex");
31#endif
32/* wepimg */ ATTRIB(Rifle, model2, string, "weaponrifle");
33/* refname */ ATTRIB(Rifle, netname, string, "rifle");
34/* wepname */ ATTRIB(Rifle, m_name, string, _("Rifle"));
35
36#define X(BEGIN, P, END, class, prefix) \
37 BEGIN(class) \
38 P(class, prefix, ammo, float, BOTH) \
39 P(class, prefix, animtime, float, BOTH) \
40 P(class, prefix, bullethail, float, BOTH) \
41 P(class, prefix, burstcost, float, BOTH) \
42 P(class, prefix, bursttime, float, NONE) \
43 P(class, prefix, damage, float, BOTH) \
44 P(class, prefix, damagefalloff_forcehalflife, float, BOTH) \
45 P(class, prefix, damagefalloff_halflife, float, BOTH) \
46 P(class, prefix, damagefalloff_maxdist, float, BOTH) \
47 P(class, prefix, damagefalloff_mindist, float, BOTH) \
48 P(class, prefix, force, float, BOTH) \
49 P(class, prefix, headshot_multiplier, float, BOTH) \
50 P(class, prefix, pickup_ammo, float, NONE) \
51 P(class, prefix, refire, float, BOTH) \
52 P(class, prefix, reload, float, SEC) \
53 P(class, prefix, reload_ammo, float, NONE) \
54 P(class, prefix, reload_time, float, NONE) \
55 P(class, prefix, secondary, float, NONE) \
56 P(class, prefix, shots, float, BOTH) \
57 P(class, prefix, solidpenetration, float, BOTH) \
58 P(class, prefix, spread, float, BOTH) \
59 P(class, prefix, switchdelay_drop, float, NONE) \
60 P(class, prefix, switchdelay_raise, float, NONE) \
61 P(class, prefix, tracer, float, BOTH) \
62 P(class, prefix, weaponreplace, string, NONE) \
63 P(class, prefix, weaponstartoverride, float, NONE) \
64 P(class, prefix, weaponstart, float, NONE) \
65 P(class, prefix, weaponthrowable, float, NONE) \
66 END()
67 W_PROPS(X, Rifle, rifle)
68#undef X
69
72
73SPAWNFUNC_WEAPON(weapon_rifle, WEP_RIFLE)
74SPAWNFUNC_WEAPON(weapon_campingrifle, WEP_RIFLE) // Nexuiz compat
75SPAWNFUNC_WEAPON(weapon_sniperrifle, WEP_RIFLE)
76
77#ifdef SVQC
79#endif
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
Definition model.qh:3
Definition rifle.qh:12
string m_canonical_spawnfunc
Definition rifle.qh:14
string netname
Definition rifle.qh:33
string m_name
Definition rifle.qh:34
float w_crosshair_size
Definition rifle.qh:29
string mdl
Definition rifle.qh:22
vector m_color
Definition rifle.qh:20
int impulse
Definition rifle.qh:18
float bot_pickupbasevalue
Definition rifle.qh:15
string model2
Definition rifle.qh:32
string w_reticle
Definition rifle.qh:30
Resource ammo_type
Definition rifle.qh:17
int spawnflags
Definition rifle.qh:19
string w_crosshair
Definition rifle.qh:28
entity m_muzzleeffect
Definition rifle.qh:25
Model m_muzzlemodel
Definition rifle.qh:24
Model m_model
Definition rifle.qh:23
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
Definition weapon.qh:42
#define X()
string W_Model(string w_mdl)
Definition all.qc:233
#define MODEL(name, path)
Definition all.qh:8
#define NEW(cname,...)
Definition oo.qh:117
#define CLASS(...)
Definition oo.qh:145
#define ENDCLASS(cname)
Definition oo.qh:281
#define ATTRIB(...)
Definition oo.qh:148
float rifle_accumulator
Definition rifle.qh:78
vector
Definition self.qh:92
string W_Sound(string w_snd)
Definition all.qc:226
#define SOUND(name, path)
Definition all.qh:30
#define W_PROPS(L, class, prefix)
Definition all.qh:188
#define REGISTER_WEAPON(id, inst)
Definition all.qh:136
const int WEP_FLAG_RELOADABLE
Definition weapon.qh:259
const int WEP_TYPE_HITSCAN
Definition weapon.qh:255
const int WEP_FLAG_MUTATORBLOCKED
Definition weapon.qh:261
#define SPAWNFUNC_WEAPON(name, weapon)
Definition weapon.qh:191
const int WEP_FLAG_PENETRATEWALLS
Definition weapon.qh:266