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