f8c3c6ca93298ded90dd9b0dd331b24f8353795f
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / minelayer.qc
1 #ifndef IMPLEMENTATION
2 CLASS(MineLayer, Weapon)
3 /* ammotype  */ ATTRIB(MineLayer, ammo_field, .int, ammo_rockets)
4 /* impulse   */ ATTRIB(MineLayer, impulse, int, 4)
5 /* flags     */ ATTRIB(MineLayer, spawnflags, int, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH);
6 /* rating    */ ATTRIB(MineLayer, bot_pickupbasevalue, float, BOT_PICKUP_RATING_HIGH);
7 /* color     */ ATTRIB(MineLayer, wpcolor, vector, '0.75 1 0');
8 /* modelname */ ATTRIB(MineLayer, mdl, string, "minelayer");
9 #ifndef MENUQC
10 /* model     */ ATTRIB(MineLayer, m_model, Model, MDL_MINELAYER_ITEM);
11 #endif
12 /* crosshair */ ATTRIB(MineLayer, w_crosshair, string, "gfx/crosshairminelayer");
13 /* crosshair */ ATTRIB(MineLayer, w_crosshair_size, float, 0.9);
14 /* wepimg    */ ATTRIB(MineLayer, model2, string, "weaponminelayer");
15 /* refname   */ ATTRIB(MineLayer, netname, string, "minelayer");
16 /* wepname   */ ATTRIB(MineLayer, m_name, string, _("Mine Layer"));
17
18 #define X(BEGIN, P, END, class, prefix) \
19         BEGIN(class) \
20                 P(class, prefix, ammo, float, NONE) \
21                 P(class, prefix, animtime, float, NONE) \
22                 P(class, prefix, damageforcescale, float, NONE) \
23                 P(class, prefix, damage, float, NONE) \
24                 P(class, prefix, detonatedelay, float, NONE) \
25                 P(class, prefix, edgedamage, float, NONE) \
26                 P(class, prefix, force, float, NONE) \
27                 P(class, prefix, health, float, NONE) \
28                 P(class, prefix, lifetime, float, NONE) \
29                 P(class, prefix, lifetime_countdown, float, NONE) \
30                 P(class, prefix, limit, float, NONE) \
31                 P(class, prefix, protection, float, NONE) \
32                 P(class, prefix, proximityradius, float, NONE) \
33                 P(class, prefix, radius, float, NONE) \
34                 P(class, prefix, refire, float, NONE) \
35                 P(class, prefix, reload_ammo, float, NONE) \
36         P(class, prefix, reload_time, float, NONE) \
37                 P(class, prefix, remote_damage, float, NONE) \
38                 P(class, prefix, remote_edgedamage, float, NONE) \
39                 P(class, prefix, remote_force, float, NONE) \
40                 P(class, prefix, remote_radius, float, NONE) \
41                 P(class, prefix, speed, float, NONE) \
42         P(class, prefix, switchdelay_drop, float, NONE) \
43         P(class, prefix, switchdelay_raise, float, NONE) \
44                 P(class, prefix, time, float, NONE) \
45         P(class, prefix, weaponreplace, string, NONE) \
46         P(class, prefix, weaponstartoverride, float, NONE) \
47         P(class, prefix, weaponstart, float, NONE) \
48         P(class, prefix, weaponthrowable, float, NONE) \
49         END()
50     W_PROPS(X, MineLayer, minelayer)
51 #undef X
52 ENDCLASS(MineLayer)
53 REGISTER_WEAPON(MINE_LAYER, minelayer, NEW(MineLayer));
54
55 #ifdef SVQC
56 void W_MineLayer_Think();
57 .float minelayer_detonate, mine_explodeanyway;
58 .float mine_time;
59 .vector mine_orientation;
60 #endif
61 #endif
62 #ifdef IMPLEMENTATION
63 #ifdef SVQC
64 spawnfunc(weapon_minelayer) { weapon_defaultspawnfunc(this, WEP_MINE_LAYER); }
65
66 void W_MineLayer_Stick(entity to)
67 {SELFPARAM();
68         spamsound(self, CH_SHOTS, SND(MINE_STICK), VOL_BASE, ATTN_NORM);
69
70         // in order for mines to face properly when sticking to the ground, they must be a server side entity rather than a csqc projectile
71
72         entity newmine = spawn();
73         newmine.classname = self.classname;
74
75         newmine.bot_dodge = self.bot_dodge;
76         newmine.bot_dodgerating = self.bot_dodgerating;
77
78         newmine.owner = self.owner;
79         newmine.realowner = self.realowner;
80         setsize(newmine, '-4 -4 -4', '4 4 4');
81         setorigin(newmine, self.origin);
82         setmodel(newmine, MDL_MINELAYER_MINE);
83         newmine.angles = vectoangles(-trace_plane_normal); // face against the surface
84
85         newmine.mine_orientation = -trace_plane_normal;
86
87         newmine.takedamage = self.takedamage;
88         newmine.damageforcescale = self.damageforcescale;
89         newmine.health = self.health;
90         newmine.event_damage = self.event_damage;
91         newmine.spawnshieldtime = self.spawnshieldtime;
92         newmine.damagedbycontents = true;
93
94         newmine.movetype = MOVETYPE_NONE; // lock the mine in place
95         newmine.projectiledeathtype = self.projectiledeathtype;
96
97         newmine.mine_time = self.mine_time;
98
99         settouch(newmine, func_null);
100         setthink(newmine, W_MineLayer_Think);
101         newmine.nextthink = time;
102         newmine.cnt = self.cnt;
103         newmine.flags = self.flags;
104
105         remove(self);
106
107         if(to)
108                 SetMovetypeFollow(newmine, to);
109 }
110
111 void W_MineLayer_Explode()
112 {SELFPARAM();
113         if(other.takedamage == DAMAGE_AIM)
114                 if(IS_PLAYER(other))
115                         if(DIFF_TEAM(self.realowner, other))
116                                 if(!IS_DEAD(other))
117                                         if(IsFlying(other))
118                                                 Send_Notification(NOTIF_ONE, self.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_AIRSHOT);
119
120         self.event_damage = func_null;
121         self.takedamage = DAMAGE_NO;
122
123         RadiusDamage(self, self.realowner, WEP_CVAR(minelayer, damage), WEP_CVAR(minelayer, edgedamage), WEP_CVAR(minelayer, radius), world, world, WEP_CVAR(minelayer, force), self.projectiledeathtype, other);
124
125         if(PS(self.realowner).m_weapon == WEP_MINE_LAYER)
126         {
127                 entity own = this.realowner;
128                 Weapon w = WEP_MINE_LAYER;
129                 if(!w.wr_checkammo1(w, own))
130                 {
131                         own.cnt = WEP_MINE_LAYER.m_id;
132                         int slot = 0; // TODO: unhardcode
133                         ATTACK_FINISHED(own, slot) = time;
134                         PS(own).m_switchweapon = w_getbestweapon(own);
135                 }
136         }
137         self.realowner.minelayer_mines -= 1;
138         remove(self);
139 }
140
141 void W_MineLayer_DoRemoteExplode()
142 {SELFPARAM();
143         self.event_damage = func_null;
144         self.takedamage = DAMAGE_NO;
145
146         if(self.movetype == MOVETYPE_NONE || self.movetype == MOVETYPE_FOLLOW)
147                 self.velocity = self.mine_orientation; // particle fx and decals need .velocity
148
149         RadiusDamage(self, self.realowner, WEP_CVAR(minelayer, remote_damage), WEP_CVAR(minelayer, remote_edgedamage), WEP_CVAR(minelayer, remote_radius), world, world, WEP_CVAR(minelayer, remote_force), self.projectiledeathtype | HITTYPE_BOUNCE, world);
150
151         if(PS(self.realowner).m_weapon == WEP_MINE_LAYER)
152         {
153                 entity own = this.realowner;
154                 Weapon w = WEP_MINE_LAYER;
155                 if(!w.wr_checkammo1(w, own))
156                 {
157                         own.cnt = WEP_MINE_LAYER.m_id;
158                         int slot = 0; // TODO: unhardcode
159                         ATTACK_FINISHED(own, slot) = time;
160                         PS(own).m_switchweapon = w_getbestweapon(own);
161                 }
162         }
163         this.realowner.minelayer_mines -= 1;
164         remove(self);
165 }
166
167 void W_MineLayer_RemoteExplode()
168 {SELFPARAM();
169         if(!IS_DEAD(self.realowner))
170                 if((self.spawnshieldtime >= 0)
171                         ? (time >= self.spawnshieldtime) // timer
172                         : (vdist(NearestPointOnBox(self.realowner, self.origin) - self.origin, >, WEP_CVAR(minelayer, remote_radius))) // safety device
173                 )
174                 {
175                         W_MineLayer_DoRemoteExplode();
176                 }
177 }
178
179 void W_MineLayer_ProximityExplode()
180 {SELFPARAM();
181         // make sure no friend is in the mine's radius. If there is any, explosion is delayed until he's at a safe distance
182         if(WEP_CVAR(minelayer, protection) && self.mine_explodeanyway == 0)
183         {
184                 entity head;
185                 head = findradius(self.origin, WEP_CVAR(minelayer, radius));
186                 while(head)
187                 {
188                         if(head == self.realowner || SAME_TEAM(head, self.realowner))
189                                 return;
190                         head = head.chain;
191                 }
192         }
193
194         self.mine_time = 0;
195         W_MineLayer_Explode();
196 }
197
198 int W_MineLayer_Count(entity e)
199 {
200         int minecount = 0;
201         entity mine;
202         for(mine = world; (mine = find(mine, classname, "mine")); ) if(mine.realowner == e)
203                 minecount += 1;
204
205         return minecount;
206 }
207
208 void W_MineLayer_Think()
209 {SELFPARAM();
210         entity head;
211
212         self.nextthink = time;
213
214         if(self.movetype == MOVETYPE_FOLLOW)
215         {
216                 if(LostMovetypeFollow(self))
217                 {
218                         UnsetMovetypeFollow(self);
219                         self.movetype = MOVETYPE_NONE;
220                 }
221         }
222
223         // our lifetime has expired, it's time to die - mine_time just allows us to play a sound for this
224         // TODO: replace this mine_trigger.wav sound with a real countdown
225         if((time > self.cnt) && (!self.mine_time) && (self.cnt > 0))
226         {
227                 if(WEP_CVAR(minelayer, lifetime_countdown) > 0)
228                         spamsound(self, CH_SHOTS, SND(MINE_TRIGGER), VOL_BASE, ATTN_NORM);
229                 self.mine_time = time + WEP_CVAR(minelayer, lifetime_countdown);
230                 self.mine_explodeanyway = 1; // make the mine super aggressive -- Samual: Rather, make it not care if a team mate is near.
231         }
232
233         // a player's mines shall explode if he disconnects or dies
234         // TODO: Do this on team change too -- Samual: But isn't a player killed when they switch teams?
235         if(!IS_PLAYER(self.realowner) || IS_DEAD(self.realowner) || STAT(FROZEN, self.realowner))
236         {
237                 other = world;
238                 self.projectiledeathtype |= HITTYPE_BOUNCE;
239                 W_MineLayer_Explode();
240                 return;
241         }
242
243         // set the mine for detonation when a foe gets close enough
244         head = findradius(self.origin, WEP_CVAR(minelayer, proximityradius));
245         while(head)
246         {
247                 if(IS_PLAYER(head) && !IS_DEAD(head) && !STAT(FROZEN, head))
248                 if(head != self.realowner && DIFF_TEAM(head, self.realowner)) // don't trigger for team mates
249                 if(!self.mine_time)
250                 {
251                         spamsound(self, CH_SHOTS, SND(MINE_TRIGGER), VOL_BASE, ATTN_NORM);
252                         self.mine_time = time + WEP_CVAR(minelayer, time);
253                 }
254                 head = head.chain;
255         }
256
257         // explode if it's time to
258         if(self.mine_time && time >= self.mine_time)
259         {
260                 W_MineLayer_ProximityExplode();
261                 return;
262         }
263
264         // remote detonation
265         if(PS(self.realowner).m_weapon == WEP_MINE_LAYER)
266         if(!IS_DEAD(self.realowner))
267         if(self.minelayer_detonate)
268                 W_MineLayer_RemoteExplode();
269 }
270
271 void W_MineLayer_Touch()
272 {SELFPARAM();
273         if(self.movetype == MOVETYPE_NONE || self.movetype == MOVETYPE_FOLLOW)
274                 return; // we're already a stuck mine, why do we get called? TODO does this even happen?
275
276         if(WarpZone_Projectile_Touch())
277         {
278                 if(wasfreed(self))
279                         self.realowner.minelayer_mines -= 1;
280                 return;
281         }
282
283         if(other && IS_PLAYER(other) && !IS_DEAD(other))
284         {
285                 // hit a player
286                 // don't stick
287         }
288         else
289         {
290                 W_MineLayer_Stick(other);
291         }
292 }
293
294 void W_MineLayer_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
295 {
296         if(this.health <= 0)
297                 return;
298
299         float is_from_enemy = (inflictor.realowner != this.realowner);
300
301         if(!W_CheckProjectileDamage(inflictor.realowner, this.realowner, deathtype, (is_from_enemy ? 1 : -1)))
302                 return; // g_projectiles_damage says to halt
303
304         this.health = this.health - damage;
305         this.angles = vectoangles(this.velocity);
306
307         if(this.health <= 0)
308                 W_PrepareExplosionByDamage(this, attacker, W_MineLayer_Explode);
309 }
310
311 void W_MineLayer_Attack(Weapon thiswep)
312 {SELFPARAM();
313         entity mine;
314         entity flash;
315
316         // scan how many mines we placed, and return if we reached our limit
317         if(WEP_CVAR(minelayer, limit))
318         {
319                 if(self.minelayer_mines >= WEP_CVAR(minelayer, limit))
320                 {
321                         // the refire delay keeps this message from being spammed
322                         Send_Notification(NOTIF_ONE, self, MSG_MULTI, WEAPON_MINELAYER_LIMIT, WEP_CVAR(minelayer, limit));
323                         play2(self, SND(UNAVAILABLE));
324                         return;
325                 }
326         }
327
328         W_DecreaseAmmo(thiswep, self, WEP_CVAR(minelayer, ammo));
329
330         W_SetupShot_ProjectileSize(self, '-4 -4 -4', '4 4 4', false, 5, SND_MINE_FIRE, CH_WEAPON_A, WEP_CVAR(minelayer, damage));
331         Send_Effect(EFFECT_ROCKET_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
332
333         mine = WarpZone_RefSys_SpawnSameRefSys(self);
334         mine.owner = mine.realowner = self;
335         if(WEP_CVAR(minelayer, detonatedelay) >= 0)
336                 mine.spawnshieldtime = time + WEP_CVAR(minelayer, detonatedelay);
337         else
338                 mine.spawnshieldtime = -1;
339         mine.classname = "mine";
340         mine.bot_dodge = true;
341         mine.bot_dodgerating = WEP_CVAR(minelayer, damage) * 2; // * 2 because it can detonate inflight which makes it even more dangerous
342
343         mine.takedamage = DAMAGE_YES;
344         mine.damageforcescale = WEP_CVAR(minelayer, damageforcescale);
345         mine.health = WEP_CVAR(minelayer, health);
346         mine.event_damage = W_MineLayer_Damage;
347         mine.damagedbycontents = true;
348
349         mine.movetype = MOVETYPE_TOSS;
350         PROJECTILE_MAKETRIGGER(mine);
351         mine.projectiledeathtype = WEP_MINE_LAYER.m_id;
352         setsize(mine, '-4 -4 -4', '4 4 4'); // give it some size so it can be shot
353
354         setorigin(mine, w_shotorg - v_forward * 4); // move it back so it hits the wall at the right point
355         W_SetupProjVelocity_Basic(mine, WEP_CVAR(minelayer, speed), 0);
356         mine.angles = vectoangles(mine.velocity);
357
358         settouch(mine, W_MineLayer_Touch);
359         setthink(mine, W_MineLayer_Think);
360         mine.nextthink = time;
361         mine.cnt = (WEP_CVAR(minelayer, lifetime) - WEP_CVAR(minelayer, lifetime_countdown));
362         mine.flags = FL_PROJECTILE;
363         mine.missile_flags = MIF_SPLASH | MIF_ARC | MIF_PROXY;
364
365         if(mine.cnt > 0) { mine.cnt += time; }
366
367         CSQCProjectile(mine, true, PROJECTILE_MINE, true);
368
369         // muzzle flash for 1st person view
370         flash = spawn();
371         setmodel(flash, MDL_MINELAYER_MUZZLEFLASH); // precision set below
372         SUB_SetFade(flash, time, 0.1);
373         flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
374         W_AttachToShotorg(self, flash, '5 0 0');
375
376         // common properties
377
378         MUTATOR_CALLHOOK(EditProjectile, self, mine);
379
380         self.minelayer_mines = W_MineLayer_Count(self);
381 }
382
383 float W_MineLayer_PlacedMines(entity this, float detonate)
384 {
385         entity mine;
386         float minfound = 0;
387
388         for(mine = world; (mine = find(mine, classname, "mine")); ) if(mine.realowner == this)
389         {
390                 if(detonate)
391                 {
392                         if(!mine.minelayer_detonate)
393                         {
394                                 mine.minelayer_detonate = true;
395                                 minfound = 1;
396                         }
397                 }
398                 else
399                         minfound = 1;
400         }
401         return minfound;
402 }
403
404 METHOD(MineLayer, wr_aim, void(entity thiswep))
405 {
406     SELFPARAM();
407     // aim and decide to fire if appropriate
408     if(self.minelayer_mines >= WEP_CVAR(minelayer, limit))
409         PHYS_INPUT_BUTTON_ATCK(self) = false;
410     else
411         PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(self, WEP_CVAR(minelayer, speed), 0, WEP_CVAR(minelayer, lifetime), false);
412     if(skill >= 2) // skill 0 and 1 bots won't detonate mines!
413     {
414         // decide whether to detonate mines
415         entity targetlist, targ;
416         float edgedamage, coredamage, edgeradius, recipricoledgeradius, d;
417         float selfdamage, teamdamage, enemydamage;
418         edgedamage = WEP_CVAR(minelayer, edgedamage);
419         coredamage = WEP_CVAR(minelayer, damage);
420         edgeradius = WEP_CVAR(minelayer, radius);
421         recipricoledgeradius = 1 / edgeradius;
422         selfdamage = 0;
423         teamdamage = 0;
424         enemydamage = 0;
425         targetlist = findchainfloat(bot_attack, true);
426         entity mine = find(world, classname, "mine");
427         while(mine)
428         {
429             if(mine.realowner != self)
430             {
431                 mine = find(mine, classname, "mine");
432                 continue;
433             }
434             targ = targetlist;
435             while(targ)
436             {
437                 d = vlen(targ.origin + (targ.mins + targ.maxs) * 0.5 - mine.origin);
438                 d = bound(0, edgedamage + (coredamage - edgedamage) * sqrt(1 - d * recipricoledgeradius), 10000);
439                 // count potential damage according to type of target
440                 if(targ == self)
441                     selfdamage = selfdamage + d;
442                 else if(targ.team == self.team && teamplay)
443                     teamdamage = teamdamage + d;
444                 else if(bot_shouldattack(self, targ))
445                     enemydamage = enemydamage + d;
446                 targ = targ.chain;
447             }
448             mine = find(mine, classname, "mine");
449         }
450         float desirabledamage;
451         desirabledamage = enemydamage;
452         if(time > self.invincible_finished && time > self.spawnshieldtime)
453             desirabledamage = desirabledamage - selfdamage * autocvar_g_balance_selfdamagepercent;
454         if(teamplay && self.team)
455             desirabledamage = desirabledamage - teamdamage;
456
457         mine = find(world, classname, "mine");
458         while(mine)
459         {
460             if(mine.realowner != self)
461             {
462                 mine = find(mine, classname, "mine");
463                 continue;
464             }
465             makevectors(mine.v_angle);
466             targ = targetlist;
467             if(skill > 9) // normal players only do this for the target they are tracking
468             {
469                 targ = targetlist;
470                 while(targ)
471                 {
472                     if(
473                         (v_forward * normalize(mine.origin - targ.origin)< 0.1)
474                         && desirabledamage > 0.1*coredamage
475                     ) PHYS_INPUT_BUTTON_ATCK2(self) = true;
476                     targ = targ.chain;
477                 }
478             }else{
479                 float distance; distance= bound(300,vlen(self.origin-self.enemy.origin),30000);
480                 //As the distance gets larger, a correct detonation gets near imposible
481                 //Bots are assumed to use the mine spawnfunc_light to see if the mine gets near a player
482                 if(v_forward * normalize(mine.origin - self.enemy.origin)< 0.1)
483                     if(IS_PLAYER(self.enemy))
484                         if(desirabledamage >= 0.1*coredamage)
485                             if(random()/distance*300 > frametime*bound(0,(10-skill)*0.2,1))
486                                 PHYS_INPUT_BUTTON_ATCK2(self) = true;
487             //  dprint(ftos(random()/distance*300),">");dprint(ftos(frametime*bound(0,(10-skill)*0.2,1)),"\n");
488             }
489
490             mine = find(mine, classname, "mine");
491         }
492         // if we would be doing at X percent of the core damage, detonate it
493         // but don't fire a new shot at the same time!
494         if(desirabledamage >= 0.75 * coredamage) //this should do group damage in rare fortunate events
495             PHYS_INPUT_BUTTON_ATCK2(self) = true;
496         if((skill > 6.5) && (selfdamage > self.health))
497             PHYS_INPUT_BUTTON_ATCK2(self) = false;
498         //if(PHYS_INPUT_BUTTON_ATCK2(self) == true)
499         //      dprint(ftos(desirabledamage),"\n");
500         if(PHYS_INPUT_BUTTON_ATCK2(self)) PHYS_INPUT_BUTTON_ATCK(self) = false;
501     }
502 }
503 METHOD(MineLayer, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
504 {
505     if(autocvar_g_balance_minelayer_reload_ammo && actor.clip_load < WEP_CVAR(minelayer, ammo)) // forced reload
506     {
507         // not if we're holding the minelayer without enough ammo, but can detonate existing mines
508         if(!(W_MineLayer_PlacedMines(actor, false) && actor.(thiswep.ammo_field) < WEP_CVAR(minelayer, ammo))) {
509             thiswep.wr_reload(thiswep, actor, weaponentity);
510         }
511     }
512     else if(fire & 1)
513     {
514         if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR(minelayer, refire)))
515         {
516             W_MineLayer_Attack(thiswep);
517             weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR(minelayer, animtime), w_ready);
518         }
519     }
520
521     if(fire & 2)
522     {
523         if(W_MineLayer_PlacedMines(actor, true))
524             sound(actor, CH_WEAPON_B, SND_MINE_DET, VOL_BASE, ATTN_NORM);
525     }
526 }
527 METHOD(MineLayer, wr_checkammo1, bool(entity thiswep, entity actor))
528 {
529     //int slot = 0; // TODO: unhardcode
530     // actually do // don't switch while placing a mine
531     //if(ATTACK_FINISHED(actor, slot) <= time || PS(actor).m_weapon != WEP_MINE_LAYER)
532     //{
533         float ammo_amount = actor.(thiswep.ammo_field) >= WEP_CVAR(minelayer, ammo);
534         ammo_amount += actor.(weapon_load[WEP_MINE_LAYER.m_id]) >= WEP_CVAR(minelayer, ammo);
535         return ammo_amount;
536     //}
537     //return true;
538 }
539 METHOD(MineLayer, wr_checkammo2, bool(entity thiswep, entity actor))
540 {
541     if(W_MineLayer_PlacedMines(actor, false))
542         return true;
543     else
544         return false;
545 }
546 METHOD(MineLayer, wr_resetplayers, void(entity thiswep))
547 {
548     SELFPARAM();
549     self.minelayer_mines = 0;
550 }
551 METHOD(MineLayer, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
552 {
553     SELFPARAM();
554     W_Reload(self, WEP_CVAR(minelayer, ammo), SND_RELOAD);
555 }
556 METHOD(MineLayer, wr_suicidemessage, Notification(entity thiswep))
557 {
558     return WEAPON_MINELAYER_SUICIDE;
559 }
560 METHOD(MineLayer, wr_killmessage, Notification(entity thiswep))
561 {
562     return WEAPON_MINELAYER_MURDER;
563 }
564
565 #endif
566 #ifdef CSQC
567
568 METHOD(MineLayer, wr_impacteffect, void(entity thiswep))
569 {
570     SELFPARAM();
571     vector org2;
572     org2 = w_org + w_backoff * 12;
573     pointparticles(EFFECT_ROCKET_EXPLODE, org2, '0 0 0', 1);
574     if(!w_issilent)
575         sound(self, CH_SHOTS, SND_MINE_EXP, VOL_BASE, ATTN_NORM);
576 }
577
578 #endif
579 #endif