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