Xonotic
hagar.qc
Go to the documentation of this file.
1 #include "hagar.qh"
2 
3 #ifdef SVQC
4 
5 // NO bounce protection, as bounces are limited!
6 
7 void W_Hagar_Explode(entity this, entity directhitentity)
8 {
9  this.event_damage = func_null;
10  RadiusDamage(this, this.realowner, WEP_CVAR_PRI(hagar, damage), WEP_CVAR_PRI(hagar, edgedamage), WEP_CVAR_PRI(hagar, radius), NULL, NULL, WEP_CVAR_PRI(hagar, force), this.projectiledeathtype, this.weaponentity_fld, directhitentity);
11 
12  delete(this);
13 }
14 
15 void W_Hagar_Explode_use(entity this, entity actor, entity trigger)
16 {
17  W_Hagar_Explode(this, trigger);
18 }
19 
20 void W_Hagar_Explode2(entity this, entity directhitentity)
21 {
22  this.event_damage = func_null;
23  RadiusDamage(this, this.realowner, WEP_CVAR_SEC(hagar, damage), WEP_CVAR_SEC(hagar, edgedamage), WEP_CVAR_SEC(hagar, radius), NULL, NULL, WEP_CVAR_SEC(hagar, force), this.projectiledeathtype, this.weaponentity_fld, directhitentity);
24 
25  delete(this);
26 }
27 
28 void W_Hagar_Explode2_use(entity this, entity actor, entity trigger)
29 {
30  W_Hagar_Explode2(this, trigger);
31 }
32 
33 void W_Hagar_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force)
34 {
35  if(GetResource(this, RES_HEALTH) <= 0)
36  return;
37 
38  float is_linkexplode = ( ((inflictor.owner != NULL) ? (inflictor.owner == this.owner) : true)
39  && (inflictor.projectiledeathtype & HITTYPE_SECONDARY)
41 
42  if(is_linkexplode)
43  is_linkexplode = (is_linkexplode && WEP_CVAR_SEC(hagar, load_linkexplode));
44  else
45  is_linkexplode = -1; // not secondary load, so continue as normal without exception.
46 
47  if(!W_CheckProjectileDamage(inflictor.realowner, this.realowner, deathtype, is_linkexplode))
48  return; // g_projectiles_damage says to halt
49 
50  TakeResource(this, RES_HEALTH, damage);
51  this.angles = vectoangles(this.velocity);
52 
53  if(GetResource(this, RES_HEALTH) <= 0)
54  W_PrepareExplosionByDamage(this, attacker, getthink(this));
55 }
56 
57 void W_Hagar_Touch(entity this, entity toucher)
58 {
59  PROJECTILE_TOUCH(this, toucher);
60  this.use(this, NULL, toucher);
61 }
62 
63 void W_Hagar_Touch2(entity this, entity toucher)
64 {
65  PROJECTILE_TOUCH(this, toucher);
66 
67  if(this.cnt > 0 || toucher.takedamage == DAMAGE_AIM) {
68  this.use(this, NULL, toucher);
69  } else {
70  this.cnt++;
71  Send_Effect(EFFECT_HAGAR_BOUNCE, this.origin, this.velocity, 1);
72  this.angles = vectoangles(this.velocity);
73  this.owner = NULL;
75  }
76 }
77 
78 void W_Hagar_Attack(Weapon thiswep, entity actor, .entity weaponentity)
79 {
80  entity missile;
81 
82  W_DecreaseAmmo(thiswep, actor, WEP_CVAR_PRI(hagar, ammo), weaponentity);
83 
84  W_SetupShot(actor, weaponentity, false, 2, SND_HAGAR_FIRE, CH_WEAPON_A, WEP_CVAR_PRI(hagar, damage), thiswep.m_id);
85 
86  W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir);
87 
88  missile = new(missile);
89  missile.owner = missile.realowner = actor;
90  missile.bot_dodge = true;
91  missile.bot_dodgerating = WEP_CVAR_PRI(hagar, damage);
92 
93  missile.takedamage = DAMAGE_YES;
95  missile.damageforcescale = WEP_CVAR_PRI(hagar, damageforcescale);
96  missile.event_damage = W_Hagar_Damage;
97  missile.damagedbycontents = true;
98  IL_PUSH(g_damagedbycontents, missile);
99 
100  settouch(missile, W_Hagar_Touch);
101  missile.use = W_Hagar_Explode_use;
103  missile.nextthink = time + WEP_CVAR_PRI(hagar, lifetime);
104  PROJECTILE_MAKETRIGGER(missile);
105  missile.projectiledeathtype = thiswep.m_id;
106  missile.weaponentity_fld = weaponentity;
107  setorigin(missile, w_shotorg);
108  setsize(missile, '0 0 0', '0 0 0');
109 
110  set_movetype(missile, MOVETYPE_FLY);
111  W_SetupProjVelocity_PRI(missile, hagar);
112 
113  missile.angles = vectoangles(missile.velocity);
114  missile.flags = FL_PROJECTILE;
115  IL_PUSH(g_projectiles, missile);
116  IL_PUSH(g_bot_dodge, missile);
117  missile.missile_flags = MIF_SPLASH;
118 
119  CSQCProjectile(missile, true, PROJECTILE_HAGAR, true);
120 
121  MUTATOR_CALLHOOK(EditProjectile, actor, missile);
122 }
123 
124 void W_Hagar_Attack2(Weapon thiswep, entity actor, .entity weaponentity)
125 {
126  entity missile;
127 
128  W_DecreaseAmmo(thiswep, actor, WEP_CVAR_SEC(hagar, ammo), weaponentity);
129 
130  W_SetupShot(actor, weaponentity, false, 2, SND_HAGAR_FIRE, CH_WEAPON_A, WEP_CVAR_SEC(hagar, damage), thiswep.m_id | HITTYPE_SECONDARY);
131 
132  W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir);
133 
134  missile = new(missile);
135  missile.owner = missile.realowner = actor;
136  missile.bot_dodge = true;
137  missile.bot_dodgerating = WEP_CVAR_SEC(hagar, damage);
138 
139  missile.takedamage = DAMAGE_YES;
141  missile.damageforcescale = WEP_CVAR_SEC(hagar, damageforcescale);
142  missile.event_damage = W_Hagar_Damage;
143  missile.damagedbycontents = true;
144  IL_PUSH(g_damagedbycontents, missile);
145 
146  settouch(missile, W_Hagar_Touch2);
147  missile.cnt = 0;
148  missile.use = W_Hagar_Explode2_use;
150  missile.nextthink = time + WEP_CVAR_SEC(hagar, lifetime_min) + random() * WEP_CVAR_SEC(hagar, lifetime_rand);
151  PROJECTILE_MAKETRIGGER(missile);
152  missile.projectiledeathtype = thiswep.m_id | HITTYPE_SECONDARY;
153  missile.weaponentity_fld = weaponentity;
154  setorigin(missile, w_shotorg);
155  setsize(missile, '0 0 0', '0 0 0');
156 
158  W_SetupProjVelocity_SEC(missile, hagar);
159 
160  missile.angles = vectoangles(missile.velocity);
161  missile.flags = FL_PROJECTILE;
162  IL_PUSH(g_projectiles, missile);
163  IL_PUSH(g_bot_dodge, missile);
164  missile.missile_flags = MIF_SPLASH;
165 
166  CSQCProjectile(missile, true, PROJECTILE_HAGAR_BOUNCING, true);
167 
168  MUTATOR_CALLHOOK(EditProjectile, actor, missile);
169 }
170 
171 .float hagar_loadstep, hagar_loadblock, hagar_loadbeep, hagar_warning;
172 void W_Hagar_Attack2_Load_Release(Weapon thiswep, entity actor, .entity weaponentity)
173 {
174  // time to release the rockets we've loaded
175 
176  entity missile;
177  float counter, shots, spread_pershot;
178  vector s;
179  vector forward, right, up;
180 
181  if(!actor.(weaponentity).hagar_load)
182  return;
183 
184  weapon_prepareattack_do(actor, weaponentity, true, WEP_CVAR_SEC(hagar, refire));
185 
186  shots = actor.(weaponentity).hagar_load;
187  W_SetupShot(actor, weaponentity, false, 2, SND_HAGAR_FIRE, CH_WEAPON_A, WEP_CVAR_SEC(hagar, damage) * shots, thiswep.m_id | HITTYPE_SECONDARY);
188  W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir);
189 
190  forward = v_forward;
191  right = v_right;
192  up = v_up;
193 
194  missile = NULL;
195  for(counter = 0; counter < shots; ++counter)
196  {
197  missile = new(missile);
198  missile.owner = missile.realowner = actor;
199  missile.bot_dodge = true;
200  missile.bot_dodgerating = WEP_CVAR_SEC(hagar, damage);
201 
202  missile.takedamage = DAMAGE_YES;
204  missile.damageforcescale = WEP_CVAR_SEC(hagar, damageforcescale);
205  missile.event_damage = W_Hagar_Damage;
206  missile.damagedbycontents = true;
207  IL_PUSH(g_damagedbycontents, missile);
208 
209  settouch(missile, W_Hagar_Touch); // not bouncy
210  missile.use = W_Hagar_Explode2_use;
212  missile.nextthink = time + WEP_CVAR_SEC(hagar, lifetime_min) + random() * WEP_CVAR_SEC(hagar, lifetime_rand);
213  PROJECTILE_MAKETRIGGER(missile);
214  missile.projectiledeathtype = thiswep.m_id | HITTYPE_SECONDARY;
215  missile.weaponentity_fld = weaponentity;
216  setorigin(missile, w_shotorg);
217  setsize(missile, '0 0 0', '0 0 0');
218  set_movetype(missile, MOVETYPE_FLY);
219  missile.missile_flags = MIF_SPLASH;
220 
221  // per-shot spread calculation: the more shots there are, the less spread is applied (based on the bias cvar)
222  spread_pershot = ((shots - 1) / (WEP_CVAR_SEC(hagar, load_max) - 1));
223  spread_pershot = (1 - (spread_pershot * WEP_CVAR_SEC(hagar, load_spread_bias)));
224  spread_pershot = (WEP_CVAR_SEC(hagar, spread) * spread_pershot * autocvar_g_weaponspreadfactor);
225 
226  // pattern spread calculation
227  s = '0 0 0';
228  if(counter == 0)
229  s = '0 0 0';
230  else
231  {
232  makevectors('0 360 0' * (0.75 + (counter - 0.5) / (shots - 1)));
233  s.y = v_forward.x;
234  s.z = v_forward.y;
235  }
236  s = s * WEP_CVAR_SEC(hagar, load_spread) * autocvar_g_weaponspreadfactor;
237 
238  W_SetupProjVelocity_Explicit(missile, w_shotdir + right * s.y + up * s.z, v_up, WEP_CVAR_SEC(hagar, speed), 0, 0, spread_pershot, false);
239 
240  missile.angles = vectoangles(missile.velocity);
241  missile.flags = FL_PROJECTILE;
242  IL_PUSH(g_projectiles, missile);
243  IL_PUSH(g_bot_dodge, missile);
244 
245  CSQCProjectile(missile, true, PROJECTILE_HAGAR, true);
246 
247  MUTATOR_CALLHOOK(EditProjectile, actor, missile);
248  }
249 
250  weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(hagar, load_animtime), w_ready);
251  actor.(weaponentity).hagar_loadstep = time + WEP_CVAR_SEC(hagar, refire) * W_WeaponRateFactor(actor);
252  actor.(weaponentity).hagar_load = 0;
253 }
254 
255 void W_Hagar_Attack2_Load(Weapon thiswep, entity actor, .entity weaponentity)
256 {
257  // loadable hagar secondary attack, must always run each frame
258  if(time < game_starttime || time < actor.race_penalty || timeout_status == TIMEOUT_ACTIVE)
259  return;
260  if (weaponUseForbidden(actor))
261  return;
262 
263  bool loaded = actor.(weaponentity).hagar_load >= WEP_CVAR_SEC(hagar, load_max);
264 
265  // this is different than WR_CHECKAMMO when it comes to reloading
266  bool enough_ammo;
267  if(actor.items & IT_UNLIMITED_AMMO)
268  enough_ammo = true;
269  else if(autocvar_g_balance_hagar_reload_ammo)
270  enough_ammo = actor.(weaponentity).(weapon_load[thiswep.m_id]) >= WEP_CVAR_SEC(hagar, ammo);
271  else
272  enough_ammo = GetResource(actor, thiswep.ammo_type) >= WEP_CVAR_SEC(hagar, ammo);
273 
274  bool stopped = loaded || !enough_ammo;
275 
276  if(PHYS_INPUT_BUTTON_ATCK2(actor))
277  {
278  if(PHYS_INPUT_BUTTON_ATCK(actor) && WEP_CVAR_SEC(hagar, load_abort))
279  {
280  if(actor.(weaponentity).hagar_load)
281  {
282  // if we pressed primary fire while loading, unload all rockets and abort
283  actor.(weaponentity).state = WS_READY;
284  W_DecreaseAmmo(thiswep, actor, WEP_CVAR_SEC(hagar, ammo) * actor.(weaponentity).hagar_load * -1, weaponentity); // give back ammo
285  actor.(weaponentity).hagar_load = 0;
286  sound(actor, CH_WEAPON_A, SND_HAGAR_BEEP, VOL_BASE, ATTN_NORM);
287 
288  // pause until we can load rockets again, once we re-press the alt fire button
289  actor.(weaponentity).hagar_loadstep = time + WEP_CVAR_SEC(hagar, load_speed) * W_WeaponRateFactor(actor);
290 
291  // require letting go of the alt fire button before we can load again
292  actor.(weaponentity).hagar_loadblock = true;
293  }
294  }
295  else
296  {
297  // check if we can attempt to load another rocket
298  if(!stopped)
299  {
300  if(!actor.(weaponentity).hagar_loadblock && actor.(weaponentity).hagar_loadstep < time)
301  {
302  W_DecreaseAmmo(thiswep, actor, WEP_CVAR_SEC(hagar, ammo), weaponentity);
303  actor.(weaponentity).state = WS_INUSE;
304  actor.(weaponentity).hagar_load += 1;
305  sound(actor, CH_WEAPON_B, SND_HAGAR_LOAD, VOL_BASE * 0.8, ATTN_NORM); // sound is too loud according to most
306 
307  if(actor.(weaponentity).hagar_load >= WEP_CVAR_SEC(hagar, load_max))
308  stopped = true;
309  else
310  actor.(weaponentity).hagar_loadstep = time + WEP_CVAR_SEC(hagar, load_speed) * W_WeaponRateFactor(actor);
311  }
312  }
313  if(stopped && !actor.(weaponentity).hagar_loadbeep && actor.(weaponentity).hagar_load) // prevents the beep from playing each frame
314  {
315  // if this is the last rocket we can load, play a beep sound to notify the player
316  sound(actor, CH_WEAPON_A, SND_HAGAR_BEEP, VOL_BASE, ATTN_NORM);
317  actor.(weaponentity).hagar_loadbeep = true;
318  actor.(weaponentity).hagar_loadstep = time + WEP_CVAR_SEC(hagar, load_hold) * W_WeaponRateFactor(actor);
319  }
320  }
321  }
322  else if(actor.(weaponentity).hagar_loadblock)
323  {
324  // the alt fire button has been released, so re-enable loading if blocked
325  actor.(weaponentity).hagar_loadblock = false;
326  }
327 
328  if(actor.(weaponentity).hagar_load)
329  {
330  // play warning sound if we're about to release
331  if(stopped && actor.(weaponentity).hagar_loadstep - 0.5 < time && WEP_CVAR_SEC(hagar, load_hold) >= 0)
332  {
333  if(!actor.(weaponentity).hagar_warning) // prevents the beep from playing each frame
334  {
335  // we're about to automatically release after holding time, play a beep sound to notify the player
336  sound(actor, CH_WEAPON_A, SND_HAGAR_BEEP, VOL_BASE, ATTN_NORM);
337  actor.(weaponentity).hagar_warning = true;
338  }
339  }
340 
341  // release if player let go of button or if they've held it in too long
342  if(!PHYS_INPUT_BUTTON_ATCK2(actor) || (stopped && actor.(weaponentity).hagar_loadstep < time && WEP_CVAR_SEC(hagar, load_hold) >= 0))
343  {
344  actor.(weaponentity).state = WS_READY;
345  W_Hagar_Attack2_Load_Release(thiswep, actor, weaponentity);
346  }
347  }
348  else
349  {
350  actor.(weaponentity).hagar_loadbeep = false;
351  actor.(weaponentity).hagar_warning = false;
352 
353  // we aren't checking ammo during an attack, so we must do it here
354  if(!(thiswep.wr_checkammo1(thiswep, actor, weaponentity) + thiswep.wr_checkammo2(thiswep, actor, weaponentity)))
355  if(!(actor.items & IT_UNLIMITED_AMMO))
356  {
357  // note: this doesn't force the switch
358  W_SwitchToOtherWeapon(actor, weaponentity);
359  return;
360  }
361  }
362 }
363 
364 void W_Hagar_Attack_Auto(Weapon thiswep, entity actor, .entity weaponentity, int fire)
365 {
366  if(!(fire & 1) || actor.(weaponentity).hagar_load || actor.(weaponentity).hagar_loadblock || actor.(weaponentity).m_switchweapon != thiswep || !weapon_prepareattack_check(thiswep, actor, weaponentity, false, -1))
367  {
368  w_ready(thiswep, actor, weaponentity, fire);
369  return;
370  }
371 
372  if(!thiswep.wr_checkammo1(thiswep, actor, weaponentity))
373  if(!(actor.items & IT_UNLIMITED_AMMO))
374  {
375  W_SwitchWeapon_Force(actor, w_getbestweapon(actor, weaponentity), weaponentity);
376  w_ready(thiswep, actor, weaponentity, fire);
377  return;
378  }
379 
380  W_Hagar_Attack(thiswep, actor, weaponentity);
381 
382  ATTACK_FINISHED(actor, weaponentity) = time + WEP_CVAR_PRI(hagar, refire) * W_WeaponRateFactor(actor);
383  actor.(weaponentity).wframe = WFRAME_FIRE1;
384  weapon_thinkf(actor, weaponentity, WFRAME_DONTCHANGE, WEP_CVAR_PRI(hagar, refire), W_Hagar_Attack_Auto);
385 }
386 
387 METHOD(Hagar, wr_aim, void(entity thiswep, entity actor, .entity weaponentity))
388 {
389  if(random()>0.15)
390  PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, weaponentity, WEP_CVAR_PRI(hagar, speed), 0, WEP_CVAR_PRI(hagar, lifetime), false);
391  else // not using secondary_speed since these are only 15% and should cause some ricochets without re-aiming
392  PHYS_INPUT_BUTTON_ATCK2(actor) = bot_aim(actor, weaponentity, WEP_CVAR_PRI(hagar, speed), 0, WEP_CVAR_PRI(hagar, lifetime), false);
393 }
394 METHOD(Hagar, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
395 {
396  float loadable_secondary;
397  loadable_secondary = (WEP_CVAR_SEC(hagar, load) && WEP_CVAR(hagar, secondary));
398 
399  if(loadable_secondary)
400  W_Hagar_Attack2_Load(thiswep, actor, weaponentity); // must always run each frame
401  if(autocvar_g_balance_hagar_reload_ammo && actor.(weaponentity).clip_load < min(WEP_CVAR_PRI(hagar, ammo), WEP_CVAR_SEC(hagar, ammo))) { // forced reload
402  thiswep.wr_reload(thiswep, actor, weaponentity);
403  }
404  else if((fire & 1) && !actor.(weaponentity).hagar_load && !actor.(weaponentity).hagar_loadblock) // not while secondary is loaded or awaiting reset
405  {
406  if(weapon_prepareattack(thiswep, actor, weaponentity, false, 0))
407  W_Hagar_Attack_Auto(thiswep, actor, weaponentity, fire);
408  }
409  else if((fire & 2) && !loadable_secondary && WEP_CVAR(hagar, secondary))
410  {
411  if(weapon_prepareattack(thiswep, actor, weaponentity, true, WEP_CVAR_SEC(hagar, refire)))
412  {
413  W_Hagar_Attack2(thiswep, actor, weaponentity);
414  weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(hagar, refire), w_ready);
415  }
416  }
417 }
418 METHOD(Hagar, wr_gonethink, void(entity thiswep, entity actor, .entity weaponentity))
419 {
420  // we lost the weapon and want to prepare switching away
421  if(actor.(weaponentity).hagar_load)
422  {
423  actor.(weaponentity).state = WS_READY;
424  W_Hagar_Attack2_Load_Release(thiswep, actor, weaponentity);
425  }
426 }
427 METHOD(Hagar, wr_setup, void(entity thiswep, entity actor, .entity weaponentity))
428 {
429  actor.(weaponentity).hagar_loadblock = false;
430  if(actor.(weaponentity).hagar_load)
431  {
432  W_DecreaseAmmo(thiswep, actor, WEP_CVAR_SEC(hagar, ammo) * actor.(weaponentity).hagar_load * -1, weaponentity); // give back ammo if necessary
433  actor.(weaponentity).hagar_load = 0;
434  }
435 }
436 METHOD(Hagar, wr_checkammo1, bool(entity thiswep, entity actor, .entity weaponentity))
437 {
438  float ammo_amount = GetResource(actor, thiswep.ammo_type) >= WEP_CVAR_PRI(hagar, ammo);
439  ammo_amount += actor.(weaponentity).(weapon_load[thiswep.m_id]) >= WEP_CVAR_PRI(hagar, ammo);
440  return ammo_amount;
441 }
442 METHOD(Hagar, wr_checkammo2, bool(entity thiswep, entity actor, .entity weaponentity))
443 {
444  float ammo_amount = GetResource(actor, thiswep.ammo_type) >= WEP_CVAR_SEC(hagar, ammo);
445  ammo_amount += actor.(weaponentity).(weapon_load[thiswep.m_id]) >= WEP_CVAR_SEC(hagar, ammo);
446  return ammo_amount;
447 }
448 METHOD(Hagar, wr_resetplayer, void(entity thiswep, entity actor))
449 {
450  for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
451  {
452  .entity weaponentity = weaponentities[slot];
453  actor.(weaponentity).hagar_load = 0;
454  }
455 }
456 METHOD(Hagar, wr_playerdeath, void(entity thiswep, entity actor, .entity weaponentity))
457 {
458  // if we have any rockets loaded when we die, release them
459  if(actor.(weaponentity).hagar_load && WEP_CVAR_SEC(hagar, load_releasedeath))
460  W_Hagar_Attack2_Load_Release(thiswep, actor, weaponentity);
461 }
462 METHOD(Hagar, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
463 {
464  if(!actor.(weaponentity).hagar_load) // require releasing loaded rockets first
465  W_Reload(actor, weaponentity, min(WEP_CVAR_PRI(hagar, ammo), WEP_CVAR_SEC(hagar, ammo)), SND_RELOAD);
466 }
467 METHOD(Hagar, wr_suicidemessage, Notification(entity thiswep))
468 {
469  return WEAPON_HAGAR_SUICIDE;
470 }
471 METHOD(Hagar, wr_killmessage, Notification(entity thiswep))
472 {
474  return WEAPON_HAGAR_MURDER_BURST;
475  else
476  return WEAPON_HAGAR_MURDER_SPRAY;
477 }
478 
479 #endif
480 #ifdef CSQC
481 
482 METHOD(Hagar, wr_impacteffect, void(entity thiswep, entity actor))
483 {
484  vector org2;
485  org2 = w_org + w_backoff * 6;
486  pointparticles(EFFECT_HAGAR_EXPLODE, org2, '0 0 0', 1);
487  if(!w_issilent)
488  {
489  if(w_random<0.15)
490  sound(actor, CH_SHOTS, SND_HAGEXP1, VOL_BASE, ATTN_NORM);
491  else if(w_random<0.7)
492  sound(actor, CH_SHOTS, SND_HAGEXP2, VOL_BASE, ATTN_NORM);
493  else
494  sound(actor, CH_SHOTS, SND_HAGEXP3, VOL_BASE, ATTN_NORM);
495  }
496 }
497 
498 #endif
float state
Definition: subs.qh:32
#define WEP_CVAR_PRI(wepname, name)
Definition: all.qh:300
#define PHYS_INPUT_BUTTON_ATCK2(s)
Definition: player.qh:148
int hagar_load
Definition: wepent.qh:13
bool bot_aim(entity this,.entity weaponentity, float shotspeed, float shotspeedupward, float maxshottime, float applygravity)
#define WEP_CVAR_SEC(wepname, name)
Definition: all.qh:301
float weapon_load[REGISTRY_MAX(Weapons)]
Definition: weaponsystem.qh:29
const int HITTYPE_BOUNCE
Definition: all.qh:28
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
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
#define getthink(e)
const int MIF_SPLASH
Definition: common.qh:34
void W_SwitchToOtherWeapon(entity this,.entity weaponentity)
Definition: selection.qc:253
bool weaponUseForbidden(entity player)
#define w_getbestweapon(ent, wepent)
Definition: selection.qh:23
Definition: hagar.qh:3
float W_CheckProjectileDamage(entity inflictor, entity projowner, int deathtype, float exception)
Definition: common.qc:49
float damageforcescale
Definition: damage.qh:137
#define W_SetupProjVelocity_SEC(ent, wepname)
Definition: tracing.qh:66
IntrusiveList g_damagedbycontents
Definition: damage.qh:155
entity() spawn
float DAMAGE_AIM
Definition: progsdefs.qc:284
float MOVETYPE_BOUNCEMISSILE
Definition: progsdefs.qc:257
void w_ready(Weapon thiswep, entity actor,.entity weaponentity, int fire)
float radius
Definition: impulse.qh:11
#define WEP_CVAR(wepname, name)
Definition: all.qh:299
vector w_shotdir
Definition: tracing.qh:19
entity weaponentity_fld
Definition: weaponsystem.qh:27
bool weapon_prepareattack_check(Weapon thiswep, entity actor,.entity weaponentity, bool secondary, float attacktime)
origin
Definition: ent_cs.qc:114
const float TIMEOUT_ACTIVE
Definition: common.qh:49
#define METHOD(cname, name, prototype)
Definition: oo.qh:257
void CSQCProjectile(entity e, float clientanimate, int type, float docull)
const int PROJECTILE_HAGAR
Definition: projectiles.qh:18
const int WS_READY
idle frame
Definition: weapon.qh:38
entity owner
Definition: main.qh:73
IntrusiveList g_bot_dodge
Definition: api.qh:150
const int PROJECTILE_HAGAR_BOUNCING
Definition: projectiles.qh:19
void TakeResource(entity receiver, Resource res_type, float amount)
Takes an entity some resource.
Definition: cl_resources.qc:31
#define PROJECTILE_TOUCH(e, t)
Definition: common.qh:27
const float ATTN_NORM
Definition: csprogsdefs.qc:226
RES_HEALTH
Definition: ent_cs.qc:126
float ammo
Definition: sv_turrets.qh:44
#define W_SetupProjVelocity_PRI(ent, wepname)
Definition: tracing.qh:64
void W_SetupProjVelocity_Explicit(entity proj, vector dir, vector upDir, float pSpeed, float pUpSpeed, float pZSpeed, float spread, float forceAbsolute)
Definition: tracing.qc:185
float lifetime
Definition: powerups.qc:23
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
vector v_up
Definition: csprogsdefs.qc:31
const int MAX_WEAPONSLOTS
Definition: weapon.qh:13
Resource ammo_type
M: ammotype : main ammo type.
Definition: weapon.qh:48
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
#define pointparticles
Definition: csprogsdefs.qh:13
#define NULL
Definition: post.qh:17
const float VOL_BASE
Definition: sound.qh:36
#define PHYS_INPUT_BUTTON_ATCK(s)
Definition: player.qh:146
const int HITTYPE_SECONDARY
Definition: all.qh:25
#define W_SetupShot(ent, wepent, antilag, recoil, snd, chan, maxdamage, deathtype)
Definition: tracing.qh:33
const int CH_SHOTS
Definition: sound.qh:14
float w_deathtype
Definition: damage.qh:97
vector(float skel, float bonenum) _skel_get_boneabs_hidden
float autocvar_g_weaponspreadfactor
Definition: weaponsystem.qh:5
IntrusiveList g_projectiles
Definition: common.qh:46
const int WS_INUSE
fire state
Definition: weapon.qh:36
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
Definition: cl_resources.qc:10
entity Notification
always last
Definition: all.qh:82
float health
Definition: progsdefs.qc:137
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
vector v_right
Definition: csprogsdefs.qc:31
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)
#define ATTACK_FINISHED(ent, w)
Definition: weaponsystem.qh:42
vector angles
Definition: csprogsdefs.qc:104
void adaptor_think2use_hittype_splash(entity this)
Definition: common.qc:110
#define use
Definition: csprogsdefs.qh:50
void W_DecreaseAmmo(Weapon wep, entity actor, float ammo_use,.entity weaponentity)
#define sound(e, c, s, v, a)
Definition: sound.qh:52
void weapon_prepareattack_do(entity actor,.entity weaponentity, bool secondary, float attacktime)
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
const int CH_WEAPON_B
Definition: sound.qh:8
int m_id
Definition: weapon.qh:42
#define makevectors
Definition: post.qh:21
float W_WeaponRateFactor(entity this)
Definition: weaponsystem.qc:33
void set_movetype(entity this, int mt)
float MOVETYPE_FLY
Definition: progsdefs.qc:251
var void func_null()
vector v_forward
Definition: csprogsdefs.qc:31
float DAMAGE_YES
Definition: progsdefs.qc:283
void W_Reload(entity actor,.entity weaponentity, float sent_ammo_min, Sound sent_sound)
int projectiledeathtype
Definition: common.qh:20