Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
fireball.qc File Reference
#include "fireball.qh"
Include dependency graph for fireball.qc:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void W_Fireball_Attack1 (entity actor,.entity weaponentity)
void W_Fireball_Attack1_Frame0 (Weapon thiswep, entity actor,.entity weaponentity, int fire)
void W_Fireball_Attack1_Frame1 (Weapon thiswep, entity actor,.entity weaponentity, int fire)
void W_Fireball_Attack1_Frame2 (Weapon thiswep, entity actor,.entity weaponentity, int fire)
void W_Fireball_Attack1_Frame3 (Weapon thiswep, entity actor,.entity weaponentity, int fire)
void W_Fireball_Attack1_Frame4 (Weapon thiswep, entity actor,.entity weaponentity, int fire)
void W_Fireball_Attack2 (entity actor,.entity weaponentity)
void W_Fireball_AttackEffect (entity actor,.entity weaponentity, int bullet_count)
void W_Fireball_Damage (entity this, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
void W_Fireball_Explode (entity this, entity directhitentity)
bool W_Fireball_Explode_cond (entity e)
void W_Fireball_Explode_think (entity this)
void W_Fireball_Explode_use (entity this, entity actor, entity trigger)
void W_Fireball_Firemine_Think (entity this)
void W_Fireball_Firemine_Touch (entity this, entity toucher)
bool W_Fireball_LaserPlay_cond (entity e)
void W_Fireball_Think (entity this)
void W_Fireball_TouchExplode (entity this, entity toucher)

Variables

bool bot_primary_fireballmooth

Function Documentation

◆ W_Fireball_Attack1()

void W_Fireball_Attack1 ( entity actor,
.entity weaponentity )

Definition at line 134 of file fireball.qc.

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}
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 lifetime
Definition powerups.qc:23
const int FL_PROJECTILE
Definition constants.qh:77
float time
void CSQCProjectile(entity e, float clientanimate, int type, float docull)
float damageforcescale
SetResourceExplicit(ent, RES_ARMOR, ReadByte() *DEC_FACTOR)) ENTCS_PROP(NAME
void W_Fireball_Think(entity this)
Definition fireball.qc:99
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_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
Definition fireball.qc:119
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
void WarpZone_RefSys_Copy(entity me, entity from)
Copies the warpzone reference of from onto me.
Definition common.qc:824
vector vectoangles(vector v)
void set_movetype(entity this, int mt)
Definition movetypes.qc:4
const int MOVETYPE_FLY
Definition movetypes.qh:138
const int PROJECTILE_FIREBALL
float health
Legacy fields for the resources. To be removed.
Definition resources.qh:9
#define setthink(e, f)
#define settouch(e, f)
Definition self.qh:77
const int MIF_SPLASH
Definition common.qh:58
IntrusiveList g_projectiles
Definition common.qh:70
const int MIF_PROXY
Definition common.qh:60
#define PROJECTILE_MAKETRIGGER(e)
Definition common.qh:46
const int CH_WEAPON_A
Definition sound.qh:7
const int DAMAGE_YES
Definition subs.qh:80
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
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

References CH_WEAPON_A, CSQCProjectile(), DAMAGE_YES, damageforcescale, entity(), FL_PROJECTILE, g_bot_dodge, g_projectiles, health, IL_PUSH(), lifetime, MIF_PROXY, MIF_SPLASH, MOVETYPE_FLY, MUTATOR_CALLHOOK, PROJECTILE_FIREBALL, PROJECTILE_MAKETRIGGER, set_movetype(), SetResourceExplicit(), setthink, settouch, time, vectoangles(), W_Fireball_Damage(), W_Fireball_Explode_use(), W_Fireball_Think(), W_Fireball_TouchExplode(), W_MuzzleFlash(), W_SetupProjVelocity_PRI, W_SetupShot_ProjectileSize, w_shotdir, w_shotorg, WarpZone_RefSys_Copy(), and WEP_CVAR_PRI.

Referenced by W_Fireball_Attack1_Frame4().

◆ W_Fireball_Attack1_Frame0()

void W_Fireball_Attack1_Frame0 ( Weapon thiswep,
entity actor,
.entity weaponentity,
int fire )

Definition at line 207 of file fireball.qc.

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}
void W_Fireball_AttackEffect(entity actor,.entity weaponentity, int bullet_count)
Definition fireball.qc:174
void W_Fireball_Attack1_Frame1(Weapon thiswep, entity actor,.entity weaponentity, int fire)
Definition fireball.qc:201
const int CH_WEAPON_SINGLE
Definition sound.qh:9
const float VOL_BASE
Definition sound.qh:36
const float ATTEN_NORM
Definition sound.qh:30
#define sound(e, c, s, v, a)
Definition sound.qh:52
void weapon_thinkf(entity actor,.entity weaponentity, WFRAME fr, float t, void(Weapon thiswep, entity actor,.entity weaponentity, int fire) func)

References ATTEN_NORM, CH_WEAPON_SINGLE, entity(), sound, VOL_BASE, W_Fireball_Attack1_Frame1(), W_Fireball_AttackEffect(), weapon_thinkf(), and WEP_CVAR_PRI.

◆ W_Fireball_Attack1_Frame1()

void W_Fireball_Attack1_Frame1 ( Weapon thiswep,
entity actor,
.entity weaponentity,
int fire )

Definition at line 201 of file fireball.qc.

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}
void W_Fireball_Attack1_Frame2(Weapon thiswep, entity actor,.entity weaponentity, int fire)
Definition fireball.qc:195

References entity(), W_Fireball_Attack1_Frame2(), W_Fireball_AttackEffect(), weapon_thinkf(), and WEP_CVAR_PRI.

Referenced by W_Fireball_Attack1_Frame0().

◆ W_Fireball_Attack1_Frame2()

void W_Fireball_Attack1_Frame2 ( Weapon thiswep,
entity actor,
.entity weaponentity,
int fire )

Definition at line 195 of file fireball.qc.

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}
void W_Fireball_Attack1_Frame3(Weapon thiswep, entity actor,.entity weaponentity, int fire)
Definition fireball.qc:189

References entity(), W_Fireball_Attack1_Frame3(), W_Fireball_AttackEffect(), weapon_thinkf(), and WEP_CVAR_PRI.

Referenced by W_Fireball_Attack1_Frame1().

◆ W_Fireball_Attack1_Frame3()

void W_Fireball_Attack1_Frame3 ( Weapon thiswep,
entity actor,
.entity weaponentity,
int fire )

Definition at line 189 of file fireball.qc.

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}
void W_Fireball_Attack1_Frame4(Weapon thiswep, entity actor,.entity weaponentity, int fire)
Definition fireball.qc:183

References entity(), W_Fireball_Attack1_Frame4(), W_Fireball_AttackEffect(), weapon_thinkf(), and WEP_CVAR_PRI.

Referenced by W_Fireball_Attack1_Frame2().

◆ W_Fireball_Attack1_Frame4()

void W_Fireball_Attack1_Frame4 ( Weapon thiswep,
entity actor,
.entity weaponentity,
int fire )

Definition at line 183 of file fireball.qc.

184{
185 W_Fireball_Attack1(actor, weaponentity);
186 weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(WEP_FIREBALL, animtime), w_ready);
187}
void W_Fireball_Attack1(entity actor,.entity weaponentity)
Definition fireball.qc:134
void w_ready(Weapon thiswep, entity actor,.entity weaponentity, int fire)

References entity(), W_Fireball_Attack1(), w_ready(), weapon_thinkf(), and WEP_CVAR_PRI.

Referenced by W_Fireball_Attack1_Frame3().

◆ W_Fireball_Attack2()

void W_Fireball_Attack2 ( entity actor,
.entity weaponentity )

Definition at line 257 of file fireball.qc.

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}
const int FL_STATICOWNER
Definition constants.qh:83
const int HITTYPE_SECONDARY
Definition all.qh:31
void W_Fireball_Firemine_Touch(entity this, entity toucher)
Definition fireball.qc:245
void W_Fireball_Firemine_Think(entity this)
Definition fireball.qc:214
vector movedir
Definition viewloc.qh:18
const int MOVETYPE_BOUNCE
Definition movetypes.qh:143
const int PROJECTILE_FIREMINE
vector
Definition self.qh:96
const int MIF_ARC
Definition common.qh:59
vector W_SetupShot_GetAlternatingOffset(int bullet_count)
Definition tracing.qc:166
#define W_SetupProjVelocity_UP_SEC(ent, wep)
Definition tracing.qh:58
#define WEP_CVAR_SEC(wep, name)
Definition all.qh:339

References CH_WEAPON_A, CSQCProjectile(), damageforcescale, entity(), FL_PROJECTILE, FL_STATICOWNER, g_bot_dodge, g_projectiles, HITTYPE_SECONDARY, IL_PUSH(), lifetime, MIF_ARC, MIF_PROXY, MIF_SPLASH, movedir, MOVETYPE_BOUNCE, MUTATOR_CALLHOOK, PROJECTILE_FIREMINE, PROJECTILE_MAKETRIGGER, set_movetype(), setthink, settouch, time, vectoangles(), vector, W_Fireball_Firemine_Think(), W_Fireball_Firemine_Touch(), W_MuzzleFlash(), W_SetupProjVelocity_UP_SEC, W_SetupShot_GetAlternatingOffset(), W_SetupShot_ProjectileSize, w_shotdir, w_shotorg, WarpZone_RefSys_Copy(), and WEP_CVAR_SEC.

◆ W_Fireball_AttackEffect()

void W_Fireball_AttackEffect ( entity actor,
.entity weaponentity,
int bullet_count )

Definition at line 174 of file fireball.qc.

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}
void Send_Effect(entity eff, vector eff_loc, vector eff_vel, int eff_cnt)
Definition all.qc:155

References entity(), movedir, Send_Effect(), vector, W_SetupShot_GetAlternatingOffset(), W_SetupShot_ProjectileSize, w_shotdir, and w_shotorg.

Referenced by W_Fireball_Attack1_Frame0(), W_Fireball_Attack1_Frame1(), W_Fireball_Attack1_Frame2(), and W_Fireball_Attack1_Frame3().

◆ W_Fireball_Damage()

void W_Fireball_Damage ( entity this,
entity inflictor,
entity attacker,
float damage,
int deathtype,
.entity weaponentity,
vector hitloc,
vector force )

Definition at line 119 of file fireball.qc.

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}
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.
float cnt
Definition powerups.qc:24
void W_Fireball_Explode_think(entity this)
Definition fireball.qc:75
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

References cnt, entity(), GetResource(), TakeResource(), vector, W_CheckProjectileDamage(), W_Fireball_Explode_think(), and W_PrepareExplosionByDamage().

Referenced by W_Fireball_Attack1().

◆ W_Fireball_Explode()

void W_Fireball_Explode ( entity this,
entity directhitentity )

Definition at line 10 of file fireball.qc.

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}
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
float radius
Definition impulse.qh:11
entity trace_ent
const float MOVE_NORMAL
vector origin
float trace_fraction
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
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
RES_ARMOR
Definition ent_cs.qc:155
bool W_Fireball_Explode_cond(entity e)
Definition fireball.qc:5
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
#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
float vlen(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)
var void func_null()
#define NULL
Definition post.qh:14
int projectiledeathtype
Definition common.qh:33
const int DAMAGE_NO
Definition subs.qh:79
float takedamage
Definition subs.qh:78
entity realowner
entity weaponentity_fld

References accuracy_add(), accuracy_isgooddamage(), cnt, Damage(), DAMAGE_NO, entity(), func_null(), GetResource(), HITTYPE_BOUNCE, HITTYPE_SPLASH, modeleffect_spawn(), MOVE_NORMAL, NULL, origin, projectiledeathtype, radius, RadiusDamage(), realowner, RES_ARMOR, Send_Effect(), sqrt(), takedamage, trace_ent, trace_fraction, vector, vlen(), W_Fireball_Explode_cond(), WarpZone_RefSys_TransformOrigin(), WarpZone_SearchInRadius(), WarpZone_SearchInRadius_otherent, WarpZone_TraceLine, WarpZone_TransformOrigin(), weaponentity_fld, and WEP_CVAR_PRI.

Referenced by W_Fireball_Explode_think(), W_Fireball_Explode_use(), W_Fireball_Think(), and W_Fireball_TouchExplode().

◆ W_Fireball_Explode_cond()

bool W_Fireball_Explode_cond ( entity e)

Definition at line 5 of file fireball.qc.

6{
7 return (e != WarpZone_SearchInRadius_otherent.realowner && e.takedamage == DAMAGE_AIM && !IS_INDEPENDENT_PLAYER(e)
9}
#define IS_PLAYER(s)
Definition player.qh:242
#define IS_INDEPENDENT_PLAYER(e)
Definition client.qh:312
const int DAMAGE_AIM
Definition subs.qh:81
#define DIFF_TEAM(a, b)
Definition teams.qh:242

References DAMAGE_AIM, DIFF_TEAM, entity(), IS_INDEPENDENT_PLAYER, IS_PLAYER, and WarpZone_SearchInRadius_otherent.

Referenced by W_Fireball_Explode().

◆ W_Fireball_Explode_think()

void W_Fireball_Explode_think ( entity this)

Definition at line 75 of file fireball.qc.

76{
78}
void W_Fireball_Explode(entity this, entity directhitentity)
Definition fireball.qc:10

References entity(), NULL, and W_Fireball_Explode().

Referenced by W_Fireball_Damage().

◆ W_Fireball_Explode_use()

void W_Fireball_Explode_use ( entity this,
entity actor,
entity trigger )

Definition at line 80 of file fireball.qc.

81{
82 W_Fireball_Explode(this, trigger);
83}

References entity(), and W_Fireball_Explode().

Referenced by W_Fireball_Attack1().

◆ W_Fireball_Firemine_Think()

void W_Fireball_Firemine_Think ( entity this)

Definition at line 214 of file fireball.qc.

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}
entity owner
Definition main.qh:87
float nextthink
bool W_Fireball_LaserPlay_cond(entity e)
Definition fireball.qc:91
float pushltime
Definition jumppads.qh:21
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
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt().
Definition vector.qh:8

References cnt, entity(), nextthink, NULL, origin, owner, pushltime, time, vdist, vector, W_Fireball_LaserPlay_cond(), W_LaserPlay(), WarpZone_RefSys_TransformOrigin(), and WEP_CVAR_SEC.

Referenced by W_Fireball_Attack2().

◆ W_Fireball_Firemine_Touch()

void W_Fireball_Firemine_Touch ( entity this,
entity toucher )

Definition at line 245 of file fireball.qc.

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}
float Fire_AddDamage(entity e, entity o, float d, float t, float dt)
Definition damage.qc:968
entity entity toucher
Definition self.qh:76
#define PROJECTILE_TOUCH(e, t)
Definition common.qh:40

References DAMAGE_AIM, entity(), Fire_AddDamage(), HITTYPE_BOUNCE, PROJECTILE_TOUCH, projectiledeathtype, realowner, toucher, and WEP_CVAR_SEC.

Referenced by W_Fireball_Attack2().

◆ W_Fireball_LaserPlay_cond()

bool W_Fireball_LaserPlay_cond ( entity e)

Definition at line 91 of file fireball.qc.

92{
93 return (e.takedamage == DAMAGE_AIM
96 && !STAT(FROZEN, e) && !StatusEffects_active(STATUSEFFECT_Frozen, e));
97}
#define STAT(...)
Definition stats.qh:94
bool StatusEffects_active(StatusEffect this, entity actor)

References DAMAGE_AIM, DIFF_TEAM, entity(), IS_INDEPENDENT_PLAYER, IS_PLAYER, STAT, StatusEffects_active(), and WarpZone_SearchInRadius_otherent.

Referenced by W_Fireball_Firemine_Think(), and W_Fireball_Think().

◆ W_Fireball_Think()

void W_Fireball_Think ( entity this)

Definition at line 99 of file fireball.qc.

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}

References cnt, entity(), HITTYPE_SPLASH, nextthink, NULL, projectiledeathtype, pushltime, time, W_Fireball_Explode(), W_Fireball_LaserPlay_cond(), W_LaserPlay(), and WEP_CVAR_PRI.

Referenced by W_Fireball_Attack1().

◆ W_Fireball_TouchExplode()

void W_Fireball_TouchExplode ( entity this,
entity toucher )

Definition at line 85 of file fireball.qc.

86{
89}

References entity(), PROJECTILE_TOUCH, toucher, and W_Fireball_Explode().

Referenced by W_Fireball_Attack1().

Variable Documentation

◆ bot_primary_fireballmooth

bool bot_primary_fireballmooth

Definition at line 294 of file fireball.qc.