Xonotic
arc.qh
Go to the documentation of this file.
1 #pragma once
2 
4 /* spawnfunc */ ATTRIB(Arc, m_canonical_spawnfunc, string, "weapon_arc");
5 /* ammotype */ ATTRIB(Arc, ammo_type, Resource, RES_CELLS);
6 /* impulse */ ATTRIB(Arc, impulse, int, 3);
7 /* flags */ ATTRIB(Arc, spawnflags, int, WEP_TYPE_HITSCAN);
8 /* rating */ ATTRIB(Arc, bot_pickupbasevalue, float, 8000);
9 /* color */ ATTRIB(Arc, wpcolor, vector, '1 1 1');
10 /* modelname */ ATTRIB(Arc, mdl, string, "arc");
11 #ifdef GAMEQC
12 /* model */ ATTRIB(Arc, m_model, Model, MDL_ARC_ITEM);
13 /* flash mdl */ ATTRIB(Arc, m_muzzlemodel, Model, MDL_Null);
14 /* flash eff */ ATTRIB(Arc, m_muzzleeffect, entity, EFFECT_ARC_MUZZLEFLASH);
15 #endif
16 /* crosshair */ ATTRIB(Arc, w_crosshair, string, "gfx/crosshairhlac");
17 /* crosshair */ ATTRIB(Arc, w_crosshair_size, float, 0.7);
18 /* wepimg */ ATTRIB(Arc, model2, string, "weaponarc");
19 /* refname */ ATTRIB(Arc, netname, string, "arc");
20 /* wepname */ ATTRIB(Arc, m_name, string, _("Arc"));
21 
22 #define X(BEGIN, P, END, class, prefix) \
23  BEGIN(class) \
24  P(class, prefix, bolt, float, NONE) \
25  P(class, prefix, bolt_ammo, float, NONE) \
26  P(class, prefix, bolt_bounce_count, float, NONE) \
27  P(class, prefix, bolt_bounce_explode, float, NONE) \
28  P(class, prefix, bolt_bounce_lifetime, float, NONE) \
29  P(class, prefix, bolt_count, float, NONE) \
30  P(class, prefix, bolt_damageforcescale, float, NONE) \
31  P(class, prefix, bolt_damage, float, NONE) \
32  P(class, prefix, bolt_edgedamage, float, NONE) \
33  P(class, prefix, bolt_force, float, NONE) \
34  P(class, prefix, bolt_health, float, NONE) \
35  P(class, prefix, bolt_lifetime, float, NONE) \
36  P(class, prefix, bolt_radius, float, NONE) \
37  P(class, prefix, bolt_refire, float, NONE) \
38  P(class, prefix, bolt_refire2, float, NONE) \
39  P(class, prefix, bolt_speed, float, NONE) \
40  P(class, prefix, bolt_spread, float, NONE) \
41  P(class, prefix, beam_ammo, float, NONE) \
42  P(class, prefix, beam_animtime, float, NONE) \
43  P(class, prefix, beam_botaimlifetime, float, NONE) \
44  P(class, prefix, beam_botaimspeed, float, NONE) \
45  P(class, prefix, beam_damage, float, NONE) \
46  P(class, prefix, beam_degreespersegment, float, NONE) \
47  P(class, prefix, beam_distancepersegment, float, NONE) \
48  P(class, prefix, beam_falloff_halflifedist, float, NONE) \
49  P(class, prefix, beam_falloff_maxdist, float, NONE) \
50  P(class, prefix, beam_falloff_mindist, float, NONE) \
51  P(class, prefix, beam_force, float, NONE) \
52  P(class, prefix, beam_healing_amax, float, NONE) \
53  P(class, prefix, beam_healing_aps, float, NONE) \
54  P(class, prefix, beam_healing_hmax, float, NONE) \
55  P(class, prefix, beam_healing_hps, float, NONE) \
56  P(class, prefix, beam_heat, float, NONE) /* heat increase per second (primary) */ \
57  P(class, prefix, beam_maxangle, float, NONE) \
58  P(class, prefix, beam_nonplayerdamage, float, NONE) \
59  P(class, prefix, beam_range, float, NONE) \
60  P(class, prefix, beam_refire, float, NONE) \
61  P(class, prefix, beam_returnspeed, float, NONE) \
62  P(class, prefix, beam_tightness, float, NONE) \
63  P(class, prefix, burst_ammo, float, NONE) \
64  P(class, prefix, burst_damage, float, NONE) \
65  P(class, prefix, burst_healing_aps, float, NONE) \
66  P(class, prefix, burst_healing_hps, float, NONE) \
67  P(class, prefix, burst_heat, float, NONE) /* heat increase per second (secondary) */ \
68  P(class, prefix, cooldown, float, NONE) /* heat decrease per second when resting */ \
69  P(class, prefix, cooldown_release, float, NONE) /* delay weapon re-use when releasing button */ \
70  P(class, prefix, overheat_max, float, NONE) /* maximum heat before jamming */ \
71  P(class, prefix, overheat_min, float, NONE) /* minimum heat to wait for cooldown */ \
72  P(class, prefix, switchdelay_drop, float, NONE) \
73  P(class, prefix, switchdelay_raise, float, NONE) \
74  P(class, prefix, weaponreplace, string, NONE) \
75  P(class, prefix, weaponstartoverride, float, NONE) \
76  P(class, prefix, weaponstart, float, NONE) \
77  P(class, prefix, weaponthrowable, float, NONE) \
78  END()
79  W_PROPS(X, Arc, arc)
80 #undef X
81 
82 ENDCLASS(Arc)
83 REGISTER_WEAPON(ARC, arc, NEW(Arc));
84 
85 SPAWNFUNC_WEAPON(weapon_arc, WEP_ARC)
86 
87 #ifdef GAMEQC
88 const float ARC_MAX_SEGMENTS = 20;
89 vector arc_shotorigin[4];
90 .vector beam_start;
91 .vector beam_dir;
92 .vector beam_wantdir;
93 .int beam_type;
94 
95 const int ARC_BT_MISS = 0x00;
96 const int ARC_BT_WALL = 0x01;
97 const int ARC_BT_HEAL = 0x02;
98 const int ARC_BT_HIT = 0x03;
99 const int ARC_BT_BURST_MISS = 0x10;
100 const int ARC_BT_BURST_WALL = 0x11;
101 const int ARC_BT_BURST_HEAL = 0x12;
102 const int ARC_BT_BURST_HIT = 0x13;
103 const int ARC_BT_BURSTMASK = 0x10;
104 
105 const int ARC_SF_SETTINGS = BIT(0);
106 const int ARC_SF_START = BIT(1);
107 const int ARC_SF_WANTDIR = BIT(2);
108 const int ARC_SF_BEAMDIR = BIT(3);
109 const int ARC_SF_BEAMTYPE = BIT(4);
110 const int ARC_SF_LOCALMASK = ARC_SF_START | ARC_SF_WANTDIR | ARC_SF_BEAMDIR;
111 #endif
112 #ifdef SVQC
113 .entity arc_beam;
114 .bool arc_BUTTON_ATCK_prev; // for better animation control
115 .float beam_prev;
116 .float beam_initialized;
117 .float beam_bursting;
118 .float beam_teleporttime;
119 .float beam_heat; // (beam) amount of heat produced
120 .float arc_overheat; // (dropped arc/player) time during which it's too hot
121 .float arc_cooldown; // (dropped arc/player) cooling speed
122 .float arc_heat_percent;
123 .float arc_smoke_sound;
124 #endif
125 #ifdef CSQC
126 
127 .vector beam_color;
128 .float beam_alpha;
129 .float beam_thickness;
130 .entity beam_traileffect;
131 .entity beam_hiteffect;
132 .float beam_hitlight[4]; // 0: radius, 123: rgb
133 .entity beam_muzzleeffect;
134 .float beam_muzzlelight[4]; // 0: radius, 123: rgb
135 .string beam_image;
136 
137 .entity beam_muzzleentity;
138 
139 .float beam_degreespersegment;
140 .float beam_distancepersegment;
141 .float beam_usevieworigin;
142 .float beam_initialized;
143 .float beam_maxangle;
144 .float beam_range;
145 .float beam_returnspeed;
146 .float beam_tightness;
147 .vector beam_shotorigin;
148 
149 entity Draw_ArcBeam_callback_entity;
150 float Draw_ArcBeam_callback_last_thickness;
151 vector Draw_ArcBeam_callback_last_top; // NOTE: in same coordinate system as player.
152 vector Draw_ArcBeam_callback_last_bottom; // NOTE: in same coordinate system as player.
153 #endif
#define NEW(cname,...)
Definition: oo.qh:105
CLASS(Object) Object
Definition: oo.qh:318
entity() spawn
vector beam_color
Definition: laser.qh:30
string netname
Definition: powerups.qc:20
float bot_pickupbasevalue
Definition: bot.qh:66
Definition: arc.qh:3
float impulse
Definition: progsdefs.qc:158
float spawnflags
Definition: progsdefs.qc:191
#define ATTRIB(...)
Definition: oo.qh:136
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
Definition: bits.qh:8
Definition: model.qh:3
vector(float skel, float bonenum) _skel_get_boneabs_hidden
#define SPAWNFUNC_WEAPON(name, weapon)
Definition: weapon.qh:143
#define ENDCLASS(cname)
Definition: oo.qh:269
float arc_heat_percent
Definition: wepent.qh:12
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
Definition: weapon.qh:41
const int WEP_TYPE_HITSCAN
Definition: weapon.qh:197
#define W_PROPS(L, class, prefix)
Definition: all.qh:163
REGISTER_WEAPON(ARC, arc, NEW(Arc))
string m_name
Definition: scores.qh:135
#define X(BEGIN, P, END, class, prefix)
Definition: arc.qh:22