Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
devastator.qc
Go to the documentation of this file.
1#include "devastator.qh"
2
3#ifdef SVQC
4
5.entity lastrocket;
6
8{
9 for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
10 {
11 .entity weaponentity = weaponentities[slot];
12 if (this.realowner.(weaponentity).lastrocket == this)
13 this.realowner.(weaponentity).lastrocket = NULL;
14 }
15}
16
17void W_Devastator_Explode(entity this, entity directhitentity)
18{
20
21 if (directhitentity.takedamage == DAMAGE_AIM
22 && IS_PLAYER(directhitentity) && DIFF_TEAM(this.realowner, directhitentity) && !IS_DEAD(directhitentity)
23 && IsFlying(directhitentity))
24 Send_Notification(NOTIF_ONE, this.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_AIRSHOT);
25
26 this.event_damage = func_null;
27 this.takedamage = DAMAGE_NO;
28
29 vector force_xyzscale = '1 1 1';
30 force_xyzscale.x = WEP_CVAR(WEP_DEVASTATOR, force_xyscale);
31 force_xyzscale.y = WEP_CVAR(WEP_DEVASTATOR, force_xyscale);
32
33 RadiusDamageForSource(this, this.origin, this.velocity, this.realowner,
34 WEP_CVAR(WEP_DEVASTATOR, damage),
35 WEP_CVAR(WEP_DEVASTATOR, edgedamage),
36 WEP_CVAR(WEP_DEVASTATOR, radius),
37 NULL,
38 NULL,
39 false,
40 WEP_CVAR(WEP_DEVASTATOR, force),
41 force_xyzscale,
44 directhitentity
45 );
46
47 Weapon thiswep = WEP_DEVASTATOR;
48 .entity weaponentity = this.weaponentity_fld;
49 if (this.realowner.(weaponentity).m_weapon == thiswep
50 && GetResource(this.realowner, thiswep.ammo_type) < WEP_CVAR(WEP_DEVASTATOR, ammo)
51 && !(this.realowner.items & IT_UNLIMITED_AMMO))
52 {
53 this.realowner.cnt = thiswep.m_id;
54 ATTACK_FINISHED(this.realowner, weaponentity) = time;
55 this.realowner.(weaponentity).m_switchweapon = w_getbestweapon(this.realowner, weaponentity);
56 }
57 delete(this);
58}
59
64
66{
67 return (e.takedamage && e == WarpZone_SearchInRadius_otherent);
68}
70{
72
73 this.event_damage = func_null;
74 this.takedamage = DAMAGE_NO;
75
76 bool handled_as_rocketjump = false;
77 entity head = NULL;
78 bool allow_rocketjump = WEP_CVAR(WEP_DEVASTATOR, remote_jump);
79 MUTATOR_CALLHOOK(AllowRocketJumping, allow_rocketjump);
80 allow_rocketjump = M_ARGV(0, bool);
81
82 if (allow_rocketjump && WEP_CVAR(WEP_DEVASTATOR, remote_jump_radius))
83 {
85 head = WarpZone_SearchInRadius(this.origin, WEP_CVAR(WEP_DEVASTATOR, remote_jump_radius), MOVE_NOTHING, W_Devastator_DoRemoteExplode_cond);
86 if (head) // TODO: this could be optimized by changing the WarpZone_SearchInRadius to return as soon as it finds one entity, somehow
87 {
88 // we handled this as a rocketjump :)
89 handled_as_rocketjump = true;
90
91 // modify velocity
92 if (WEP_CVAR(WEP_DEVASTATOR, remote_jump_velocity_z_add))
93 {
94 head.velocity.x *= 0.9;
95 head.velocity.y *= 0.9;
96 head.velocity.z = bound(
97 WEP_CVAR(WEP_DEVASTATOR, remote_jump_velocity_z_min),
98 head.velocity.z + WEP_CVAR(WEP_DEVASTATOR, remote_jump_velocity_z_add),
99 WEP_CVAR(WEP_DEVASTATOR, remote_jump_velocity_z_max)
100 );
101 }
102
103 // now do the damage
104 RadiusDamage(this, head,
105 WEP_CVAR(WEP_DEVASTATOR, remote_jump_damage),
106 WEP_CVAR(WEP_DEVASTATOR, remote_jump_damage),
107 WEP_CVAR(WEP_DEVASTATOR, remote_jump_radius),
108 NULL,
109 head,
110 (WEP_CVAR(WEP_DEVASTATOR, remote_jump_force) ? WEP_CVAR(WEP_DEVASTATOR, remote_jump_force) : 0),
112 this.weaponentity_fld,
113 NULL
114 );
115 }
116 }
117
118 RadiusDamage(this, this.realowner,
119 WEP_CVAR(WEP_DEVASTATOR, remote_damage),
120 WEP_CVAR(WEP_DEVASTATOR, remote_edgedamage),
121 WEP_CVAR(WEP_DEVASTATOR, remote_radius),
122 (handled_as_rocketjump ? head : NULL),
123 NULL,
124 WEP_CVAR(WEP_DEVASTATOR, remote_force),
126 this.weaponentity_fld,
127 NULL
128 );
129
130 Weapon thiswep = WEP_DEVASTATOR;
131 if (this.realowner.(weaponentity).m_weapon == thiswep
132 && GetResource(this.realowner, thiswep.ammo_type) < WEP_CVAR(WEP_DEVASTATOR, ammo)
133 && !(this.realowner.items & IT_UNLIMITED_AMMO))
134 {
135 this.realowner.cnt = thiswep.m_id;
136 ATTACK_FINISHED(this.realowner, weaponentity) = time;
137 this.realowner.(weaponentity).m_switchweapon = w_getbestweapon(this.realowner, weaponentity);
138 }
139 delete(this);
140}
141
142void W_Devastator_RemoteExplode(entity this, .entity weaponentity)
143{
144 if (IS_DEAD(this.realowner)
145 || !this.realowner.(weaponentity).lastrocket)
146 return;
147
148 bool do_explode;
149 if (this.spawnshieldtime >= 0)
150 do_explode = (time >= this.spawnshieldtime); // timer
151 else
152 {
153 vector transformed_org = WarpZone_RefSys_TransformOrigin(this, this.realowner, this.origin);
154 do_explode = vdist(NearestPointOnBox(this.realowner, transformed_org) - transformed_org, >, WEP_CVAR(WEP_DEVASTATOR, remote_radius)); // safety device
155 }
156 if (do_explode)
157 W_Devastator_DoRemoteExplode(this, weaponentity);
158}
159
161{
162 if (time > this.cnt)
163 {
166 return;
167 }
168 this.nextthink = time;
169
170 // accelerate
171 makevectors(vec2(-this.angles.x, this.angles.y));
172 float velspeed = WEP_CVAR(WEP_DEVASTATOR, speed) * W_WeaponSpeedFactor(this.realowner) - (this.velocity * v_forward);
173 if (velspeed > 0)
174 this.velocity += v_forward * min(WEP_CVAR(WEP_DEVASTATOR, speedaccel) * W_WeaponSpeedFactor(this.realowner) * frametime, velspeed);
175
176 // laser guided, or remote detonation
177 .entity weaponentity = this.weaponentity_fld;
178 if (this.realowner.(weaponentity).m_weapon == WEP_DEVASTATOR)
179 {
180 if (this == this.realowner.(weaponentity).lastrocket
181 && !this.realowner.(weaponentity).rl_release
183 && WEP_CVAR(WEP_DEVASTATOR, guiderate)
184 && time > this.pushltime
185 && !IS_DEAD(this.realowner))
186 W_GuideProjectile(this, weaponentity, this.pushltime,
187 WEP_CVAR(WEP_DEVASTATOR, guiderate),
188 WEP_CVAR(WEP_DEVASTATOR, guideratedelay),
189 WEP_CVAR(WEP_DEVASTATOR, guidegoal),
190 WEP_CVAR(WEP_DEVASTATOR, guidedelay),
191 EFFECT_ROCKET_GUIDE, SND_DEVASTATOR_MODE, VOL_BASE); // TODO: add a better sound here
192
193 if (this.rl_detonate_later)
194 W_Devastator_RemoteExplode(this, weaponentity);
195 }
196
197 if (WEP_CVAR(WEP_DEVASTATOR, speedaccel) || WEP_CVAR(WEP_DEVASTATOR, guiderate))
199}
200
202{
204 {
205 if (wasfreed(this))
207 return;
208 }
211}
212
213void W_Devastator_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force)
214{
215 if (GetResource(this, RES_HEALTH) <= 0)
216 return;
217 if (!W_CheckProjectileDamage(inflictor.realowner, this.realowner, deathtype, -1)) // no exceptions
218 return; // g_projectiles_damage says to halt
219
220 TakeResource(this, RES_HEALTH, damage);
221 this.angles = vectoangles(this.velocity);
222
223 if (GetResource(this, RES_HEALTH) <= 0)
225}
226
227void W_Devastator_Attack(Weapon thiswep, entity actor, .entity weaponentity, int fire)
228{
229 W_DecreaseAmmo(thiswep, actor, WEP_CVAR(WEP_DEVASTATOR, ammo), weaponentity);
230
231 W_SetupShot_ProjectileSize(actor, weaponentity, '-3 -3 -3', '3 3 3', false, 5, SND_DEVASTATOR_FIRE, CH_WEAPON_A, WEP_CVAR(WEP_DEVASTATOR, damage), thiswep.m_id);
232 W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir);
233
234 entity missile = new(rocket);
235 WarpZone_RefSys_Copy(missile, actor);
236 missile.weaponentity_fld = weaponentity;
237 missile.owner = missile.realowner = actor;
238 actor.(weaponentity).lastrocket = missile;
239 if (WEP_CVAR(WEP_DEVASTATOR, detonatedelay) >= 0)
240 missile.spawnshieldtime = time + WEP_CVAR(WEP_DEVASTATOR, detonatedelay);
241 else
242 missile.spawnshieldtime = -1; // NOTE: proximity based when rocket jumping
243 missile.pushltime = time + WEP_CVAR(WEP_DEVASTATOR, guidedelay);
244 missile.bot_dodge = true;
245 missile.bot_dodgerating = WEP_CVAR(WEP_DEVASTATOR, damage) * 2; // * 2 because it can be detonated inflight which makes it even more dangerous
246
247 missile.takedamage = DAMAGE_YES;
248 missile.damageforcescale = WEP_CVAR(WEP_DEVASTATOR, damageforcescale);
249 SetResourceExplicit(missile, RES_HEALTH, WEP_CVAR(WEP_DEVASTATOR, health));
250 missile.event_damage = W_Devastator_Damage;
251 missile.damagedbycontents = true;
253
254 set_movetype(missile, MOVETYPE_FLY);
255 PROJECTILE_MAKETRIGGER(missile);
256 missile.projectiledeathtype = thiswep.m_id;
257 setsize(missile, '-3 -3 -3', '3 3 3'); // give it some size so it can be shot
258
259 setorigin(missile, w_shotorg - v_forward * 3); // move it back so it hits the wall at the right point
260 W_SetupProjVelocity_Basic(missile, WEP_CVAR(WEP_DEVASTATOR, speedstart), 0);
261 missile.angles = vectoangles(missile.velocity);
262
265 missile.nextthink = time;
266 missile.cnt = time + WEP_CVAR(WEP_DEVASTATOR, lifetime);
267 missile.rl_detonate_later = boolean(fire & 2); // allow instant detonation
268 missile.flags = FL_PROJECTILE;
269 IL_PUSH(g_projectiles, missile);
270 IL_PUSH(g_bot_dodge, missile);
271 missile.missile_flags = MIF_SPLASH;
272
273 CSQCProjectile(missile, fabs(WEP_CVAR(WEP_DEVASTATOR, guiderate)) <= 30, PROJECTILE_ROCKET, false); // because of fly sound
274 // Network velocity for the trail only if the guiding isn't strong,
275 // or else the trail clearly goes off path (backwards)
276
277 // common properties
278 MUTATOR_CALLHOOK(EditProjectile, actor, missile);
279
280 if (time >= missile.nextthink)
281 getthink(missile)(missile);
282}
283
284METHOD(Devastator, wr_aim, void(entity thiswep, entity actor, .entity weaponentity))
285{
286 if (!WEP_CVAR(WEP_DEVASTATOR, guidestop) && !actor.(weaponentity).rl_release)
287 {
288 int fired_rockets = 0;
289 IL_EACH(g_projectiles, it.realowner == actor && it.classname == "rocket", ++fired_rockets);
290 // release PHYS_INPUT_BUTTON_ATCK after all fired rocket exploded otherwise bot can't fire again
291 if (!fired_rockets)
292 return;
293 }
294
295 // aim and decide to fire if appropriate
296 float spd = WEP_CVAR(WEP_DEVASTATOR, speed);
297 // simulate rocket guide by calculating rocket trajectory with higher speed
298 // 20 times faster at 90 degrees guide rate
299 if (WEP_CVAR(WEP_DEVASTATOR, guiderate) > 0)
300 spd *= sqrt(WEP_CVAR(WEP_DEVASTATOR, guiderate)) * (20 / 9.489); // 9.489 ~= sqrt(90)
301 // no need to fire with high accuracy on large distances if rockets can be guided
302 bool shot_accurate = (WEP_CVAR(WEP_DEVASTATOR, guiderate) < 50);
303 PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, weaponentity, spd, 0, WEP_CVAR(WEP_DEVASTATOR, lifetime), false, shot_accurate);
304 float pred_time = bound(0.02, 0.02 + (8 - skill) * 0.01, 0.1);
305 if (skill >= 2) // skill 0 and 1 bots won't detonate rockets!
306 {
307 // decide whether to detonate rockets
308 float selfdamage = 0, teamdamage = 0, enemydamage = 0;
309 float pred_selfdamage = 0, pred_teamdamage = 0, pred_enemydamage = 0;
310 float edgedamage = WEP_CVAR(WEP_DEVASTATOR, edgedamage);
311 float coredamage = WEP_CVAR(WEP_DEVASTATOR, damage);
312 float edgeradius = WEP_CVAR(WEP_DEVASTATOR, radius);
313 IL_EACH(g_projectiles, it.realowner == actor && it.classname == "rocket",
314 {
315 entity rocket = it;
316 IL_EACH(g_bot_targets, it.bot_attack,
317 {
318 // code to calculate damage is similar to the one used in RadiusDamageForSource with some simplifications
319 vector target_pos = it.origin + (it.maxs - it.mins) * 0.5;
320
321 float f;
322 float dist = vlen(target_pos - rocket.origin);
323 float dmg = 0;
324 if (dist <= edgeradius)
325 {
326 f = (edgeradius > 0) ? max(0, 1 - (dist / edgeradius)) : 1;
327 dmg = coredamage * f + edgedamage * (1 - f);
328 }
329
330 float pred_dist = vlen(target_pos + it.velocity * pred_time - (rocket.origin + rocket.velocity * pred_time));
331 float pred_dmg = 0;
332 if (pred_dist <= edgeradius)
333 {
334 f = (edgeradius > 0) ? max(0, 1 - (pred_dist / edgeradius)) : 1;
335 pred_dmg = coredamage * f + edgedamage * (1 - f);
336 }
337
338 // count potential damage according to type of target
339 if (it == actor)
340 {
341 if (StatusEffects_active(STATUSEFFECT_Strength, it))
342 dmg *= autocvar_g_balance_powerup_strength_damage;
343 if (StatusEffects_active(STATUSEFFECT_Shield, it))
344 dmg *= autocvar_g_balance_powerup_invincible_takedamage;
345 // self damage reduction factor will be applied later to the total damage
346 selfdamage += dmg;
347 pred_selfdamage += pred_dmg;
348 }
349 else if (SAME_TEAM(it, actor))
350 {
351 if (StatusEffects_active(STATUSEFFECT_Shield, it))
352 dmg *= autocvar_g_balance_powerup_invincible_takedamage;
353 // bot strength factor will be applied later to the total damage
354 teamdamage += dmg;
355 pred_teamdamage += pred_dmg;
356 }
357 else if (bot_shouldattack(actor, it))
358 {
359 if (StatusEffects_active(STATUSEFFECT_Shield, it))
360 dmg *= autocvar_g_balance_powerup_invincible_takedamage;
361 // bot strength factor will be applied later to the total damage
362 enemydamage += dmg;
363 pred_enemydamage += pred_dmg;
364 }
365 });
366 });
367
369 pred_selfdamage *= autocvar_g_balance_selfdamagepercent;
370 if (StatusEffects_active(STATUSEFFECT_Strength, actor))
371 {
372 // FIXME bots don't know whether team damage is enabled or not
377 }
378
379 float good_damage = enemydamage;
380 float pred_good_damage = pred_enemydamage;
381 float bad_damage = selfdamage + teamdamage;
382 float pred_bad_damage = pred_selfdamage + pred_teamdamage;
383
384 // detonate if predicted good damage is lower (current good damage is maximum)
385 // or if predicted bad damage is too much
386 if (good_damage > coredamage * 0.1 && good_damage > bad_damage * 1.5
387 && (pred_good_damage < good_damage + 2 || pred_good_damage < pred_bad_damage * 1.5))
388 PHYS_INPUT_BUTTON_ATCK2(actor) = true;
389 if (skill >= 7 && selfdamage > GetResource(actor, RES_HEALTH))
390 PHYS_INPUT_BUTTON_ATCK2(actor) = false;
391
392 // don't fire a new shot at the same time!
393 if (PHYS_INPUT_BUTTON_ATCK2(actor))
394 PHYS_INPUT_BUTTON_ATCK(actor) = false;
395 }
396}
397
398METHOD(Devastator, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
399{
400 if (WEP_CVAR(WEP_DEVASTATOR, reload_ammo) && actor.(weaponentity).clip_load < WEP_CVAR(WEP_DEVASTATOR, ammo))
401 { // forced reload
402 thiswep.wr_reload(thiswep, actor, weaponentity);
403 return;
404 }
405
406 if (fire & 1)
407 {
408 if ((actor.(weaponentity).rl_release || WEP_CVAR(WEP_DEVASTATOR, guidestop))
409 && weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR(WEP_DEVASTATOR, refire)))
410 {
411 W_Devastator_Attack(thiswep, actor, weaponentity, fire);
412 weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR(WEP_DEVASTATOR, animtime), w_ready);
413 actor.(weaponentity).rl_release = false;
414 }
415 }
416 else
417 actor.(weaponentity).rl_release = true;
418
419 if ((fire & 2)
420 && actor.(weaponentity).m_switchweapon == thiswep)
421 {
422 bool rockfound = false;
423 IL_EACH(g_projectiles, it.realowner == actor && it.classname == "rocket",
424 {
425 if (!it.rl_detonate_later)
426 {
427 it.rl_detonate_later = true;
428 rockfound = true;
429 }
430 });
431 if (rockfound)
432 sound(actor, CH_WEAPON_B, SND_DEVASTATOR_DET, VOL_BASE, ATTN_NORM);
433 }
434}
435
436METHOD(Devastator, wr_setup, void(entity thiswep, entity actor, .entity weaponentity))
437{
438 actor.(weaponentity).rl_release = true;
439}
440
441METHOD(Devastator, wr_checkammo1, bool(entity thiswep, entity actor, .entity weaponentity))
442{
443 #if 0
444 // don't switch while guiding a missile
445 if (ATTACK_FINISHED(actor, weaponentity) <= time || PS(actor).m_weapon != WEP_DEVASTATOR)
446 {
447 ammo_amount = false;
448 if (WEP_CVAR(WEP_DEVASTATOR, reload_ammo))
449 {
450 if (GetResource(actor, thiswep.ammo_type) < WEP_CVAR(WEP_DEVASTATOR, ammo) && actor.(weaponentity).(weapon_load[WEP_DEVASTATOR.m_id]) < WEP_CVAR(WEP_DEVASTATOR, ammo))
451 ammo_amount = true;
452 }
453 else if (GetResource(actor, thiswep.ammo_type) < WEP_CVAR(WEP_DEVASTATOR, ammo))
454 ammo_amount = true;
455 return !ammo_amount;
456 }
457 #endif
458 #if 0
459 if (!actor.rl_release)
460 {
461 LOG_INFOF("W_Devastator(WR_CHECKAMMO1): %d, %.2f, %d: TRUE", actor.rl_release, GetResource(actor, thiswep.ammo_type), WEP_CVAR(WEP_DEVASTATOR, ammo));
462 return true;
463 }
464 else
465 {
466 ammo_amount = GetResource(actor, thiswep.ammo_type) >= WEP_CVAR(WEP_DEVASTATOR, ammo);
467 ammo_amount += actor.(weaponentity).(weapon_load[WEP_DEVASTATOR.m_id]) >= WEP_CVAR(WEP_DEVASTATOR, ammo);
468 LOG_INFOF("W_Devastator(WR_CHECKAMMO1): %d, %.2f, %d: %s", actor.rl_release, GetResource(actor, thiswep.ammo_type), WEP_CVAR(WEP_DEVASTATOR, ammo), (ammo_amount ? "TRUE" : "FALSE"));
469 return ammo_amount;
470 }
471 #else
472 float ammo_amount = GetResource(actor, thiswep.ammo_type) >= WEP_CVAR(WEP_DEVASTATOR, ammo);
473 ammo_amount += actor.(weaponentity).(weapon_load[thiswep.m_id]) >= WEP_CVAR(WEP_DEVASTATOR, ammo);
474 return ammo_amount;
475 #endif
476}
477
478METHOD(Devastator, wr_checkammo2, bool(entity thiswep, entity actor, .entity weaponentity))
479{
480 return false;
481}
482
483METHOD(Devastator, wr_resetplayer, void(entity thiswep, entity actor))
484{
485 for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
486 {
487 .entity weaponentity = weaponentities[slot];
488 actor.(weaponentity).lastrocket = NULL; // stop rocket guiding, no revenge from the grave!
489 actor.(weaponentity).rl_release = true;
490 }
491}
492
493METHOD(Devastator, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
494{
495 W_Reload(actor, weaponentity, WEP_CVAR(WEP_DEVASTATOR, ammo), SND_RELOAD);
496}
497
498METHOD(Devastator, wr_suicidemessage, Notification(entity thiswep))
499{
500 return WEAPON_DEVASTATOR_SUICIDE;
501}
502
503METHOD(Devastator, wr_killmessage, Notification(entity thiswep))
504{
506 return WEAPON_DEVASTATOR_MURDER_SPLASH;
507 else
508 return WEAPON_DEVASTATOR_MURDER_DIRECT;
509}
510
511#endif // SVQC
512#ifdef CSQC
513
514METHOD(Devastator, wr_impacteffect, void(entity thiswep, entity actor))
515{
516 vector org2 = w_org + w_backoff * 2;
517 pointparticles(EFFECT_ROCKET_EXPLODE, org2, '0 0 0', 1);
518 if (!w_issilent)
519 sound(actor, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTN_NORM);
520}
521
522#endif // CSQC
523#ifdef MENUQC
526#include "vortex.qh"
527
528METHOD(Devastator, describe, string(Devastator this))
529{
530 TC(Devastator, this);
532 PAR(_("The %s launches a remote controlled rocket, dealing significant damage when it explodes on impact. "
533 "If the primary fire is held, the rocket can be guided by the user's aim, allowing steering it towards enemies."), COLORED_NAME(this));
534 PAR(_("The secondary fire can be used to immediately detonate rockets, allowing dealing damage to enemies even if the rocket barely missed colliding with them."));
535 PAR(_("It consumes a bunch of %s ammo for each rocket, which can end up being depleted quickly, so often players alternate with another weapon like %s."), COLORED_NAME(ITEM_Rockets), COLORED_NAME(WEP_VORTEX));
536 PAR(_("Due to its high damage output, the %s is one of the most commonly used weapons. "
537 "It can be used in almost any scenario, working best in medium range combat. "
538 "In close range combat, the large splash radius often results in rockets damaging both you and your enemy."), COLORED_NAME(this));
539 PAR(_("Due to the ability to remotely detonate rockets, a common usage is \"rocket flying,\" where you fire a rocket and immediately detonate it to boost yourself while mid-air, "
540 "much more effective with the %s mutator enabled."), COLORED_NAME(MUTATOR_rocketflying));
541 PAR(W_Guide_Keybinds(this));
543 return PAGE_TEXT;
544}
545
546#endif // MENUQC
float skill
Definition api.qh:35
bool bot_aim(entity this,.entity weaponentity, float shotspeed, float shotspeedupward, float maxshottime, float applygravity, bool shot_accurate)
IntrusiveList g_bot_dodge
Definition api.qh:150
#define MUTATOR_CALLHOOK(name,...)
Definition base.qh:186
#define M_ARGV(idx, type)
Definition base.qh:153
#define boolean(value)
Definition bool.qh:9
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
void TakeResource(entity receiver, Resource res_type, float amount)
Takes an entity some resource.
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
Definition weapon.qh:36
Resource ammo_type
M: ammotype : main ammo type.
Definition weapon.qh:50
int m_id
Definition weapon.qh:37
string netname
Definition powerups.qc:20
float lifetime
Definition powerups.qc:23
float cnt
Definition powerups.qc:24
#define COLORED_NAME(this)
Definition color.qh:189
const int IT_UNLIMITED_AMMO
Definition item.qh:23
float radius
Definition impulse.qh:11
bool IsFlying(entity this)
Definition player.qc:843
#define IS_DEAD(s)
Definition player.qh:244
#define IS_PLAYER(s)
Definition player.qh:242
#define PHYS_INPUT_BUTTON_ATCK(s)
Definition player.qh:152
#define PHYS_INPUT_BUTTON_ATCK2(s)
Definition player.qh:154
const int FL_PROJECTILE
Definition constants.qh:77
float frametime
vector velocity
float time
float nextthink
vector v_forward
vector origin
const float ATTN_NORM
void UpdateCSQCProjectile(entity e)
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:937
float RadiusDamageForSource(entity inflictor, vector inflictororigin, vector inflictorvelocity, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, bool inflictorselfdamage, float forceintensity, vector forcexyzscale, int deathtype,.entity weaponentity, entity directhitentity)
Returns total damage applied to creatures.
Definition damage.qc:714
IntrusiveList g_damagedbycontents
Definition damage.qh:143
float spawnshieldtime
Definition damage.qh:61
float autocvar_g_balance_selfdamagepercent
Definition damage.qh:25
vector w_org
int w_deathtype
float damageforcescale
vector w_backoff
float w_issilent
const int HITTYPE_BOUNCE
set manually after projectile has bounced
Definition all.qh:33
const int HITTYPE_SPLASH
automatically set by RadiusDamage
Definition all.qh:32
void W_Devastator_Explode(entity this, entity directhitentity)
Definition devastator.qc:17
void W_Devastator_Explode_think(entity this)
Definition devastator.qc:60
void W_Devastator_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
void W_Devastator_DoRemoteExplode(entity this,.entity weaponentity)
Definition devastator.qc:69
bool W_Devastator_DoRemoteExplode_cond(entity e)
Definition devastator.qc:65
void W_Devastator_Attack(Weapon thiswep, entity actor,.entity weaponentity, int fire)
void W_Devastator_Touch(entity this, entity toucher)
void W_Devastator_RemoteExplode(entity this,.entity weaponentity)
void W_Devastator_Unregister(entity this)
Definition devastator.qc:7
void W_Devastator_Think(entity this)
entity lastrocket
Definition devastator.qc:5
bool rl_detonate_later
Definition devastator.qh:92
bool rl_release
Definition devastator.qh:91
float speed
Definition dynlight.qc:9
#define pointparticles(effect, org, vel, howmany)
Definition effect.qh:6
ent angles
Definition ent_cs.qc:146
SetResourceExplicit(ent, RES_ARMOR, ReadByte() *DEC_FACTOR)) ENTCS_PROP(NAME
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
#define IL_EACH(this, cond, body)
float pushltime
Definition jumppads.qh:21
#define TC(T, sym)
Definition _all.inc:82
entity WarpZone_SearchInRadius(vector org, float rad, float nomonsters, WarpZone_FindRadius_cond_callback_t cb)
Modified findradius aware of warpzones, that only includes entities that meet the "cb" criteria.
Definition common.qc:684
vector WarpZone_RefSys_TransformOrigin(entity from, entity to, vector org)
Transform origin org in from's reference into to's reference.
Definition common.qc:791
void WarpZone_RefSys_Copy(entity me, entity from)
Copies the warpzone reference of from onto me.
Definition common.qc:828
noref entity WarpZone_SearchInRadius_otherent
Free to use in the callback.
Definition common.qh:71
#define MOVE_NOTHING
Definition common.qh:35
#define LOG_INFOF(...)
Definition log.qh:63
float bound(float min, float value, float max)
vector vectoangles(vector v)
float sqrt(float f)
float min(float f,...)
float fabs(float f)
void set_movetype(entity this, int mt)
Definition movetypes.qc:4
const int MOVETYPE_FLY
Definition movetypes.qh:138
var void func_null()
void Send_Notification(NOTIF broadcast, entity client, MSG net_type, Notification net_name,...count)
Definition all.qc:1500
entity Notification
always last
Definition all.qh:86
#define METHOD(cname, name, prototype)
Definition oo.qh:274
#define NULL
Definition post.qh:14
#define makevectors
Definition post.qh:21
const int PROJECTILE_ROCKET
Definition projectiles.qh:4
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)
#define getthink(e)
vector
Definition self.qh:96
entity entity toucher
Definition self.qh:76
#define settouch(e, f)
Definition self.qh:77
float W_CheckProjectileDamage(entity inflictor, entity projowner, int deathtype, float exception)
Definition common.qc:45
void W_GuideProjectile(entity this,.entity weaponentity, float guide_start_time, float guide_rate, float guide_rate_delay, float guide_goal, float guide_delay, entity eff, entity snd, float vol)
Guides a projectile towards the crosshair (v_forward).
Definition common.qc:349
void W_PrepareExplosionByDamage(entity this, entity attacker, void(entity this) explode)
Definition common.qc:87
const int MIF_SPLASH
Definition common.qh:63
int projectiledeathtype
Definition common.qh:38
IntrusiveList g_projectiles
Definition common.qh:75
#define PROJECTILE_MAKETRIGGER(e)
Definition common.qh:51
float WarpZone_Projectile_Touch(entity this, entity toucher)
Definition server.qc:344
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
#define sound(e, c, s, v, a)
Definition sound.qh:52
const int CH_WEAPON_B
Definition sound.qh:8
#define PS(this)
Definition state.qh:18
bool StatusEffects_active(StatusEffect this, entity actor)
float autocvar_g_balance_powerup_strength_damage
Definition strength.qh:18
#define PAGE_TEXT
Definition string.qh:652
#define PAR(...)
Adds an individually translatable paragraph to PAGE_TEXT without having to deal with strcat and sprin...
Definition string.qh:658
#define PAGE_TEXT_INIT()
Definition string.qh:651
const int DAMAGE_YES
Definition subs.qh:80
const int DAMAGE_NO
Definition subs.qh:79
const int DAMAGE_AIM
Definition subs.qh:81
float takedamage
Definition subs.qh:78
float ammo
Definition sv_turrets.qh:43
#define DIFF_TEAM(a, b)
Definition teams.qh:242
entity realowner
vector w_shotdir
Definition tracing.qh:20
#define W_SetupShot_ProjectileSize(ent, wepent, mi, ma, antilag, recoil, snd, chan, maxdamage, deathtype)
Definition tracing.qh:30
vector w_shotorg
Definition tracing.qh:19
#define W_SetupProjVelocity_Basic(ent, pspeed, pspread)
Definition tracing.qh:51
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt().
Definition vector.qh:8
ERASEABLE vector NearestPointOnBox(entity box, vector org)
Definition vector.qh:187
#define vec2(...)
Definition vector.qh:95
string W_Guide_Keybinds(Weapon wep)
Definition all.qc:803
void W_MuzzleFlash(Weapon thiswep, entity actor,.entity weaponentity, vector shotorg, vector shotdir)
Definition all.qc:694
string W_Guide_DPS_onlyOne_unnamed(string name)
Definition all.qc:894
#define WEP_CVAR(wep, name)
Definition all.qh:339
const int MAX_WEAPONSLOTS
Definition weapon.qh:15
entity weaponentities[MAX_WEAPONSLOTS]
Definition weapon.qh:16
void W_DecreaseAmmo(Weapon wep, entity actor, float ammo_use,.entity weaponentity)
float W_WeaponSpeedFactor(entity this)
void W_Reload(entity actor,.entity weaponentity, float sent_ammo_min, Sound sent_sound)
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)
#define ATTACK_FINISHED(ent, w)
entity weaponentity_fld
float weapon_load[REGISTRY_MAX(Weapons)]
Weapon m_weapon
Definition wepent.qh:26
Weapon m_switchweapon
Definition wepent.qh:25