Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
fireball.qc
Go to the documentation of this file.
1#include "fireball.qh"
2
3#ifdef SVQC
4
5void W_Fireball_Explode(entity this, entity directhitentity)
6{
7 this.event_damage = func_null;
9
10 // 1. dist damage
11 float d = GetResource(this.realowner, RES_HEALTH) + GetResource(this.realowner, RES_ARMOR);
12
13 RadiusDamage(this, this.realowner,
14 WEP_CVAR_PRI(WEP_FIREBALL, damage),
15 WEP_CVAR_PRI(WEP_FIREBALL, edgedamage),
16 WEP_CVAR_PRI(WEP_FIREBALL, radius),
17 NULL,
18 NULL,
19 WEP_CVAR_PRI(WEP_FIREBALL, force),
21 this.weaponentity_fld, directhitentity
22 );
23
24 if (GetResource(this.realowner, RES_HEALTH) + GetResource(this.realowner, RES_ARMOR) >= d
25 && !this.cnt)
26 {
27 float dist;
28 float points;
29 vector dir;
30
31 modeleffect_spawn("models/sphere/sphere.md3", 0, 0, this.origin, '0 0 0', '0 0 0', '0 0 0', 0, WEP_CVAR_PRI(WEP_FIREBALL, bfgradius), 0.2, 0.05, 0.25);
32
33 // 2. bfg effect
34 // NOTE: this cannot be made warpzone aware by design. So, better intentionally ignore warpzones here.
35 for (entity e = findradius(this.origin, WEP_CVAR_PRI(WEP_FIREBALL, bfgradius)); e; e = e.chain)
36 if (e != this.realowner && e.takedamage == DAMAGE_AIM && !IS_INDEPENDENT_PLAYER(e)
37 && (!IS_PLAYER(e) || !this.realowner || DIFF_TEAM(e, this)))
38 {
39
40 // can we see fireball?
41 traceline(e.origin + e.view_ofs, this.origin, MOVE_NORMAL, e);
42 if (/* trace_startsolid || */ trace_fraction != 1) // startsolid should be never happening anyway
43 continue;
44 // can we see player who shot fireball?
45 traceline(e.origin + e.view_ofs, this.realowner.origin + this.realowner.view_ofs, MOVE_NORMAL, e);
46 if (trace_ent != this.realowner)
47 if (/* trace_startsolid || */ trace_fraction != 1)
48 continue;
49 dist = vlen(this.origin - e.origin - e.view_ofs);
50 points = 1 - sqrt(dist / WEP_CVAR_PRI(WEP_FIREBALL, bfgradius));
51 if (points <= 0)
52 continue;
53 dir = normalize(e.origin + e.view_ofs - this.origin);
54
56 accuracy_add(this.realowner, WEP_FIREBALL, 0, WEP_CVAR_PRI(WEP_FIREBALL, bfgdamage) * points, 0); // add to hit
57
58 Damage(e, this, this.realowner,
59 WEP_CVAR_PRI(WEP_FIREBALL, bfgdamage) * points,
62 e.origin + e.view_ofs,
63 WEP_CVAR_PRI(WEP_FIREBALL, bfgforce) * dir
64 );
65
66 Send_Effect(EFFECT_FIREBALL_BFGDAMAGE, e.origin, -dir, 1);
67 }
68 }
69
70 delete(this);
71}
72
77
78void W_Fireball_Explode_use(entity this, entity actor, entity trigger)
79{
80 W_Fireball_Explode(this, trigger);
81}
82
88
89void W_Fireball_LaserPlay(entity this, float rad, float damage, float edgedamage, float burntime)
90{
91 if (damage <= 0)
92 return;
93
94 // NOTE: napalm_damage uses similar code, please keep them in sync
96 entity last = NULL;
97 float last_dist = 0;
98 // optimize code by comparing squared distances and avoiding vlen and sqrt calls as much as possible
99 float rad2 = rad * rad;
100 for (entity e = WarpZone_FindRadius(this.origin, rad, true); e; e = e.chain)
101 {
102 if (STAT(FROZEN, e) || StatusEffects_active(STATUSEFFECT_Frozen, e)
103 || e == this.realowner || IS_INDEPENDENT_PLAYER(e)
104 || e.takedamage != DAMAGE_AIM
105 || (IS_PLAYER(e) && this.realowner && SAME_TEAM(e, this)))
106 continue;
107
108 vector p = e.origin;
109 p.x += e.mins.x + random() * (e.maxs.x - e.mins.x);
110 p.y += e.mins.y + random() * (e.maxs.y - e.mins.y);
111 p.z += e.mins.z + random() * (e.maxs.z - e.mins.z);
112 float dist2 = vlen2(WarpZone_UnTransformOrigin(e, this.origin) - p);
113 if (dist2 < rad2)
114 {
115 e.fireball_impactvec = p;
116 last = e;
117 last_dist = sqrt(dist2); // won't be recalculated if this entity is the only or last one found
118 RandomSelection_AddEnt(e, 1 / (1 + last_dist), !StatusEffects_active(STATUSEFFECT_Burning, e));
119 }
120 }
122 {
123 float dist;
124 if (RandomSelection_chosen_ent == last)
125 dist = last_dist; // already calculated
126 else
128 dist = damage + (edgedamage - damage) * (dist / rad);
130 //trailparticles(this, particleeffectnum(EFFECT_FIREBALL_LASER), this.origin, RandomSelection_chosen_ent.fireball_impactvec);
131 Send_Effect(EFFECT_FIREBALL_LASER, this.origin, RandomSelection_chosen_ent.fireball_impactvec - this.origin, 1);
132 }
133}
134
136{
137 if (time > this.pushltime)
138 {
139 this.cnt = 1;
142 return;
143 }
144
146 WEP_CVAR_PRI(WEP_FIREBALL, laserradius),
147 WEP_CVAR_PRI(WEP_FIREBALL, laserdamage),
148 WEP_CVAR_PRI(WEP_FIREBALL, laseredgedamage),
149 WEP_CVAR_PRI(WEP_FIREBALL, laserburntime));
150
151 this.nextthink = time + 0.1;
152}
153
154void W_Fireball_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force)
155{
156 if (GetResource(this, RES_HEALTH) <= 0)
157 return;
158 if (!W_CheckProjectileDamage(inflictor.realowner, this.realowner, deathtype, -1)) // no exceptions
159 return; // g_projectiles_damage says to halt
160
161 TakeResource(this, RES_HEALTH, damage);
162 if (GetResource(this, RES_HEALTH) <= 0)
163 {
164 this.cnt = 1;
166 }
167}
168
169void W_Fireball_Attack1(entity actor, .entity weaponentity)
170{
171 W_SetupShot_ProjectileSize(actor, weaponentity, '-16 -16 -16', '16 16 16', false, 2, SND_FIREBALL_FIRE2, CH_WEAPON_A, WEP_CVAR_PRI(WEP_FIREBALL, damage) + WEP_CVAR_PRI(WEP_FIREBALL, bfgdamage), WEP_FIREBALL.m_id);
172
173 W_MuzzleFlash(WEP_FIREBALL, actor, weaponentity, w_shotorg, w_shotdir);
174
175 entity proj = new(plasma_prim);
176 proj.owner = proj.realowner = actor;
177 proj.bot_dodge = true;
178 proj.bot_dodgerating = WEP_CVAR_PRI(WEP_FIREBALL, damage);
179 proj.pushltime = time + WEP_CVAR_PRI(WEP_FIREBALL, lifetime);
180 proj.use = W_Fireball_Explode_use;
182 proj.nextthink = time;
183 SetResourceExplicit(proj, RES_HEALTH, WEP_CVAR_PRI(WEP_FIREBALL, health));
184 proj.team = actor.team;
185 proj.event_damage = W_Fireball_Damage;
186 proj.takedamage = DAMAGE_YES;
187 proj.damageforcescale = WEP_CVAR_PRI(WEP_FIREBALL, damageforcescale);
189 proj.projectiledeathtype = WEP_FIREBALL.m_id;
190 proj.weaponentity_fld = weaponentity;
191 setorigin(proj, w_shotorg);
192
194 W_SetupProjVelocity_PRI(proj, WEP_FIREBALL);
195 proj.angles = vectoangles(proj.velocity);
197 setsize(proj, '-16 -16 -16', '16 16 16');
198 proj.flags = FL_PROJECTILE;
199 IL_PUSH(g_projectiles, proj);
200 IL_PUSH(g_bot_dodge, proj);
201 proj.missile_flags = MIF_SPLASH | MIF_PROXY;
202
203 CSQCProjectile(proj, true, PROJECTILE_FIREBALL, true);
204
205 MUTATOR_CALLHOOK(EditProjectile, actor, proj);
206}
207
208void W_Fireball_AttackEffect(entity actor, .entity weaponentity, float i, vector f_diff)
209{
210 W_SetupShot_ProjectileSize(actor, weaponentity, '-16 -16 -16', '16 16 16', false, 0, SND_Null, 0, 0, WEP_FIREBALL.m_id); // TODO: probably doesn't need deathtype, just a prefire effect
211 w_shotorg += f_diff.x * v_up + f_diff.y * v_right;
212 Send_Effect(EFFECT_FIREBALL_PRE_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
213}
214
215void W_Fireball_Attack1_Frame4(Weapon thiswep, entity actor, .entity weaponentity, int fire)
216{
217 W_Fireball_Attack1(actor, weaponentity);
218 weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(WEP_FIREBALL, animtime), w_ready);
219}
220
221void W_Fireball_Attack1_Frame3(Weapon thiswep, entity actor, .entity weaponentity, int fire)
222{
223 W_Fireball_AttackEffect(actor, weaponentity, 0, '+1.25 +3.75 0');
224 weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(WEP_FIREBALL, animtime), W_Fireball_Attack1_Frame4);
225}
226
227void W_Fireball_Attack1_Frame2(Weapon thiswep, entity actor, .entity weaponentity, int fire)
228{
229 W_Fireball_AttackEffect(actor, weaponentity, 0, '-1.25 +3.75 0');
230 weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(WEP_FIREBALL, animtime), W_Fireball_Attack1_Frame3);
231}
232
233void W_Fireball_Attack1_Frame1(Weapon thiswep, entity actor, .entity weaponentity, int fire)
234{
235 W_Fireball_AttackEffect(actor, weaponentity, 1, '+1.25 -3.75 0');
236 weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(WEP_FIREBALL, animtime), W_Fireball_Attack1_Frame2);
237}
238
239void W_Fireball_Attack1_Frame0(Weapon thiswep, entity actor, .entity weaponentity, int fire)
240{
241 W_Fireball_AttackEffect(actor, weaponentity, 0, '-1.25 -3.75 0');
242 sound(actor, CH_WEAPON_SINGLE, SND_FIREBALL_PREFIRE2, VOL_BASE, ATTEN_NORM);
243 weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(WEP_FIREBALL, animtime), W_Fireball_Attack1_Frame1);
244}
245
247{
248 if (time > this.pushltime)
249 {
250 delete(this);
251 return;
252 }
253
254 // make it "hot" once it leaves its owner
255 if (this.owner)
256 {
257 if (vdist(this.origin - this.owner.origin - this.owner.view_ofs, >, WEP_CVAR_SEC(WEP_FIREBALL, laserradius)))
258 {
259 ++this.cnt;
260 if (this.cnt == 3)
261 this.owner = NULL;
262 }
263 else
264 this.cnt = 0;
265 }
266
268 WEP_CVAR_SEC(WEP_FIREBALL, laserradius),
269 WEP_CVAR_SEC(WEP_FIREBALL, laserdamage),
270 WEP_CVAR_SEC(WEP_FIREBALL, laseredgedamage),
271 WEP_CVAR_SEC(WEP_FIREBALL, laserburntime));
272
273 this.nextthink = time + 0.1;
274}
275
277{
279 if (toucher.takedamage == DAMAGE_AIM
280 && Fire_AddDamage(toucher, this.realowner, WEP_CVAR_SEC(WEP_FIREBALL, damage), WEP_CVAR_SEC(WEP_FIREBALL, damagetime), this.projectiledeathtype) >= 0)
281 {
282 delete(this);
283 return;
284 }
286}
287
288void W_Fireball_Attack2(entity actor, .entity weaponentity)
289{
290 vector f_diff;
291
292 float c = actor.(weaponentity).bulletcounter % 4;
293 switch (c)
294 {
295 case 0:
296 f_diff = '-1.25 -3.75 0';
297 break;
298 case 1:
299 f_diff = '+1.25 -3.75 0';
300 break;
301 case 2:
302 f_diff = '-1.25 +3.75 0';
303 break;
304 case 3:
305 default:
306 f_diff = '+1.25 +3.75 0';
307 break;
308 }
309 W_SetupShot_ProjectileSize(actor, weaponentity, '-4 -4 -4', '4 4 4', false, 2, SND_FIREBALL_FIRE, CH_WEAPON_A, WEP_CVAR_SEC(WEP_FIREBALL, damage), WEP_FIREBALL.m_id | HITTYPE_SECONDARY);
310 traceline(w_shotorg, w_shotorg + f_diff.x * v_up + f_diff.y * v_right, MOVE_NORMAL, actor);
312
313 W_MuzzleFlash(WEP_FIREBALL, actor, weaponentity, w_shotorg, w_shotdir);
314
315 entity proj = new(grenade);
316 proj.owner = proj.realowner = actor;
317 proj.bot_dodge = true;
318 proj.bot_dodgerating = WEP_CVAR_SEC(WEP_FIREBALL, damage);
320 proj.projectiledeathtype = WEP_FIREBALL.m_id | HITTYPE_SECONDARY;
323 setsize(proj, '-4 -4 -4', '4 4 4');
324 setorigin(proj, w_shotorg);
326 proj.nextthink = time;
327 proj.damageforcescale = WEP_CVAR_SEC(WEP_FIREBALL, damageforcescale);
328 proj.pushltime = time + WEP_CVAR_SEC(WEP_FIREBALL, lifetime);
329 W_SetupProjVelocity_UP_SEC(proj, WEP_FIREBALL);
330
331 proj.angles = vectoangles(proj.velocity);
332 proj.flags = FL_PROJECTILE;
333 IL_PUSH(g_projectiles, proj);
334 IL_PUSH(g_bot_dodge, proj);
335 proj.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_ARC;
336
337 CSQCProjectile(proj, true, PROJECTILE_FIREMINE, true);
338
339 MUTATOR_CALLHOOK(EditProjectile, actor, proj);
340}
341
342.bool bot_primary_fireballmooth; // whatever a mooth is
343
344METHOD(Fireball, wr_aim, void(entity thiswep, entity actor, .entity weaponentity))
345{
346 PHYS_INPUT_BUTTON_ATCK(actor) = false;
347 PHYS_INPUT_BUTTON_ATCK2(actor) = false;
348 if (!actor.bot_primary_fireballmooth)
349 {
350 if (bot_aim(actor, weaponentity, WEP_CVAR_PRI(WEP_FIREBALL, speed), 0, WEP_CVAR_PRI(WEP_FIREBALL, lifetime), false, false))
351 {
352 PHYS_INPUT_BUTTON_ATCK(actor) = true;
353 if (random() < 0.02)
354 actor.bot_primary_fireballmooth = true;
355 }
356 }
357 else
358 {
359 if (bot_aim(actor, weaponentity, WEP_CVAR_SEC(WEP_FIREBALL, speed), WEP_CVAR_SEC(WEP_FIREBALL, speed_up), WEP_CVAR_SEC(WEP_FIREBALL, lifetime), true, false))
360 {
361 PHYS_INPUT_BUTTON_ATCK2(actor) = true;
362 if (random() < 0.01)
363 actor.bot_primary_fireballmooth = false;
364 }
365 }
366}
367
368METHOD(Fireball, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
369{
370 if (fire & 1)
371 {
372 if (time >= actor.(weaponentity).fireball_primarytime
373 && weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(WEP_FIREBALL, refire)))
374 {
375 W_Fireball_Attack1_Frame0(thiswep, actor, weaponentity, fire);
376 actor.(weaponentity).fireball_primarytime = time + WEP_CVAR_PRI(WEP_FIREBALL, refire2) * W_WeaponRateFactor(actor);
377 }
378 }
379 else if (fire & 2)
380 {
381 if (weapon_prepareattack(thiswep, actor, weaponentity, true, WEP_CVAR_SEC(WEP_FIREBALL, refire)))
382 {
383 W_Fireball_Attack2(actor, weaponentity);
384 weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(WEP_FIREBALL, animtime), w_ready);
385 }
386 }
387}
388
389METHOD(Fireball, wr_checkammo1, bool(entity thiswep, entity actor, .entity weaponentity))
390{
391 return true; // fireball has infinite ammo
392}
393
394METHOD(Fireball, wr_checkammo2, bool(entity thiswep, entity actor, .entity weaponentity))
395{
396 return true; // fireball has infinite ammo
397}
398
399METHOD(Fireball, wr_resetplayer, void(entity thiswep, entity actor))
400{
401 for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
402 {
403 .entity weaponentity = weaponentities[slot];
404 actor.(weaponentity).fireball_primarytime = time;
405 }
406}
407
408METHOD(Fireball, wr_suicidemessage, Notification(entity thiswep))
409{
411 return WEAPON_FIREBALL_SUICIDE_FIREMINE;
412 else
413 return WEAPON_FIREBALL_SUICIDE_BLAST;
414}
415
416METHOD(Fireball, wr_killmessage, Notification(entity thiswep))
417{
419 return WEAPON_FIREBALL_MURDER_FIREMINE;
420 else
421 return WEAPON_FIREBALL_MURDER_BLAST;
422}
423
424#endif // SVQC
425#ifdef CSQC
426
427METHOD(Fireball, wr_impacteffect, void(entity thiswep, entity actor))
428{
430 {
431 // firemine goes out silently
432 }
433 else
434 {
435 vector org2 = w_org + w_backoff * 2;
436 pointparticles(EFFECT_FIREBALL_EXPLODE, org2, '0 0 0', 1);
437 if (!w_issilent)
438 sound(actor, CH_SHOTS, SND_FIREBALL_IMPACT2, VOL_BASE, ATTEN_NORM * 0.25); // long range boom
439 }
440}
441
442#endif // CSQC
443#ifdef MENUQC
444
445METHOD(Fireball, describe, string(Fireball this))
446{
447 TC(Fireball, this);
449 PAR(_("The %s supercharges then fires a massive fireball in a straight line, dealing heaps of splash damage over a large radius on impact."), COLORED_NAME(this));
450 PAR(_("The secondary fire launches flaming balls that set nearby players alight."));
451 PAR(_("It is a superweapon, so isn't often found in game."));
452 PAR(_("It doesn't require ammo, but it is destroyed after some time."));
453 PAR(_("Since the %s takes a moment to charge and the fireball travels slowly, using it effectively may be difficult, "
454 "but if done properly it can deal a ton of damage."), COLORED_NAME(this));
455 PAR(W_Guide_Keybinds(this));
456 PAR(W_Guide_DPS(this.netname, "primary", "secondary"));
457 return PAGE_TEXT;
458}
459
460#endif // MENUQC
void accuracy_add(entity this, Weapon w, float fired, float hit, float real)
update accuracy stats
Definition accuracy.qc:102
bool accuracy_isgooddamage(entity attacker, entity targ)
does this damage count towards accuracy stats?
Definition accuracy.qc:133
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(id,...)
Definition base.qh:143
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:42
string netname
Definition powerups.qc:20
float lifetime
Definition powerups.qc:23
float cnt
Definition powerups.qc:24
entity owner
Definition main.qh:87
#define COLORED_NAME(this)
Definition color.qh:189
float radius
Definition impulse.qh:11
#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
float W_WeaponRateFactor(entity this)
const int FL_PROJECTILE
Definition constants.qh:76
vector v_up
entity trace_ent
const float MOVE_NORMAL
float time
vector v_right
vector trace_endpos
float nextthink
vector origin
float trace_fraction
void CSQCProjectile(entity e, float clientanimate, int type, float docull)
void Damage(entity targ, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
Definition damage.qc:483
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:934
float Fire_AddDamage(entity e, entity o, float d, float t, float dt)
Definition damage.qc:965
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
const int HITTYPE_SECONDARY
Definition all.qh:31
float speed
Definition dynlight.qc:9
#define pointparticles(effect, org, vel, howmany)
Definition effect.qh:7
void Send_Effect(entity eff, vector eff_loc, vector eff_vel, int eff_cnt)
Definition all.qc:120
RES_ARMOR
Definition ent_cs.qc:155
SetResourceExplicit(ent, RES_ARMOR, ReadByte() *DEC_FACTOR)) ENTCS_PROP(NAME
void W_Fireball_Think(entity this)
Definition fireball.qc:135
void W_Fireball_Attack2(entity actor,.entity weaponentity)
Definition fireball.qc:288
void W_Fireball_Explode_use(entity this, entity actor, entity trigger)
Definition fireball.qc:78
void W_Fireball_TouchExplode(entity this, entity toucher)
Definition fireball.qc:83
void W_Fireball_Firemine_Touch(entity this, entity toucher)
Definition fireball.qc:276
void W_Fireball_Attack1_Frame0(Weapon thiswep, entity actor,.entity weaponentity, int fire)
Definition fireball.qc:239
void W_Fireball_Firemine_Think(entity this)
Definition fireball.qc:246
void W_Fireball_Explode(entity this, entity directhitentity)
Definition fireball.qc:5
void W_Fireball_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
Definition fireball.qc:154
bool bot_primary_fireballmooth
Definition fireball.qc:342
void W_Fireball_Attack1_Frame1(Weapon thiswep, entity actor,.entity weaponentity, int fire)
Definition fireball.qc:233
void W_Fireball_Attack1_Frame4(Weapon thiswep, entity actor,.entity weaponentity, int fire)
Definition fireball.qc:215
void W_Fireball_Attack1_Frame3(Weapon thiswep, entity actor,.entity weaponentity, int fire)
Definition fireball.qc:221
void W_Fireball_Explode_think(entity this)
Definition fireball.qc:73
void W_Fireball_Attack1(entity actor,.entity weaponentity)
Definition fireball.qc:169
void W_Fireball_AttackEffect(entity actor,.entity weaponentity, float i, vector f_diff)
Definition fireball.qc:208
void W_Fireball_LaserPlay(entity this, float rad, float damage, float edgedamage, float burntime)
Definition fireball.qc:89
void W_Fireball_Attack1_Frame2(Weapon thiswep, entity actor,.entity weaponentity, int fire)
Definition fireball.qc:227
float fireball_primarytime
Definition fireball.qh:81
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
float pushltime
Definition jumppads.qh:21
#define TC(T, sym)
Definition _all.inc:82
#define STAT(...)
Definition stats.qh:94
entity WarpZone_FindRadius(vector org, float rad, bool needlineofsight)
Definition common.qc:651
vector WarpZone_UnTransformOrigin(entity wz, vector v)
Definition common.qc:519
float random(void)
float vlen(vector v)
vector vectoangles(vector v)
float sqrt(float f)
vector normalize(vector v)
void modeleffect_spawn(string m, float s, float f, vector o, vector v, vector ang, vector angv, float s0, float s2, float a, float t1, float t2)
void set_movetype(entity this, int mt)
Definition movetypes.qc:4
const int MOVETYPE_FLY
Definition movetypes.qh:138
const int MOVETYPE_BOUNCE
Definition movetypes.qh:143
var void func_null()
entity Notification
always last
Definition all.qh:85
#define METHOD(cname, name, prototype)
Definition oo.qh:274
#define NULL
Definition post.qh:14
const int PROJECTILE_FIREMINE
const int PROJECTILE_FIREBALL
ERASEABLE void RandomSelection_Init()
Definition random.qc:4
#define RandomSelection_AddEnt(e, weight, priority)
Definition random.qh:14
entity RandomSelection_chosen_ent
Definition random.qh:5
float health
Legacy fields for the resources. To be removed.
Definition resources.qh:9
#define setthink(e, f)
vector
Definition self.qh:96
entity entity toucher
Definition self.qh:76
#define settouch(e, f)
Definition self.qh:77
#define IS_INDEPENDENT_PLAYER(e)
Definition client.qh:312
int dir
Definition impulse.qc:89
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
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_PROXY
Definition common.qh:48
const int MIF_ARC
Definition common.qh:47
#define PROJECTILE_MAKETRIGGER(e)
Definition common.qh:34
const int CH_WEAPON_SINGLE
Definition sound.qh:9
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 float ATTEN_NORM
Definition sound.qh:30
#define sound(e, c, s, v, a)
Definition sound.qh:52
bool StatusEffects_active(StatusEffect this, entity actor)
#define PAGE_TEXT
Definition string.qh:651
#define PAR(...)
Adds an individually translatable paragraph to PAGE_TEXT without having to deal with strcat and sprin...
Definition string.qh:657
#define PAGE_TEXT_INIT()
Definition string.qh:650
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
#define SAME_TEAM(a, b)
Definition teams.qh:241
#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
#define W_SetupProjVelocity_PRI(ent, wep)
Definition tracing.qh:67
vector w_shotorg
Definition tracing.qh:19
#define W_SetupProjVelocity_UP_SEC(ent, wep)
Definition tracing.qh:56
#define vlen2(v)
Definition vector.qh:4
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt().
Definition vector.qh:8
string W_Guide_Keybinds(Weapon wep)
Definition all.qc:824
string W_Guide_DPS(string name, string pri, string sec)
Definition all.qc:918
void W_MuzzleFlash(Weapon thiswep, entity actor,.entity weaponentity, vector shotorg, vector shotdir)
Definition all.qc:715
#define WEP_CVAR_PRI(wep, name)
Definition all.qh:338
#define WEP_CVAR_SEC(wep, name)
Definition all.qh:339
const int MAX_WEAPONSLOTS
Definition weapon.qh:16
entity weaponentities[MAX_WEAPONSLOTS]
Definition weapon.qh:17
void 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)
float bulletcounter
entity weaponentity_fld