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, dmg_remaining_next, f;
8
9 dt = time - this.teleport_time;
10 dmg_remaining_next = (bound(0, 1 - dt / this.dmg_duration, 1) ** this.dmg_power);
11
12 f = this.dmg_last - dmg_remaining_next;
13 this.dmg_last = dmg_remaining_next;
14
15 RadiusDamage(this, this.realowner, this.dmg * f, this.dmg_edge * f, this.dmg_radius, this.realowner, NULL, this.dmg_force * f, this.projectiledeathtype, this.weaponentity_fld, NULL);
17 //RadiusDamage(this, NULL, this.dmg * f, this.dmg_edge * f, this.dmg_radius, NULL, NULL, this.dmg_force * f, this.projectiledeathtype, NULL);
18
19 if(dt < this.dmg_duration)
20 this.nextthink = time + 0.05; // soon
21 else
22 delete(this);
23}
24
26{
27 this.event_damage = func_null;
28 settouch(this, func_null);
29 this.effects |= EF_NODRAW;
30
32 this.nextthink = time;
33 this.dmg = WEP_CVAR_SEC(WEP_HOOK, damage);
34 this.dmg_edge = WEP_CVAR_SEC(WEP_HOOK, edgedamage);
35 this.dmg_radius = WEP_CVAR_SEC(WEP_HOOK, radius);
36 this.dmg_force = WEP_CVAR_SEC(WEP_HOOK, force);
37 this.dmg_power = WEP_CVAR_SEC(WEP_HOOK, power);
38 this.dmg_duration = WEP_CVAR_SEC(WEP_HOOK, duration);
39 this.teleport_time = time;
40 this.dmg_last = 1;
42}
43
44void W_Hook_Explode2_use(entity this, entity actor, entity trigger)
45{
46 W_Hook_Explode2(this);
47}
48
49void W_Hook_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force)
50{
51 if(GetResource(this, RES_HEALTH) <= 0)
52 return;
53
54 if(!W_CheckProjectileDamage(inflictor.realowner, this.realowner, deathtype, -1)) // no exceptions
55 return; // g_projectiles_damage says to halt
56
57 SetResourceExplicit(this, RES_HEALTH, GetResource(this, RES_HEALTH));
58
59 if(GetResource(this, RES_HEALTH) <= 0)
61}
62
64{
66 this.use(this, NULL, NULL);
67}
68
69void W_Hook_Attack2(Weapon thiswep, entity actor, .entity weaponentity)
70{
71 //W_DecreaseAmmo(thiswep, actor, WEP_CVAR_SEC(WEP_HOOK, ammo)); // WEAPONTODO: Figure out how to handle ammo with hook secondary (gravitybomb)
72 W_SetupShot(actor, weaponentity, false, 4, SND_HOOKBOMB_FIRE, CH_WEAPON_A, WEP_CVAR_SEC(WEP_HOOK, damage), WEP_HOOK.m_id | HITTYPE_SECONDARY);
73
74 entity gren = new(hookbomb);
75 gren.owner = gren.realowner = actor;
76 gren.bot_dodge = true;
77 gren.bot_dodgerating = WEP_CVAR_SEC(WEP_HOOK, damage);
80 gren.projectiledeathtype = WEP_HOOK.m_id | HITTYPE_SECONDARY;
81 gren.weaponentity_fld = weaponentity;
82 setorigin(gren, w_shotorg);
83 setsize(gren, '0 0 0', '0 0 0');
84
85 gren.nextthink = time + WEP_CVAR_SEC(WEP_HOOK, lifetime);
87 gren.use = W_Hook_Explode2_use;
89
90 gren.takedamage = DAMAGE_YES;
91 SetResourceExplicit(gren, RES_HEALTH, WEP_CVAR_SEC(WEP_HOOK, health));
92 gren.damageforcescale = WEP_CVAR_SEC(WEP_HOOK, damageforcescale);
93 gren.event_damage = W_Hook_Damage;
94 gren.damagedbycontents = true;
96 gren.missile_flags = MIF_SPLASH | MIF_ARC;
97
98 gren.velocity = '0 0 1' * WEP_CVAR_SEC(WEP_HOOK, speed);
100 gren.velocity = gren.velocity + actor.velocity;
101
102 gren.gravity = WEP_CVAR_SEC(WEP_HOOK, gravity);
103 //W_SetupProjVelocity_Basic(gren); // just falling down!
104
105 gren.angles = '0 0 0';
106 gren.flags = FL_PROJECTILE;
107 IL_PUSH(g_projectiles, gren);
108 IL_PUSH(g_bot_dodge, gren);
109
110 CSQCProjectile(gren, true, PROJECTILE_HOOKBOMB, true);
111
112 MUTATOR_CALLHOOK(EditProjectile, actor, gren);
113}
114
115METHOD(Hook, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
116{
117 if (fire & 1)
118 {
119 if(!actor.(weaponentity).hook)
120 if(!(actor.(weaponentity).hook_state & HOOK_WAITING_FOR_RELEASE))
121 if(time > actor.(weaponentity).hook_refire)
122 if(weapon_prepareattack(thiswep, actor, weaponentity, false, -1))
123 {
124 W_DecreaseAmmo(thiswep, actor, thiswep.ammo_factor * WEP_CVAR_PRI(WEP_HOOK, ammo), weaponentity);
125 actor.(weaponentity).hook_state |= HOOK_FIRING;
126 actor.(weaponentity).hook_state |= HOOK_WAITING_FOR_RELEASE;
127 weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(WEP_HOOK, animtime), w_ready);
128 }
129 }
130 else
131 {
132 actor.(weaponentity).hook_state |= HOOK_REMOVING;
133 actor.(weaponentity).hook_state &= ~HOOK_WAITING_FOR_RELEASE;
134 }
135
136 if(fire & 2)
137 {
138 if(weapon_prepareattack(thiswep, actor, weaponentity, true, WEP_CVAR_SEC(WEP_HOOK, refire)))
139 {
140 W_Hook_Attack2(thiswep, actor, weaponentity);
141 weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(WEP_HOOK, animtime), w_ready);
142 }
143 }
144
145 if(actor.(weaponentity).hook)
146 {
147 // if hooked, no bombs, and increase the timer
148 actor.(weaponentity).hook_refire = max(actor.(weaponentity).hook_refire, time + WEP_CVAR_PRI(WEP_HOOK, refire) * W_WeaponRateFactor(actor));
149
150 // hook also inhibits health regeneration, but only for 1 second
151 if(!(actor.items & IT_UNLIMITED_AMMO))
152 actor.pauseregen_finished = max(actor.pauseregen_finished, time + autocvar_g_balance_pause_fuel_regen);
153 }
154
155 if(actor.(weaponentity).hook && actor.(weaponentity).hook.state == 1)
156 {
157 float hooked_time_max = WEP_CVAR_PRI(WEP_HOOK, hooked_time_max);
158 if(hooked_time_max > 0)
159 {
160 if(time > actor.(weaponentity).hook_time_hooked + hooked_time_max)
161 actor.(weaponentity).hook_state |= HOOK_REMOVING;
162 }
163
164 float hooked_fuel = thiswep.ammo_factor * WEP_CVAR_PRI(WEP_HOOK, hooked_ammo);
165 if(hooked_fuel > 0)
166 {
167 if(time > actor.(weaponentity).hook_time_fueldecrease)
168 {
169 if(!(actor.items & IT_UNLIMITED_AMMO))
170 {
171 if(GetResource(actor, RES_FUEL) >= (time - actor.(weaponentity).hook_time_fueldecrease) * hooked_fuel)
172 {
173 W_DecreaseAmmo(thiswep, actor, (time - actor.(weaponentity).hook_time_fueldecrease) * hooked_fuel, weaponentity);
174 actor.(weaponentity).hook_time_fueldecrease = time;
175 // decrease next frame again
176 }
177 else
178 {
179 SetResource(actor, RES_FUEL, 0);
180 actor.(weaponentity).hook_state |= HOOK_REMOVING;
181 if(actor.(weaponentity).m_weapon != WEP_Null) // offhand
182 W_SwitchWeapon_Force(actor, w_getbestweapon(actor, weaponentity), weaponentity);
183 }
184 }
185 }
186 }
187 }
188 else
189 {
190 actor.(weaponentity).hook_time_hooked = time;
191 actor.(weaponentity).hook_time_fueldecrease = time + WEP_CVAR_PRI(WEP_HOOK, hooked_time_free);
192 }
193
194 actor.(weaponentity).hook_state = BITSET(actor.(weaponentity).hook_state, HOOK_PULLING, (!PHYS_INPUT_BUTTON_CROUCH(actor) || !autocvar_g_balance_grapplehook_crouchslide));
195
196 if (actor.(weaponentity).hook_state & HOOK_FIRING)
197 {
198 if (actor.(weaponentity).hook)
199 RemoveHook(actor.(weaponentity).hook);
200 FireGrapplingHook(actor, weaponentity);
201 actor.(weaponentity).hook_state &= ~HOOK_FIRING;
202 actor.(weaponentity).hook_refire = max(actor.(weaponentity).hook_refire, time + autocvar_g_balance_grapplehook_refire * W_WeaponRateFactor(actor));
203 }
204 else if (actor.(weaponentity).hook_state & HOOK_REMOVING)
205 {
206 if (actor.(weaponentity).hook)
207 RemoveHook(actor.(weaponentity).hook);
208 actor.(weaponentity).hook_state &= ~HOOK_REMOVING;
209 }
210}
211
212METHOD(Hook, wr_setup, void(entity thiswep, entity actor, .entity weaponentity))
213{
214 actor.(weaponentity).hook_state &= ~HOOK_WAITING_FOR_RELEASE;
215}
216
217METHOD(Hook, wr_checkammo1, bool(Hook thiswep, entity actor, .entity weaponentity))
218{
219 if (!thiswep.ammo_factor) return true;
220
221 if(actor.(weaponentity).hook)
222 return GetResource(actor, RES_FUEL) > 0;
223
224 return GetResource(actor, RES_FUEL) >= WEP_CVAR_PRI(WEP_HOOK, ammo);
225}
226
227METHOD(Hook, wr_checkammo2, bool(Hook thiswep, entity actor, .entity weaponentity))
228{
229 // infinite ammo for now
230 return true; // actor.ammo_cells >= WEP_CVAR_SEC(WEP_HOOK, ammo); // WEAPONTODO: see above
231}
232
233METHOD(Hook, wr_resetplayer, void(entity thiswep, entity actor))
234{
236 for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
237 {
238 .entity weaponentity = weaponentities[slot];
239 actor.(weaponentity).hook_time = 0;
240 actor.(weaponentity).hook_refire = time;
241 }
242}
243
244METHOD(Hook, wr_killmessage, Notification(entity thiswep))
245{
246 return WEAPON_HOOK_MURDER;
247}
248
249#endif
250#ifdef CSQC
251
252METHOD(Hook, wr_impacteffect, void(entity thiswep, entity actor))
253{
254 // the hook bomb uses a negative w_backoff factor because it explodes slightly below the floor, unlike other projectiles
255 vector org2 = w_org + w_backoff * -2;
256 pointparticles(EFFECT_HOOK_EXPLODE, org2, '0 0 0', 1);
257 if(!w_issilent)
258 sound(actor, CH_SHOTS, SND_HOOKBOMB_IMPACT, VOL_BASE, ATTN_NORM);
259}
260
261#endif
262
263#ifdef CSQC
265#include <lib/warpzone/common.qh>
266
268
269void Draw_CylindricLine(vector from, vector to, float thickness, string texture, float aspect, float shift, vector rgb, float theAlpha, float drawflag, vector vieworg);
270
273classfield(Hook) .vector velocity;
274classfield(Hook) .float HookSilent;
275classfield(Hook) .float HookRange;
276
290
293{
294 vector a, b;
295 string tex;
296 vector rgb;
297
298 if(this.teleport_time)
299 if(time > this.teleport_time)
300 {
301 sound (this, CH_SHOTS_SINGLE, SND_Null, VOL_BASE, ATTEN_NORM); // safeguard
302 this.teleport_time = 0;
303 }
304
306
307 int s = W_GunAlign(viewmodels[this.cnt], STAT(GUNALIGN)) - 1;
308 vector vs = hook_shotorigin[s];
309
310 if((this.owner.sv_entnum == player_localentnum - 1))
311 {
313 a = csqcplayer.origin + csqcplayer.view_ofs;
314 else
315 a = view_origin + view_forward * vs.x + view_right * -vs.y + view_up * vs.z;
316 b = this.origin;
317 }
318 else
319 {
320 a = this.velocity;
321 b = this.origin;
322 }
323
324 int t = entcs_GetTeamColor(this.owner.sv_entnum);
325
326 float intensity = autocvar_cl_grapplehook_alpha;
327 float offset = 0;
328 switch(t)
329 {
330 case NUM_TEAM_1: tex = "particles/hook_red"; rgb = '1 0.3 0.3'; break;
331 case NUM_TEAM_2: tex = "particles/hook_blue"; rgb = '0.3 0.3 1'; break;
332 case NUM_TEAM_3: tex = "particles/hook_yellow"; rgb = '1 1 0.3'; break;
333 case NUM_TEAM_4: tex = "particles/hook_pink"; rgb = '1 0.3 1'; break;
334 default: tex = "particles/hook_white"; rgb = entcs_GetColor(this.sv_entnum - 1); break;
335 }
336
337 MUTATOR_CALLHOOK(DrawGrapplingHook, this, tex, rgb, t);
338 tex = M_ARGV(1, string);
339 rgb = M_ARGV(2, vector);
340
347
349
350 if(vdist(trace_endpos - atrans, >, 0.5))
351 {
352 setorigin(this, trace_endpos); // hook endpoint!
353 this.angles = vectoangles(trace_endpos - atrans);
354 this.drawmask = MASK_NORMAL;
355 }
356 else
357 {
358 this.drawmask = 0;
359 }
360}
361
363{
364 sound (this, CH_SHOTS_SINGLE, SND_Null, VOL_BASE, ATTEN_NORM);
365
366 for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
367 {
368 entity wep = viewmodels[slot];
369 if(wep.hook == this)
370 wep.hook = NULL;
371 }
372}
373
374NET_HANDLE(ENT_CLIENT_HOOK, bool bIsNew)
375{
376 int sf = ReadByte();
377
378 this.HookSilent = (sf & 0x80);
380
382
383 if(sf & 1)
384 {
385 int myowner = ReadByte();
386 int slot = ReadByte();
387 this.owner = playerslots[myowner - 1];
388 this.sv_entnum = myowner;
389 if(myowner == player_localentnum)
390 viewmodels[slot].hook = this;
391 this.cnt = slot;
392 this.HookRange = 0;
393 }
394 if(sf & 2)
395 {
396 this.origin = ReadVector();
397 setorigin(this, this.origin);
398 }
399 if(sf & 4)
400 {
401 this.velocity = ReadVector();
402 }
403
405
406 if(bIsNew || !this.teleport_time)
407 {
408 this.draw = Draw_GrapplingHook;
409 IL_PUSH(g_drawables, this);
410 this.entremove = Remove_GrapplingHook;
411
412 setmodel(this, MDL_HOOK);
413 this.drawmask = MASK_NORMAL;
414 }
415
416 this.teleport_time = time + 10;
417 return true;
418}
419
420// TODO: hook: temporarily transform this.origin for drawing the model along warpzones!
421#endif
422#ifdef MENUQC
425
426METHOD(Hook, describe, string(Hook this))
427{
428 TC(Hook, this);
430 PAR(_("The %s is a unique weapon, firing a chain forwards which pulls you in once it latches onto something."), COLORED_NAME(this));
431 PAR(_("The secondary fire usually drops a gravity bomb that affects enemies, also releasing light and smoke sort of like a flashbang."));
432 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));
433 PAR(_("The %s allows reaching previously unreachable places on maps and zooming around the map at high speeds, "
434 "making both surprise ambushes and miraculous escapes possible."), COLORED_NAME(this));
435 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"));
436 PAR(W_Guide_Keybinds(this));
437 PAR(W_Guide_DPS_onlySecondary(this.netname, "secondary"));
438 return PAGE_TEXT;
439}
440
441#endif
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:33
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
Definition weapon.qh:44
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:154
float teleport_time
Definition player.qh:216
float W_WeaponRateFactor(entity this)
void Draw_GrapplingHook(entity this)
Definition hook.qc:292
void W_Hook_Explode2(entity this)
Definition hook.qc:25
void W_Hook_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
Definition hook.qc:49
string Draw_GrapplingHook_trace_callback_tex
Definition hook.qc:277
void W_Hook_Explode2_use(entity this, entity actor, entity trigger)
Definition hook.qc:44
float Draw_GrapplingHook_trace_callback_a
Definition hook.qc:280
void Draw_GrapplingHook_trace_callback(vector start, vector hit, vector end)
Definition hook.qc:281
void Remove_GrapplingHook(entity this)
Definition hook.qc:362
vector Draw_GrapplingHook_trace_callback_rgb
Definition hook.qc:279
float autocvar_cl_grapplehook_alpha
Definition hook.qc:267
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:278
void W_Hook_Attack2(Weapon thiswep, entity actor,.entity weaponentity)
Definition hook.qc:69
void W_Hook_Touch2(entity this, entity toucher)
Definition hook.qc:63
float dmg_power
Definition hook.qh:89
float dmg_last
Definition hook.qh:91
float hook_refire
Definition hook.qh:92
float hook_time_fueldecrease
Definition hook.qh:94
float dmg_duration
Definition hook.qh:90
float hook_time_hooked
Definition hook.qh:93
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:981
IntrusiveList g_damagedbycontents
Definition damage.qh:135
void W_SwitchWeapon_Force(Player this, Weapon w,.entity weaponentity)
Definition selection.qc:246
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:367
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:319
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:643
#define PAR(...)
Adds an individually translatable paragraph to PAGE_TEXT without having to deal with strcat and sprin...
Definition string.qh:649
#define PAGE_TEXT_INIT()
Definition string.qh:642
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:836
string W_Guide_DPS_onlySecondary(string name, string sec)
Definition all.qc:958
#define WEP_CVAR_PRI(wep, name)
Definition all.qh:322
#define WEP_CVAR_SEC(wep, name)
Definition all.qh:323
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