Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
hook.qc
Go to the documentation of this file.
1#include "hook.qh"
2
3#ifdef SVQC
4
6{
7 float dt = time - this.teleport_time;
8 float dmg_remaining_next = bound(0, 1 - dt / WEP_CVAR_SEC(WEP_HOOK, duration), 1) ** WEP_CVAR_SEC(WEP_HOOK, power);
9
10 float f = this.dmg_last - dmg_remaining_next;
11 this.dmg_last = dmg_remaining_next;
12
13 RadiusDamage(this, this.realowner,
14 f * this.dmg,
15 f * this.dmg_edge,
16 this.dmg_radius,
17 this.realowner,
18 NULL,
19 f * this.dmg_force,
22 NULL
23 );
25 #if 0
26 RadiusDamage(this, NULL,
27 f * this.dmg,
28 f * this.dmg_edge,
29 this.dmg_radius,
30 NULL,
31 NULL,
32 f * this.dmg_force,
34 NULL
35 );
36 #endif
37
38 if (dt < WEP_CVAR_SEC(WEP_HOOK, duration))
39 this.nextthink = time + 0.05; // soon
40 else
41 delete(this);
42}
43
45{
46 this.event_damage = func_null;
47 settouch(this, func_null);
48 this.effects |= EF_NODRAW;
49
51 this.nextthink = time;
52 this.dmg = WEP_CVAR_SEC(WEP_HOOK, damage);
53 this.dmg_edge = WEP_CVAR_SEC(WEP_HOOK, edgedamage);
54 this.dmg_radius = WEP_CVAR_SEC(WEP_HOOK, radius);
55 this.dmg_force = WEP_CVAR_SEC(WEP_HOOK, force);
56 this.teleport_time = time;
57 this.dmg_last = 1;
59}
60
61void W_Hook_Explode2_use(entity this, entity actor, entity trigger)
62{
63 W_Hook_Explode2(this);
64}
65
66void W_Hook_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force)
67{
68 if (GetResource(this, RES_HEALTH) <= 0)
69 return;
70 if (!W_CheckProjectileDamage(inflictor.realowner, this.realowner, deathtype, -1)) // no exceptions
71 return; // g_projectiles_damage says to halt
72
73 SetResourceExplicit(this, RES_HEALTH, GetResource(this, RES_HEALTH));
74
75 if (GetResource(this, RES_HEALTH) <= 0)
77}
78
80{
82 this.use(this, NULL, NULL);
83}
84
85void W_Hook_Attack2(Weapon thiswep, entity actor, .entity weaponentity)
86{
87 //W_DecreaseAmmo(thiswep, actor, WEP_CVAR_SEC(WEP_HOOK, ammo)); // WEAPONTODO: Figure out how to handle ammo with hook secondary (gravitybomb)
88 W_SetupShot(actor, weaponentity, false, 4, SND_HOOKBOMB_FIRE, CH_WEAPON_A, WEP_CVAR_SEC(WEP_HOOK, damage), WEP_HOOK.m_id | HITTYPE_SECONDARY);
89
90 entity gren = new(hookbomb);
91 gren.owner = gren.realowner = actor;
92 gren.bot_dodge = true;
93 gren.bot_dodgerating = WEP_CVAR_SEC(WEP_HOOK, damage);
96 gren.projectiledeathtype = WEP_HOOK.m_id | HITTYPE_SECONDARY;
97 gren.weaponentity_fld = weaponentity;
98 setorigin(gren, w_shotorg);
99 setsize(gren, '0 0 0', '0 0 0');
100
101 gren.nextthink = time + WEP_CVAR_SEC(WEP_HOOK, lifetime);
103 gren.use = W_Hook_Explode2_use;
104 settouch(gren, W_Hook_Touch2);
105
106 gren.takedamage = DAMAGE_YES;
107 SetResourceExplicit(gren, RES_HEALTH, WEP_CVAR_SEC(WEP_HOOK, health));
108 gren.damageforcescale = WEP_CVAR_SEC(WEP_HOOK, damageforcescale);
109 gren.event_damage = W_Hook_Damage;
110 gren.damagedbycontents = true;
112 gren.missile_flags = MIF_SPLASH | MIF_ARC;
113
114 gren.velocity = '0 0 1' * WEP_CVAR_SEC(WEP_HOOK, speed);
116 gren.velocity += actor.velocity;
117
118 gren.gravity = WEP_CVAR_SEC(WEP_HOOK, gravity);
119 //W_SetupProjVelocity_Basic(gren); // just falling down!
120
121 gren.angles = '0 0 0';
122 gren.flags = FL_PROJECTILE;
123 IL_PUSH(g_projectiles, gren);
124 IL_PUSH(g_bot_dodge, gren);
125
126 CSQCProjectile(gren, true, PROJECTILE_HOOKBOMB, true);
127
128 MUTATOR_CALLHOOK(EditProjectile, actor, gren);
129}
130
131METHOD(Hook, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
132{
133 if (fire & 1)
134 {
135 if (!actor.(weaponentity).hook
136 && !(actor.(weaponentity).hook_state & HOOK_WAITING_FOR_RELEASE)
137 && actor.(weaponentity).hook_refire < time
138 && weapon_prepareattack(thiswep, actor, weaponentity, false, -1))
139 {
140 W_DecreaseAmmo(thiswep, actor, thiswep.ammo_factor * WEP_CVAR_PRI(WEP_HOOK, ammo), weaponentity);
141 actor.(weaponentity).hook_state |= HOOK_FIRING;
142 actor.(weaponentity).hook_state |= HOOK_WAITING_FOR_RELEASE;
143 weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(WEP_HOOK, animtime), w_ready);
144 }
145 }
146 else
147 {
148 actor.(weaponentity).hook_state |= HOOK_REMOVING;
149 actor.(weaponentity).hook_state &= ~HOOK_WAITING_FOR_RELEASE;
150 }
151
152 if (fire & 2)
153 if (weapon_prepareattack(thiswep, actor, weaponentity, true, WEP_CVAR_SEC(WEP_HOOK, refire)))
154 {
155 W_Hook_Attack2(thiswep, actor, weaponentity);
156 weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(WEP_HOOK, animtime), w_ready);
157 }
158
159 if (actor.(weaponentity).hook)
160 {
161 // if hooked, no bombs, and increase the timer
162 actor.(weaponentity).hook_refire = max(actor.(weaponentity).hook_refire, time + WEP_CVAR_PRI(WEP_HOOK, refire) * W_WeaponRateFactor(actor));
163
164 // hook also inhibits health regeneration, but only for 1 second
165 if (!(actor.items & IT_UNLIMITED_AMMO))
166 actor.pauseregen_finished = max(actor.pauseregen_finished, time + autocvar_g_balance_pause_fuel_regen);
167 }
168
169 if (actor.(weaponentity).hook && actor.(weaponentity).hook.state == 1)
170 {
171 float hooked_time_max = WEP_CVAR_PRI(WEP_HOOK, hooked_time_max);
172 if (hooked_time_max > 0 && time > actor.(weaponentity).hook_time_hooked + hooked_time_max)
173 actor.(weaponentity).hook_state |= HOOK_REMOVING;
174
175 float hooked_fuel = thiswep.ammo_factor * WEP_CVAR_PRI(WEP_HOOK, hooked_ammo);
176 if (hooked_fuel > 0
177 && time > actor.(weaponentity).hook_time_fueldecrease
178 && !(actor.items & IT_UNLIMITED_AMMO))
179 {
180 if (GetResource(actor, RES_FUEL) >= (time - actor.(weaponentity).hook_time_fueldecrease) * hooked_fuel)
181 {
182 W_DecreaseAmmo(thiswep, actor, (time - actor.(weaponentity).hook_time_fueldecrease) * hooked_fuel, weaponentity);
183 actor.(weaponentity).hook_time_fueldecrease = time;
184 // decrease next frame again
185 }
186 else
187 {
188 SetResource(actor, RES_FUEL, 0);
189 actor.(weaponentity).hook_state |= HOOK_REMOVING;
190 if (actor.(weaponentity).m_weapon != WEP_Null) // offhand
191 W_SwitchWeapon_Force(actor, w_getbestweapon(actor, weaponentity), weaponentity);
192 }
193 }
194 }
195 else
196 {
197 actor.(weaponentity).hook_time_hooked = time;
198 actor.(weaponentity).hook_time_fueldecrease = time + WEP_CVAR_PRI(WEP_HOOK, hooked_time_free);
199 }
200
201 actor.(weaponentity).hook_state = BITSET(actor.(weaponentity).hook_state, HOOK_PULLING, (!PHYS_INPUT_BUTTON_CROUCH(actor) || !autocvar_g_balance_grapplehook_crouchslide));
202
203 if (actor.(weaponentity).hook_state & HOOK_FIRING)
204 {
205 if (actor.(weaponentity).hook)
206 RemoveHook(actor.(weaponentity).hook);
207 FireGrapplingHook(actor, weaponentity);
208 actor.(weaponentity).hook_state &= ~HOOK_FIRING;
209 actor.(weaponentity).hook_refire = max(actor.(weaponentity).hook_refire, time + autocvar_g_balance_grapplehook_refire * W_WeaponRateFactor(actor));
210 }
211 else if (actor.(weaponentity).hook_state & HOOK_REMOVING)
212 {
213 if (actor.(weaponentity).hook)
214 RemoveHook(actor.(weaponentity).hook);
215 actor.(weaponentity).hook_state &= ~HOOK_REMOVING;
216 }
217}
218
219METHOD(Hook, wr_setup, void(entity thiswep, entity actor, .entity weaponentity))
220{
221 actor.(weaponentity).hook_state &= ~HOOK_WAITING_FOR_RELEASE;
222}
223
224METHOD(Hook, wr_checkammo1, bool(Hook thiswep, entity actor, .entity weaponentity))
225{
226 if (!thiswep.ammo_factor)
227 return true;
228 if (actor.(weaponentity).hook)
229 return GetResource(actor, RES_FUEL) > 0;
230
231 return GetResource(actor, RES_FUEL) >= WEP_CVAR_PRI(WEP_HOOK, ammo);
232}
233
234METHOD(Hook, wr_checkammo2, bool(Hook thiswep, entity actor, .entity weaponentity))
235{
236 // infinite ammo for now
237 return true; // actor.ammo_cells >= WEP_CVAR_SEC(WEP_HOOK, ammo); // WEAPONTODO: see above
238}
239
240METHOD(Hook, wr_resetplayer, void(entity thiswep, entity actor))
241{
243 for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
244 {
245 .entity weaponentity = weaponentities[slot];
246 actor.(weaponentity).hook_time = 0;
247 actor.(weaponentity).hook_refire = time;
248 }
249}
250
251METHOD(Hook, wr_killmessage, Notification(entity thiswep))
252{
253 return WEAPON_HOOK_MURDER;
254}
255
256#endif // SVQC
257#ifdef CSQC
258
259METHOD(Hook, wr_impacteffect, void(entity thiswep, entity actor))
260{
261 // the hook bomb uses a negative w_backoff factor because it explodes slightly below the floor, unlike other projectiles
262 vector org2 = w_org + w_backoff * -2;
263 pointparticles(EFFECT_HOOK_EXPLODE, org2, '0 0 0', 1);
264 if (!w_issilent)
265 sound(actor, CH_SHOTS, SND_HOOKBOMB_IMPACT, VOL_BASE, ATTN_NORM);
266}
267
269#include <lib/warpzone/common.qh>
270
272
273void Draw_CylindricLine(vector from, vector to, float thickness, string texture, float aspect, float shift, vector rgb, float theAlpha, float drawflag, vector vieworg);
274
277classfield(Hook) .vector velocity;
278classfield(Hook) .float HookSilent;
279classfield(Hook) .float HookRange;
280
292
295{
296 vector a, b;
297 string tex;
298 vector rgb;
299
300 if (this.teleport_time && time > this.teleport_time)
301 {
302 sound(this, CH_SHOTS_SINGLE, SND_Null, VOL_BASE, ATTEN_NORM); // safeguard
303 this.teleport_time = 0;
304 }
305
307
308 int s = W_GunAlign(viewmodels[this.cnt], STAT(GUNALIGN)) - 1;
309 vector vs = hook_shotorigin[s];
310
311 if (this.owner.sv_entnum == player_localentnum - 1)
312 {
314 a = csqcplayer.origin + csqcplayer.view_ofs;
315 else
316 a = view_origin + view_forward * vs.x + view_right * -vs.y + view_up * vs.z;
317 b = this.origin;
318 }
319 else
320 {
321 a = this.velocity;
322 b = this.origin;
323 }
324
325 int t = entcs_GetTeamColor(this.owner.sv_entnum);
326
327 float intensity = autocvar_cl_grapplehook_alpha;
328 float offset = 0;
329 switch (t)
330 {
331 case NUM_TEAM_1: tex = "particles/hook_red"; rgb = '1 0.3 0.3'; break;
332 case NUM_TEAM_2: tex = "particles/hook_blue"; rgb = '0.3 0.3 1'; break;
333 case NUM_TEAM_3: tex = "particles/hook_yellow"; rgb = '1 1 0.3'; break;
334 case NUM_TEAM_4: tex = "particles/hook_pink"; rgb = '1 0.3 1'; break;
335 default:
336 tex = "particles/hook_white";
337 rgb = entcs_GetColor(this.sv_entnum - 1);
338 break;
339 }
340
341 MUTATOR_CALLHOOK(DrawGrapplingHook, this, tex, rgb, t);
342 tex = M_ARGV(1, string);
343 rgb = M_ARGV(2, vector);
344
351
353
354 if (vdist(trace_endpos - atrans, >, 0.5))
355 {
356 setorigin(this, trace_endpos); // hook endpoint!
357 this.angles = vectoangles(trace_endpos - atrans);
358 this.drawmask = MASK_NORMAL;
359 }
360 else
361 this.drawmask = 0;
362}
363
365{
366 sound(this, CH_SHOTS_SINGLE, SND_Null, VOL_BASE, ATTEN_NORM);
367
368 for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
369 {
370 entity wep = viewmodels[slot];
371 if (wep.hook == this)
372 wep.hook = NULL;
373 }
374}
375
376NET_HANDLE(ENT_CLIENT_HOOK, bool isNew)
377{
378 int sf = ReadByte();
379
380 this.HookSilent = sf & 0x80;
382
384
385 if (sf & 1)
386 {
387 this.sv_entnum = ReadByte();
388 int slot = ReadByte();
389 this.owner = playerslots[this.sv_entnum - 1];
390 if (this.sv_entnum == player_localentnum)
391 viewmodels[slot].hook = this;
392 this.cnt = slot;
393 this.HookRange = 0;
394 }
395 if (sf & 2)
396 {
397 this.origin = ReadVector();
398 setorigin(this, this.origin);
399 }
400 if (sf & 4)
401 this.velocity = ReadVector();
402
404
405 if (isNew || !this.teleport_time)
406 {
407 this.draw = Draw_GrapplingHook;
408 IL_PUSH(g_drawables, this);
409 this.entremove = Remove_GrapplingHook;
410
411 setmodel(this, MDL_HOOK);
412 this.drawmask = MASK_NORMAL;
413 }
414
415 this.teleport_time = time + 10;
416 return true;
417}
418
419// TODO: hook: temporarily transform this.origin for drawing the model along warpzones!
420#endif // CSQC
421#ifdef MENUQC
424
425METHOD(Hook, describe, string(Hook this))
426{
427 TC(Hook, this);
429 PAR(_("The %s is a unique weapon, firing a chain forwards which pulls you in once it latches onto something."), COLORED_NAME(this));
430 PAR(_("The secondary fire usually drops a gravity bomb that affects enemies, also releasing light and smoke sort of like a flashbang."));
431 PAR(_("It usually requires %s ammo to work, consuming it both when initially firing the hook, and after a couple seconds as it reels you in."), COLORED_NAME(ITEM_Fuel));
432 PAR(_("The %s allows reaching previously unreachable places on maps and zooming around the map at high speeds, "
433 "making both surprise ambushes and miraculous escapes possible."), COLORED_NAME(this));
434 PAR(_("It isn't available very often on maps, unless the %s mutator is active, in which all players have it on their offhand, used with %s."), COLORED_NAME(MUTATOR_hook), strcat("^3", _("hook"), "^7"));
435 PAR(W_Guide_Keybinds(this));
436 PAR(W_Guide_DPS_onlySecondary(this.netname, "secondary"));
437 return PAGE_TEXT;
438}
439
440#endif // MENUQC
IntrusiveList g_bot_dodge
Definition api.qh:150
#define MUTATOR_CALLHOOK(id,...)
Definition base.qh:143
#define BITSET(var, mask, flag)
Definition bits.qh:11
float dmg_force
Definition breakable.qc:15
float dmg
Definition breakable.qc:12
float dmg_edge
Definition breakable.qc:13
float dmg_radius
Definition breakable.qc:14
int W_GunAlign(entity this, int preferred_align)
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
entity csqcplayer
Definition cl_player.qh:26
void SetResource(entity e, Resource res_type, float amount)
Sets the current amount of resource the given entity will have.
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
bool SetResourceExplicit(entity e, Resource res_type, float amount)
Sets the resource amount of an entity without calling any hooks.
Definition hook.qh:15
float ammo_factor
Definition hook.qh:37
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
Definition weapon.qh:42
string netname
Definition powerups.qc:20
float lifetime
Definition powerups.qc:23
float cnt
Definition powerups.qc:24
float gravity
Definition items.qh:17
entity playerslots[255]
Definition main.qh:84
IntrusiveList g_drawables
Definition main.qh:91
vector view_origin
Definition main.qh:109
entity owner
Definition main.qh:87
int sv_entnum
Definition main.qh:186
vector view_up
Definition main.qh:109
vector hook_shotorigin[4]
Definition main.qh:205
vector view_right
Definition main.qh:109
vector view_forward
Definition main.qh:109
#define COLORED_NAME(this)
Definition color.qh:195
const int IT_UNLIMITED_AMMO
Definition item.qh:23
float radius
Definition impulse.qh:11
#define setmodel(this, m)
Definition model.qh:26
#define M_ARGV(x, type)
Definition events.qh:17
#define PHYS_INPUT_BUTTON_CROUCH(s)
Definition player.qh:156
float teleport_time
Definition player.qh:218
float W_WeaponRateFactor(entity this)
void Draw_GrapplingHook(entity this)
Definition hook.qc:294
void W_Hook_Explode2(entity this)
Definition hook.qc:44
void W_Hook_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
Definition hook.qc:66
string Draw_GrapplingHook_trace_callback_tex
Definition hook.qc:281
void W_Hook_Explode2_use(entity this, entity actor, entity trigger)
Definition hook.qc:61
float Draw_GrapplingHook_trace_callback_a
Definition hook.qc:284
void Draw_GrapplingHook_trace_callback(vector start, vector hit, vector end)
Definition hook.qc:285
void Remove_GrapplingHook(entity this)
Definition hook.qc:364
vector Draw_GrapplingHook_trace_callback_rgb
Definition hook.qc:283
float autocvar_cl_grapplehook_alpha
Definition hook.qc:271
void Draw_CylindricLine(vector from, vector to, float thickness, string texture, float aspect, float shift, vector rgb, float theAlpha, float drawflag, vector vieworg)
Definition draw.qh:11
void W_Hook_ExplodeThink(entity this)
Definition hook.qc:5
float Draw_GrapplingHook_trace_callback_rnd
Definition hook.qc:282
void W_Hook_Attack2(Weapon thiswep, entity actor,.entity weaponentity)
Definition hook.qc:85
void W_Hook_Touch2(entity this, entity toucher)
Definition hook.qc:79
float dmg_last
Definition hook.qh:93
float hook_refire
Definition hook.qh:94
float hook_time_fueldecrease
Definition hook.qh:96
float hook_time_hooked
Definition hook.qh:95
const int FL_PROJECTILE
Definition constants.qh:85
const float DRAWFLAG_NORMAL
float drawmask
const float MASK_NORMAL
vector velocity
float effects
float time
vector trace_endpos
float nextthink
float player_localentnum
vector origin
const float ATTN_NORM
const float EF_NODRAW
#define use
void CSQCProjectile(entity e, float clientanimate, int type, float docull)
float RadiusDamage(entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float forceintensity, int deathtype,.entity weaponentity, entity directhitentity)
Definition damage.qc:943
IntrusiveList g_damagedbycontents
Definition damage.qh:143
void W_SwitchWeapon_Force(Player this, Weapon w,.entity weaponentity)
Definition selection.qc:237
vector w_org
float damageforcescale
vector w_backoff
float w_issilent
const int HITTYPE_SPAM
Definition all.qh:34
const int HITTYPE_SECONDARY
Definition all.qh:29
float speed
Definition dynlight.qc:9
#define pointparticles(effect, org, vel, howmany)
Definition effect.qh:7
ent angles
Definition ent_cs.qc:121
vector entcs_GetColor(int i)
Definition ent_cs.qh:176
int entcs_GetTeamColor(int i)
Definition ent_cs.qh:125
void InterpolateOrigin_Undo(entity this)
snap origin to iorigin2 (actual origin)
void InterpolateOrigin_Note(entity this)
void InterpolateOrigin_Do(entity this)
set origin based on iorigin1 (old pos), iorigin2 (desired pos), and time
const int IFLAG_VELOCITY
const int IFLAG_ORIGIN
int iflags
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
#define TC(T, sym)
Definition _all.inc:82
#define NET_HANDLE(id, param)
Definition net.qh:15
#define ReadVector()
Definition net.qh:350
int ReadByte()
#define STAT(...)
Definition stats.qh:82
void WarpZone_TraceBox_ThroughZone(vector org, vector mi, vector ma, vector end, float nomonsters, entity forent, entity zone, WarpZone_trace_callback_t cb)
Definition common.qc:212
vector WarpZone_TransformOrigin(entity wz, vector v)
Definition common.qc:509
entity WarpZone_trace_transform
Definition common.qh:37
#define MOVE_NOTHING
Definition common.qh:33
float bound(float min, float value, float max)
float vlen(vector v)
vector vectoangles(vector v)
float min(float f,...)
float max(float f,...)
void set_movetype(entity this, int mt)
Definition movetypes.qc:4
const int MOVETYPE_NONE
Definition movetypes.qh:129
const int MOVETYPE_TOSS
Definition movetypes.qh:135
var void func_null()
string string_null
Definition nil.qh:9
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
entity Notification
always last
Definition all.qh:81
#define entityclass(...)
Definition oo.qh:52
#define METHOD(cname, name, prototype)
Definition oo.qh:269
#define classfield(name)
Definition oo.qh:57
#define NULL
Definition post.qh:14
const int PROJECTILE_HOOKBOMB
float health
Legacy fields for the resources. To be removed.
Definition resources.qh:9
#define w_getbestweapon(ent, wepent)
Definition selection.qh:23
#define setthink(e, f)
vector
Definition self.qh:92
entity entity toucher
Definition self.qh:72
#define settouch(e, f)
Definition self.qh:73
void RemoveHook(entity this)
Definition hook.qc:48
void RemoveGrapplingHooks(entity pl)
Definition hook.qc:30
void FireGrapplingHook(entity actor,.entity weaponentity)
Definition hook.qc:311
const float HOOK_PULLING
Definition hook.qh:29
const float HOOK_WAITING_FOR_RELEASE
Definition hook.qh:31
const float HOOK_FIRING
Definition hook.qh:27
bool autocvar_g_balance_grapplehook_crouchslide
Definition hook.qh:16
float hook_time
Definition hook.qh:24
const float HOOK_REMOVING
Definition hook.qh:28
int hook_state
Definition hook.qh:32
float autocvar_g_balance_grapplehook_refire
Definition hook.qh:12
float W_CheckProjectileDamage(entity inflictor, entity projowner, int deathtype, float exception)
Definition common.qc:45
void W_PrepareExplosionByDamage(entity this, entity attacker, void(entity this) explode)
Definition common.qc:87
void adaptor_think2use_hittype_splash(entity this)
Definition common.qc:106
const int MIF_SPLASH
Definition common.qh:46
int projectiledeathtype
Definition common.qh:21
#define PROJECTILE_TOUCH(e, t)
Definition common.qh:28
IntrusiveList g_projectiles
Definition common.qh:58
const int MIF_ARC
Definition common.qh:47
#define PROJECTILE_MAKETRIGGER(e)
Definition common.qh:34
const float VOL_BASE
Definition sound.qh:36
const int CH_SHOTS
Definition sound.qh:14
const int CH_WEAPON_A
Definition sound.qh:7
const int CH_SHOTS_SINGLE
Definition sound.qh:15
const float ATTEN_NORM
Definition sound.qh:30
#define sound(e, c, s, v, a)
Definition sound.qh:52
#define PAGE_TEXT
Definition string.qh:642
#define PAR(...)
Adds an individually translatable paragraph to PAGE_TEXT without having to deal with strcat and sprin...
Definition string.qh:648
#define PAGE_TEXT_INIT()
Definition string.qh:641
const int DAMAGE_YES
Definition subs.qh:80
float autocvar_g_balance_pause_fuel_regen
float ammo
Definition sv_turrets.qh:43
const int NUM_TEAM_2
Definition teams.qh:14
const int NUM_TEAM_4
Definition teams.qh:16
const int NUM_TEAM_3
Definition teams.qh:15
const int NUM_TEAM_1
Definition teams.qh:13
entity realowner
int autocvar_g_projectiles_newton_style
Definition tracing.qh:11
vector w_shotorg
Definition tracing.qh:19
#define W_SetupShot(ent, wepent, antilag, recoil, snd, chan, maxdamage, deathtype)
Definition tracing.qh:34
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
Definition vector.qh:8
int autocvar_chase_active
Definition view.qh:17
entity viewmodels[MAX_WEAPONSLOTS]
Definition view.qh:108
string W_Guide_Keybinds(Weapon wep)
Definition all.qc:824
string W_Guide_DPS_onlySecondary(string name, string sec)
Definition all.qc:946
#define WEP_CVAR_PRI(wep, name)
Definition all.qh:338
#define WEP_CVAR_SEC(wep, name)
Definition all.qh:339
const int MAX_WEAPONSLOTS
Definition weapon.qh:16
entity weaponentities[MAX_WEAPONSLOTS]
Definition weapon.qh:17
void W_DecreaseAmmo(Weapon wep, entity actor, float ammo_use,.entity weaponentity)
void weapon_thinkf(entity actor,.entity weaponentity, WFRAME fr, float t, void(Weapon thiswep, entity actor,.entity weaponentity, int fire) func)
bool weapon_prepareattack(Weapon thiswep, entity actor,.entity weaponentity, bool secondary, float attacktime)
void w_ready(Weapon thiswep, entity actor,.entity weaponentity, int fire)
entity weaponentity_fld