]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/weapons/weapon/rifle.qh
Nades code: don't use booleans as array indexes for m_projectile, optimize spawn_held...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / rifle.qh
1 #pragma once
2
3 CLASS(Rifle, Weapon)
4 /* spawnfunc */ ATTRIB(Rifle, m_canonical_spawnfunc, string, "weapon_rifle");
5 /* ammotype  */ ATTRIB(Rifle, ammo_type, int, RES_BULLETS);
6 /* impulse   */ ATTRIB(Rifle, impulse, int, 7);
7 /* flags     */ ATTRIB(Rifle, spawnflags, int, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_FLAG_PENETRATEWALLS);
8 /* rating    */ ATTRIB(Rifle, bot_pickupbasevalue, float, 7000);
9 /* color     */ ATTRIB(Rifle, wpcolor, vector, '0.5 1 0');
10 /* modelname */ ATTRIB(Rifle, mdl, string, "campingrifle");
11 #ifdef GAMEQC
12 /* model     */ ATTRIB(Rifle, m_model, Model, MDL_RIFLE_ITEM);
13 /* flash mdl */ ATTRIB(Rifle, m_muzzlemodel, Model, MDL_Null);
14 /* flash eff */ ATTRIB(Rifle, m_muzzleeffect, entity, EFFECT_RIFLE_MUZZLEFLASH);
15 #endif
16 /* crosshair */ ATTRIB(Rifle, w_crosshair, string, "gfx/crosshairrifle");
17 /* crosshair */ ATTRIB(Rifle, w_crosshair_size, float, 0.6);
18 /* reticle   */ ATTRIB(Rifle, w_reticle, string, "gfx/reticle_nex");
19 /* wepimg    */ ATTRIB(Rifle, model2, string, "weaponrifle");
20 /* refname   */ ATTRIB(Rifle, netname, string, "rifle");
21 /* wepname   */ ATTRIB(Rifle, m_name, string, _("Rifle"));
22
23 #define X(BEGIN, P, END, class, prefix) \
24         BEGIN(class) \
25                 P(class, prefix, ammo, float, BOTH) \
26                 P(class, prefix, animtime, float, BOTH) \
27                 P(class, prefix, bullethail, float, BOTH) \
28                 P(class, prefix, burstcost, float, BOTH) \
29                 P(class, prefix, bursttime, float, NONE) \
30                 P(class, prefix, damage, float, BOTH) \
31                 P(class, prefix, force, float, BOTH) \
32                 P(class, prefix, headshot_multiplier, float, BOTH) \
33                 P(class, prefix, refire, float, BOTH) \
34                 P(class, prefix, reload, float, SEC) \
35                 P(class, prefix, reload_ammo, float, NONE) \
36         P(class, prefix, reload_time, float, NONE) \
37                 P(class, prefix, secondary, float, NONE) \
38                 P(class, prefix, shots, float, BOTH) \
39                 P(class, prefix, solidpenetration, float, BOTH) \
40                 P(class, prefix, spread, float, BOTH) \
41         P(class, prefix, switchdelay_drop, float, NONE) \
42         P(class, prefix, switchdelay_raise, float, NONE) \
43                 P(class, prefix, tracer, float, BOTH) \
44         P(class, prefix, weaponreplace, string, NONE) \
45         P(class, prefix, weaponstartoverride, float, NONE) \
46         P(class, prefix, weaponstart, float, NONE) \
47         P(class, prefix, weaponthrowable, float, NONE) \
48         END()
49     W_PROPS(X, Rifle, rifle)
50 #undef X
51 ENDCLASS(Rifle)
52 REGISTER_WEAPON(RIFLE, rifle, NEW(Rifle));
53
54 SPAWNFUNC_WEAPON(weapon_rifle, WEP_RIFLE)
55 SPAWNFUNC_WEAPON(weapon_campingrifle, WEP_RIFLE)
56 SPAWNFUNC_WEAPON(weapon_sniperrifle, WEP_RIFLE)
57
58 #ifdef SVQC
59 .float rifle_accumulator;
60 #endif