]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/weapons/weapon/devastator.qc
Merge branch 'master' into Lyberta/StandaloneOverkillWeapons
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / devastator.qc
1 #include "devastator.qh"
2
3 #ifdef SVQC
4
5 .entity lastrocket;
6
7 void W_Devastator_Unregister(entity this)
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 }
16
17 void W_Devastator_Explode(entity this, entity directhitentity)
18 {
19         W_Devastator_Unregister(this);
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         RadiusDamage(
32                 this,
33                 this.realowner,
34                 WEP_CVAR(devastator, damage),
35                 WEP_CVAR(devastator, edgedamage),
36                 WEP_CVAR(devastator, radius),
37                 NULL,
38                 NULL,
39                 WEP_CVAR(devastator, force),
40                 this.projectiledeathtype,
41                 directhitentity
42         );
43
44         Weapon thiswep = WEP_DEVASTATOR;
45         .entity weaponentity = this.weaponentity_fld;
46         if(this.realowner.(weaponentity).m_weapon == thiswep)
47         {
48                 if(GetResourceAmount(this.realowner, thiswep.ammo_type) < WEP_CVAR(devastator, ammo))
49                 if(!(this.realowner.items & IT_UNLIMITED_WEAPON_AMMO))
50                 {
51                         this.realowner.cnt = WEP_DEVASTATOR.m_id;
52                         int slot = weaponslot(weaponentity);
53                         ATTACK_FINISHED(this.realowner, slot) = time;
54                         this.realowner.(weaponentity).m_switchweapon = w_getbestweapon(this.realowner, weaponentity);
55                 }
56         }
57         delete(this);
58 }
59
60 void W_Devastator_Explode_think(entity this)
61 {
62         W_Devastator_Explode(this, NULL);
63 }
64
65 void W_Devastator_DoRemoteExplode(entity this, .entity weaponentity)
66 {
67         W_Devastator_Unregister(this);
68
69         this.event_damage = func_null;
70         this.takedamage = DAMAGE_NO;
71
72         bool handled_as_rocketjump = false;
73         entity head = NULL;
74
75         if(WEP_CVAR(devastator, remote_jump_radius))
76         {
77                 head = WarpZone_FindRadius(
78                         this.origin,
79                         WEP_CVAR(devastator, remote_jump_radius),
80                         false
81                 );
82
83                 while(head)
84                 {
85                         if(head.takedamage && (head == this.realowner))
86                         {
87                                 if(vdist(this.origin - head.WarpZone_findradius_nearest, <=, WEP_CVAR(devastator, remote_jump_radius)))
88                                 {
89                                         // we handled this as a rocketjump :)
90                                         handled_as_rocketjump = true;
91
92                                         // modify velocity
93                                         if(WEP_CVAR(devastator, remote_jump_velocity_z_add))
94                                         {
95                                                 head.velocity_x *= 0.9;
96                                                 head.velocity_y *= 0.9;
97                                                 head.velocity_z = bound(
98                                                         WEP_CVAR(devastator, remote_jump_velocity_z_min),
99                                                         head.velocity.z + WEP_CVAR(devastator, remote_jump_velocity_z_add),
100                                                         WEP_CVAR(devastator, remote_jump_velocity_z_max)
101                                                 );
102                                         }
103
104                                         // now do the damage
105                                         RadiusDamage(
106                                                 this,
107                                                 head,
108                                                 WEP_CVAR(devastator, remote_jump_damage),
109                                                 WEP_CVAR(devastator, remote_jump_damage),
110                                                 WEP_CVAR(devastator, remote_jump_radius),
111                                                 NULL,
112                                                 head,
113                                                 (WEP_CVAR(devastator, remote_jump_force) ? WEP_CVAR(devastator, remote_jump_force) : 0),
114                                                 this.projectiledeathtype | HITTYPE_BOUNCE,
115                                                 NULL
116                                         );
117                                         break;
118                                 }
119                         }
120                         head = head.chain;
121                 }
122         }
123
124         RadiusDamage(
125                 this,
126                 this.realowner,
127                 WEP_CVAR(devastator, remote_damage),
128                 WEP_CVAR(devastator, remote_edgedamage),
129                 WEP_CVAR(devastator, remote_radius),
130                 (handled_as_rocketjump ? head : NULL),
131                 NULL,
132                 WEP_CVAR(devastator, remote_force),
133                 this.projectiledeathtype | HITTYPE_BOUNCE,
134                 NULL
135         );
136
137         Weapon thiswep = WEP_DEVASTATOR;
138         if(this.realowner.(weaponentity).m_weapon == thiswep)
139         {
140                 if(GetResourceAmount(this.realowner, thiswep.ammo_type) < WEP_CVAR(devastator, ammo))
141                 if(!(this.realowner.items & IT_UNLIMITED_WEAPON_AMMO))
142                 {
143                         this.realowner.cnt = WEP_DEVASTATOR.m_id;
144                         int slot = weaponslot(weaponentity);
145                         ATTACK_FINISHED(this.realowner, slot) = time;
146                         this.realowner.(weaponentity).m_switchweapon = w_getbestweapon(this.realowner, weaponentity);
147                 }
148         }
149         delete(this);
150 }
151
152 void W_Devastator_RemoteExplode(entity this, .entity weaponentity)
153 {
154         if(!IS_DEAD(this.realowner))
155         if(this.realowner.(weaponentity).lastrocket)
156         {
157                 if((this.spawnshieldtime >= 0)
158                         ? (time >= this.spawnshieldtime) // timer
159                         : (vdist(NearestPointOnBox(this.realowner, this.origin) - this.origin, >, WEP_CVAR(devastator, remote_radius))) // safety device
160                 )
161                 {
162                         W_Devastator_DoRemoteExplode(this, weaponentity);
163                 }
164         }
165 }
166
167 vector W_Devastator_SteerTo(vector thisdir, vector goaldir, float maxturn_cos)
168 {
169         if(thisdir * goaldir > maxturn_cos)
170                 return goaldir;
171         if(thisdir * goaldir < -0.9998) // less than 1 degree and opposite
172                 return thisdir; // refuse to guide (better than letting a numerical error happen)
173         float f, m2;
174         vector v;
175         // solve:
176         //   g = normalize(thisdir + goaldir * X)
177         //   thisdir * g = maxturn
178         //
179         //   gg = thisdir + goaldir * X
180         //   (thisdir * gg)^2 = maxturn^2 * (gg * gg)
181         //
182         //   (1 + (thisdir * goaldir) * X)^2 = maxturn^2 * (1 + X*X + 2 * X * thisdir * goaldir)
183         f = thisdir * goaldir;
184         //   (1 + f * X)^2 = maxturn^2 * (1 + X*X + 2 * X * f)
185         //   0 = (m^2 - f^2) * x^2 + (2 * f * (m^2 - 1)) * x + (m^2 - 1)
186         m2 = maxturn_cos * maxturn_cos;
187         v = solve_quadratic(m2 - f * f, 2 * f * (m2 - 1), m2 - 1);
188         return normalize(thisdir + goaldir * v.y); // the larger solution!
189 }
190 // assume thisdir == -goaldir:
191 //   f == -1
192 //   v = solve_qadratic(m2 - 1, -2 * (m2 - 1), m2 - 1)
193 //   (m2 - 1) x^2 - 2 * (m2 - 1) * x + (m2 - 1) = 0
194 //   x^2 - 2 * x + 1 = 0
195 //   (x - 1)^2 = 0
196 //   x = 1
197 //   normalize(thisdir + goaldir)
198 //   normalize(0)
199
200 void W_Devastator_Think(entity this)
201 {
202         vector desireddir, olddir, newdir, desiredorigin, goal;
203         float velspeed, f;
204         this.nextthink = time;
205         if(time > this.cnt)
206         {
207                 this.projectiledeathtype |= HITTYPE_BOUNCE;
208                 W_Devastator_Explode(this, NULL);
209                 return;
210         }
211
212         // accelerate
213         makevectors(this.angles.x * '-1 0 0' + this.angles.y * '0 1 0');
214         velspeed = WEP_CVAR(devastator, speed) * W_WeaponSpeedFactor(this.realowner) - (this.velocity * v_forward);
215         if(velspeed > 0)
216                 this.velocity = this.velocity + v_forward * min(WEP_CVAR(devastator, speedaccel) * W_WeaponSpeedFactor(this.realowner) * frametime, velspeed);
217
218         // laser guided, or remote detonation
219         .entity weaponentity = this.weaponentity_fld;
220         if(this.realowner.(weaponentity).m_weapon == WEP_DEVASTATOR)
221         {
222                 if(this == this.realowner.(weaponentity).lastrocket)
223                 if(!this.realowner.(weaponentity).rl_release)
224                 if(!PHYS_INPUT_BUTTON_ATCK2(this))
225                 if(WEP_CVAR(devastator, guiderate))
226                 if(time > this.pushltime)
227                 if(!IS_DEAD(this.realowner))
228                 {
229                         f = WEP_CVAR(devastator, guideratedelay);
230                         if(f)
231                                 f = bound(0, (time - this.pushltime) / f, 1);
232                         else
233                                 f = 1;
234
235                         velspeed = vlen(this.velocity);
236
237                         makevectors(this.realowner.v_angle);
238                         desireddir = WarpZone_RefSys_TransformVelocity(this.realowner, this, v_forward);
239                         desiredorigin = WarpZone_RefSys_TransformOrigin(this.realowner, this, this.realowner.origin + this.realowner.view_ofs);
240                         olddir = normalize(this.velocity);
241
242                         // now it gets tricky... we want to move like some curve to approximate the target direction
243                         // but we are limiting the rate at which we can turn!
244                         goal = desiredorigin + ((this.origin - desiredorigin) * desireddir + WEP_CVAR(devastator, guidegoal)) * desireddir;
245                         newdir = W_Devastator_SteerTo(olddir, normalize(goal - this.origin), cos(WEP_CVAR(devastator, guiderate) * f * frametime * DEG2RAD));
246
247                         this.velocity = newdir * velspeed;
248                         this.angles = vectoangles(this.velocity);
249
250                         if(!this.count)
251                         {
252                                 Send_Effect(EFFECT_ROCKET_GUIDE, this.origin, this.velocity, 1);
253                                 // TODO add a better sound here
254                                 sound(this.realowner, CH_WEAPON_B, SND_ROCKET_MODE, VOL_BASE, ATTN_NORM);
255                                 this.count = 1;
256                         }
257                 }
258
259                 if(this.rl_detonate_later)
260                         W_Devastator_RemoteExplode(this, weaponentity);
261         }
262
263         if(this.csqcprojectile_clientanimate == 0)
264                 UpdateCSQCProjectile(this);
265 }
266
267 void W_Devastator_Touch(entity this, entity toucher)
268 {
269         if(WarpZone_Projectile_Touch(this, toucher))
270         {
271                 if(wasfreed(this))
272                         W_Devastator_Unregister(this);
273                 return;
274         }
275         W_Devastator_Unregister(this);
276         W_Devastator_Explode(this, toucher);
277 }
278
279 void W_Devastator_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
280 {
281         if(this.health <= 0)
282                 return;
283
284         if(!W_CheckProjectileDamage(inflictor.realowner, this.realowner, deathtype, -1)) // no exceptions
285                 return; // g_projectiles_damage says to halt
286
287         this.health = this.health - damage;
288         this.angles = vectoangles(this.velocity);
289
290         if(this.health <= 0)
291                 W_PrepareExplosionByDamage(this, attacker, W_Devastator_Explode_think);
292 }
293
294 void W_Devastator_Attack(Weapon thiswep, entity actor, .entity weaponentity)
295 {
296         W_DecreaseAmmo(thiswep, actor, WEP_CVAR(devastator, ammo), weaponentity);
297
298         W_SetupShot_ProjectileSize(actor, weaponentity, '-3 -3 -3', '3 3 3', false, 5, SND_ROCKET_FIRE, CH_WEAPON_A, WEP_CVAR(devastator, damage));
299         Send_Effect(EFFECT_ROCKET_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
300
301         entity missile = WarpZone_RefSys_SpawnSameRefSys(actor);
302         missile.weaponentity_fld = weaponentity;
303         missile.owner = missile.realowner = actor;
304         actor.(weaponentity).lastrocket = missile;
305         if(WEP_CVAR(devastator, detonatedelay) >= 0)
306                 missile.spawnshieldtime = time + WEP_CVAR(devastator, detonatedelay);
307         else
308                 missile.spawnshieldtime = -1;
309         missile.pushltime = time + WEP_CVAR(devastator, guidedelay);
310         missile.classname = "rocket";
311         missile.bot_dodge = true;
312         missile.bot_dodgerating = WEP_CVAR(devastator, damage) * 2; // * 2 because it can be detonated inflight which makes it even more dangerous
313
314         missile.takedamage = DAMAGE_YES;
315         missile.damageforcescale = WEP_CVAR(devastator, damageforcescale);
316         missile.health = WEP_CVAR(devastator, health);
317         missile.event_damage = W_Devastator_Damage;
318         missile.damagedbycontents = true;
319         IL_PUSH(g_damagedbycontents, missile);
320
321         set_movetype(missile, MOVETYPE_FLY);
322         PROJECTILE_MAKETRIGGER(missile);
323         missile.projectiledeathtype = WEP_DEVASTATOR.m_id;
324         setsize(missile, '-3 -3 -3', '3 3 3'); // give it some size so it can be shot
325
326         setorigin(missile, w_shotorg - v_forward * 3); // move it back so it hits the wall at the right point
327         W_SetupProjVelocity_Basic(missile, WEP_CVAR(devastator, speedstart), 0);
328         missile.angles = vectoangles(missile.velocity);
329
330         settouch(missile, W_Devastator_Touch);
331         setthink(missile, W_Devastator_Think);
332         missile.nextthink = time;
333         missile.cnt = time + WEP_CVAR(devastator, lifetime);
334         missile.flags = FL_PROJECTILE;
335         IL_PUSH(g_projectiles, missile);
336         IL_PUSH(g_bot_dodge, missile);
337         missile.missile_flags = MIF_SPLASH;
338
339         CSQCProjectile(missile, WEP_CVAR(devastator, guiderate) == 0 && WEP_CVAR(devastator, speedaccel) == 0, PROJECTILE_ROCKET, false); // because of fly sound
340
341         // muzzle flash for 1st person view
342         entity flash = spawn();
343         setmodel(flash, MDL_DEVASTATOR_MUZZLEFLASH); // precision set below
344         SUB_SetFade(flash, time, 0.1);
345         flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
346         W_AttachToShotorg(actor, weaponentity, flash, '5 0 0');
347
348         // common properties
349         MUTATOR_CALLHOOK(EditProjectile, actor, missile);
350 }
351
352 METHOD(Devastator, wr_aim, void(entity thiswep, entity actor, .entity weaponentity))
353 {
354     // aim and decide to fire if appropriate
355     PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, weaponentity, WEP_CVAR(devastator, speed), 0, WEP_CVAR(devastator, lifetime), false);
356     if(skill >= 2) // skill 0 and 1 bots won't detonate rockets!
357     {
358         // decide whether to detonate rockets
359         float edgedamage, coredamage, edgeradius, recipricoledgeradius;
360         float selfdamage, teamdamage, enemydamage;
361         edgedamage = WEP_CVAR(devastator, edgedamage);
362         coredamage = WEP_CVAR(devastator, damage);
363         edgeradius = WEP_CVAR(devastator, radius);
364         recipricoledgeradius = 1 / edgeradius;
365         selfdamage = 0;
366         teamdamage = 0;
367         enemydamage = 0;
368         IL_EACH(g_projectiles, it.realowner == actor && it.classname == "rocket",
369         {
370             entity rocket = it;
371             IL_EACH(g_bot_targets, it.bot_attack,
372             {
373                 float d = vlen(it.origin + (it.mins + it.maxs) * 0.5 - rocket.origin);
374                 d = bound(0, edgedamage + (coredamage - edgedamage) * sqrt(1 - d * recipricoledgeradius), 10000);
375                 // count potential damage according to type of target
376                 if(it == actor)
377                         selfdamage = selfdamage + d;
378                 else if(SAME_TEAM(it, actor))
379                         teamdamage = teamdamage + d;
380                 else if(bot_shouldattack(actor, it))
381                         enemydamage = enemydamage + d;
382             });
383         });
384         float desirabledamage;
385         desirabledamage = enemydamage;
386         if(time > actor.invincible_finished && time > actor.spawnshieldtime)
387             desirabledamage = desirabledamage - selfdamage * autocvar_g_balance_selfdamagepercent;
388         if(teamplay && actor.team)
389             desirabledamage = desirabledamage - teamdamage;
390
391         makevectors(actor.v_angle);
392         IL_EACH(g_projectiles, it.realowner == actor && it.classname == "rocket",
393         {
394             if(skill > 9) // normal players only do this for the target they are tracking
395             {
396                     entity rocket = it;
397                     IL_EACH(g_bot_targets, it.bot_attack,
398                     {
399                         if((v_forward * normalize(rocket.origin - it.origin) < 0.1)
400                             && desirabledamage > 0.1 * coredamage
401                             ) PHYS_INPUT_BUTTON_ATCK2(actor) = true;
402                     });
403                 }
404                 else
405                 {
406                 //As the distance gets larger, a correct detonation gets near imposible
407                 //Bots are assumed to use the rocket spawnfunc_light to see if the rocket gets near a player
408                 if((v_forward * normalize(it.origin - actor.enemy.origin) < 0.1)
409                         && IS_PLAYER(actor.enemy)
410                         && (desirabledamage >= 0.1 * coredamage)
411                         )
412                 {
413                         float distance = bound(300, vlen(actor.origin - actor.enemy.origin), 30000);
414                         if(random() / distance * 300 > frametime * bound(0, (10 - skill) * 0.2, 1))
415                                 PHYS_INPUT_BUTTON_ATCK2(actor) = true;
416                 }
417                 }
418         });
419         // if we would be doing at X percent of the core damage, detonate it
420         // but don't fire a new shot at the same time!
421         if(desirabledamage >= 0.75 * coredamage) //this should do group damage in rare fortunate events
422             PHYS_INPUT_BUTTON_ATCK2(actor) = true;
423         if((skill > 6.5) && (selfdamage > actor.health))
424             PHYS_INPUT_BUTTON_ATCK2(actor) = false;
425         //if(PHYS_INPUT_BUTTON_ATCK2(actor) == true)
426         //      dprint(ftos(desirabledamage),"\n");
427         if(PHYS_INPUT_BUTTON_ATCK2(actor)) PHYS_INPUT_BUTTON_ATCK(actor) = false;
428     }
429 }
430
431 METHOD(Devastator, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
432 {
433     if(WEP_CVAR(devastator, reload_ammo) && actor.(weaponentity).clip_load < WEP_CVAR(devastator, ammo)) { // forced reload
434         thiswep.wr_reload(thiswep, actor, weaponentity);
435     } else {
436         if(fire & 1)
437         {
438             if(actor.(weaponentity).rl_release || WEP_CVAR(devastator, guidestop))
439             if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR(devastator, refire)))
440             {
441                 W_Devastator_Attack(thiswep, actor, weaponentity);
442                 weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR(devastator, animtime), w_ready);
443                 actor.(weaponentity).rl_release = 0;
444             }
445         }
446         else
447             actor.(weaponentity).rl_release = 1;
448
449         if(fire & 2)
450         if(actor.(weaponentity).m_switchweapon == WEP_DEVASTATOR)
451         {
452             bool rockfound = false;
453             IL_EACH(g_projectiles, it.realowner == actor && it.classname == "rocket",
454             {
455                 if(!it.rl_detonate_later)
456                 {
457                     it.rl_detonate_later = true;
458                     rockfound = true;
459                 }
460             });
461             if(rockfound)
462                 sound(actor, CH_WEAPON_B, SND_ROCKET_DET, VOL_BASE, ATTN_NORM);
463         }
464     }
465 }
466 METHOD(Devastator, wr_setup, void(entity thiswep, entity actor, .entity weaponentity))
467 {
468     actor.(weaponentity).rl_release = 1;
469 }
470 METHOD(Devastator, wr_checkammo1, bool(entity thiswep, entity actor, .entity weaponentity))
471 {
472     #if 0
473     // don't switch while guiding a missile
474     if(ATTACK_FINISHED(actor, slot) <= time || PS(actor).m_weapon != WEP_DEVASTATOR)
475     {
476         ammo_amount = false;
477         if(WEP_CVAR(devastator, reload_ammo))
478         {
479             if(GetResourceAmount(actor, thiswep.ammo_type) < WEP_CVAR(devastator, ammo) && actor.(weaponentity).(weapon_load[WEP_DEVASTATOR.m_id]) < WEP_CVAR(devastator, ammo))
480                 ammo_amount = true;
481         }
482         else if(GetResourceAmount(actor, thiswep.ammo_type) < WEP_CVAR(devastator, ammo))
483             ammo_amount = true;
484         return !ammo_amount;
485     }
486     #endif
487     #if 0
488     if(actor.rl_release == 0)
489     {
490         LOG_INFOF("W_Devastator(WR_CHECKAMMO1): %d, %.2f, %d: TRUE", actor.rl_release, GetResourceAmount(actor, thiswep.ammo_type), WEP_CVAR(devastator, ammo));
491         return true;
492     }
493     else
494     {
495         ammo_amount = GetResourceAmount(actor, thiswep.ammo_type) >= WEP_CVAR(devastator, ammo);
496         ammo_amount += actor.(weaponentity).(weapon_load[WEP_DEVASTATOR.m_id]) >= WEP_CVAR(devastator, ammo);
497         LOG_INFOF("W_Devastator(WR_CHECKAMMO1): %d, %.2f, %d: %s", actor.rl_release, GetResourceAmount(actor, thiswep.ammo_type), WEP_CVAR(devastator, ammo), (ammo_amount ? "TRUE" : "FALSE"));
498         return ammo_amount;
499     }
500     #else
501     float ammo_amount = GetResourceAmount(actor, thiswep.ammo_type) >= WEP_CVAR(devastator, ammo);
502     ammo_amount += actor.(weaponentity).(weapon_load[WEP_DEVASTATOR.m_id]) >= WEP_CVAR(devastator, ammo);
503     return ammo_amount;
504     #endif
505 }
506 METHOD(Devastator, wr_checkammo2, bool(entity thiswep, entity actor, .entity weaponentity))
507 {
508     return false;
509 }
510 METHOD(Devastator, wr_resetplayer, void(entity thiswep, entity actor))
511 {
512     for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
513     {
514         .entity weaponentity = weaponentities[slot];
515         actor.(weaponentity).lastrocket = NULL; // stop rocket guiding, no revenge from the grave!
516         actor.(weaponentity).rl_release = 0;
517     }
518 }
519 METHOD(Devastator, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
520 {
521     W_Reload(actor, weaponentity, WEP_CVAR(devastator, ammo), SND_RELOAD);
522 }
523 METHOD(Devastator, wr_suicidemessage, Notification(entity thiswep))
524 {
525     return WEAPON_DEVASTATOR_SUICIDE;
526 }
527 METHOD(Devastator, wr_killmessage, Notification(entity thiswep))
528 {
529     if((w_deathtype & HITTYPE_BOUNCE) || (w_deathtype & HITTYPE_SPLASH))
530         return WEAPON_DEVASTATOR_MURDER_SPLASH;
531     else
532         return WEAPON_DEVASTATOR_MURDER_DIRECT;
533 }
534
535 #endif
536 #ifdef CSQC
537
538 METHOD(Devastator, wr_impacteffect, void(entity thiswep, entity actor))
539 {
540     vector org2;
541     org2 = w_org + w_backoff * 12;
542     pointparticles(EFFECT_ROCKET_EXPLODE, org2, '0 0 0', 1);
543     if(!w_issilent)
544         sound(actor, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTN_NORM);
545 }
546
547 #endif