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/* spawnfunc */ ATTRIB(Rifle, m_canonical_spawnfunc, string, "weapon_rifle");
14/* ammotype */ ATTRIB(Rifle, ammo_type, Resource, RES_BULLETS);
15/* impulse */ ATTRIB(Rifle, impulse, int, 7);
17/* rating */ ATTRIB(Rifle, bot_pickupbasevalue, float, 7000);
18/* color */ ATTRIB(Rifle, m_color, vector, '0.886 0.620 0.353');
19/* modelname */ ATTRIB(Rifle, mdl, string, "campingrifle");
20#ifdef GAMEQC
21/* model */ ATTRIB(Rifle, m_model, Model, MDL_RIFLE_ITEM);
22/* flash mdl */ ATTRIB(Rifle, m_muzzlemodel, Model, MDL_Null);
23/* flash eff */ ATTRIB(Rifle, m_muzzleeffect, entity, EFFECT_RIFLE_MUZZLEFLASH);
24#endif
25/* crosshair */ ATTRIB(Rifle, w_crosshair, string, "gfx/crosshairrifle");
26/* crosshair */ ATTRIB(Rifle, w_crosshair_size, float, 0.6);
27/* reticle */ ATTRIB(Rifle, w_reticle, string, "gfx/reticle_nex");
28/* wepimg */ ATTRIB(Rifle, model2, string, "weaponrifle");
29/* refname */ ATTRIB(Rifle, netname, string, "rifle");
30/* wepname */ ATTRIB(Rifle, m_name, string, _("Rifle"));
31
32#define X(BEGIN, P, END, class, prefix) \
33 BEGIN(class) \
34 P(class, prefix, ammo, float, BOTH) \
35 P(class, prefix, animtime, float, BOTH) \
36 P(class, prefix, bullethail, float, BOTH) \
37 P(class, prefix, burstcost, float, BOTH) \
38 P(class, prefix, bursttime, float, NONE) \
39 P(class, prefix, damage, float, BOTH) \
40 P(class, prefix, damagefalloff_forcehalflife, float, BOTH) \
41 P(class, prefix, damagefalloff_halflife, float, BOTH) \
42 P(class, prefix, damagefalloff_maxdist, float, BOTH) \
43 P(class, prefix, damagefalloff_mindist, float, BOTH) \
44 P(class, prefix, force, float, BOTH) \
45 P(class, prefix, headshot_multiplier, float, BOTH) \
46 P(class, prefix, pickup_ammo, float, NONE) \
47 P(class, prefix, refire, float, BOTH) \
48 P(class, prefix, reload, float, SEC) \
49 P(class, prefix, reload_ammo, float, NONE) \
50 P(class, prefix, reload_time, float, NONE) \
51 P(class, prefix, secondary, float, NONE) \
52 P(class, prefix, shots, float, BOTH) \
53 P(class, prefix, solidpenetration, float, BOTH) \
54 P(class, prefix, spread, float, BOTH) \
55 P(class, prefix, switchdelay_drop, float, NONE) \
56 P(class, prefix, switchdelay_raise, float, NONE) \
57 P(class, prefix, tracer, float, BOTH) \
58 P(class, prefix, weaponreplace, string, NONE) \
59 P(class, prefix, weaponstartoverride, float, NONE) \
60 P(class, prefix, weaponstart, float, NONE) \
61 P(class, prefix, weaponthrowable, float, NONE) \
62 END()
63 W_PROPS(X, Rifle, rifle)
64#undef X
65
68
69SPAWNFUNC_WEAPON(weapon_rifle, WEP_RIFLE)
70SPAWNFUNC_WEAPON(weapon_campingrifle, WEP_RIFLE) // Nexuiz compat
71SPAWNFUNC_WEAPON(weapon_sniperrifle, WEP_RIFLE)
72
73#ifdef SVQC
75#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:13
string netname
Definition rifle.qh:29
string m_name
Definition rifle.qh:30
float w_crosshair_size
Definition rifle.qh:26
string mdl
Definition rifle.qh:19
vector m_color
Definition rifle.qh:18
int impulse
Definition rifle.qh:15
float bot_pickupbasevalue
Definition rifle.qh:17
string model2
Definition rifle.qh:28
string w_reticle
Definition rifle.qh:27
Resource ammo_type
Definition rifle.qh:14
int spawnflags
Definition rifle.qh:16
string w_crosshair
Definition rifle.qh:25
entity m_muzzleeffect
Definition rifle.qh:23
Model m_muzzlemodel
Definition rifle.qh:22
Model m_model
Definition rifle.qh:21
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
Definition weapon.qh:44
ATTRIB(Weapon, m_canonical_spawnfunc, string)
the canonical spawnfunc name
#define X()
string W_Model(string w_mdl)
Definition all.qc:232
#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:74
vector
Definition self.qh:92
string W_Sound(string w_snd)
Definition all.qc:225
#define SOUND(name, path)
Definition all.qh:30
#define W_PROPS(L, class, prefix)
Definition all.qh:179
#define REGISTER_WEAPON(id, inst)
Definition all.qh:136
const int WEP_FLAG_RELOADABLE
Definition weapon.qh:217
const int WEP_TYPE_HITSCAN
Definition weapon.qh:213
const int WEP_FLAG_MUTATORBLOCKED
Definition weapon.qh:219
#define SPAWNFUNC_WEAPON(name, weapon)
Definition weapon.qh:150
const int WEP_FLAG_PENETRATEWALLS
Definition weapon.qh:224