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