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