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