Xonotic
hook.qc
Go to the documentation of this file.
1 #include "hook.qh"
2 
3 #ifdef SVQC
4 
5 void W_Hook_ExplodeThink(entity this)
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 
25 void W_Hook_Explode2(entity this)
26 {
27  this.event_damage = func_null;
28  settouch(this, func_null);
29  this.effects |= EF_NODRAW;
30 
31  setthink(this, W_Hook_ExplodeThink);
32  this.nextthink = time;
33  this.dmg = WEP_CVAR_SEC(hook, damage);
34  this.dmg_edge = WEP_CVAR_SEC(hook, edgedamage);
36  this.dmg_force = WEP_CVAR_SEC(hook, force);
37  this.dmg_power = WEP_CVAR_SEC(hook, power);
38  this.dmg_duration = WEP_CVAR_SEC(hook, duration);
39  this.teleport_time = time;
40  this.dmg_last = 1;
42 }
43 
44 void W_Hook_Explode2_use(entity this, entity actor, entity trigger)
45 {
46  W_Hook_Explode2(this);
47 }
48 
49 void 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 
58 
59  if(GetResource(this, RES_HEALTH) <= 0)
60  W_PrepareExplosionByDamage(this, this.realowner, W_Hook_Explode2);
61 }
62 
63 void W_Hook_Touch2(entity this, entity toucher)
64 {
65  PROJECTILE_TOUCH(this, toucher);
66  this.use(this, NULL, NULL);
67 }
68 
69 void W_Hook_Attack2(Weapon thiswep, entity actor, .entity weaponentity)
70 {
71  //W_DecreaseAmmo(thiswep, actor, WEP_CVAR_SEC(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(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(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(hook, lifetime);
87  gren.use = W_Hook_Explode2_use;
88  settouch(gren, W_Hook_Touch2);
89 
90  gren.takedamage = DAMAGE_YES;
92  gren.damageforcescale = WEP_CVAR_SEC(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(hook, speed);
100  gren.velocity = gren.velocity + actor.velocity;
101 
102  gren.gravity = WEP_CVAR_SEC(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 
115 METHOD(Hook, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
116 {
117  if (fire & 1) {
118  if(!actor.(weaponentity).hook)
119  if(!(actor.(weaponentity).hook_state & HOOK_WAITING_FOR_RELEASE))
120  if(time > actor.(weaponentity).hook_refire)
121  if(weapon_prepareattack(thiswep, actor, weaponentity, false, -1))
122  {
123  W_DecreaseAmmo(thiswep, actor, thiswep.ammo_factor * WEP_CVAR_PRI(hook, ammo), weaponentity);
124  actor.(weaponentity).hook_state |= HOOK_FIRING;
125  actor.(weaponentity).hook_state |= HOOK_WAITING_FOR_RELEASE;
126  weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(hook, animtime), w_ready);
127  }
128  } else {
129  actor.(weaponentity).hook_state |= HOOK_REMOVING;
130  actor.(weaponentity).hook_state &= ~HOOK_WAITING_FOR_RELEASE;
131  }
132 
133  if(fire & 2)
134  {
135  if(weapon_prepareattack(thiswep, actor, weaponentity, true, WEP_CVAR_SEC(hook, refire)))
136  {
137  W_Hook_Attack2(thiswep, actor, weaponentity);
138  weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(hook, animtime), w_ready);
139  }
140  }
141 
142  if(actor.(weaponentity).hook)
143  {
144  // if hooked, no bombs, and increase the timer
145  actor.(weaponentity).hook_refire = max(actor.(weaponentity).hook_refire, time + WEP_CVAR_PRI(hook, refire) * W_WeaponRateFactor(actor));
146 
147  // hook also inhibits health regeneration, but only for 1 second
148  if(!(actor.items & IT_UNLIMITED_AMMO))
149  actor.pauseregen_finished = max(actor.pauseregen_finished, time + autocvar_g_balance_pause_fuel_regen);
150  }
151 
152  if(actor.(weaponentity).hook && actor.(weaponentity).hook.state == 1)
153  {
154  float hooked_time_max = WEP_CVAR_PRI(hook, hooked_time_max);
155  if(hooked_time_max > 0)
156  {
157  if( time > actor.(weaponentity).hook_time_hooked + hooked_time_max )
158  actor.(weaponentity).hook_state |= HOOK_REMOVING;
159  }
160 
161  float hooked_fuel = thiswep.ammo_factor * WEP_CVAR_PRI(hook, hooked_ammo);
162  if(hooked_fuel > 0)
163  {
164  if( time > actor.(weaponentity).hook_time_fueldecrease )
165  {
166  if(!(actor.items & IT_UNLIMITED_AMMO))
167  {
168  if( GetResource(actor, RES_FUEL) >= (time - actor.(weaponentity).hook_time_fueldecrease) * hooked_fuel )
169  {
170  W_DecreaseAmmo(thiswep, actor, (time - actor.(weaponentity).hook_time_fueldecrease) * hooked_fuel, weaponentity);
171  actor.(weaponentity).hook_time_fueldecrease = time;
172  // decrease next frame again
173  }
174  else
175  {
176  SetResource(actor, RES_FUEL, 0);
177  actor.(weaponentity).hook_state |= HOOK_REMOVING;
178  if(actor.(weaponentity).m_weapon != WEP_Null) // offhand
179  W_SwitchWeapon_Force(actor, w_getbestweapon(actor, weaponentity), weaponentity);
180  }
181  }
182  }
183  }
184  }
185  else
186  {
187  actor.(weaponentity).hook_time_hooked = time;
188  actor.(weaponentity).hook_time_fueldecrease = time + WEP_CVAR_PRI(hook, hooked_time_free);
189  }
190 
191  actor.(weaponentity).hook_state = BITSET(actor.(weaponentity).hook_state, HOOK_PULLING, (!PHYS_INPUT_BUTTON_CROUCH(actor) || !autocvar_g_balance_grapplehook_crouchslide));
192 
193  if (actor.(weaponentity).hook_state & HOOK_FIRING)
194  {
195  if (actor.(weaponentity).hook)
196  RemoveHook(actor.(weaponentity).hook);
197  FireGrapplingHook(actor, weaponentity);
198  actor.(weaponentity).hook_state &= ~HOOK_FIRING;
199  actor.(weaponentity).hook_refire = max(actor.(weaponentity).hook_refire, time + autocvar_g_balance_grapplehook_refire * W_WeaponRateFactor(actor));
200  }
201  else if (actor.(weaponentity).hook_state & HOOK_REMOVING)
202  {
203  if (actor.(weaponentity).hook)
204  RemoveHook(actor.(weaponentity).hook);
205  actor.(weaponentity).hook_state &= ~HOOK_REMOVING;
206  }
207 }
208 METHOD(Hook, wr_setup, void(entity thiswep, entity actor, .entity weaponentity))
209 {
210  actor.(weaponentity).hook_state &= ~HOOK_WAITING_FOR_RELEASE;
211 }
212 METHOD(Hook, wr_checkammo1, bool(Hook thiswep, entity actor, .entity weaponentity))
213 {
214  if (!thiswep.ammo_factor) return true;
215 
216  if(actor.(weaponentity).hook)
217  return GetResource(actor, RES_FUEL) > 0;
218 
219  return GetResource(actor, RES_FUEL) >= WEP_CVAR_PRI(hook, ammo);
220 }
221 METHOD(Hook, wr_checkammo2, bool(Hook thiswep, entity actor, .entity weaponentity))
222 {
223  // infinite ammo for now
224  return true; // actor.ammo_cells >= WEP_CVAR_SEC(hook, ammo); // WEAPONTODO: see above
225 }
226 METHOD(Hook, wr_resetplayer, void(entity thiswep, entity actor))
227 {
228  RemoveGrapplingHooks(actor);
229  for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
230  {
231  .entity weaponentity = weaponentities[slot];
232  actor.(weaponentity).hook_time = 0;
233  actor.(weaponentity).hook_refire = time;
234  }
235 }
236 METHOD(Hook, wr_killmessage, Notification(entity thiswep))
237 {
238  return WEAPON_HOOK_MURDER;
239 }
240 
241 #endif
242 #ifdef CSQC
243 
244 METHOD(Hook, wr_impacteffect, void(entity thiswep, entity actor))
245 {
246  vector org2;
247  org2 = w_org + w_backoff * 2;
248  pointparticles(EFFECT_HOOK_EXPLODE, org2, '0 0 0', 1);
249  if(!w_issilent)
250  sound(actor, CH_SHOTS, SND_HOOKBOMB_IMPACT, VOL_BASE, ATTN_NORM);
251 }
252 
253 #endif
254 
255 #ifdef CSQC
257 #include <lib/warpzone/common.qh>
258 
259 float autocvar_cl_grapplehook_alpha = 1;
260 
261 void Draw_CylindricLine(vector from, vector to, float thickness, string texture, float aspect, float shift, vector rgb, float theAlpha, float drawflag, vector vieworg);
262 
264 classfield(Hook) .entity HookType; // ENT_CLIENT_*
265 classfield(Hook) .vector origin;
266 classfield(Hook) .vector velocity;
267 classfield(Hook) .float HookSilent;
268 classfield(Hook) .float HookRange;
269 
270 string Draw_GrapplingHook_trace_callback_tex;
271 float Draw_GrapplingHook_trace_callback_rnd;
272 vector Draw_GrapplingHook_trace_callback_rgb;
273 float Draw_GrapplingHook_trace_callback_a;
274 void Draw_GrapplingHook_trace_callback(vector start, vector hit, vector end)
275 {
276  float i;
277  vector vorg;
279  for(i = 0; i < Draw_GrapplingHook_trace_callback_a; ++i)
280  Draw_CylindricLine(hit, start, 8, Draw_GrapplingHook_trace_callback_tex, 0.25, Draw_GrapplingHook_trace_callback_rnd, Draw_GrapplingHook_trace_callback_rgb, min(1, Draw_GrapplingHook_trace_callback_a - i), DRAWFLAG_NORMAL, vorg);
281  Draw_GrapplingHook_trace_callback_rnd += 0.25 * vlen(hit - start) / 8;
282 }
283 
285 void Draw_GrapplingHook(entity this)
286 {
287  vector a, b, atrans;
288  string tex;
289  vector rgb;
290  float t;
291  vector vs;
292  float intensity, offset;
293 
294  if(this.teleport_time)
295  if(time > this.teleport_time)
296  {
297  sound (this, CH_SHOTS_SINGLE, SND_Null, VOL_BASE, ATTEN_NORM); // safeguard
298  this.teleport_time = 0;
299  }
300 
301  InterpolateOrigin_Do(this);
302 
303  int s = W_GunAlign(viewmodels[this.cnt], STAT(GUNALIGN)) - 1;
304 
305  switch(this.HookType)
306  {
307  default:
308  case NET_ENT_CLIENT_HOOK:
309  vs = hook_shotorigin[s];
310  break;
311  case NET_ENT_CLIENT_ARC_BEAM:
312  vs = lightning_shotorigin[s];
313  break;
314  }
315 
316  if((this.owner.sv_entnum == player_localentnum - 1))
317  {
318  switch(this.HookType)
319  {
320  default:
321  case NET_ENT_CLIENT_HOOK:
323  a = csqcplayer.origin + csqcplayer.view_ofs;
324  else
325  a = view_origin + view_forward * vs.x + view_right * -vs.y + view_up * vs.z;
326  b = this.origin;
327  break;
328  case NET_ENT_CLIENT_ARC_BEAM:
329  if(this.HookRange)
330  b = view_origin + view_forward * this.HookRange;
331  else
332  b = view_origin + view_forward * vlen(this.velocity - this.origin); // honor original length of beam!
335  a = view_origin + view_forward * vs.x + view_right * -vs.y + view_up * vs.z;
336  break;
337  }
338  }
339  else
340  {
341  switch(this.HookType)
342  {
343  default:
344  case NET_ENT_CLIENT_HOOK:
345  a = this.velocity;
346  b = this.origin;
347  break;
348  case NET_ENT_CLIENT_ARC_BEAM:
349  a = this.origin;
350  b = this.velocity;
351  break;
352  }
353  }
354 
355  t = entcs_GetTeamColor(this.owner.sv_entnum);
356 
357  switch(this.HookType)
358  {
359  default:
360  case NET_ENT_CLIENT_HOOK:
361  intensity = autocvar_cl_grapplehook_alpha;
362  offset = 0;
363  switch(t)
364  {
365  case NUM_TEAM_1: tex = "particles/hook_red"; rgb = '1 0.3 0.3'; break;
366  case NUM_TEAM_2: tex = "particles/hook_blue"; rgb = '0.3 0.3 1'; break;
367  case NUM_TEAM_3: tex = "particles/hook_yellow"; rgb = '1 1 0.3'; break;
368  case NUM_TEAM_4: tex = "particles/hook_pink"; rgb = '1 0.3 1'; break;
369  default: tex = "particles/hook_white"; rgb = entcs_GetColor(this.sv_entnum - 1); break;
370  }
371  break;
372  case NET_ENT_CLIENT_ARC_BEAM: // todo
373  intensity = bound(0.2, 1 + Noise_Pink(this, frametime) * 1 + Noise_Burst(this, frametime, 0.03) * 0.3, 2);
374  offset = Noise_Brown(this, frametime) * 10;
375  tex = "particles/lgbeam";
376  rgb = '1 1 1';
377  break;
378  }
379 
380  MUTATOR_CALLHOOK(DrawGrapplingHook, this, tex, rgb, t);
381  tex = M_ARGV(1, string);
382  rgb = M_ARGV(2, vector);
383 
384  Draw_GrapplingHook_trace_callback_tex = tex;
385  Draw_GrapplingHook_trace_callback_rnd = offset;
386  Draw_GrapplingHook_trace_callback_rgb = rgb;
387  Draw_GrapplingHook_trace_callback_a = intensity;
388  WarpZone_TraceBox_ThroughZone(a, '0 0 0', '0 0 0', b, ((this.HookType == NET_ENT_CLIENT_HOOK) ? MOVE_NOTHING : MOVE_NORMAL), NULL, NULL, Draw_GrapplingHook_trace_callback);
389  Draw_GrapplingHook_trace_callback_tex = string_null;
390 
392 
393  switch(this.HookType)
394  {
395  default:
396  case NET_ENT_CLIENT_HOOK:
397  if(vdist(trace_endpos - atrans, >, 0.5))
398  {
399  setorigin(this, trace_endpos); // hook endpoint!
400  this.angles = vectoangles(trace_endpos - atrans);
401  this.drawmask = MASK_NORMAL;
402  }
403  else
404  {
405  this.drawmask = 0;
406  }
407  break;
408  case NET_ENT_CLIENT_ARC_BEAM:
409  setorigin(this, a); // beam origin!
410  break;
411  }
412 
413  switch(this.HookType)
414  {
415  default:
416  case NET_ENT_CLIENT_HOOK:
417  break;
418  case NET_ENT_CLIENT_ARC_BEAM:
419  pointparticles(EFFECT_ARC_LIGHTNING2, trace_endpos, normalize(atrans - trace_endpos), frametime * intensity); // todo: new effect
420  break;
421  }
422 }
423 
424 void Remove_GrapplingHook(entity this)
425 {
426  sound (this, CH_SHOTS_SINGLE, SND_Null, VOL_BASE, ATTEN_NORM);
427 
428  for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
429  {
430  entity wep = viewmodels[slot];
431  if(wep.hook == this)
432  wep.hook = NULL;
433  }
434 }
435 
436 NET_HANDLE(ENT_CLIENT_HOOK, bool bIsNew)
437 {
438  this.HookType = NET_ENT_CLIENT_HOOK;
439 
440  int sf = ReadByte();
441 
442  this.HookSilent = (sf & 0x80);
444 
446 
447  if(sf & 1)
448  {
449  int myowner = ReadByte();
450  int slot = ReadByte();
451  this.owner = playerslots[myowner - 1];
452  this.sv_entnum = myowner;
453  if(myowner == player_localentnum)
454  viewmodels[slot].hook = this;
455  this.cnt = slot;
456  switch(this.HookType)
457  {
458  default:
459  case NET_ENT_CLIENT_HOOK:
460  this.HookRange = 0;
461  break;
462  case NET_ENT_CLIENT_ARC_BEAM:
463  this.HookRange = ReadCoord();
464  break;
465  }
466  }
467  if(sf & 2)
468  {
469  this.origin = ReadVector();
470  setorigin(this, this.origin);
471  }
472  if(sf & 4)
473  {
474  this.velocity = ReadVector();
475  }
476 
478 
479  if(bIsNew || !this.teleport_time)
480  {
481  this.draw = Draw_GrapplingHook;
482  IL_PUSH(g_drawables, this);
483  this.entremove = Remove_GrapplingHook;
484 
485  switch(this.HookType)
486  {
487  default:
488  case NET_ENT_CLIENT_HOOK:
489  // for the model
490  setmodel(this, MDL_HOOK);
491  this.drawmask = MASK_NORMAL;
492  break;
493  case NET_ENT_CLIENT_ARC_BEAM:
494  sound (this, CH_SHOTS_SINGLE, SND_LGBEAM_FLY, VOL_BASE, ATTEN_NORM);
495  break;
496  }
497  }
498 
499  this.teleport_time = time + 10;
500  return true;
501 }
502 
503 // TODO: hook: temporarily transform this.origin for drawing the model along warpzones!
504 #endif
#define WEP_CVAR_PRI(wepname, name)
Definition: all.qh:300
void InterpolateOrigin_Note(entity this)
Definition: interpolate.qc:37
float MOVETYPE_NONE
Definition: progsdefs.qc:246
#define WEP_CVAR_SEC(wepname, name)
Definition: all.qh:301
#define PHYS_INPUT_BUTTON_CROUCH(s)
Definition: player.qh:150
float hook_time
Definition: hook.qh:24
const int HITTYPE_BOUNCE
Definition: all.qh:28
string string_null
Definition: nil.qh:9
const int NUM_TEAM_2
Definition: teams.qh:19
float dmg_radius
Definition: damage.qh:40
int iflags
Definition: interpolate.qh:26
entity hook
Definition: hook.qh:19
float speed
Definition: subs.qh:41
vector w_shotorg
Definition: tracing.qh:18
void W_SwitchWeapon_Force(Player this, Weapon w,.entity weaponentity)
Definition: selection.qc:243
#define PROJECTILE_MAKETRIGGER(e)
Definition: common.qh:29
void InterpolateOrigin_Undo(entity this)
snap origin to iorigin2 (actual origin)
Definition: interpolate.qc:159
bool SetResourceExplicit(entity e, Resource res_type, float amount)
Sets the resource amount of an entity without calling any hooks.
Definition: cl_resources.qc:15
const int MIF_ARC
Definition: common.qh:35
const int MIF_SPLASH
Definition: common.qh:34
#define w_getbestweapon(ent, wepent)
Definition: selection.qh:23
vector lightning_shotorigin[4]
Definition: main.qh:178
float MOVETYPE_TOSS
Definition: progsdefs.qc:252
#define MOVE_NOTHING
Definition: common.qh:33
float teleport_time
Definition: player.qh:212
float W_CheckProjectileDamage(entity inflictor, entity projowner, int deathtype, float exception)
Definition: common.qc:49
float damageforcescale
Definition: damage.qh:137
entity viewmodels[MAX_WEAPONSLOTS]
Definition: view.qh:104
IntrusiveList g_damagedbycontents
Definition: damage.qh:155
entity() spawn
vector WarpZone_TransformOrigin(entity wz, vector v)
Definition: common.qc:499
int sv_entnum
Definition: main.qh:155
const float MOVE_NORMAL
Definition: csprogsdefs.qc:252
void w_ready(Weapon thiswep, entity actor,.entity weaponentity, int fire)
float radius
Definition: impulse.qh:11
vector view_origin
Definition: main.qh:93
vector hook_shotorigin[4]
Definition: main.qh:177
ERASEABLE float Noise_Brown(entity e, float dt)
Definition: noise.qh:12
#define classfield(name)
Definition: oo.qh:52
#define NET_HANDLE(id, param)
Definition: net.qh:12
float dmg
Definition: platforms.qh:6
entity weaponentity_fld
Definition: weaponsystem.qh:27
entity to
Definition: self.qh:96
vector view_forward
Definition: main.qh:93
origin
Definition: ent_cs.qc:114
float autocvar_g_balance_pause_fuel_regen
Definition: sv_resources.qh:33
entity playerslots[255]
Definition: main.qh:70
int W_GunAlign(entity this, int preferred_align)
#define METHOD(cname, name, prototype)
Definition: oo.qh:257
void CSQCProjectile(entity e, float clientanimate, int type, float docull)
float effects
Definition: csprogsdefs.qc:111
entity owner
Definition: main.qh:73
int autocvar_g_projectiles_newton_style
Definition: tracing.qh:11
IntrusiveList g_bot_dodge
Definition: api.qh:150
vector WarpZone_UnTransformOrigin(entity wz, vector v)
Definition: common.qc:535
ERASEABLE float Noise_Burst(entity e, float dt, float p)
+1 or -1
Definition: noise.qh:35
#define PROJECTILE_TOUCH(e, t)
Definition: common.qh:27
const int IFLAG_VELOCITY
Definition: interpolate.qh:27
#define setmodel(this, m)
Definition: model.qh:26
const float ATTN_NORM
Definition: csprogsdefs.qc:226
RES_HEALTH
Definition: ent_cs.qc:126
const float EF_NODRAW
Definition: csprogsdefs.qc:305
float ammo
Definition: sv_turrets.qh:44
vector view_up
Definition: main.qh:93
float lifetime
Definition: powerups.qc:23
float dmg_edge
Definition: damage.qh:38
float cnt
Definition: powerups.qc:24
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
const int CH_WEAPON_A
Definition: sound.qh:7
void SetResource(entity e, Resource res_type, float amount)
Sets the current amount of resource the given entity will have.
Definition: cl_resources.qc:26
const int MAX_WEAPONSLOTS
Definition: weapon.qh:13
bool weapon_prepareattack(Weapon thiswep, entity actor,.entity weaponentity, bool secondary, float attacktime)
void W_PrepareExplosionByDamage(entity this, entity attacker, void(entity this) explode)
Definition: common.qc:91
const float HOOK_PULLING
Definition: hook.qh:30
#define pointparticles
Definition: csprogsdefs.qh:13
#define NULL
Definition: post.qh:17
float frametime
Definition: csprogsdefs.qc:17
const float DRAWFLAG_NORMAL
Definition: csprogsdefs.qc:317
float dmg_force
Definition: damage.qh:39
const float VOL_BASE
Definition: sound.qh:36
vector trace_endpos
Definition: csprogsdefs.qc:37
vector view_right
Definition: main.qh:93
const int HITTYPE_SECONDARY
Definition: all.qh:25
#define W_SetupShot(ent, wepent, antilag, recoil, snd, chan, maxdamage, deathtype)
Definition: tracing.qh:33
const float MASK_NORMAL
Definition: csprogsdefs.qc:164
#define M_ARGV(x, type)
Definition: events.qh:17
float drawmask
Definition: csprogsdefs.qc:95
const float ATTEN_NORM
Definition: sound.qh:30
float nextthink
Definition: csprogsdefs.qc:121
float player_localentnum
Definition: csprogsdefs.qc:19
#define BITSET(var, mask, flag)
Definition: bits.qh:11
const int CH_SHOTS
Definition: sound.qh:14
float autocvar_g_balance_grapplehook_refire
Definition: hook.qh:12
void RemoveGrapplingHooks(entity pl)
Definition: hook.qc:78
vector(float skel, float bonenum) _skel_get_boneabs_hidden
entity WarpZone_trace_transform
Definition: common.qh:37
const float HOOK_FIRING
Definition: hook.qh:28
float gravity
Definition: items.qh:16
const float HOOK_REMOVING
Definition: hook.qh:29
const int NUM_TEAM_4
Definition: teams.qh:21
void FireGrapplingHook(entity actor,.entity weaponentity)
Definition: hook.qc:364
IntrusiveList g_projectiles
Definition: common.qh:46
const float HOOK_WAITING_FOR_RELEASE
Definition: hook.qh:32
const int IFLAG_ORIGIN
Definition: interpolate.qh:36
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
Definition: cl_resources.qc:10
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
Definition: vector.qh:8
void WarpZone_TraceLine(vector org, vector end, float nomonsters, entity forent)
Definition: common.qc:338
entity Notification
always last
Definition: all.qh:82
float health
Definition: progsdefs.qc:137
bool autocvar_g_balance_grapplehook_crouchslide
Definition: hook.qh:16
void weapon_thinkf(entity actor,.entity weaponentity, WFRAME fr, float t, void(Weapon thiswep, entity actor,.entity weaponentity, int fire) func)
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:1057
entity realowner
Definition: common.qh:25
#define MUTATOR_CALLHOOK(id,...)
Definition: base.qh:140
entity weaponentities[MAX_WEAPONSLOTS]
Definition: weapon.qh:14
setorigin(ent, v)
#define setthink(e, f)
vector angles
Definition: csprogsdefs.qc:104
void adaptor_think2use_hittype_splash(entity this)
Definition: common.qc:110
const int NUM_TEAM_1
Definition: teams.qh:18
entity csqcplayer
Definition: cl_player.qh:26
#define use
Definition: csprogsdefs.qh:50
const int CH_SHOTS_SINGLE
Definition: sound.qh:15
void W_DecreaseAmmo(Weapon wep, entity actor, float ammo_use,.entity weaponentity)
int autocvar_chase_active
Definition: view.qh:17
#define sound(e, c, s, v, a)
Definition: sound.qh:52
ERASEABLE float Noise_Pink(entity e, float dt)
Definition: noise.qh:18
#define entityclass(...)
Definition: oo.qh:47
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
Definition: weapon.qh:41
float time
Definition: csprogsdefs.qc:16
vector velocity
Definition: csprogsdefs.qc:103
float hook_state
Definition: hook.qh:33
float W_WeaponRateFactor(entity this)
Definition: weaponsystem.qc:33
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:202
void InterpolateOrigin_Do(entity this)
set origin based on iorigin1 (old pos), iorigin2 (desired pos), and time
Definition: interpolate.qc:129
IntrusiveList g_drawables
Definition: main.qh:77
void set_movetype(entity this, int mt)
float ammo_factor
Definition: hook.qh:21
const int PROJECTILE_HOOKBOMB
Definition: projectiles.qh:17
var void func_null()
void RemoveHook(entity this)
Definition: hook.qc:96
const int NUM_TEAM_3
Definition: teams.qh:20
Definition: hook.qh:3
float DAMAGE_YES
Definition: progsdefs.qc:283
int projectiledeathtype
Definition: common.qh:20