]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/weapons/weapon/minelayer.qc
Merge branch 'master' into Mario/balance
[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(entity this);
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 this, entity to)
67 {
68         spamsound(this, 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 = this.classname;
74
75         newmine.bot_dodge = this.bot_dodge;
76         newmine.bot_dodgerating = this.bot_dodgerating;
77
78         newmine.owner = this.owner;
79         newmine.realowner = this.realowner;
80         setsize(newmine, '-4 -4 -4', '4 4 4');
81         setorigin(newmine, this.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 = this.takedamage;
88         newmine.damageforcescale = this.damageforcescale;
89         newmine.health = this.health;
90         newmine.event_damage = this.event_damage;
91         newmine.spawnshieldtime = this.spawnshieldtime;
92         newmine.damagedbycontents = true;
93
94         newmine.movetype = MOVETYPE_NONE; // lock the mine in place
95         newmine.projectiledeathtype = this.projectiledeathtype;
96
97         newmine.mine_time = this.mine_time;
98
99         settouch(newmine, func_null);
100         setthink(newmine, W_MineLayer_Think);
101         newmine.nextthink = time;
102         newmine.cnt = this.cnt;
103         newmine.flags = this.flags;
104
105         remove(this);
106
107         if(to)
108                 SetMovetypeFollow(newmine, to);
109 }
110
111 void W_MineLayer_Explode(entity this, entity directhitentity)
112 {
113         if(directhitentity.takedamage == DAMAGE_AIM)
114                 if(IS_PLAYER(directhitentity))
115                         if(DIFF_TEAM(this.realowner, directhitentity))
116                                 if(!IS_DEAD(directhitentity))
117                                         if(IsFlying(directhitentity))
118                                                 Send_Notification(NOTIF_ONE, this.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_AIRSHOT);
119
120         this.event_damage = func_null;
121         this.takedamage = DAMAGE_NO;
122
123         RadiusDamage(this, this.realowner, WEP_CVAR(minelayer, damage), WEP_CVAR(minelayer, edgedamage), WEP_CVAR(minelayer, radius), NULL, NULL, WEP_CVAR(minelayer, force), this.projectiledeathtype, directhitentity);
124
125         if(PS(this.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         this.realowner.minelayer_mines -= 1;
138         remove(this);
139 }
140
141 void W_MineLayer_Explode_think(entity this)
142 {
143         W_MineLayer_Explode(this, NULL);
144 }
145
146 void W_MineLayer_DoRemoteExplode(entity this)
147 {
148         this.event_damage = func_null;
149         this.takedamage = DAMAGE_NO;
150
151         if(this.movetype == MOVETYPE_NONE || this.movetype == MOVETYPE_FOLLOW)
152                 this.velocity = this.mine_orientation; // particle fx and decals need .velocity
153
154         RadiusDamage(this, this.realowner, WEP_CVAR(minelayer, remote_damage), WEP_CVAR(minelayer, remote_edgedamage), WEP_CVAR(minelayer, remote_radius), NULL, NULL, WEP_CVAR(minelayer, remote_force), this.projectiledeathtype | HITTYPE_BOUNCE, NULL);
155
156         if(PS(this.realowner).m_weapon == WEP_MINE_LAYER)
157         {
158                 entity own = this.realowner;
159                 Weapon w = WEP_MINE_LAYER;
160                 if(!w.wr_checkammo1(w, own))
161                 {
162                         own.cnt = WEP_MINE_LAYER.m_id;
163                         int slot = 0; // TODO: unhardcode
164                         ATTACK_FINISHED(own, slot) = time;
165                         PS(own).m_switchweapon = w_getbestweapon(own);
166                 }
167         }
168         this.realowner.minelayer_mines -= 1;
169         remove(this);
170 }
171
172 void W_MineLayer_RemoteExplode(entity this)
173 {
174         if(!IS_DEAD(this.realowner))
175                 if((this.spawnshieldtime >= 0)
176                         ? (time >= this.spawnshieldtime) // timer
177                         : (vdist(NearestPointOnBox(this.realowner, this.origin) - this.origin, >, WEP_CVAR(minelayer, remote_radius))) // safety device
178                 )
179                 {
180                         W_MineLayer_DoRemoteExplode(this);
181                 }
182 }
183
184 void W_MineLayer_ProximityExplode(entity this)
185 {
186         // make sure no friend is in the mine's radius. If there is any, explosion is delayed until he's at a safe distance
187         if(WEP_CVAR(minelayer, protection) && this.mine_explodeanyway == 0)
188         {
189                 entity head;
190                 head = findradius(this.origin, WEP_CVAR(minelayer, radius));
191                 while(head)
192                 {
193                         if(head == this.realowner || SAME_TEAM(head, this.realowner))
194                                 return;
195                         head = head.chain;
196                 }
197         }
198
199         this.mine_time = 0;
200         W_MineLayer_Explode(this, NULL);
201 }
202
203 int W_MineLayer_Count(entity e)
204 {
205         int minecount = 0;
206         entity mine;
207         for(mine = NULL; (mine = find(mine, classname, "mine")); ) if(mine.realowner == e)
208                 minecount += 1;
209
210         return minecount;
211 }
212
213 void W_MineLayer_Think(entity this)
214 {
215         entity head;
216
217         this.nextthink = time;
218
219         if(this.movetype == MOVETYPE_FOLLOW)
220         {
221                 if(LostMovetypeFollow(this))
222                 {
223                         UnsetMovetypeFollow(this);
224                         this.movetype = MOVETYPE_NONE;
225                 }
226         }
227
228         // our lifetime has expired, it's time to die - mine_time just allows us to play a sound for this
229         // TODO: replace this mine_trigger.wav sound with a real countdown
230         if((time > this.cnt) && (!this.mine_time) && (this.cnt > 0))
231         {
232                 if(WEP_CVAR(minelayer, lifetime_countdown) > 0)
233                         spamsound(this, CH_SHOTS, SND(MINE_TRIGGER), VOL_BASE, ATTN_NORM);
234                 this.mine_time = time + WEP_CVAR(minelayer, lifetime_countdown);
235                 this.mine_explodeanyway = 1; // make the mine super aggressive -- Samual: Rather, make it not care if a team mate is near.
236         }
237
238         // a player's mines shall explode if he disconnects or dies
239         // TODO: Do this on team change too -- Samual: But isn't a player killed when they switch teams?
240         if(!IS_PLAYER(this.realowner) || IS_DEAD(this.realowner) || STAT(FROZEN, this.realowner))
241         {
242                 this.projectiledeathtype |= HITTYPE_BOUNCE;
243                 W_MineLayer_Explode(this, NULL);
244                 return;
245         }
246
247         // set the mine for detonation when a foe gets close enough
248         head = findradius(this.origin, WEP_CVAR(minelayer, proximityradius));
249         while(head)
250         {
251                 if(IS_PLAYER(head) && !IS_DEAD(head) && !STAT(FROZEN, head))
252                 if(head != this.realowner && DIFF_TEAM(head, this.realowner)) // don't trigger for team mates
253                 if(!this.mine_time)
254                 {
255                         spamsound(this, CH_SHOTS, SND(MINE_TRIGGER), VOL_BASE, ATTN_NORM);
256                         this.mine_time = time + WEP_CVAR(minelayer, time);
257                 }
258                 head = head.chain;
259         }
260
261         // explode if it's time to
262         if(this.mine_time && time >= this.mine_time)
263         {
264                 W_MineLayer_ProximityExplode(this);
265                 return;
266         }
267
268         // remote detonation
269         if(PS(this.realowner).m_weapon == WEP_MINE_LAYER)
270         if(!IS_DEAD(this.realowner))
271         if(this.minelayer_detonate)
272                 W_MineLayer_RemoteExplode(this);
273 }
274
275 void W_MineLayer_Touch(entity this, entity toucher)
276 {
277         if(this.movetype == MOVETYPE_NONE || this.movetype == MOVETYPE_FOLLOW)
278                 return; // we're already a stuck mine, why do we get called? TODO does this even happen?
279
280         if(WarpZone_Projectile_Touch(this, toucher))
281         {
282                 if(wasfreed(this))
283                         this.realowner.minelayer_mines -= 1;
284                 return;
285         }
286
287         if(toucher && IS_PLAYER(toucher) && !IS_DEAD(toucher))
288         {
289                 // hit a player
290                 // don't stick
291         }
292         else
293         {
294                 W_MineLayer_Stick(this, toucher);
295         }
296 }
297
298 void W_MineLayer_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
299 {
300         if(this.health <= 0)
301                 return;
302
303         float is_from_enemy = (inflictor.realowner != this.realowner);
304
305         if(!W_CheckProjectileDamage(inflictor.realowner, this.realowner, deathtype, (is_from_enemy ? 1 : -1)))
306                 return; // g_projectiles_damage says to halt
307
308         this.health = this.health - damage;
309         this.angles = vectoangles(this.velocity);
310
311         if(this.health <= 0)
312                 W_PrepareExplosionByDamage(this, attacker, W_MineLayer_Explode_think);
313 }
314
315 void W_MineLayer_Attack(Weapon thiswep, entity actor)
316 {
317         entity mine;
318         entity flash;
319
320         // scan how many mines we placed, and return if we reached our limit
321         if(WEP_CVAR(minelayer, limit))
322         {
323                 if(actor.minelayer_mines >= WEP_CVAR(minelayer, limit))
324                 {
325                         // the refire delay keeps this message from being spammed
326                         Send_Notification(NOTIF_ONE, actor, MSG_MULTI, WEAPON_MINELAYER_LIMIT, WEP_CVAR(minelayer, limit));
327                         play2(actor, SND(UNAVAILABLE));
328                         return;
329                 }
330         }
331
332         W_DecreaseAmmo(thiswep, actor, WEP_CVAR(minelayer, ammo));
333
334         W_SetupShot_ProjectileSize(actor, '-4 -4 -4', '4 4 4', false, 5, SND_MINE_FIRE, CH_WEAPON_A, WEP_CVAR(minelayer, damage));
335         Send_Effect(EFFECT_ROCKET_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
336
337         mine = WarpZone_RefSys_SpawnSameRefSys(actor);
338         mine.owner = mine.realowner = actor;
339         if(WEP_CVAR(minelayer, detonatedelay) >= 0)
340                 mine.spawnshieldtime = time + WEP_CVAR(minelayer, detonatedelay);
341         else
342                 mine.spawnshieldtime = -1;
343         mine.classname = "mine";
344         mine.bot_dodge = true;
345         mine.bot_dodgerating = WEP_CVAR(minelayer, damage) * 2; // * 2 because it can detonate inflight which makes it even more dangerous
346
347         mine.takedamage = DAMAGE_YES;
348         mine.damageforcescale = WEP_CVAR(minelayer, damageforcescale);
349         mine.health = WEP_CVAR(minelayer, health);
350         mine.event_damage = W_MineLayer_Damage;
351         mine.damagedbycontents = true;
352
353         mine.movetype = MOVETYPE_TOSS;
354         PROJECTILE_MAKETRIGGER(mine);
355         mine.projectiledeathtype = WEP_MINE_LAYER.m_id;
356         setsize(mine, '-4 -4 -4', '4 4 4'); // give it some size so it can be shot
357
358         setorigin(mine, w_shotorg - v_forward * 4); // move it back so it hits the wall at the right point
359         W_SetupProjVelocity_Basic(mine, WEP_CVAR(minelayer, speed), 0);
360         mine.angles = vectoangles(mine.velocity);
361
362         settouch(mine, W_MineLayer_Touch);
363         setthink(mine, W_MineLayer_Think);
364         mine.nextthink = time;
365         mine.cnt = (WEP_CVAR(minelayer, lifetime) - WEP_CVAR(minelayer, lifetime_countdown));
366         mine.flags = FL_PROJECTILE;
367         mine.missile_flags = MIF_SPLASH | MIF_ARC | MIF_PROXY;
368
369         if(mine.cnt > 0) { mine.cnt += time; }
370
371         CSQCProjectile(mine, true, PROJECTILE_MINE, true);
372
373         // muzzle flash for 1st person view
374         flash = spawn();
375         setmodel(flash, MDL_MINELAYER_MUZZLEFLASH); // precision set below
376         SUB_SetFade(flash, time, 0.1);
377         flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
378         W_AttachToShotorg(actor, flash, '5 0 0');
379
380         // common properties
381
382         MUTATOR_CALLHOOK(EditProjectile, actor, mine);
383
384         actor.minelayer_mines = W_MineLayer_Count(actor);
385 }
386
387 float W_MineLayer_PlacedMines(entity this, float detonate)
388 {
389         entity mine;
390         float minfound = 0;
391
392         for(mine = NULL; (mine = find(mine, classname, "mine")); ) if(mine.realowner == this)
393         {
394                 if(detonate)
395                 {
396                         if(!mine.minelayer_detonate)
397                         {
398                                 mine.minelayer_detonate = true;
399                                 minfound = 1;
400                         }
401                 }
402                 else
403                         minfound = 1;
404         }
405         return minfound;
406 }
407
408 METHOD(MineLayer, wr_aim, void(entity thiswep, entity actor))
409 {
410     // aim and decide to fire if appropriate
411     if(actor.minelayer_mines >= WEP_CVAR(minelayer, limit))
412         PHYS_INPUT_BUTTON_ATCK(actor) = false;
413     else
414         PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, 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(NULL, classname, "mine");
430         while(mine)
431         {
432             if(mine.realowner != actor)
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 == actor)
444                     selfdamage = selfdamage + d;
445                 else if(targ.team == actor.team && teamplay)
446                     teamdamage = teamdamage + d;
447                 else if(bot_shouldattack(actor, 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 > actor.invincible_finished && time > actor.spawnshieldtime)
456             desirabledamage = desirabledamage - selfdamage * autocvar_g_balance_selfdamagepercent;
457         if(teamplay && actor.team)
458             desirabledamage = desirabledamage - teamdamage;
459
460         mine = find(NULL, classname, "mine");
461         while(mine)
462         {
463             if(mine.realowner != actor)
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(actor) = true;
479                     targ = targ.chain;
480                 }
481             }else{
482                 float distance; distance= bound(300,vlen(actor.origin-actor.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 - actor.enemy.origin)< 0.1)
486                     if(IS_PLAYER(actor.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(actor) = 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(actor) = true;
499         if((skill > 6.5) && (selfdamage > actor.health))
500             PHYS_INPUT_BUTTON_ATCK2(actor) = false;
501         //if(PHYS_INPUT_BUTTON_ATCK2(actor) == true)
502         //      dprint(ftos(desirabledamage),"\n");
503         if(PHYS_INPUT_BUTTON_ATCK2(actor)) PHYS_INPUT_BUTTON_ATCK(actor) = 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(actor, 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, actor);
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(actor, true))
527             sound(actor, CH_WEAPON_B, SND_MINE_DET, VOL_BASE, ATTN_NORM);
528     }
529 }
530 METHOD(MineLayer, wr_checkammo1, bool(entity thiswep, entity actor))
531 {
532     //int slot = 0; // TODO: unhardcode
533     // actually do // don't switch while placing a mine
534     //if(ATTACK_FINISHED(actor, slot) <= time || PS(actor).m_weapon != WEP_MINE_LAYER)
535     //{
536         float ammo_amount = actor.(thiswep.ammo_field) >= WEP_CVAR(minelayer, ammo);
537         ammo_amount += actor.(weapon_load[WEP_MINE_LAYER.m_id]) >= WEP_CVAR(minelayer, ammo);
538         return ammo_amount;
539     //}
540     //return true;
541 }
542 METHOD(MineLayer, wr_checkammo2, bool(entity thiswep, entity actor))
543 {
544     if(W_MineLayer_PlacedMines(actor, false))
545         return true;
546     else
547         return false;
548 }
549 METHOD(MineLayer, wr_resetplayer, void(entity thiswep, entity actor))
550 {
551     actor.minelayer_mines = 0;
552 }
553 METHOD(MineLayer, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
554 {
555     W_Reload(actor, WEP_CVAR(minelayer, ammo), SND_RELOAD);
556 }
557 METHOD(MineLayer, wr_suicidemessage, Notification(entity thiswep))
558 {
559     return WEAPON_MINELAYER_SUICIDE;
560 }
561 METHOD(MineLayer, wr_killmessage, Notification(entity thiswep))
562 {
563     return WEAPON_MINELAYER_MURDER;
564 }
565
566 #endif
567 #ifdef CSQC
568
569 METHOD(MineLayer, wr_impacteffect, void(entity thiswep, entity actor))
570 {
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(actor, CH_SHOTS, SND_MINE_EXP, VOL_BASE, ATTN_NORM);
576 }
577
578 #endif
579 #endif