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 284 of file devastator.qc.

285{
286 W_DecreaseAmmo(thiswep, actor, WEP_CVAR(WEP_DEVASTATOR, ammo), weaponentity);
287
288 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);
289 W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir);
290
292 missile.weaponentity_fld = weaponentity;
293 missile.owner = missile.realowner = actor;
294 actor.(weaponentity).lastrocket = missile;
295 if (WEP_CVAR(WEP_DEVASTATOR, detonatedelay) >= 0)
296 missile.spawnshieldtime = time + WEP_CVAR(WEP_DEVASTATOR, detonatedelay);
297 else
298 missile.spawnshieldtime = -1; // NOTE: proximity based when rocket jumping
299 missile.pushltime = time + WEP_CVAR(WEP_DEVASTATOR, guidedelay);
300 missile.classname = "rocket";
301 missile.bot_dodge = true;
302 missile.bot_dodgerating = WEP_CVAR(WEP_DEVASTATOR, damage) * 2; // * 2 because it can be detonated inflight which makes it even more dangerous
303
304 missile.takedamage = DAMAGE_YES;
305 missile.damageforcescale = WEP_CVAR(WEP_DEVASTATOR, damageforcescale);
306 SetResourceExplicit(missile, RES_HEALTH, WEP_CVAR(WEP_DEVASTATOR, health));
307 missile.event_damage = W_Devastator_Damage;
308 missile.damagedbycontents = true;
310
311 set_movetype(missile, MOVETYPE_FLY);
312 PROJECTILE_MAKETRIGGER(missile);
313 missile.projectiledeathtype = thiswep.m_id;
314 setsize(missile, '-3 -3 -3', '3 3 3'); // give it some size so it can be shot
315
316 setorigin(missile, w_shotorg - v_forward * 3); // move it back so it hits the wall at the right point
317 W_SetupProjVelocity_Basic(missile, WEP_CVAR(WEP_DEVASTATOR, speedstart), 0);
318 missile.angles = vectoangles(missile.velocity);
319
322 missile.nextthink = time;
323 missile.cnt = time + WEP_CVAR(WEP_DEVASTATOR, lifetime);
324 missile.rl_detonate_later = (fire & 2); // allow instant detonation
325 missile.flags = FL_PROJECTILE;
326 IL_PUSH(g_projectiles, missile);
327 IL_PUSH(g_bot_dodge, missile);
328 missile.missile_flags = MIF_SPLASH;
329
330 CSQCProjectile(missile, WEP_CVAR(WEP_DEVASTATOR, guiderate) == 0 && WEP_CVAR(WEP_DEVASTATOR, speedaccel) == 0, PROJECTILE_ROCKET, false); // because of fly sound
331
332 // common properties
333 MUTATOR_CALLHOOK(EditProjectile, actor, missile);
334
335 if (time >= missile.nextthink)
336 getthink(missile)(missile);
337}
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:43
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:143
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:806
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:715
#define WEP_CVAR(wep, name)
Definition all.qh:337
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 270 of file devastator.qc.

271{
272 if (GetResource(this, RES_HEALTH) <= 0)
273 return;
274 if (!W_CheckProjectileDamage(inflictor.realowner, this.realowner, deathtype, -1)) // no exceptions
275 return; // g_projectiles_damage says to halt
276
277 TakeResource(this, RES_HEALTH, damage);
278 this.angles = vectoangles(this.velocity);
279
280 if (GetResource(this, RES_HEALTH) <= 0)
282}
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:60
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 65 of file devastator.qc.

66{
68
69 this.event_damage = func_null;
70 this.takedamage = DAMAGE_NO;
71
72 bool handled_as_rocketjump = false;
73 entity head = NULL;
74 bool allow_rocketjump = WEP_CVAR(WEP_DEVASTATOR, remote_jump);
75 MUTATOR_CALLHOOK(AllowRocketJumping, allow_rocketjump);
76 allow_rocketjump = M_ARGV(0, bool);
77
78 if (allow_rocketjump && WEP_CVAR(WEP_DEVASTATOR, remote_jump_radius))
79 {
80 head = WarpZone_FindRadius(this.origin, WEP_CVAR(WEP_DEVASTATOR, remote_jump_radius), false);
81 for (; head; head = head.chain)
82 if (head.takedamage && head == this.realowner
83 && vdist(this.origin - head.WarpZone_findradius_nearest, <=, WEP_CVAR(WEP_DEVASTATOR, remote_jump_radius)))
84 {
85 // we handled this as a rocketjump :)
86 handled_as_rocketjump = true;
87
88 // modify velocity
89 if (WEP_CVAR(WEP_DEVASTATOR, remote_jump_velocity_z_add))
90 {
91 head.velocity.x *= 0.9;
92 head.velocity.y *= 0.9;
93 head.velocity.z = bound(
94 WEP_CVAR(WEP_DEVASTATOR, remote_jump_velocity_z_min),
95 head.velocity.z + WEP_CVAR(WEP_DEVASTATOR, remote_jump_velocity_z_add),
96 WEP_CVAR(WEP_DEVASTATOR, remote_jump_velocity_z_max)
97 );
98 }
99
100 // now do the damage
101 RadiusDamage(this, head,
102 WEP_CVAR(WEP_DEVASTATOR, remote_jump_damage),
103 WEP_CVAR(WEP_DEVASTATOR, remote_jump_damage),
104 WEP_CVAR(WEP_DEVASTATOR, remote_jump_radius),
105 NULL,
106 head,
107 (WEP_CVAR(WEP_DEVASTATOR, remote_jump_force) ? WEP_CVAR(WEP_DEVASTATOR, remote_jump_force) : 0),
109 this.weaponentity_fld,
110 NULL
111 );
112 break;
113 }
114 }
115
116 RadiusDamage(this, this.realowner,
117 WEP_CVAR(WEP_DEVASTATOR, remote_damage),
118 WEP_CVAR(WEP_DEVASTATOR, remote_edgedamage),
119 WEP_CVAR(WEP_DEVASTATOR, remote_radius),
120 (handled_as_rocketjump ? head : NULL),
121 NULL,
122 WEP_CVAR(WEP_DEVASTATOR, remote_force),
124 this.weaponentity_fld,
125 NULL
126 );
127
128 Weapon thiswep = WEP_DEVASTATOR;
129 if (this.realowner.(weaponentity).m_weapon == thiswep
130 && GetResource(this.realowner, thiswep.ammo_type) < WEP_CVAR(WEP_DEVASTATOR, ammo)
131 && !(this.realowner.items & IT_UNLIMITED_AMMO))
132 {
133 this.realowner.cnt = thiswep.m_id;
134 ATTACK_FINISHED(this.realowner, weaponentity) = time;
135 this.realowner.(weaponentity).m_switchweapon = w_getbestweapon(this.realowner, weaponentity);
136 }
137 delete(this);
138}
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
Definition weapon.qh:42
Resource ammo_type
M: ammotype : main ammo type.
Definition weapon.qh:56
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:943
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:684
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 && IS_PLAYER(directhitentity) && DIFF_TEAM(this.realowner, directhitentity) && !IS_DEAD(directhitentity)
23 && IsFlying(directhitentity))
24 Send_Notification(NOTIF_ONE, this.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_AIRSHOT);
25
26 this.event_damage = func_null;
27 this.takedamage = DAMAGE_NO;
28
29 vector force_xyzscale = '1 1 1';
30 force_xyzscale.x = WEP_CVAR(WEP_DEVASTATOR, force_xyscale);
31 force_xyzscale.y = WEP_CVAR(WEP_DEVASTATOR, force_xyscale);
32
33 RadiusDamageForSource(this, this.origin, this.velocity, this.realowner,
34 WEP_CVAR(WEP_DEVASTATOR, damage),
35 WEP_CVAR(WEP_DEVASTATOR, edgedamage),
36 WEP_CVAR(WEP_DEVASTATOR, radius),
37 NULL,
38 NULL,
39 false,
40 WEP_CVAR(WEP_DEVASTATOR, force),
41 force_xyzscale,
44 directhitentity
45 );
46
47 Weapon thiswep = WEP_DEVASTATOR;
48 .entity weaponentity = this.weaponentity_fld;
49 if (this.realowner.(weaponentity).m_weapon == thiswep
50 && GetResource(this.realowner, thiswep.ammo_type) < WEP_CVAR(WEP_DEVASTATOR, ammo)
51 && !(this.realowner.items & IT_UNLIMITED_AMMO))
52 {
53 this.realowner.cnt = thiswep.m_id;
54 ATTACK_FINISHED(this.realowner, weaponentity) = time;
55 this.realowner.(weaponentity).m_switchweapon = w_getbestweapon(this.realowner, weaponentity);
56 }
57 delete(this);
58}
float radius
Definition impulse.qh:11
bool IsFlying(entity this)
Definition player.qc:843
#define IS_DEAD(s)
Definition player.qh:244
#define IS_PLAYER(s)
Definition player.qh:242
float RadiusDamageForSource(entity inflictor, vector inflictororigin, vector inflictorvelocity, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, bool inflictorselfdamage, float forceintensity, vector forcexyzscale, int deathtype,.entity weaponentity, entity directhitentity)
Definition damage.qc:718
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 60 of file devastator.qc.

61{
63}
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 140 of file devastator.qc.

141{
142 if (!IS_DEAD(this.realowner)
143 && this.realowner.(weaponentity).lastrocket)
144 {
145 if ((this.spawnshieldtime >= 0)
146 ? (time >= this.spawnshieldtime) // timer
147 : vdist(NearestPointOnBox(this.realowner, this.origin) - this.origin, >, WEP_CVAR(WEP_DEVASTATOR, remote_radius))) // safety device
148 {
149 W_Devastator_DoRemoteExplode(this, weaponentity);
150 }
151 }
152}
float spawnshieldtime
Definition damage.qh:61
void W_Devastator_DoRemoteExplode(entity this,.entity weaponentity)
Definition devastator.qc:65
ERASEABLE vector NearestPointOnBox(entity box, vector org)
Definition vector.qh:181

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 154 of file devastator.qc.

155{
156 if (thisdir * goaldir > maxturn_cos)
157 return goaldir;
158 if (thisdir * goaldir < -0.9998) // less than 1 degree and opposite
159 return thisdir; // refuse to guide (better than letting a numerical error happen)
160
161 // solve:
162 // g = normalize(thisdir + goaldir * X)
163 // thisdir * g = maxturn
164 //
165 // gg = thisdir + goaldir * X
166 // (thisdir * gg)^2 = maxturn^2 * (gg * gg)
167 //
168 // (1 + (thisdir * goaldir) * X)^2 = maxturn^2 * (1 + X*X + 2 * X * thisdir * goaldir)
169 float f = thisdir * goaldir;
170 // (1 + f * X)^2 = maxturn^2 * (1 + X*X + 2 * X * f)
171 // 0 = (m^2 - f^2) * x^2 + (2 * f * (m^2 - 1)) * x + (m^2 - 1)
172 float m2 = maxturn_cos * maxturn_cos;
173 vector v = solve_quadratic(m2 - f * f, 2 * f * (m2 - 1), m2 - 1);
174 return normalize(thisdir + goaldir * v.y); // the larger solution!
175}
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 186 of file devastator.qc.

187{
188 this.nextthink = time;
189 if (time > this.cnt)
190 {
193 return;
194 }
195
196 // accelerate
197 makevectors(this.angles.x * '-1 0 0' + this.angles.y * '0 1 0');
198 float velspeed = WEP_CVAR(WEP_DEVASTATOR, speed) * W_WeaponSpeedFactor(this.realowner) - (this.velocity * v_forward);
199 if (velspeed > 0)
200 this.velocity += v_forward * min(WEP_CVAR(WEP_DEVASTATOR, speedaccel) * W_WeaponSpeedFactor(this.realowner) * frametime, velspeed);
201
202 // laser guided, or remote detonation
203 .entity weaponentity = this.weaponentity_fld;
204 if (this.realowner.(weaponentity).m_weapon == WEP_DEVASTATOR)
205 {
206 if (this == this.realowner.(weaponentity).lastrocket
207 && !this.realowner.(weaponentity).rl_release
209 && WEP_CVAR(WEP_DEVASTATOR, guiderate)
210 && time > this.pushltime
211 && !IS_DEAD(this.realowner))
212 {
213 vector desireddir, olddir, newdir, desiredorigin, goal;
214 float f = WEP_CVAR(WEP_DEVASTATOR, guideratedelay);
215 if (f)
216 f = bound(0, (time - this.pushltime) / f, 1);
217 else
218 f = 1;
219
220 vector md = this.realowner.(weaponentity).movedir;
221 vector dv = v_right * -md.y + v_up * md.z;
222
223 if (!W_DualWielding(this.realowner))
224 dv = '0 0 0'; // don't override!
225
226 velspeed = vlen(this.velocity);
227
228 makevectors(this.realowner.v_angle);
229 desireddir = WarpZone_RefSys_TransformVelocity(this.realowner, this, v_forward);
230 desiredorigin = WarpZone_RefSys_TransformOrigin(this.realowner, this, this.realowner.origin + this.realowner.view_ofs + dv);
231 olddir = normalize(this.velocity);
232
233 // now it gets tricky... we want to move like some curve to approximate the target direction
234 // but we are limiting the rate at which we can turn!
235 goal = desiredorigin + ((this.origin - desiredorigin) * desireddir + WEP_CVAR(WEP_DEVASTATOR, guidegoal)) * desireddir;
236 newdir = W_Devastator_SteerTo(olddir, normalize(goal - this.origin), cos(WEP_CVAR(WEP_DEVASTATOR, guiderate) * f * frametime * DEG2RAD));
237
238 this.velocity = newdir * velspeed;
239 this.angles = vectoangles(this.velocity);
240
241 if (!this.count)
242 {
243 Send_Effect(EFFECT_ROCKET_GUIDE, this.origin, this.velocity, 1);
244 // TODO add a better sound here
245 sound(this.realowner, CH_WEAPON_B, SND_DEVASTATOR_MODE, VOL_BASE, ATTN_NORM);
246 this.count = 1;
247 }
248 }
249
250 if (this.rl_detonate_later)
251 W_Devastator_RemoteExplode(this, weaponentity);
252 }
253
254 if (this.csqcprojectile_clientanimate == 0)
256}
float cnt
Definition powerups.qc:24
float count
Definition powerups.qc:22
#define PHYS_INPUT_BUTTON_ATCK2(s)
Definition player.qh:154
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:92
float speed
Definition dynlight.qc:9
void Send_Effect(entity eff, vector eff_loc, vector eff_vel, int eff_cnt)
Definition all.qc:120
float pushltime
Definition jumppads.qh:21
vector WarpZone_RefSys_TransformVelocity(entity from, entity to, vector vel)
Definition common.qc:771
vector WarpZone_RefSys_TransformOrigin(entity from, entity to, vector org)
Definition common.qc:763
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 258 of file devastator.qc.

259{
261 {
262 if (wasfreed(this))
264 return;
265 }
268}
entity entity toucher
Definition self.qh:72
float WarpZone_Projectile_Touch(entity this, entity toucher)
Definition server.qc:378

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().