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

Go to the source code of this file.

Functions

void W_Devastator_Attack (Weapon thiswep, entity actor,.entity weaponentity, int fire)
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)
void W_Devastator_Explode (entity this, entity directhitentity)
void W_Devastator_Explode_think (entity this)
void W_Devastator_RemoteExplode (entity this,.entity weaponentity)
vector W_Devastator_SteerTo (vector thisdir, vector goaldir, float maxturn_cos)
void W_Devastator_Think (entity this)
void W_Devastator_Touch (entity this, entity toucher)
void W_Devastator_Unregister (entity this)

Variables

entity lastrocket

Function Documentation

◆ W_Devastator_Attack()

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

Definition at line 312 of file devastator.qc.

313{
314 W_DecreaseAmmo(thiswep, actor, WEP_CVAR(WEP_DEVASTATOR, ammo), weaponentity);
315
316 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);
317 W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir);
318
320 missile.weaponentity_fld = weaponentity;
321 missile.owner = missile.realowner = actor;
322 actor.(weaponentity).lastrocket = missile;
323 if(WEP_CVAR(WEP_DEVASTATOR, detonatedelay) >= 0)
324 missile.spawnshieldtime = time + WEP_CVAR(WEP_DEVASTATOR, detonatedelay);
325 else
326 missile.spawnshieldtime = -1; // NOTE: proximity based when rocket jumping
327 missile.pushltime = time + WEP_CVAR(WEP_DEVASTATOR, guidedelay);
328 missile.classname = "rocket";
329 missile.bot_dodge = true;
330 missile.bot_dodgerating = WEP_CVAR(WEP_DEVASTATOR, damage) * 2; // * 2 because it can be detonated inflight which makes it even more dangerous
331
332 missile.takedamage = DAMAGE_YES;
333 missile.damageforcescale = WEP_CVAR(WEP_DEVASTATOR, damageforcescale);
334 SetResourceExplicit(missile, RES_HEALTH, WEP_CVAR(WEP_DEVASTATOR, health));
335 missile.event_damage = W_Devastator_Damage;
336 missile.damagedbycontents = true;
338
339 set_movetype(missile, MOVETYPE_FLY);
340 PROJECTILE_MAKETRIGGER(missile);
341 missile.projectiledeathtype = thiswep.m_id;
342 setsize(missile, '-3 -3 -3', '3 3 3'); // give it some size so it can be shot
343
344 setorigin(missile, w_shotorg - v_forward * 3); // move it back so it hits the wall at the right point
345 W_SetupProjVelocity_Basic(missile, WEP_CVAR(WEP_DEVASTATOR, speedstart), 0);
346 missile.angles = vectoangles(missile.velocity);
347
350 missile.nextthink = time;
351 missile.cnt = time + WEP_CVAR(WEP_DEVASTATOR, lifetime);
352 missile.rl_detonate_later = (fire & 2); // allow instant detonation
353 missile.flags = FL_PROJECTILE;
354 IL_PUSH(g_projectiles, missile);
355 IL_PUSH(g_bot_dodge, missile);
356 missile.missile_flags = MIF_SPLASH;
357
358 CSQCProjectile(missile, WEP_CVAR(WEP_DEVASTATOR, guiderate) == 0 && WEP_CVAR(WEP_DEVASTATOR, speedaccel) == 0, PROJECTILE_ROCKET, false); // because of fly sound
359
360 // common properties
361 MUTATOR_CALLHOOK(EditProjectile, actor, missile);
362
363 if (time >= missile.nextthink)
364 {
365 getthink(missile)(missile);
366 }
367}
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
bool SetResourceExplicit(entity e, Resource res_type, float amount)
Sets the resource amount of an entity without calling any hooks.
int m_id
Definition weapon.qh:45
float lifetime
Definition powerups.qc:23
const int FL_PROJECTILE
Definition constants.qh:85
float time
vector v_forward
void CSQCProjectile(entity e, float clientanimate, int type, float docull)
IntrusiveList g_damagedbycontents
Definition damage.qh:135
float damageforcescale
void W_Devastator_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
void W_Devastator_Touch(entity this, entity toucher)
void W_Devastator_Think(entity this)
entity lastrocket
Definition devastator.qc:5
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
entity WarpZone_RefSys_SpawnSameRefSys(entity me)
Definition common.qc:808
vector vectoangles(vector v)
void set_movetype(entity this, int mt)
Definition movetypes.qc:4
const int MOVETYPE_FLY
Definition movetypes.qh:134
const int PROJECTILE_ROCKET
Definition projectiles.qh:4
float health
Legacy fields for the resources. To be removed.
Definition resources.qh:9
#define setthink(e, f)
#define getthink(e)
#define settouch(e, f)
Definition self.qh:73
const int MIF_SPLASH
Definition common.qh:46
IntrusiveList g_projectiles
Definition common.qh:58
#define PROJECTILE_MAKETRIGGER(e)
Definition common.qh:34
const int CH_WEAPON_A
Definition sound.qh:7
const int DAMAGE_YES
Definition subs.qh:80
float ammo
Definition sv_turrets.qh:43
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:49
void W_MuzzleFlash(Weapon thiswep, entity actor,.entity weaponentity, vector shotorg, vector shotdir)
Definition all.qc:728
#define WEP_CVAR(wep, name)
Definition all.qh:321
void W_DecreaseAmmo(Weapon wep, entity actor, float ammo_use,.entity weaponentity)

References ammo, CH_WEAPON_A, CSQCProjectile(), DAMAGE_YES, damageforcescale, entity(), FL_PROJECTILE, g_bot_dodge, g_damagedbycontents, g_projectiles, getthink, health, IL_PUSH(), lastrocket, lifetime, Weapon::m_id, MIF_SPLASH, MOVETYPE_FLY, MUTATOR_CALLHOOK, PROJECTILE_MAKETRIGGER, PROJECTILE_ROCKET, set_movetype(), SetResourceExplicit(), setthink, settouch, time, v_forward, vectoangles(), W_DecreaseAmmo(), W_Devastator_Damage(), W_Devastator_Think(), W_Devastator_Touch(), W_MuzzleFlash(), W_SetupProjVelocity_Basic, W_SetupShot_ProjectileSize, w_shotdir, w_shotorg, WarpZone_RefSys_SpawnSameRefSys(), and WEP_CVAR.

◆ W_Devastator_Damage()

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

Definition at line 297 of file devastator.qc.

298{
299 if(GetResource(this, RES_HEALTH) <= 0)
300 return;
301
302 if(!W_CheckProjectileDamage(inflictor.realowner, this.realowner, deathtype, -1)) // no exceptions
303 return; // g_projectiles_damage says to halt
304
305 TakeResource(this, RES_HEALTH, damage);
306 this.angles = vectoangles(this.velocity);
307
308 if(GetResource(this, RES_HEALTH) <= 0)
310}
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.
vector velocity
void W_Devastator_Explode_think(entity this)
Definition devastator.qc:68
ent angles
Definition ent_cs.qc:121
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 angles, entity(), GetResource(), TakeResource(), vectoangles(), vector, velocity, W_CheckProjectileDamage(), W_Devastator_Explode_think(), and W_PrepareExplosionByDamage().

Referenced by W_Devastator_Attack().

◆ W_Devastator_DoRemoteExplode()

void W_Devastator_DoRemoteExplode ( entity this,
.entity weaponentity )

Definition at line 73 of file devastator.qc.

74{
76
77 this.event_damage = func_null;
78 this.takedamage = DAMAGE_NO;
79
80 bool handled_as_rocketjump = false;
81 entity head = NULL;
82 bool allow_rocketjump = WEP_CVAR(WEP_DEVASTATOR, remote_jump);
83 MUTATOR_CALLHOOK(AllowRocketJumping, allow_rocketjump);
84 allow_rocketjump = M_ARGV(0, bool);
85
86 if(allow_rocketjump && WEP_CVAR(WEP_DEVASTATOR, remote_jump_radius))
87 {
89 this.origin,
90 WEP_CVAR(WEP_DEVASTATOR, remote_jump_radius),
91 false
92 );
93
94 while(head)
95 {
96 if(head.takedamage && (head == this.realowner))
97 {
98 if(vdist(this.origin - head.WarpZone_findradius_nearest, <=, WEP_CVAR(WEP_DEVASTATOR, remote_jump_radius)))
99 {
100 // we handled this as a rocketjump :)
101 handled_as_rocketjump = true;
102
103 // modify velocity
104 if(WEP_CVAR(WEP_DEVASTATOR, remote_jump_velocity_z_add))
105 {
106 head.velocity_x *= 0.9;
107 head.velocity_y *= 0.9;
108 head.velocity_z = bound(
109 WEP_CVAR(WEP_DEVASTATOR, remote_jump_velocity_z_min),
110 head.velocity.z + WEP_CVAR(WEP_DEVASTATOR, remote_jump_velocity_z_add),
111 WEP_CVAR(WEP_DEVASTATOR, remote_jump_velocity_z_max)
112 );
113 }
114
115 // now do the damage
117 this,
118 head,
119 WEP_CVAR(WEP_DEVASTATOR, remote_jump_damage),
120 WEP_CVAR(WEP_DEVASTATOR, remote_jump_damage),
121 WEP_CVAR(WEP_DEVASTATOR, remote_jump_radius),
122 NULL,
123 head,
124 (WEP_CVAR(WEP_DEVASTATOR, remote_jump_force) ? WEP_CVAR(WEP_DEVASTATOR, remote_jump_force) : 0),
126 this.weaponentity_fld,
127 NULL
128 );
129 break;
130 }
131 }
132 head = head.chain;
133 }
134 }
135
137 this,
138 this.realowner,
139 WEP_CVAR(WEP_DEVASTATOR, remote_damage),
140 WEP_CVAR(WEP_DEVASTATOR, remote_edgedamage),
141 WEP_CVAR(WEP_DEVASTATOR, remote_radius),
142 (handled_as_rocketjump ? head : NULL),
143 NULL,
144 WEP_CVAR(WEP_DEVASTATOR, remote_force),
146 this.weaponentity_fld,
147 NULL
148 );
149
150 Weapon thiswep = WEP_DEVASTATOR;
151 if(this.realowner.(weaponentity).m_weapon == thiswep)
152 {
153 if(GetResource(this.realowner, thiswep.ammo_type) < WEP_CVAR(WEP_DEVASTATOR, ammo))
154 if(!(this.realowner.items & IT_UNLIMITED_AMMO))
155 {
156 this.realowner.cnt = thiswep.m_id;
157 ATTACK_FINISHED(this.realowner, weaponentity) = time;
158 this.realowner.(weaponentity).m_switchweapon = w_getbestweapon(this.realowner, weaponentity);
159 }
160 }
161 delete(this);
162}
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
Definition weapon.qh:44
Resource ammo_type
M: ammotype : main ammo type.
Definition weapon.qh:51
const int IT_UNLIMITED_AMMO
Definition item.qh:23
#define M_ARGV(x, type)
Definition events.qh:17
vector origin
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:981
const int HITTYPE_BOUNCE
Definition all.qh:31
void W_Devastator_Unregister(entity this)
Definition devastator.qc:7
entity WarpZone_FindRadius(vector org, float rad, bool needlineofsight)
Definition common.qc:686
float bound(float min, float value, float max)
var void func_null()
#define NULL
Definition post.qh:14
#define w_getbestweapon(ent, wepent)
Definition selection.qh:23
int projectiledeathtype
Definition common.qh:21
const int DAMAGE_NO
Definition subs.qh:79
float takedamage
Definition subs.qh:78
entity realowner
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
Definition vector.qh:8
#define ATTACK_FINISHED(ent, w)
entity weaponentity_fld
Weapon m_switchweapon
Definition wepent.qh:25

References ammo, Weapon::ammo_type, ATTACK_FINISHED, bound(), DAMAGE_NO, entity(), func_null(), GetResource(), HITTYPE_BOUNCE, IT_UNLIMITED_AMMO, M_ARGV, Weapon::m_id, m_switchweapon, MUTATOR_CALLHOOK, NULL, origin, projectiledeathtype, RadiusDamage(), realowner, takedamage, time, vdist, W_Devastator_Unregister(), w_getbestweapon, WarpZone_FindRadius(), weaponentity_fld, and WEP_CVAR.

Referenced by W_Devastator_RemoteExplode().

◆ W_Devastator_Explode()

void W_Devastator_Explode ( entity this,
entity directhitentity )

Definition at line 17 of file devastator.qc.

18{
20
21 if(directhitentity.takedamage == DAMAGE_AIM)
22 if(IS_PLAYER(directhitentity))
23 if(DIFF_TEAM(this.realowner, directhitentity))
24 if(!IS_DEAD(directhitentity))
25 if(IsFlying(directhitentity))
26 Send_Notification(NOTIF_ONE, this.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_AIRSHOT);
27
28 this.event_damage = func_null;
29 this.takedamage = DAMAGE_NO;
30
31 vector force_xyzscale = '1 1 1';
32 force_xyzscale.x = WEP_CVAR(WEP_DEVASTATOR, force_xyscale);
33 force_xyzscale.y = WEP_CVAR(WEP_DEVASTATOR, force_xyscale);
34
36 this,
37 this.origin,
38 this.velocity,
39 this.realowner,
40 WEP_CVAR(WEP_DEVASTATOR, damage),
41 WEP_CVAR(WEP_DEVASTATOR, edgedamage),
42 WEP_CVAR(WEP_DEVASTATOR, radius),
43 NULL,
44 NULL,
45 false,
46 WEP_CVAR(WEP_DEVASTATOR, force),
47 force_xyzscale,
50 directhitentity
51 );
52
53 Weapon thiswep = WEP_DEVASTATOR;
54 .entity weaponentity = this.weaponentity_fld;
55 if(this.realowner.(weaponentity).m_weapon == thiswep)
56 {
57 if(GetResource(this.realowner, thiswep.ammo_type) < WEP_CVAR(WEP_DEVASTATOR, ammo))
58 if(!(this.realowner.items & IT_UNLIMITED_AMMO))
59 {
60 this.realowner.cnt = thiswep.m_id;
61 ATTACK_FINISHED(this.realowner, weaponentity) = time;
62 this.realowner.(weaponentity).m_switchweapon = w_getbestweapon(this.realowner, weaponentity);
63 }
64 }
65 delete(this);
66}
float radius
Definition impulse.qh:11
bool IsFlying(entity this)
Definition player.qc:836
#define IS_DEAD(s)
Definition player.qh:245
#define IS_PLAYER(s)
Definition player.qh:243
float RadiusDamageForSource(entity inflictor, vector inflictororigin, vector inflictorvelocity, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float inflictorselfdamage, float forceintensity, vector forcexyzscale, int deathtype,.entity weaponentity, entity directhitentity)
Definition damage.qc:741
void Send_Notification(NOTIF broadcast, entity client, MSG net_type, Notification net_name,...count)
Definition all.qc:1573
vector
Definition self.qh:92
const int DAMAGE_AIM
Definition subs.qh:81
#define DIFF_TEAM(a, b)
Definition teams.qh:242

References ammo, Weapon::ammo_type, ATTACK_FINISHED, DAMAGE_AIM, DAMAGE_NO, DIFF_TEAM, entity(), func_null(), GetResource(), IS_DEAD, IS_PLAYER, IsFlying(), IT_UNLIMITED_AMMO, Weapon::m_id, m_switchweapon, NULL, origin, projectiledeathtype, radius, RadiusDamageForSource(), realowner, Send_Notification(), takedamage, time, vector, velocity, W_Devastator_Unregister(), w_getbestweapon, weaponentity_fld, and WEP_CVAR.

Referenced by W_Devastator_Explode_think(), W_Devastator_Think(), and W_Devastator_Touch().

◆ W_Devastator_Explode_think()

void W_Devastator_Explode_think ( entity this)

Definition at line 68 of file devastator.qc.

69{
71}
void W_Devastator_Explode(entity this, entity directhitentity)
Definition devastator.qc:17

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

Referenced by W_Devastator_Damage().

◆ W_Devastator_RemoteExplode()

void W_Devastator_RemoteExplode ( entity this,
.entity weaponentity )

Definition at line 164 of file devastator.qc.

165{
166 if(!IS_DEAD(this.realowner))
167 if(this.realowner.(weaponentity).lastrocket)
168 {
169 if((this.spawnshieldtime >= 0)
170 ? (time >= this.spawnshieldtime) // timer
171 : (vdist(NearestPointOnBox(this.realowner, this.origin) - this.origin, >, WEP_CVAR(WEP_DEVASTATOR, remote_radius))) // safety device
172 )
173 {
174 W_Devastator_DoRemoteExplode(this, weaponentity);
175 }
176 }
177}
float spawnshieldtime
Definition damage.qh:61
void W_Devastator_DoRemoteExplode(entity this,.entity weaponentity)
Definition devastator.qc:73
ERASEABLE vector NearestPointOnBox(entity box, vector org)
Definition vector.qh:178

References entity(), IS_DEAD, NearestPointOnBox(), origin, realowner, spawnshieldtime, time, vdist, W_Devastator_DoRemoteExplode(), and WEP_CVAR.

Referenced by W_Devastator_Think().

◆ W_Devastator_SteerTo()

vector W_Devastator_SteerTo ( vector thisdir,
vector goaldir,
float maxturn_cos )

Definition at line 179 of file devastator.qc.

180{
181 if(thisdir * goaldir > maxturn_cos)
182 return goaldir;
183 if(thisdir * goaldir < -0.9998) // less than 1 degree and opposite
184 return thisdir; // refuse to guide (better than letting a numerical error happen)
185 float f, m2;
186 vector v;
187 // solve:
188 // g = normalize(thisdir + goaldir * X)
189 // thisdir * g = maxturn
190 //
191 // gg = thisdir + goaldir * X
192 // (thisdir * gg)^2 = maxturn^2 * (gg * gg)
193 //
194 // (1 + (thisdir * goaldir) * X)^2 = maxturn^2 * (1 + X*X + 2 * X * thisdir * goaldir)
195 f = thisdir * goaldir;
196 // (1 + f * X)^2 = maxturn^2 * (1 + X*X + 2 * X * f)
197 // 0 = (m^2 - f^2) * x^2 + (2 * f * (m^2 - 1)) * x + (m^2 - 1)
198 m2 = maxturn_cos * maxturn_cos;
199 v = solve_quadratic(m2 - f * f, 2 * f * (m2 - 1), m2 - 1);
200 return normalize(thisdir + goaldir * v.y); // the larger solution!
201}
ERASEABLE vector solve_quadratic(float a, float b, float c)
ax^2 + bx + c = 0
Definition math.qh:304
vector normalize(vector v)

References normalize(), solve_quadratic(), and vector.

Referenced by W_Devastator_Think().

◆ W_Devastator_Think()

void W_Devastator_Think ( entity this)

Definition at line 212 of file devastator.qc.

213{
214 vector desireddir, olddir, newdir, desiredorigin, goal;
215 float velspeed, f;
216 this.nextthink = time;
217 if(time > this.cnt)
218 {
221 return;
222 }
223
224 // accelerate
225 makevectors(this.angles.x * '-1 0 0' + this.angles.y * '0 1 0');
226 velspeed = WEP_CVAR(WEP_DEVASTATOR, speed) * W_WeaponSpeedFactor(this.realowner) - (this.velocity * v_forward);
227 if(velspeed > 0)
228 this.velocity = this.velocity + v_forward * min(WEP_CVAR(WEP_DEVASTATOR, speedaccel) * W_WeaponSpeedFactor(this.realowner) * frametime, velspeed);
229
230 // laser guided, or remote detonation
231 .entity weaponentity = this.weaponentity_fld;
232 if(this.realowner.(weaponentity).m_weapon == WEP_DEVASTATOR)
233 {
234 if(this == this.realowner.(weaponentity).lastrocket)
235 if(!this.realowner.(weaponentity).rl_release)
236 if(!PHYS_INPUT_BUTTON_ATCK2(this))
237 if(WEP_CVAR(WEP_DEVASTATOR, guiderate))
238 if(time > this.pushltime)
239 if(!IS_DEAD(this.realowner))
240 {
241 f = WEP_CVAR(WEP_DEVASTATOR, guideratedelay);
242 if(f)
243 f = bound(0, (time - this.pushltime) / f, 1);
244 else
245 f = 1;
246
247 vector md = this.realowner.(weaponentity).movedir;
248 vector dv = v_right * -md.y + v_up * md.z;
249
250 if(!W_DualWielding(this.realowner))
251 dv = '0 0 0'; // don't override!
252
253 velspeed = vlen(this.velocity);
254
255 makevectors(this.realowner.v_angle);
256 desireddir = WarpZone_RefSys_TransformVelocity(this.realowner, this, v_forward);
257 desiredorigin = WarpZone_RefSys_TransformOrigin(this.realowner, this, this.realowner.origin + this.realowner.view_ofs + dv);
258 olddir = normalize(this.velocity);
259
260 // now it gets tricky... we want to move like some curve to approximate the target direction
261 // but we are limiting the rate at which we can turn!
262 goal = desiredorigin + ((this.origin - desiredorigin) * desireddir + WEP_CVAR(WEP_DEVASTATOR, guidegoal)) * desireddir;
263 newdir = W_Devastator_SteerTo(olddir, normalize(goal - this.origin), cos(WEP_CVAR(WEP_DEVASTATOR, guiderate) * f * frametime * DEG2RAD));
264
265 this.velocity = newdir * velspeed;
266 this.angles = vectoangles(this.velocity);
267
268 if(!this.count)
269 {
270 Send_Effect(EFFECT_ROCKET_GUIDE, this.origin, this.velocity, 1);
271 // TODO add a better sound here
272 sound(this.realowner, CH_WEAPON_B, SND_DEVASTATOR_MODE, VOL_BASE, ATTN_NORM);
273 this.count = 1;
274 }
275 }
276
277 if(this.rl_detonate_later)
278 W_Devastator_RemoteExplode(this, weaponentity);
279 }
280
281 if(this.csqcprojectile_clientanimate == 0)
283}
float cnt
Definition powerups.qc:24
float count
Definition powerups.qc:22
#define PHYS_INPUT_BUTTON_ATCK2(s)
Definition player.qh:152
vector v_up
float DEG2RAD
float frametime
vector v_right
float nextthink
const float ATTN_NORM
void UpdateCSQCProjectile(entity e)
float csqcprojectile_clientanimate
void W_Devastator_RemoteExplode(entity this,.entity weaponentity)
vector W_Devastator_SteerTo(vector thisdir, vector goaldir, float maxturn_cos)
float rl_detonate_later
Definition devastator.qh:88
float speed
Definition dynlight.qc:9
void Send_Effect(entity eff, vector eff_loc, vector eff_vel, int eff_cnt)
Definition all.qc:124
float pushltime
Definition jumppads.qh:21
vector WarpZone_RefSys_TransformVelocity(entity from, entity to, vector vel)
Definition common.qc:773
vector WarpZone_RefSys_TransformOrigin(entity from, entity to, vector org)
Definition common.qc:765
vector movedir
Definition viewloc.qh:18
float cos(float f)
float vlen(vector v)
float min(float f,...)
#define makevectors
Definition post.qh:21
bool W_DualWielding(entity player)
Definition common.qc:20
const float VOL_BASE
Definition sound.qh:36
#define sound(e, c, s, v, a)
Definition sound.qh:52
const int CH_WEAPON_B
Definition sound.qh:8
float W_WeaponSpeedFactor(entity this)

References angles, ATTN_NORM, bound(), CH_WEAPON_B, cnt, cos(), count, csqcprojectile_clientanimate, DEG2RAD, entity(), frametime, HITTYPE_BOUNCE, IS_DEAD, makevectors, min(), movedir, nextthink, normalize(), NULL, origin, PHYS_INPUT_BUTTON_ATCK2, projectiledeathtype, pushltime, realowner, rl_detonate_later, Send_Effect(), sound, speed, time, UpdateCSQCProjectile(), v_forward, v_right, v_up, vectoangles(), vector, velocity, vlen(), VOL_BASE, W_Devastator_Explode(), W_Devastator_RemoteExplode(), W_Devastator_SteerTo(), W_DualWielding(), W_WeaponSpeedFactor(), WarpZone_RefSys_TransformOrigin(), WarpZone_RefSys_TransformVelocity(), weaponentity_fld, and WEP_CVAR.

Referenced by W_Devastator_Attack().

◆ W_Devastator_Touch()

void W_Devastator_Touch ( entity this,
entity toucher )

Definition at line 285 of file devastator.qc.

286{
288 {
289 if(wasfreed(this))
291 return;
292 }
295}
entity entity toucher
Definition self.qh:72
float WarpZone_Projectile_Touch(entity this, entity toucher)
Definition server.qc:381

References entity(), toucher, W_Devastator_Explode(), W_Devastator_Unregister(), and WarpZone_Projectile_Touch().

Referenced by W_Devastator_Attack().

◆ W_Devastator_Unregister()

void W_Devastator_Unregister ( entity this)

Definition at line 7 of file devastator.qc.

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}
const int MAX_WEAPONSLOTS
Definition weapon.qh:16
entity weaponentities[MAX_WEAPONSLOTS]
Definition weapon.qh:17

References entity(), lastrocket, MAX_WEAPONSLOTS, NULL, realowner, and weaponentities.

Referenced by W_Devastator_DoRemoteExplode(), W_Devastator_Explode(), and W_Devastator_Touch().

Variable Documentation

◆ lastrocket

entity lastrocket

Definition at line 5 of file devastator.qc.

Referenced by W_Devastator_Attack(), and W_Devastator_Unregister().