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