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
10void W_Fireball_Explode(entity this, entity directhitentity)
11{
12 this.event_damage = func_null;
13 this.takedamage = DAMAGE_NO;
14
15 // 1. dist damage
16 float d = GetResource(this.realowner, RES_HEALTH) + GetResource(this.realowner, RES_ARMOR);
17
18 RadiusDamage(this, this.realowner,
19 WEP_CVAR_PRI(WEP_FIREBALL, damage),
20 WEP_CVAR_PRI(WEP_FIREBALL, edgedamage),
21 WEP_CVAR_PRI(WEP_FIREBALL, radius),
22 NULL,
23 NULL,
24 WEP_CVAR_PRI(WEP_FIREBALL, force),
26 this.weaponentity_fld, directhitentity
27 );
28
29 if (GetResource(this.realowner, RES_HEALTH) + GetResource(this.realowner, RES_ARMOR) >= d
30 && !this.cnt)
31 {
32 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);
33
34 // 2. bfg effect
35 // Apply bfg damage to enemies within the radius who can trace to the fireball and the fireball's .realowner
36 // k9er: why trace to the fireball's .realowner? it prevents damage if the .realowner goes around a corner, but why?
39 vector force_dir, realowner_org;
40 float points, dist;
41 for (; e; e = e.chain)
42 {
43 // we can trace from the fireball, but can we trace to the eyes of the player who shot the fireball?
44 realowner_org = WarpZone_RefSys_TransformOrigin(this.realowner, this, this.realowner.origin + this.realowner.view_ofs);
45 WarpZone_TraceLine(e.WarpZone_findradius_nearest, WarpZone_TransformOrigin(e, realowner_org), MOVE_NORMAL, e);
46 if (trace_ent != this.realowner
47 && (/* trace_startsolid || */ trace_fraction != 1))
48 continue;
49
50 dist = vlen(e.WarpZone_findradius_dist);
51 // k9er: all this just to use different RadiusDamage falloff and require line of sight to .realowner??
52 points = 1 - sqrt(dist / WEP_CVAR_PRI(WEP_FIREBALL, bfgradius));
53 if (points <= 0) // should never occur
54 continue;
55 force_dir = e.WarpZone_findradius_dist * 1 / -dist;
56
58 accuracy_add(this.realowner, WEP_FIREBALL, 0, WEP_CVAR_PRI(WEP_FIREBALL, bfgdamage) * points, 0); // add to hit
59
60 Damage(e, this, this.realowner,
61 WEP_CVAR_PRI(WEP_FIREBALL, bfgdamage) * points,
64 e.WarpZone_findradius_nearest,
65 WEP_CVAR_PRI(WEP_FIREBALL, bfgforce) * force_dir
66 );
67
68 Send_Effect(EFFECT_FIREBALL_BFGDAMAGE, e.WarpZone_findradius_nearest, -force_dir, 1);
69 }
70 }
71
72 delete(this);
73}
74
79
80void W_Fireball_Explode_use(entity this, entity actor, entity trigger)
81{
82 W_Fireball_Explode(this, trigger);
83}
84
90
92{
93 return (e.takedamage == DAMAGE_AIM
96 && !STAT(FROZEN, e) && !StatusEffects_active(STATUSEFFECT_Frozen, e));
97}
98
100{
101 if (time > this.pushltime)
102 {
103 this.cnt = 1;
106 return;
107 }
108
109 W_LaserPlay(this,
110 WEP_CVAR_PRI(WEP_FIREBALL, laserradius),
111 WEP_CVAR_PRI(WEP_FIREBALL, laserdamage),
112 WEP_CVAR_PRI(WEP_FIREBALL, laseredgedamage),
113 WEP_CVAR_PRI(WEP_FIREBALL, laserburntime),
115
116 this.nextthink = time + 0.1;
117}
118
119void W_Fireball_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force)
120{
121 if (GetResource(this, RES_HEALTH) <= 0)
122 return;
123 if (!W_CheckProjectileDamage(inflictor.realowner, this.realowner, deathtype, -1)) // no exceptions
124 return; // g_projectiles_damage says to halt
125
126 TakeResource(this, RES_HEALTH, damage);
127 if (GetResource(this, RES_HEALTH) <= 0)
128 {
129 this.cnt = 1;
131 }
132}
133
134void W_Fireball_Attack1(entity actor, .entity weaponentity)
135{
136 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);
137
138 W_MuzzleFlash(WEP_FIREBALL, actor, weaponentity, w_shotorg, w_shotdir);
139
140 entity proj = new(plasma_prim);
141 WarpZone_RefSys_Copy(proj, actor);
142 proj.owner = proj.realowner = actor;
143 proj.bot_dodge = true;
144 proj.bot_dodgerating = WEP_CVAR_PRI(WEP_FIREBALL, damage);
145 proj.pushltime = time + WEP_CVAR_PRI(WEP_FIREBALL, lifetime);
146 proj.use = W_Fireball_Explode_use;
148 proj.nextthink = time;
149 SetResourceExplicit(proj, RES_HEALTH, WEP_CVAR_PRI(WEP_FIREBALL, health));
150 proj.team = actor.team;
151 proj.event_damage = W_Fireball_Damage;
152 proj.takedamage = DAMAGE_YES;
153 proj.damageforcescale = WEP_CVAR_PRI(WEP_FIREBALL, damageforcescale);
155 proj.projectiledeathtype = WEP_FIREBALL.m_id;
156 proj.weaponentity_fld = weaponentity;
157 setorigin(proj, w_shotorg);
158
160 W_SetupProjVelocity_PRI(proj, WEP_FIREBALL);
161 proj.angles = vectoangles(proj.velocity);
163 setsize(proj, '-16 -16 -16', '16 16 16');
164 proj.flags = FL_PROJECTILE;
165 IL_PUSH(g_projectiles, proj);
166 IL_PUSH(g_bot_dodge, proj);
167 proj.missile_flags = MIF_SPLASH | MIF_PROXY;
168
169 CSQCProjectile(proj, true, PROJECTILE_FIREBALL, true);
170
171 MUTATOR_CALLHOOK(EditProjectile, actor, proj);
172}
173
174void W_Fireball_AttackEffect(entity actor, .entity weaponentity, int bullet_count)
175{
176 vector old_movedir = actor.(weaponentity).movedir;
177 actor.(weaponentity).movedir += W_SetupShot_GetAlternatingOffset(bullet_count);
178 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
179 actor.(weaponentity).movedir = old_movedir;
180 Send_Effect(EFFECT_FIREBALL_PRE_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
181}
182
183void W_Fireball_Attack1_Frame4(Weapon thiswep, entity actor, .entity weaponentity, int fire)
184{
185 W_Fireball_Attack1(actor, weaponentity);
186 weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(WEP_FIREBALL, animtime), w_ready);
187}
188
189void W_Fireball_Attack1_Frame3(Weapon thiswep, entity actor, .entity weaponentity, int fire)
190{
191 W_Fireball_AttackEffect(actor, weaponentity, 3);
192 weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(WEP_FIREBALL, animtime), W_Fireball_Attack1_Frame4);
193}
194
195void W_Fireball_Attack1_Frame2(Weapon thiswep, entity actor, .entity weaponentity, int fire)
196{
197 W_Fireball_AttackEffect(actor, weaponentity, 2);
198 weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(WEP_FIREBALL, animtime), W_Fireball_Attack1_Frame3);
199}
200
201void W_Fireball_Attack1_Frame1(Weapon thiswep, entity actor, .entity weaponentity, int fire)
202{
203 W_Fireball_AttackEffect(actor, weaponentity, 1);
204 weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(WEP_FIREBALL, animtime), W_Fireball_Attack1_Frame2);
205}
206
207void W_Fireball_Attack1_Frame0(Weapon thiswep, entity actor, .entity weaponentity, int fire)
208{
209 W_Fireball_AttackEffect(actor, weaponentity, 0);
210 sound(actor, CH_WEAPON_SINGLE, SND_FIREBALL_PREFIRE2, VOL_BASE, ATTEN_NORM);
211 weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(WEP_FIREBALL, animtime), W_Fireball_Attack1_Frame1);
212}
213
215{
216 if (time > this.pushltime)
217 {
218 delete(this);
219 return;
220 }
221
222 // Make it "hot" once it leaves its owner: can touch the owner, but won't do laserplay
223 if (this.owner)
224 {
225 vector owner_view_origin = WarpZone_RefSys_TransformOrigin(this.owner, this, this.owner.origin + this.owner.view_ofs);
226 if (vdist(this.origin - owner_view_origin, >, WEP_CVAR_SEC(WEP_FIREBALL, laserradius)))
227 {
228 if (++this.cnt == 3)
229 this.owner = NULL;
230 }
231 else
232 this.cnt = 0;
233 }
234
235 W_LaserPlay(this,
236 WEP_CVAR_SEC(WEP_FIREBALL, laserradius),
237 WEP_CVAR_SEC(WEP_FIREBALL, laserdamage),
238 WEP_CVAR_SEC(WEP_FIREBALL, laseredgedamage),
239 WEP_CVAR_SEC(WEP_FIREBALL, laserburntime),
241
242 this.nextthink = time + 0.1;
243}
244
246{
248 if (toucher.takedamage == DAMAGE_AIM
249 && Fire_AddDamage(toucher, this.realowner, WEP_CVAR_SEC(WEP_FIREBALL, damage), WEP_CVAR_SEC(WEP_FIREBALL, damagetime), this.projectiledeathtype) >= 0)
250 {
251 delete(this);
252 return;
253 }
255}
256
257void W_Fireball_Attack2(entity actor, .entity weaponentity)
258{
259 vector old_movedir = actor.(weaponentity).movedir;
260 actor.(weaponentity).movedir += W_SetupShot_GetAlternatingOffset(actor.(weaponentity).bulletcounter);
261 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);
262 actor.(weaponentity).movedir = old_movedir;
263
264 W_MuzzleFlash(WEP_FIREBALL, actor, weaponentity, w_shotorg, w_shotdir);
265
266 entity proj = new(grenade);
267 WarpZone_RefSys_Copy(proj, actor);
268 proj.owner = proj.realowner = actor;
269 proj.bot_dodge = true;
270 proj.bot_dodgerating = WEP_CVAR_SEC(WEP_FIREBALL, damage);
272 proj.projectiledeathtype = WEP_FIREBALL.m_id | HITTYPE_SECONDARY;
275 setsize(proj, '-4 -4 -4', '4 4 4');
276 setorigin(proj, w_shotorg);
278 proj.nextthink = time;
279 proj.damageforcescale = WEP_CVAR_SEC(WEP_FIREBALL, damageforcescale);
280 proj.pushltime = time + WEP_CVAR_SEC(WEP_FIREBALL, lifetime);
281 W_SetupProjVelocity_UP_SEC(proj, WEP_FIREBALL);
282
283 proj.angles = vectoangles(proj.velocity);
284 proj.flags = FL_PROJECTILE | FL_STATICOWNER;
285 IL_PUSH(g_projectiles, proj);
286 IL_PUSH(g_bot_dodge, proj);
287 proj.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_ARC;
288
289 CSQCProjectile(proj, true, PROJECTILE_FIREMINE, true);
290
291 MUTATOR_CALLHOOK(EditProjectile, actor, proj);
292}
293
294.bool bot_primary_fireballmooth; // whatever a mooth is
295
296METHOD(Fireball, wr_aim, void(entity thiswep, entity actor, .entity weaponentity))
297{
298 PHYS_INPUT_BUTTON_ATCK(actor) = false;
299 PHYS_INPUT_BUTTON_ATCK2(actor) = false;
300 if (!actor.bot_primary_fireballmooth)
301 {
302 if (bot_aim(actor, weaponentity, WEP_CVAR_PRI(WEP_FIREBALL, speed), 0, WEP_CVAR_PRI(WEP_FIREBALL, lifetime), false, false))
303 {
304 PHYS_INPUT_BUTTON_ATCK(actor) = true;
305 if (random() < 0.02)
306 actor.bot_primary_fireballmooth = true;
307 }
308 }
309 else
310 {
311 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))
312 {
313 PHYS_INPUT_BUTTON_ATCK2(actor) = true;
314 if (random() < 0.01)
315 actor.bot_primary_fireballmooth = false;
316 }
317 }
318}
319
320METHOD(Fireball, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
321{
322 if (fire & 1)
323 {
324 if (time >= actor.(weaponentity).fireball_primarytime
325 && weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(WEP_FIREBALL, refire)))
326 {
327 W_Fireball_Attack1_Frame0(thiswep, actor, weaponentity, fire);
328 actor.(weaponentity).fireball_primarytime = time + WEP_CVAR_PRI(WEP_FIREBALL, refire2) * W_WeaponRateFactor(actor);
329 }
330 }
331 else if (fire & 2)
332 {
333 if (weapon_prepareattack(thiswep, actor, weaponentity, true, WEP_CVAR_SEC(WEP_FIREBALL, refire)))
334 {
335 W_Fireball_Attack2(actor, weaponentity);
336 weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(WEP_FIREBALL, animtime), w_ready);
337 }
338 }
339}
340
341METHOD(Fireball, wr_checkammo1, bool(entity thiswep, entity actor, .entity weaponentity))
342{
343 return true; // fireball has infinite ammo
344}
345
346METHOD(Fireball, wr_checkammo2, bool(entity thiswep, entity actor, .entity weaponentity))
347{
348 return true; // fireball has infinite ammo
349}
350
351METHOD(Fireball, wr_resetplayer, void(entity thiswep, entity actor))
352{
353 for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
354 {
355 .entity weaponentity = weaponentities[slot];
356 actor.(weaponentity).fireball_primarytime = time;
357 }
358}
359
360METHOD(Fireball, wr_suicidemessage, Notification(entity thiswep))
361{
363 return WEAPON_FIREBALL_SUICIDE_FIREMINE;
364 else
365 return WEAPON_FIREBALL_SUICIDE_BLAST;
366}
367
368METHOD(Fireball, wr_killmessage, Notification(entity thiswep))
369{
371 return WEAPON_FIREBALL_MURDER_FIREMINE;
372 else
373 return WEAPON_FIREBALL_MURDER_BLAST;
374}
375
376#endif // SVQC
377#ifdef CSQC
378
379METHOD(Fireball, wr_impacteffect, void(entity thiswep, entity actor))
380{
382 {
383 // firemine goes out silently
384 }
385 else
386 {
387 vector org2 = w_org + w_backoff * 2;
388 pointparticles(EFFECT_FIREBALL_EXPLODE, org2, '0 0 0', 1);
389 if (!w_issilent)
390 sound(actor, CH_SHOTS, SND_FIREBALL_IMPACT2, VOL_BASE, ATTEN_NORM * 0.25); // long range boom
391 }
392}
393
394#endif // CSQC
395#ifdef MENUQC
396
397METHOD(Fireball, describe, string(Fireball this))
398{
399 TC(Fireball, this);
401 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));
402 PAR(_("The secondary fire launches flaming balls that set nearby players alight."));
403 PAR(_("It is a superweapon, so isn't often found in game."));
404 PAR(_("It doesn't require ammo, but it is destroyed after some time."));
405 PAR(_("Since the %s takes a moment to charge and the fireball travels slowly, using it effectively may be difficult, "
406 "but if done properly it can deal a ton of damage."), COLORED_NAME(this));
407 PAR(W_Guide_Keybinds(this));
408 PAR(W_Guide_DPS(this.netname, "primary", "secondary"));
409 return PAGE_TEXT;
410}
411
412#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:77
const int FL_STATICOWNER
Definition constants.qh:83
entity trace_ent
const float MOVE_NORMAL
float time
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:484
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 Fire_AddDamage(entity e, entity o, float d, float t, float dt)
Definition damage.qc:968
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:6
void Send_Effect(entity eff, vector eff_loc, vector eff_vel, int eff_cnt)
Definition all.qc:155
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:99
void W_Fireball_Attack2(entity actor,.entity weaponentity)
Definition fireball.qc:257
void W_Fireball_Explode_use(entity this, entity actor, entity trigger)
Definition fireball.qc:80
void W_Fireball_TouchExplode(entity this, entity toucher)
Definition fireball.qc:85
void W_Fireball_Firemine_Touch(entity this, entity toucher)
Definition fireball.qc:245
void W_Fireball_Attack1_Frame0(Weapon thiswep, entity actor,.entity weaponentity, int fire)
Definition fireball.qc:207
bool W_Fireball_LaserPlay_cond(entity e)
Definition fireball.qc:91
void W_Fireball_Firemine_Think(entity this)
Definition fireball.qc:214
void W_Fireball_AttackEffect(entity actor,.entity weaponentity, int bullet_count)
Definition fireball.qc:174
void W_Fireball_Explode(entity this, entity directhitentity)
Definition fireball.qc:10
void W_Fireball_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
Definition fireball.qc:119
bool bot_primary_fireballmooth
Definition fireball.qc:294
bool W_Fireball_Explode_cond(entity e)
Definition fireball.qc:5
void W_Fireball_Attack1_Frame1(Weapon thiswep, entity actor,.entity weaponentity, int fire)
Definition fireball.qc:201
void W_Fireball_Attack1_Frame4(Weapon thiswep, entity actor,.entity weaponentity, int fire)
Definition fireball.qc:183
void W_Fireball_Attack1_Frame3(Weapon thiswep, entity actor,.entity weaponentity, int fire)
Definition fireball.qc:189
void W_Fireball_Explode_think(entity this)
Definition fireball.qc:75
void W_Fireball_Attack1(entity actor,.entity weaponentity)
Definition fireball.qc:134
void W_Fireball_Attack1_Frame2(Weapon thiswep, entity actor,.entity weaponentity, int fire)
Definition fireball.qc:195
float fireball_primarytime
Definition fireball.qh:80
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_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:680
vector WarpZone_TransformOrigin(entity wz, vector org)
Transforms origin org across warpzone wz.
Definition common.qc:489
vector WarpZone_RefSys_TransformOrigin(entity from, entity to, vector org)
Transform origin org in from's reference into to's reference.
Definition common.qc:787
void WarpZone_RefSys_Copy(entity me, entity from)
Copies the warpzone reference of from onto me.
Definition common.qc:824
#define WarpZone_TraceLine(org, end, nomonsters, forent)
Definition common.qh:51
noref entity WarpZone_SearchInRadius_otherent
Free to use in the callback.
Definition common.qh:71
vector movedir
Definition viewloc.qh:18
float random(void)
float vlen(vector v)
vector vectoangles(vector v)
float sqrt(float f)
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
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
float W_CheckProjectileDamage(entity inflictor, entity projowner, int deathtype, float exception)
Definition common.qc:45
void W_LaserPlay(entity this, float rad, float damage, float edgedamage, float burntime, WarpZone_FindRadius_cond_callback_t cb)
Randomly chooses a player within the radius to shoot a laser towards.
Definition common.qc:191
void W_PrepareExplosionByDamage(entity this, entity attacker, void(entity this) explode)
Definition common.qc:87
const int MIF_SPLASH
Definition common.qh:58
int projectiledeathtype
Definition common.qh:33
#define PROJECTILE_TOUCH(e, t)
Definition common.qh:40
IntrusiveList g_projectiles
Definition common.qh:70
const int MIF_PROXY
Definition common.qh:60
const int MIF_ARC
Definition common.qh:59
#define PROJECTILE_MAKETRIGGER(e)
Definition common.qh:46
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 DIFF_TEAM(a, b)
Definition teams.qh:242
entity realowner
vector W_SetupShot_GetAlternatingOffset(int bullet_count)
Definition tracing.qc:166
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:69
vector w_shotorg
Definition tracing.qh:19
#define W_SetupProjVelocity_UP_SEC(ent, wep)
Definition tracing.qh:58
#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)
entity weaponentity_fld