]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/weapons/weapon/hagar.qc
7f6b01008788048d12302926fffdf8e04fc759c7
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / hagar.qc
1 #ifndef IMPLEMENTATION
2 REGISTER_WEAPON(
3 /* WEP_##id  */ HAGAR,
4 /* function  */ W_Hagar,
5 /* ammotype  */ ammo_rockets,
6 /* impulse   */ 8,
7 /* flags     */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH,
8 /* rating    */ BOT_PICKUP_RATING_MID,
9 /* color     */ '1 1 0.5',
10 /* modelname */ "hagar",
11 /* model     */ MDL_HAGAR_ITEM,
12 /* simplemdl */ "foobar",
13 /* crosshair */ "gfx/crosshairhagar 0.8",
14 /* wepimg    */ "weaponhagar",
15 /* refname   */ "hagar",
16 /* wepname   */ _("Hagar")
17 );
18
19 #define HAGAR_SETTINGS(w_cvar,w_prop) HAGAR_SETTINGS_LIST(w_cvar, w_prop, HAGAR, hagar)
20 #define HAGAR_SETTINGS_LIST(w_cvar,w_prop,id,sn) \
21         w_cvar(id, sn, BOTH, ammo) \
22         w_cvar(id, sn, BOTH, damage) \
23         w_cvar(id, sn, BOTH, edgedamage) \
24         w_cvar(id, sn, BOTH, force) \
25         w_cvar(id, sn, BOTH, radius) \
26         w_cvar(id, sn, BOTH, refire) \
27         w_cvar(id, sn, BOTH, speed) \
28         w_cvar(id, sn, BOTH, spread) \
29         w_cvar(id, sn, BOTH, damageforcescale) \
30         w_cvar(id, sn, BOTH, health) \
31         w_cvar(id, sn, PRI,  lifetime) \
32         w_cvar(id, sn, SEC,  load) \
33         w_cvar(id, sn, SEC,  load_max) \
34         w_cvar(id, sn, SEC,  load_abort) \
35         w_cvar(id, sn, SEC,  load_animtime) \
36         w_cvar(id, sn, SEC,  load_hold) \
37         w_cvar(id, sn, SEC,  load_speed) \
38         w_cvar(id, sn, SEC,  load_releasedeath) \
39         w_cvar(id, sn, SEC,  load_spread) \
40         w_cvar(id, sn, SEC,  load_spread_bias) \
41         w_cvar(id, sn, SEC,  load_linkexplode) \
42         w_cvar(id, sn, SEC,  lifetime_min) \
43         w_cvar(id, sn, SEC,  lifetime_rand) \
44         w_cvar(id, sn, NONE, secondary) \
45         w_prop(id, sn, float,  reloading_ammo, reload_ammo) \
46         w_prop(id, sn, float,  reloading_time, reload_time) \
47         w_prop(id, sn, float,  switchdelay_raise, switchdelay_raise) \
48         w_prop(id, sn, float,  switchdelay_drop, switchdelay_drop) \
49         w_prop(id, sn, string, weaponreplace, weaponreplace) \
50         w_prop(id, sn, float,  weaponstart, weaponstart) \
51         w_prop(id, sn, float,  weaponstartoverride, weaponstartoverride) \
52         w_prop(id, sn, float,  weaponthrowable, weaponthrowable)
53
54 #ifdef SVQC
55 HAGAR_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
56 #endif
57 #endif
58 #ifdef IMPLEMENTATION
59 #ifdef SVQC
60 void spawnfunc_weapon_hagar(void) { weapon_defaultspawnfunc(WEP_HAGAR.m_id); }
61
62 // NO bounce protection, as bounces are limited!
63
64 void W_Hagar_Explode(void)
65 {SELFPARAM();
66         self.event_damage = func_null;
67         RadiusDamage(self, self.realowner, WEP_CVAR_PRI(hagar, damage), WEP_CVAR_PRI(hagar, edgedamage), WEP_CVAR_PRI(hagar, radius), world, world, WEP_CVAR_PRI(hagar, force), self.projectiledeathtype, other);
68
69         remove(self);
70 }
71
72 void W_Hagar_Explode2(void)
73 {SELFPARAM();
74         self.event_damage = func_null;
75         RadiusDamage(self, self.realowner, WEP_CVAR_SEC(hagar, damage), WEP_CVAR_SEC(hagar, edgedamage), WEP_CVAR_SEC(hagar, radius), world, world, WEP_CVAR_SEC(hagar, force), self.projectiledeathtype, other);
76
77         remove(self);
78 }
79
80 void W_Hagar_Damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
81 {SELFPARAM();
82         if(self.health <= 0)
83                 return;
84
85         float is_linkexplode = ( ((inflictor.owner != world) ? (inflictor.owner == self.owner) : true)
86                 && (inflictor.projectiledeathtype & HITTYPE_SECONDARY)
87                 && (self.projectiledeathtype & HITTYPE_SECONDARY));
88
89         if(is_linkexplode)
90                 is_linkexplode = (is_linkexplode && WEP_CVAR_SEC(hagar, load_linkexplode));
91         else
92                 is_linkexplode = -1; // not secondary load, so continue as normal without exception.
93
94         if(!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, is_linkexplode))
95                 return; // g_projectiles_damage says to halt
96
97         self.health = self.health - damage;
98         self.angles = vectoangles(self.velocity);
99
100         if(self.health <= 0)
101                 W_PrepareExplosionByDamage(attacker, self.think);
102 }
103
104 void W_Hagar_Touch(void)
105 {SELFPARAM();
106         PROJECTILE_TOUCH;
107         self.use();
108 }
109
110 void W_Hagar_Touch2(void)
111 {SELFPARAM();
112         PROJECTILE_TOUCH;
113
114         if(self.cnt > 0 || other.takedamage == DAMAGE_AIM) {
115                 self.use();
116         } else {
117                 self.cnt++;
118                 Send_Effect(EFFECT_HAGAR_BOUNCE, self.origin, self.velocity, 1);
119                 self.angles = vectoangles(self.velocity);
120                 self.owner = world;
121                 self.projectiledeathtype |= HITTYPE_BOUNCE;
122         }
123 }
124
125 void W_Hagar_Attack(void)
126 {SELFPARAM();
127         entity missile;
128
129         W_DecreaseAmmo(WEP_CVAR_PRI(hagar, ammo));
130
131         W_SetupShot(self, false, 2, SND(HAGAR_FIRE), CH_WEAPON_A, WEP_CVAR_PRI(hagar, damage));
132
133         Send_Effect(EFFECT_HAGAR_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
134
135         missile = spawn();
136         missile.owner = missile.realowner = self;
137         missile.classname = "missile";
138         missile.bot_dodge = true;
139         missile.bot_dodgerating = WEP_CVAR_PRI(hagar, damage);
140
141         missile.takedamage = DAMAGE_YES;
142         missile.health = WEP_CVAR_PRI(hagar, health);
143         missile.damageforcescale = WEP_CVAR_PRI(hagar, damageforcescale);
144         missile.event_damage = W_Hagar_Damage;
145         missile.damagedbycontents = true;
146
147         missile.touch = W_Hagar_Touch;
148         missile.use = W_Hagar_Explode;
149         missile.think = adaptor_think2use_hittype_splash;
150         missile.nextthink = time + WEP_CVAR_PRI(hagar, lifetime);
151         PROJECTILE_MAKETRIGGER(missile);
152         missile.projectiledeathtype = WEP_HAGAR.m_id;
153         setorigin(missile, w_shotorg);
154         setsize(missile, '0 0 0', '0 0 0');
155
156         missile.movetype = MOVETYPE_FLY;
157         W_SetupProjVelocity_PRI(missile, hagar);
158
159         missile.angles = vectoangles(missile.velocity);
160         missile.flags = FL_PROJECTILE;
161         missile.missile_flags = MIF_SPLASH;
162
163         CSQCProjectile(missile, true, PROJECTILE_HAGAR, true);
164
165         MUTATOR_CALLHOOK(EditProjectile, self, missile);
166 }
167
168 void W_Hagar_Attack2(void)
169 {SELFPARAM();
170         entity missile;
171
172         W_DecreaseAmmo(WEP_CVAR_SEC(hagar, ammo));
173
174         W_SetupShot(self, false, 2, SND(HAGAR_FIRE), CH_WEAPON_A, WEP_CVAR_SEC(hagar, damage));
175
176         Send_Effect(EFFECT_HAGAR_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
177
178         missile = spawn();
179         missile.owner = missile.realowner = self;
180         missile.classname = "missile";
181         missile.bot_dodge = true;
182         missile.bot_dodgerating = WEP_CVAR_SEC(hagar, damage);
183
184         missile.takedamage = DAMAGE_YES;
185         missile.health = WEP_CVAR_SEC(hagar, health);
186         missile.damageforcescale = WEP_CVAR_SEC(hagar, damageforcescale);
187         missile.event_damage = W_Hagar_Damage;
188         missile.damagedbycontents = true;
189
190         missile.touch = W_Hagar_Touch2;
191         missile.cnt = 0;
192         missile.use = W_Hagar_Explode2;
193         missile.think = adaptor_think2use_hittype_splash;
194         missile.nextthink = time + WEP_CVAR_SEC(hagar, lifetime_min) + random() * WEP_CVAR_SEC(hagar, lifetime_rand);
195         PROJECTILE_MAKETRIGGER(missile);
196         missile.projectiledeathtype = WEP_HAGAR.m_id | HITTYPE_SECONDARY;
197         setorigin(missile, w_shotorg);
198         setsize(missile, '0 0 0', '0 0 0');
199
200         missile.movetype = MOVETYPE_BOUNCEMISSILE;
201         W_SetupProjVelocity_SEC(missile, hagar);
202
203         missile.angles = vectoangles(missile.velocity);
204         missile.flags = FL_PROJECTILE;
205         missile.missile_flags = MIF_SPLASH;
206
207         CSQCProjectile(missile, true, PROJECTILE_HAGAR_BOUNCING, true);
208
209         MUTATOR_CALLHOOK(EditProjectile, self, missile);
210 }
211
212 .float hagar_loadstep, hagar_loadblock, hagar_loadbeep, hagar_warning;
213 void W_Hagar_Attack2_Load_Release(void)
214 {SELFPARAM();
215         // time to release the rockets we've loaded
216
217         entity missile;
218         float counter, shots, spread_pershot;
219         vector s;
220         vector forward, right, up;
221
222         if(!self.hagar_load)
223                 return;
224
225         weapon_prepareattack_do(1, WEP_CVAR_SEC(hagar, refire));
226
227         W_SetupShot(self, false, 2, SND(HAGAR_FIRE), CH_WEAPON_A, WEP_CVAR_SEC(hagar, damage));
228         Send_Effect(EFFECT_HAGAR_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
229
230         forward = v_forward;
231         right = v_right;
232         up = v_up;
233
234         shots = self.hagar_load;
235         missile = world;
236         for(counter = 0; counter < shots; ++counter)
237         {
238                 missile = spawn();
239                 missile.owner = missile.realowner = self;
240                 missile.classname = "missile";
241                 missile.bot_dodge = true;
242                 missile.bot_dodgerating = WEP_CVAR_SEC(hagar, damage);
243
244                 missile.takedamage = DAMAGE_YES;
245                 missile.health = WEP_CVAR_SEC(hagar, health);
246                 missile.damageforcescale = WEP_CVAR_SEC(hagar, damageforcescale);
247                 missile.event_damage = W_Hagar_Damage;
248                 missile.damagedbycontents = true;
249
250                 missile.touch = W_Hagar_Touch; // not bouncy
251                 missile.use = W_Hagar_Explode2;
252                 missile.think = adaptor_think2use_hittype_splash;
253                 missile.nextthink = time + WEP_CVAR_SEC(hagar, lifetime_min) + random() * WEP_CVAR_SEC(hagar, lifetime_rand);
254                 PROJECTILE_MAKETRIGGER(missile);
255                 missile.projectiledeathtype = WEP_HAGAR.m_id | HITTYPE_SECONDARY;
256                 setorigin(missile, w_shotorg);
257                 setsize(missile, '0 0 0', '0 0 0');
258                 missile.movetype = MOVETYPE_FLY;
259                 missile.missile_flags = MIF_SPLASH;
260
261                 // per-shot spread calculation: the more shots there are, the less spread is applied (based on the bias cvar)
262                 spread_pershot = ((shots - 1) / (WEP_CVAR_SEC(hagar, load_max) - 1));
263                 spread_pershot = (1 - (spread_pershot * WEP_CVAR_SEC(hagar, load_spread_bias)));
264                 spread_pershot = (WEP_CVAR_SEC(hagar, spread) * spread_pershot * g_weaponspreadfactor);
265
266                 // pattern spread calculation
267                 s = '0 0 0';
268                 if(counter == 0)
269                         s = '0 0 0';
270                 else
271                 {
272                         makevectors('0 360 0' * (0.75 + (counter - 0.5) / (shots - 1)));
273                         s.y = v_forward.x;
274                         s.z = v_forward.y;
275                 }
276                 s = s * WEP_CVAR_SEC(hagar, load_spread) * g_weaponspreadfactor;
277
278                 W_SetupProjVelocity_Explicit(missile, w_shotdir + right * s.y + up * s.z, v_up, WEP_CVAR_SEC(hagar, speed), 0, 0, spread_pershot, false);
279
280                 missile.angles = vectoangles(missile.velocity);
281                 missile.flags = FL_PROJECTILE;
282
283                 CSQCProjectile(missile, true, PROJECTILE_HAGAR, true);
284
285                 MUTATOR_CALLHOOK(EditProjectile, self, missile);
286         }
287
288         weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(hagar, load_animtime), w_ready);
289         self.hagar_loadstep = time + WEP_CVAR_SEC(hagar, refire) * W_WeaponRateFactor();
290         self.hagar_load = 0;
291 }
292
293 void W_Hagar_Attack2_Load(void)
294 {SELFPARAM();
295         // loadable hagar secondary attack, must always run each frame
296
297         if(time < game_starttime)
298                 return;
299
300         bool loaded = self.hagar_load >= WEP_CVAR_SEC(hagar, load_max);
301
302         // this is different than WR_CHECKAMMO when it comes to reloading
303         bool enough_ammo;
304         if(self.items & IT_UNLIMITED_WEAPON_AMMO)
305                 enough_ammo = true;
306         else if(autocvar_g_balance_hagar_reload_ammo)
307                 enough_ammo = self.(weapon_load[WEP_HAGAR.m_id]) >= WEP_CVAR_SEC(hagar, ammo);
308         else
309                 enough_ammo = self.WEP_AMMO(HAGAR) >= WEP_CVAR_SEC(hagar, ammo);
310
311         bool stopped = loaded || !enough_ammo;
312
313         if(self.BUTTON_ATCK2)
314         {
315                 if(self.BUTTON_ATCK && WEP_CVAR_SEC(hagar, load_abort))
316                 {
317                         if(self.hagar_load)
318                         {
319                                 // if we pressed primary fire while loading, unload all rockets and abort
320                                 self.weaponentity.state = WS_READY;
321                                 W_DecreaseAmmo(WEP_CVAR_SEC(hagar, ammo) * self.hagar_load * -1); // give back ammo
322                                 self.hagar_load = 0;
323                                 sound(self, CH_WEAPON_A, SND_HAGAR_BEEP, VOL_BASE, ATTN_NORM);
324
325                                 // pause until we can load rockets again, once we re-press the alt fire button
326                                 self.hagar_loadstep = time + WEP_CVAR_SEC(hagar, load_speed) * W_WeaponRateFactor();
327
328                                 // require letting go of the alt fire button before we can load again
329                                 self.hagar_loadblock = true;
330                         }
331                 }
332                 else
333                 {
334                         // check if we can attempt to load another rocket
335                         if(!stopped)
336                         {
337                                 if(!self.hagar_loadblock && self.hagar_loadstep < time)
338                                 {
339                                         W_DecreaseAmmo(WEP_CVAR_SEC(hagar, ammo));
340                                         self.weaponentity.state = WS_INUSE;
341                                         self.hagar_load += 1;
342                                         sound(self, CH_WEAPON_B, SND_HAGAR_LOAD, VOL_BASE * 0.8, ATTN_NORM); // sound is too loud according to most
343
344                                         if(self.hagar_load >= WEP_CVAR_SEC(hagar, load_max))
345                                                 stopped = true;
346                                         else
347                                                 self.hagar_loadstep = time + WEP_CVAR_SEC(hagar, load_speed) * W_WeaponRateFactor();
348                                 }
349                         }
350                         if(stopped && !self.hagar_loadbeep && self.hagar_load) // prevents the beep from playing each frame
351                         {
352                                 // if this is the last rocket we can load, play a beep sound to notify the player
353                                 sound(self, CH_WEAPON_A, SND_HAGAR_BEEP, VOL_BASE, ATTN_NORM);
354                                 self.hagar_loadbeep = true;
355                                 self.hagar_loadstep = time + WEP_CVAR_SEC(hagar, load_hold) * W_WeaponRateFactor();
356                         }
357                 }
358         }
359         else if(self.hagar_loadblock)
360         {
361                 // the alt fire button has been released, so re-enable loading if blocked
362                 self.hagar_loadblock = false;
363         }
364
365         if(self.hagar_load)
366         {
367                 // play warning sound if we're about to release
368                 if(stopped && self.hagar_loadstep - 0.5 < time && WEP_CVAR_SEC(hagar, load_hold) >= 0)
369                 {
370                         if(!self.hagar_warning) // prevents the beep from playing each frame
371                         {
372                                 // we're about to automatically release after holding time, play a beep sound to notify the player
373                                 sound(self, CH_WEAPON_A, SND_HAGAR_BEEP, VOL_BASE, ATTN_NORM);
374                                 self.hagar_warning = true;
375                         }
376                 }
377
378                 // release if player let go of button or if they've held it in too long
379                 if(!self.BUTTON_ATCK2 || (stopped && self.hagar_loadstep < time && WEP_CVAR_SEC(hagar, load_hold) >= 0))
380                 {
381                         self.weaponentity.state = WS_READY;
382                         W_Hagar_Attack2_Load_Release();
383                 }
384         }
385         else
386         {
387                 self.hagar_loadbeep = false;
388                 self.hagar_warning = false;
389
390                 // we aren't checking ammo during an attack, so we must do it here
391                 if(!(_WEP_ACTION(self.weapon, WR_CHECKAMMO1) + _WEP_ACTION(self.weapon, WR_CHECKAMMO2)))
392                 if(!(self.items & IT_UNLIMITED_WEAPON_AMMO))
393                 {
394                         // note: this doesn't force the switch
395                         W_SwitchToOtherWeapon(self);
396                         return;
397                 }
398         }
399 }
400
401 bool W_Hagar(entity thiswep, int req)
402 {SELFPARAM();
403         float ammo_amount;
404         switch(req)
405         {
406                 case WR_AIM:
407                 {
408                         if(random()>0.15)
409                                 self.BUTTON_ATCK = bot_aim(WEP_CVAR_PRI(hagar, speed), 0, WEP_CVAR_PRI(hagar, lifetime), false);
410                         else // not using secondary_speed since these are only 15% and should cause some ricochets without re-aiming
411                                 self.BUTTON_ATCK2 = bot_aim(WEP_CVAR_PRI(hagar, speed), 0, WEP_CVAR_PRI(hagar, lifetime), false);
412
413                         return true;
414                 }
415                 case WR_THINK:
416                 {
417                         float loadable_secondary;
418                         loadable_secondary = (WEP_CVAR_SEC(hagar, load) && WEP_CVAR(hagar, secondary));
419
420                         if(loadable_secondary)
421                                 W_Hagar_Attack2_Load(); // must always run each frame
422                         if(autocvar_g_balance_hagar_reload_ammo && self.clip_load < min(WEP_CVAR_PRI(hagar, ammo), WEP_CVAR_SEC(hagar, ammo))) // forced reload
423                                 _WEP_ACTION(self.weapon, WR_RELOAD);
424                         else if(self.BUTTON_ATCK && !self.hagar_load && !self.hagar_loadblock) // not while secondary is loaded or awaiting reset
425                         {
426                                 if(weapon_prepareattack(0, WEP_CVAR_PRI(hagar, refire)))
427                                 {
428                                         W_Hagar_Attack();
429                                         weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(hagar, refire), w_ready);
430                                 }
431                         }
432                         else if(self.BUTTON_ATCK2 && !loadable_secondary && WEP_CVAR(hagar, secondary))
433                         {
434                                 if(weapon_prepareattack(1, WEP_CVAR_SEC(hagar, refire)))
435                                 {
436                                         W_Hagar_Attack2();
437                                         weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(hagar, refire), w_ready);
438                                 }
439                         }
440                         return true;
441                 }
442                 case WR_GONETHINK:
443                 {
444                         // we lost the weapon and want to prepare switching away
445                         if(self.hagar_load)
446                         {
447                                 self.weaponentity.state = WS_READY;
448                                 W_Hagar_Attack2_Load_Release();
449                         }
450
451                         return true;
452                 }
453                 case WR_INIT:
454                 {
455                         HAGAR_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
456                         return true;
457                 }
458                 case WR_SETUP:
459                 {
460                         self.hagar_loadblock = false;
461
462                         if(self.hagar_load)
463                         {
464                                 W_DecreaseAmmo(WEP_CVAR_SEC(hagar, ammo) * self.hagar_load * -1); // give back ammo if necessary
465                                 self.hagar_load = 0;
466                         }
467
468                         return true;
469                 }
470                 case WR_CHECKAMMO1:
471                 {
472                         ammo_amount = self.WEP_AMMO(HAGAR) >= WEP_CVAR_PRI(hagar, ammo);
473                         ammo_amount += self.(weapon_load[WEP_HAGAR.m_id]) >= WEP_CVAR_PRI(hagar, ammo);
474                         return ammo_amount;
475                 }
476                 case WR_CHECKAMMO2:
477                 {
478                         ammo_amount = self.WEP_AMMO(HAGAR) >= WEP_CVAR_SEC(hagar, ammo);
479                         ammo_amount += self.(weapon_load[WEP_HAGAR.m_id]) >= WEP_CVAR_SEC(hagar, ammo);
480                         return ammo_amount;
481                 }
482                 case WR_CONFIG:
483                 {
484                         HAGAR_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS);
485                         return true;
486                 }
487                 case WR_RESETPLAYER:
488                 {
489                         self.hagar_load = 0;
490                         return true;
491                 }
492                 case WR_PLAYERDEATH:
493                 {
494                         // if we have any rockets loaded when we die, release them
495                         if(self.hagar_load && WEP_CVAR_SEC(hagar, load_releasedeath))
496                                 W_Hagar_Attack2_Load_Release();
497
498                         return true;
499                 }
500                 case WR_RELOAD:
501                 {
502                         if(!self.hagar_load) // require releasing loaded rockets first
503                                 W_Reload(min(WEP_CVAR_PRI(hagar, ammo), WEP_CVAR_SEC(hagar, ammo)), SND(RELOAD));
504
505                         return true;
506                 }
507                 case WR_SUICIDEMESSAGE:
508                 {
509                         return WEAPON_HAGAR_SUICIDE;
510                 }
511                 case WR_KILLMESSAGE:
512                 {
513                         if(w_deathtype & HITTYPE_SECONDARY)
514                                 return WEAPON_HAGAR_MURDER_BURST;
515                         else
516                                 return WEAPON_HAGAR_MURDER_SPRAY;
517                 }
518         }
519         return false;
520 }
521 #endif
522 #ifdef CSQC
523 bool W_Hagar(entity thiswep, int req)
524 {SELFPARAM();
525         switch(req)
526         {
527                 case WR_IMPACTEFFECT:
528                 {
529                         vector org2;
530                         org2 = w_org + w_backoff * 6;
531                         pointparticles(particleeffectnum(EFFECT_HAGAR_EXPLODE), org2, '0 0 0', 1);
532                         if(!w_issilent)
533                         {
534                                 if(w_random<0.15)
535                                         sound(self, CH_SHOTS, SND_HAGEXP1, VOL_BASE, ATTN_NORM);
536                                 else if(w_random<0.7)
537                                         sound(self, CH_SHOTS, SND_HAGEXP2, VOL_BASE, ATTN_NORM);
538                                 else
539                                         sound(self, CH_SHOTS, SND_HAGEXP3, VOL_BASE, ATTN_NORM);
540                         }
541
542                         return true;
543                 }
544                 case WR_INIT:
545                 {
546                         return true;
547                 }
548                 case WR_ZOOMRETICLE:
549                 {
550                         // no weapon specific image for this weapon
551                         return false;
552                 }
553         }
554         return false;
555 }
556 #endif
557 #endif