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)
bool W_Devastator_DoRemoteExplode_cond (entity e)
void W_Devastator_Explode (entity this, entity directhitentity)
void W_Devastator_Explode_think (entity this)
void W_Devastator_RemoteExplode (entity this,.entity weaponentity)
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 227 of file devastator.qc.

228{
229 W_DecreaseAmmo(thiswep, actor, WEP_CVAR(WEP_DEVASTATOR, ammo), weaponentity);
230
231 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);
232 W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir);
233
234 entity missile = new(rocket);
235 WarpZone_RefSys_Copy(missile, actor);
236 missile.weaponentity_fld = weaponentity;
237 missile.owner = missile.realowner = actor;
238 actor.(weaponentity).lastrocket = missile;
239 if (WEP_CVAR(WEP_DEVASTATOR, detonatedelay) >= 0)
240 missile.spawnshieldtime = time + WEP_CVAR(WEP_DEVASTATOR, detonatedelay);
241 else
242 missile.spawnshieldtime = -1; // NOTE: proximity based when rocket jumping
243 missile.pushltime = time + WEP_CVAR(WEP_DEVASTATOR, guidedelay);
244 missile.bot_dodge = true;
245 missile.bot_dodgerating = WEP_CVAR(WEP_DEVASTATOR, damage) * 2; // * 2 because it can be detonated inflight which makes it even more dangerous
246
247 missile.takedamage = DAMAGE_YES;
248 missile.damageforcescale = WEP_CVAR(WEP_DEVASTATOR, damageforcescale);
249 SetResourceExplicit(missile, RES_HEALTH, WEP_CVAR(WEP_DEVASTATOR, health));
250 missile.event_damage = W_Devastator_Damage;
251 missile.damagedbycontents = true;
253
254 set_movetype(missile, MOVETYPE_FLY);
255 PROJECTILE_MAKETRIGGER(missile);
256 missile.projectiledeathtype = thiswep.m_id;
257 setsize(missile, '-3 -3 -3', '3 3 3'); // give it some size so it can be shot
258
259 setorigin(missile, w_shotorg - v_forward * 3); // move it back so it hits the wall at the right point
260 W_SetupProjVelocity_Basic(missile, WEP_CVAR(WEP_DEVASTATOR, speedstart), 0);
261 missile.angles = vectoangles(missile.velocity);
262
265 missile.nextthink = time;
266 missile.cnt = time + WEP_CVAR(WEP_DEVASTATOR, lifetime);
267 missile.rl_detonate_later = boolean(fire & 2); // allow instant detonation
268 missile.flags = FL_PROJECTILE;
269 IL_PUSH(g_projectiles, missile);
270 IL_PUSH(g_bot_dodge, missile);
271 missile.missile_flags = MIF_SPLASH;
272
273 CSQCProjectile(missile, fabs(WEP_CVAR(WEP_DEVASTATOR, guiderate)) <= 30, PROJECTILE_ROCKET, false); // because of fly sound
274 // Network velocity for the trail only if the guiding isn't strong,
275 // or else the trail clearly goes off path (backwards)
276
277 // common properties
278 MUTATOR_CALLHOOK(EditProjectile, actor, missile);
279
280 if (time >= missile.nextthink)
281 getthink(missile)(missile);
282}
IntrusiveList g_bot_dodge
Definition api.qh:150
#define MUTATOR_CALLHOOK(name,...)
Definition base.qh:186
#define boolean(value)
Definition bool.qh:9
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
int m_id
Definition weapon.qh:37
float lifetime
Definition powerups.qc:23
const int FL_PROJECTILE
Definition constants.qh:77
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
SetResourceExplicit(ent, RES_ARMOR, ReadByte() *DEC_FACTOR)) ENTCS_PROP(NAME
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:828
vector vectoangles(vector v)
float fabs(float f)
void set_movetype(entity this, int mt)
Definition movetypes.qc:4
const int MOVETYPE_FLY
Definition movetypes.qh:138
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:77
const int MIF_SPLASH
Definition common.qh:63
IntrusiveList g_projectiles
Definition common.qh:75
#define PROJECTILE_MAKETRIGGER(e)
Definition common.qh:51
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:51
void W_MuzzleFlash(Weapon thiswep, entity actor,.entity weaponentity, vector shotorg, vector shotdir)
Definition all.qc:694
#define WEP_CVAR(wep, name)
Definition all.qh:339
void W_DecreaseAmmo(Weapon wep, entity actor, float ammo_use,.entity weaponentity)

References ammo, boolean, CH_WEAPON_A, CSQCProjectile(), DAMAGE_YES, damageforcescale, entity(), fabs(), 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_Copy(), 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 213 of file devastator.qc.

214{
215 if (GetResource(this, RES_HEALTH) <= 0)
216 return;
217 if (!W_CheckProjectileDamage(inflictor.realowner, this.realowner, deathtype, -1)) // no exceptions
218 return; // g_projectiles_damage says to halt
219
220 TakeResource(this, RES_HEALTH, damage);
221 this.angles = vectoangles(this.velocity);
222
223 if (GetResource(this, RES_HEALTH) <= 0)
225}
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:146
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 69 of file devastator.qc.

70{
72
73 this.event_damage = func_null;
74 this.takedamage = DAMAGE_NO;
75
76 bool handled_as_rocketjump = false;
77 entity head = NULL;
78 bool allow_rocketjump = WEP_CVAR(WEP_DEVASTATOR, remote_jump);
79 MUTATOR_CALLHOOK(AllowRocketJumping, allow_rocketjump);
80 allow_rocketjump = M_ARGV(0, bool);
81
82 if (allow_rocketjump && WEP_CVAR(WEP_DEVASTATOR, remote_jump_radius))
83 {
85 head = WarpZone_SearchInRadius(this.origin, WEP_CVAR(WEP_DEVASTATOR, remote_jump_radius), MOVE_NOTHING, W_Devastator_DoRemoteExplode_cond);
86 if (head) // TODO: this could be optimized by changing the WarpZone_SearchInRadius to return as soon as it finds one entity, somehow
87 {
88 // we handled this as a rocketjump :)
89 handled_as_rocketjump = true;
90
91 // modify velocity
92 if (WEP_CVAR(WEP_DEVASTATOR, remote_jump_velocity_z_add))
93 {
94 head.velocity.x *= 0.9;
95 head.velocity.y *= 0.9;
96 head.velocity.z = bound(
97 WEP_CVAR(WEP_DEVASTATOR, remote_jump_velocity_z_min),
98 head.velocity.z + WEP_CVAR(WEP_DEVASTATOR, remote_jump_velocity_z_add),
99 WEP_CVAR(WEP_DEVASTATOR, remote_jump_velocity_z_max)
100 );
101 }
102
103 // now do the damage
104 RadiusDamage(this, head,
105 WEP_CVAR(WEP_DEVASTATOR, remote_jump_damage),
106 WEP_CVAR(WEP_DEVASTATOR, remote_jump_damage),
107 WEP_CVAR(WEP_DEVASTATOR, remote_jump_radius),
108 NULL,
109 head,
110 (WEP_CVAR(WEP_DEVASTATOR, remote_jump_force) ? WEP_CVAR(WEP_DEVASTATOR, remote_jump_force) : 0),
112 this.weaponentity_fld,
113 NULL
114 );
115 }
116 }
117
118 RadiusDamage(this, this.realowner,
119 WEP_CVAR(WEP_DEVASTATOR, remote_damage),
120 WEP_CVAR(WEP_DEVASTATOR, remote_edgedamage),
121 WEP_CVAR(WEP_DEVASTATOR, remote_radius),
122 (handled_as_rocketjump ? head : NULL),
123 NULL,
124 WEP_CVAR(WEP_DEVASTATOR, remote_force),
126 this.weaponentity_fld,
127 NULL
128 );
129
130 Weapon thiswep = WEP_DEVASTATOR;
131 if (this.realowner.(weaponentity).m_weapon == thiswep
132 && GetResource(this.realowner, thiswep.ammo_type) < WEP_CVAR(WEP_DEVASTATOR, ammo)
133 && !(this.realowner.items & IT_UNLIMITED_AMMO))
134 {
135 this.realowner.cnt = thiswep.m_id;
136 ATTACK_FINISHED(this.realowner, weaponentity) = time;
137 this.realowner.(weaponentity).m_switchweapon = w_getbestweapon(this.realowner, weaponentity);
138 }
139 delete(this);
140}
#define M_ARGV(idx, type)
Definition base.qh:153
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
Definition weapon.qh:36
Resource ammo_type
M: ammotype : main ammo type.
Definition weapon.qh:50
const int IT_UNLIMITED_AMMO
Definition item.qh:23
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:937
const int HITTYPE_BOUNCE
set manually after projectile has bounced
Definition all.qh:33
bool W_Devastator_DoRemoteExplode_cond(entity e)
Definition devastator.qc:65
void W_Devastator_Unregister(entity this)
Definition devastator.qc:7
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:684
noref entity WarpZone_SearchInRadius_otherent
Free to use in the callback.
Definition common.qh:71
#define MOVE_NOTHING
Definition common.qh:35
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:38
const int DAMAGE_NO
Definition subs.qh:79
float takedamage
Definition subs.qh:78
entity realowner
#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, MOVE_NOTHING, MUTATOR_CALLHOOK, NULL, origin, projectiledeathtype, RadiusDamage(), realowner, takedamage, time, W_Devastator_DoRemoteExplode_cond(), W_Devastator_Unregister(), w_getbestweapon, WarpZone_SearchInRadius(), WarpZone_SearchInRadius_otherent, weaponentity_fld, and WEP_CVAR.

Referenced by W_Devastator_RemoteExplode().

◆ W_Devastator_DoRemoteExplode_cond()

bool W_Devastator_DoRemoteExplode_cond ( entity e)

Definition at line 65 of file devastator.qc.

66{
67 return (e.takedamage && e == WarpZone_SearchInRadius_otherent);
68}

References entity(), and WarpZone_SearchInRadius_otherent.

Referenced by W_Devastator_DoRemoteExplode().

◆ 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)
Returns total damage applied to creatures.
Definition damage.qc:714
void Send_Notification(NOTIF broadcast, entity client, MSG net_type, Notification net_name,...count)
Definition all.qc:1500
vector
Definition self.qh:96
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 142 of file devastator.qc.

143{
144 if (IS_DEAD(this.realowner)
145 || !this.realowner.(weaponentity).lastrocket)
146 return;
147
148 bool do_explode;
149 if (this.spawnshieldtime >= 0)
150 do_explode = (time >= this.spawnshieldtime); // timer
151 else
152 {
153 vector transformed_org = WarpZone_RefSys_TransformOrigin(this, this.realowner, this.origin);
154 do_explode = vdist(NearestPointOnBox(this.realowner, transformed_org) - transformed_org, >, WEP_CVAR(WEP_DEVASTATOR, remote_radius)); // safety device
155 }
156 if (do_explode)
157 W_Devastator_DoRemoteExplode(this, weaponentity);
158}
float spawnshieldtime
Definition damage.qh:61
void W_Devastator_DoRemoteExplode(entity this,.entity weaponentity)
Definition devastator.qc:69
vector WarpZone_RefSys_TransformOrigin(entity from, entity to, vector org)
Transform origin org in from's reference into to's reference.
Definition common.qc:791
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt().
Definition vector.qh:8
ERASEABLE vector NearestPointOnBox(entity box, vector org)
Definition vector.qh:187

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

Referenced by W_Devastator_Think().

◆ W_Devastator_Think()

void W_Devastator_Think ( entity this)

Definition at line 160 of file devastator.qc.

161{
162 if (time > this.cnt)
163 {
166 return;
167 }
168 this.nextthink = time;
169
170 // accelerate
171 makevectors(vec2(-this.angles.x, this.angles.y));
172 float velspeed = WEP_CVAR(WEP_DEVASTATOR, speed) * W_WeaponSpeedFactor(this.realowner) - (this.velocity * v_forward);
173 if (velspeed > 0)
174 this.velocity += v_forward * min(WEP_CVAR(WEP_DEVASTATOR, speedaccel) * W_WeaponSpeedFactor(this.realowner) * frametime, velspeed);
175
176 // laser guided, or remote detonation
177 .entity weaponentity = this.weaponentity_fld;
178 if (this.realowner.(weaponentity).m_weapon == WEP_DEVASTATOR)
179 {
180 if (this == this.realowner.(weaponentity).lastrocket
181 && !this.realowner.(weaponentity).rl_release
183 && WEP_CVAR(WEP_DEVASTATOR, guiderate)
184 && time > this.pushltime
185 && !IS_DEAD(this.realowner))
186 W_GuideProjectile(this, weaponentity, this.pushltime,
187 WEP_CVAR(WEP_DEVASTATOR, guiderate),
188 WEP_CVAR(WEP_DEVASTATOR, guideratedelay),
189 WEP_CVAR(WEP_DEVASTATOR, guidegoal),
190 WEP_CVAR(WEP_DEVASTATOR, guidedelay),
191 EFFECT_ROCKET_GUIDE, SND_DEVASTATOR_MODE, VOL_BASE); // TODO: add a better sound here
192
193 if (this.rl_detonate_later)
194 W_Devastator_RemoteExplode(this, weaponentity);
195 }
196
197 if (WEP_CVAR(WEP_DEVASTATOR, speedaccel) || WEP_CVAR(WEP_DEVASTATOR, guiderate))
199}
float cnt
Definition powerups.qc:24
#define PHYS_INPUT_BUTTON_ATCK2(s)
Definition player.qh:154
float frametime
float nextthink
void UpdateCSQCProjectile(entity e)
void W_Devastator_RemoteExplode(entity this,.entity weaponentity)
bool rl_detonate_later
Definition devastator.qh:92
float speed
Definition dynlight.qc:9
float pushltime
Definition jumppads.qh:21
float min(float f,...)
#define makevectors
Definition post.qh:21
void W_GuideProjectile(entity this,.entity weaponentity, float guide_start_time, float guide_rate, float guide_rate_delay, float guide_goal, float guide_delay, entity eff, entity snd, float vol)
Guides a projectile towards the crosshair (v_forward).
Definition common.qc:349
const float VOL_BASE
Definition sound.qh:36
#define vec2(...)
Definition vector.qh:95
float W_WeaponSpeedFactor(entity this)

References angles, cnt, entity(), frametime, HITTYPE_BOUNCE, IS_DEAD, makevectors, min(), nextthink, NULL, PHYS_INPUT_BUTTON_ATCK2, projectiledeathtype, pushltime, realowner, rl_detonate_later, speed, time, UpdateCSQCProjectile(), v_forward, vec2, velocity, VOL_BASE, W_Devastator_Explode(), W_Devastator_RemoteExplode(), W_GuideProjectile(), W_WeaponSpeedFactor(), weaponentity_fld, and WEP_CVAR.

Referenced by W_Devastator_Attack().

◆ W_Devastator_Touch()

void W_Devastator_Touch ( entity this,
entity toucher )

Definition at line 201 of file devastator.qc.

202{
204 {
205 if (wasfreed(this))
207 return;
208 }
211}
entity entity toucher
Definition self.qh:76
float WarpZone_Projectile_Touch(entity this, entity toucher)
Definition server.qc:344

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:15
entity weaponentities[MAX_WEAPONSLOTS]
Definition weapon.qh:16

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