Xonotic
blaster.qh
Go to the documentation of this file.
1 #pragma once
2 
4 /* spawnfunc */ ATTRIB(Blaster, m_canonical_spawnfunc, string, "weapon_blaster");
5 /* ammotype */ //ATTRIB(Blaster, ammo_type, Resource, RES_NONE);
6 /* impulse */ ATTRIB(Blaster, impulse, int, 1);
8 /* rating */ ATTRIB(Blaster, bot_pickupbasevalue, float, 0);
9 /* color */ ATTRIB(Blaster, wpcolor, vector, '1 0.5 0.5');
10 /* modelname */ ATTRIB(Blaster, mdl, string, "laser");
11 #ifdef GAMEQC
12 /* model */ ATTRIB(Blaster, m_model, Model, MDL_BLASTER_ITEM);
13 /* flash mdl */ ATTRIB(Blaster, m_muzzlemodel, Model, MDL_Null);
14 /* flash eff */ ATTRIB(Blaster, m_muzzleeffect, entity, EFFECT_BLASTER_MUZZLEFLASH);
15 #endif
16 /* crosshair */ ATTRIB(Blaster, w_crosshair, string, "gfx/crosshairlaser");
17 /* crosshair */ ATTRIB(Blaster, w_crosshair_size, float, 0.5);
18 /* wepimg */ ATTRIB(Blaster, model2, string, "weaponlaser");
19 /* refname */ ATTRIB(Blaster, netname, string, "blaster");
20 /* wepname */ ATTRIB(Blaster, m_name, string, _("Blaster"));
21 
22 #define X(BEGIN, P, END, class, prefix) \
23  BEGIN(class) \
24  P(class, prefix, animtime, float, BOTH) \
25  P(class, prefix, damage, float, BOTH) \
26  P(class, prefix, delay, float, BOTH) \
27  P(class, prefix, edgedamage, float, BOTH) \
28  P(class, prefix, force, float, BOTH) \
29  P(class, prefix, force_zscale, float, BOTH) \
30  P(class, prefix, lifetime, float, BOTH) \
31  P(class, prefix, radius, float, BOTH) \
32  P(class, prefix, refire, float, BOTH) \
33  P(class, prefix, secondary, float, NONE) \
34  P(class, prefix, shotangle, float, BOTH) \
35  P(class, prefix, speed, float, BOTH) \
36  P(class, prefix, spread, float, BOTH) \
37  P(class, prefix, switchdelay_drop, float, NONE) \
38  P(class, prefix, switchdelay_raise, float, NONE) \
39  P(class, prefix, weaponreplace, string, NONE) \
40  P(class, prefix, weaponstartoverride, float, NONE) \
41  P(class, prefix, weaponstart, float, NONE) \
42  P(class, prefix, weaponthrowable, float, NONE) \
43  END()
44  W_PROPS(X, Blaster, blaster)
45 #undef X
46 
47 ENDCLASS(Blaster)
48 REGISTER_WEAPON(BLASTER, blaster, NEW(Blaster));
49 
50 SPAWNFUNC_WEAPON(weapon_blaster, WEP_BLASTER)
51 SPAWNFUNC_WEAPON(weapon_laser, WEP_BLASTER)
52 
54 ENDCLASS(OffhandBlaster)
55 OffhandBlaster OFFHAND_BLASTER;
56 STATIC_INIT(OFFHAND_BLASTER) { OFFHAND_BLASTER = NEW(OffhandBlaster); }
57 
58 #ifdef SVQC
59 .float blaster_damage;
60 .float blaster_edgedamage;
61 .float blaster_radius;
62 .float blaster_force;
63 .float blaster_force_zscale;
64 .float blaster_lifetime;
65 
66 // Will be demacroed after WEP_CVAR macros are also demacroed.
67 #define BLASTER_SECONDARY_ATTACK(weapon_name, actor, weaponentity) \
68  makevectors(actor.v_angle); \
69  W_Blaster_Attack( \
70  actor, \
71  weaponentity, \
72  WEP_BLASTER.m_id | HITTYPE_SECONDARY, \
73  WEP_CVAR_SEC(weapon_name, shotangle), \
74  WEP_CVAR_SEC(weapon_name, damage), \
75  WEP_CVAR_SEC(weapon_name, edgedamage), \
76  WEP_CVAR_SEC(weapon_name, radius), \
77  WEP_CVAR_SEC(weapon_name, force), \
78  WEP_CVAR_SEC(weapon_name, force_zscale), \
79  WEP_CVAR_SEC(weapon_name, speed), \
80  WEP_CVAR_SEC(weapon_name, spread), \
81  WEP_CVAR_SEC(weapon_name, delay), \
82  WEP_CVAR_SEC(weapon_name, lifetime) \
83  );
84 
85 #endif
#define NEW(cname,...)
Definition: oo.qh:105
#define X(BEGIN, P, END, class, prefix)
Definition: blaster.qh:22
CLASS(Object) Object
Definition: oo.qh:318
entity() spawn
OffhandBlaster OFFHAND_BLASTER
Definition: blaster.qh:55
string netname
Definition: powerups.qc:20
float bot_pickupbasevalue
Definition: bot.qh:66
const int WEP_TYPE_SPLASH
Definition: weapon.qh:196
float impulse
Definition: progsdefs.qc:158
float spawnflags
Definition: progsdefs.qc:191
#define ATTRIB(...)
Definition: oo.qh:136
STATIC_INIT(OFFHAND_BLASTER)
Definition: blaster.qh:56
REGISTER_WEAPON(BLASTER, blaster, NEW(Blaster))
Definition: model.qh:3
vector(float skel, float bonenum) _skel_get_boneabs_hidden
const int WEP_FLAG_CANCLIMB
Definition: weapon.qh:198
#define SPAWNFUNC_WEAPON(name, weapon)
Definition: weapon.qh:143
#define ENDCLASS(cname)
Definition: oo.qh:269
const int WEP_FLAG_NORMAL
Definition: weapon.qh:199
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
Definition: weapon.qh:41
#define W_PROPS(L, class, prefix)
Definition: all.qh:163
string m_name
Definition: scores.qh:135