3 /* WEP_##id */ SHOCKWAVE,
4 /* function */ W_Shockwave,
5 /* ammotype */ ammo_none,
7 /* flags */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN,
8 /* rating */ BOT_PICKUP_RATING_LOW,
10 /* netname */ "shockwave",
11 /* fullname */ _("Shockwave")
14 #define SHOCKWAVE_SETTINGS(w_cvar,w_prop) SHOCKWAVE_SETTINGS_LIST(w_cvar, w_prop, SHOCKWAVE, shockwave)
15 #define SHOCKWAVE_SETTINGS_LIST(w_cvar,w_prop,id,sn) \
16 w_cvar(id, sn, MO_NONE, blast_damage) \
17 w_cvar(id, sn, MO_NONE, blast_distance) \
18 w_cvar(id, sn, MO_NONE, blast_edgedamage) \
19 w_cvar(id, sn, MO_NONE, blast_force) \
20 w_cvar(id, sn, MO_NONE, blast_force_forwardbias) \
21 w_cvar(id, sn, MO_NONE, blast_force_zscale) \
22 w_cvar(id, sn, MO_NONE, blast_jump_damage) \
23 w_cvar(id, sn, MO_NONE, blast_jump_edgedamage) \
24 w_cvar(id, sn, MO_NONE, blast_jump_force) \
25 w_cvar(id, sn, MO_NONE, blast_jump_force_velocitybias) \
26 w_cvar(id, sn, MO_NONE, blast_jump_force_zscale) \
27 w_cvar(id, sn, MO_NONE, blast_jump_multiplier_accuracy) \
28 w_cvar(id, sn, MO_NONE, blast_jump_multiplier_distance) \
29 w_cvar(id, sn, MO_NONE, blast_jump_multiplier_min) \
30 w_cvar(id, sn, MO_NONE, blast_jump_radius) \
31 w_cvar(id, sn, MO_NONE, blast_multiplier_accuracy) \
32 w_cvar(id, sn, MO_NONE, blast_multiplier_distance) \
33 w_cvar(id, sn, MO_NONE, blast_multiplier_min) \
34 w_cvar(id, sn, MO_NONE, blast_splash_damage) \
35 w_cvar(id, sn, MO_NONE, blast_splash_edgedamage) \
36 w_cvar(id, sn, MO_NONE, blast_splash_force) \
37 w_cvar(id, sn, MO_NONE, blast_splash_force_forwardbias) \
38 w_cvar(id, sn, MO_NONE, blast_splash_multiplier_accuracy) \
39 w_cvar(id, sn, MO_NONE, blast_splash_multiplier_distance) \
40 w_cvar(id, sn, MO_NONE, blast_splash_multiplier_min) \
41 w_cvar(id, sn, MO_NONE, blast_splash_radius) \
42 w_cvar(id, sn, MO_NONE, blast_spread_max) \
43 w_cvar(id, sn, MO_NONE, blast_spread_min) \
44 w_cvar(id, sn, MO_NONE, melee_animtime) \
45 w_cvar(id, sn, MO_NONE, melee_damage) \
46 w_cvar(id, sn, MO_NONE, melee_delay) \
47 w_cvar(id, sn, MO_NONE, melee_force) \
48 w_cvar(id, sn, MO_NONE, melee_multihit) \
49 w_cvar(id, sn, MO_NONE, melee_no_doubleslap) \
50 w_cvar(id, sn, MO_NONE, melee_nonplayerdamage) \
51 w_cvar(id, sn, MO_NONE, melee_range) \
52 w_cvar(id, sn, MO_NONE, melee_refire) \
53 w_cvar(id, sn, MO_NONE, melee_swing_side) \
54 w_cvar(id, sn, MO_NONE, melee_swing_up) \
55 w_cvar(id, sn, MO_NONE, melee_time) \
56 w_cvar(id, sn, MO_NONE, melee_traces) \
57 w_cvar(id, sn, MO_NONE, pellets_animtime) \
58 w_cvar(id, sn, MO_NONE, pellets_bulletconstant) \
59 w_cvar(id, sn, MO_NONE, pellets_bullets) \
60 w_cvar(id, sn, MO_NONE, pellets_damage) \
61 w_cvar(id, sn, MO_NONE, pellets_force) \
62 w_cvar(id, sn, MO_NONE, pellets_refire) \
63 w_cvar(id, sn, MO_NONE, pellets_speed) \
64 w_cvar(id, sn, MO_NONE, pellets_spread) \
65 w_cvar(id, sn, MO_NONE, primary) \
66 w_cvar(id, sn, MO_NONE, secondary) \
67 w_prop(id, sn, float, reloading_ammo, reload_ammo) \
68 w_prop(id, sn, float, reloading_time, reload_time) \
69 w_prop(id, sn, float, switchdelay_raise, switchdelay_raise) \
70 w_prop(id, sn, float, switchdelay_drop, switchdelay_drop) \
71 w_prop(id, sn, string, weaponreplace, weaponreplace) \
72 w_prop(id, sn, float, weaponstart, weaponstart) \
73 w_prop(id, sn, float, weaponstartoverride, weaponstartoverride)
76 SHOCKWAVE_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
80 void spawnfunc_weapon_shockwave()
82 //if(autocvar_sv_q3acompat_machineshockwaveswap) // WEAPONTODO
83 if(autocvar_sv_q3acompat_machineshotgunswap)
84 if(self.classname != "droppedweapon")
86 weapon_defaultspawnfunc(WEP_UZI);
89 weapon_defaultspawnfunc(WEP_SHOCKWAVE);
93 .entity swing_alreadyhit;
94 .float shockwave_pelletstime;
95 entity shockwave_hit[32];
96 float shockwave_hit_damage[32];
97 vector shockwave_hit_force[32];
99 // LEGACY ATTACK MODE: Scattered bullets
100 void W_Shockwave_Pellets(void)
105 //W_DecreaseAmmo(ammo_shells, WEP_CVAR(shockwave, pellets_ammo), WEP_CVAR(shockwave, reload_ammo));
107 W_SetupShot(self, TRUE, 5, "weapons/shotgun_fire.wav", CH_WEAPON_A, WEP_CVAR(shockwave, pellets_damage) * WEP_CVAR(shockwave, pellets_bullets));
109 for(sc = 0; sc < WEP_CVAR(shockwave, pellets_bullets); ++sc)
114 WEP_CVAR(shockwave, pellets_spread),
115 WEP_CVAR(shockwave, pellets_speed),
117 WEP_CVAR(shockwave, pellets_damage),
118 WEP_CVAR(shockwave, pellets_force),
121 WEP_CVAR(shockwave, pellets_bulletconstant)
124 endFireBallisticBullet();
126 pointparticles(particleeffectnum("shotgun_muzzleflash"), w_shotorg, w_shotdir * 1000, 5); // WEAPONTODO: why 5? this was pellets_ammo before
129 if(autocvar_g_casings >= 1)
131 for(sc = 0;sc < 5; ++sc)
135 ((random () * 50 + 50) * v_right)
137 (v_forward * (random () * 25 + 25))
139 ((random () * 5 - 30) * v_up)
142 vectoangles(v_forward),
151 // muzzle flash for 1st person view
153 setmodel(flash, "models/uziflash.md3"); // precision set below
154 flash.think = SUB_Remove;
155 flash.nextthink = time + 0.06;
156 flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
157 W_AttachToShotorg(flash, '5 0 0');
161 void W_Shockwave_Melee_Think()
164 float i, f, swing, swing_factor, swing_damage, meleetime, is_player;
165 entity target_victim;
168 // check to see if we can still continue, otherwise give up now
169 if((self.realowner.deadflag != DEAD_NO) && WEP_CVAR(shockwave, melee_no_doubleslap))
175 // set start time of melee
179 W_PlayStrengthSound(self.realowner);
182 // update values for v_* vectors
183 makevectors(self.realowner.v_angle);
185 // calculate swing percentage based on time
186 meleetime = WEP_CVAR(shockwave, melee_time) * W_WeaponRateFactor();
187 swing = bound(0, (self.cnt + meleetime - time) / meleetime, 10);
188 f = ((1 - swing) * WEP_CVAR(shockwave, melee_traces));
190 // perform the traces needed for this frame
191 for(i=self.swing_prev; i < f; ++i)
193 swing_factor = ((1 - (i / WEP_CVAR(shockwave, melee_traces))) * 2 - 1);
195 targpos = (self.realowner.origin + self.realowner.view_ofs
196 + (v_forward * WEP_CVAR(shockwave, melee_range))
197 + (v_up * swing_factor * WEP_CVAR(shockwave, melee_swing_up))
198 + (v_right * swing_factor * WEP_CVAR(shockwave, melee_swing_side)));
200 WarpZone_traceline_antilag(
202 (self.realowner.origin + self.realowner.view_ofs),
206 ANTILAG_LATENCY(self.realowner)
209 // draw lightning beams for debugging
210 te_lightning2(world, targpos, self.realowner.origin + self.realowner.view_ofs + v_forward * 5 - v_up * 5);
211 te_customflash(targpos, 40, 2, '1 1 1');
213 is_player = (trace_ent.classname == "player" || trace_ent.classname == "body");
215 if((trace_fraction < 1) // if trace is good, apply the damage and remove self if necessary
216 && (trace_ent.takedamage == DAMAGE_AIM)
217 && (trace_ent != self.swing_alreadyhit)
218 && (is_player || WEP_CVAR(shockwave, melee_nonplayerdamage)))
220 target_victim = trace_ent; // so it persists through other calls
222 if(is_player) // this allows us to be able to nerf the non-player damage done in e.g. assault or onslaught
223 swing_damage = (WEP_CVAR(shockwave, melee_damage) * min(1, swing_factor + 1));
225 swing_damage = (WEP_CVAR(shockwave, melee_nonplayerdamage) * min(1, swing_factor + 1));
227 // trigger damage with this calculated info
233 (WEP_SHOCKWAVE | HITTYPE_SECONDARY),
234 (self.realowner.origin + self.realowner.view_ofs),
235 (v_forward * WEP_CVAR(shockwave, melee_force))
239 if(accuracy_isgooddamage(self.realowner, target_victim))
240 { accuracy_add(self.realowner, WEP_SHOCKWAVE, 0, swing_damage); }
242 #ifdef DEBUG_SHOCKWAVE
244 "MELEE: %s hitting %s with %f damage (factor: %f) at %f time.\n",
245 self.realowner.netname,
246 target_victim.netname,
253 // allow multiple hits with one swing, but not against the same player twice
254 if(WEP_CVAR(shockwave, melee_multihit))
256 self.swing_alreadyhit = target_victim;
257 continue; // move along to next trace
267 if(time >= self.cnt + meleetime)
277 self.nextthink = time;
281 void W_Shockwave_Melee()
283 sound(self, CH_WEAPON_A, "weapons/shotgun_melee.wav", VOL_BASE, ATTN_NORM);
284 weapon_thinkf(WFRAME_FIRE2, WEP_CVAR(shockwave, melee_animtime), w_ready);
288 meleetemp.owner = meleetemp.realowner = self;
289 meleetemp.think = W_Shockwave_Melee_Think;
290 meleetemp.nextthink = time + WEP_CVAR(shockwave, melee_delay) * W_WeaponRateFactor();
291 W_SetupShot_Range(self, TRUE, 0, "", 0, WEP_CVAR(shockwave, melee_damage), WEP_CVAR(shockwave, melee_range));
294 // SHOCKWAVE ATTACK MODE
295 float W_Shockwave_Attack_CheckSpread(
297 vector nearest_on_line,
299 vector attack_endpos)
302 float distance_of_attack = vlen(sw_shotorg - attack_endpos);
303 float distance_from_line = vlen(targetorg - nearest_on_line);
305 spreadlimit = (distance_of_attack ? min(1, (vlen(sw_shotorg - nearest_on_line) / distance_of_attack)) : 1);
308 (WEP_CVAR(shockwave, blast_spread_min) * (1 - spreadlimit))
310 (WEP_CVAR(shockwave, blast_spread_max) * spreadlimit)
314 (spreadlimit && (distance_from_line <= spreadlimit))
316 ((vlen(normalize(targetorg - sw_shotorg) - normalize(attack_endpos - sw_shotorg)) * RAD2DEG) <= 90)
318 { return bound(0, (distance_from_line / spreadlimit), 1); }
323 float W_Shockwave_Attack_IsVisible(
325 vector nearest_on_line,
327 vector attack_endpos)
329 vector nearest_to_attacker = head.WarpZone_findradius_nearest;
330 vector center = (head.origin + (head.mins + head.maxs) * 0.5);
334 // STEP ONE: Check if the nearest point is clear
335 if(W_Shockwave_Attack_CheckSpread(nearest_to_attacker, nearest_on_line, sw_shotorg, attack_endpos))
337 WarpZone_TraceLine(sw_shotorg, nearest_to_attacker, MOVE_NOMONSTERS, self);
338 if(trace_fraction == 1) { return TRUE; } // yes, the nearest point is clear and we can allow the damage
341 // STEP TWO: Check if shotorg to center point is clear
342 if(W_Shockwave_Attack_CheckSpread(center, nearest_on_line, sw_shotorg, attack_endpos))
344 WarpZone_TraceLine(sw_shotorg, center, MOVE_NOMONSTERS, self);
345 if(trace_fraction == 1) { return TRUE; } // yes, the center point is clear and we can allow the damage
348 // STEP THREE: Check each corner to see if they are clear
351 corner = get_corner_position(head, i);
352 if(W_Shockwave_Attack_CheckSpread(corner, nearest_on_line, sw_shotorg, attack_endpos))
354 WarpZone_TraceLine(sw_shotorg, corner, MOVE_NOMONSTERS, self);
355 if(trace_fraction == 1) { return TRUE; } // yes, this corner is clear and we can allow the damage
362 float W_Shockwave_Attack_CheckHit(
368 if(!head) { return FALSE; }
373 for(i = 1; i <= queue; ++i)
375 if(shockwave_hit[i] == head)
377 if(vlen(final_force) > vlen(shockwave_hit_force[i])) { shockwave_hit_force[i] = final_force; }
378 if(final_damage > shockwave_hit_damage[i]) { shockwave_hit_damage[i] = final_damage; }
383 shockwave_hit[queue] = head;
384 shockwave_hit_force[queue] = final_force;
385 shockwave_hit_damage[queue] = final_damage;
389 void W_Shockwave_Attack()
392 float multiplier, multiplier_from_accuracy, multiplier_from_distance;
394 vector final_force, center, vel;
399 // set up the shot direction
400 W_SetupShot(self, FALSE, 3, "weapons/lasergun_fire.wav", CH_WEAPON_B, WEP_CVAR(shockwave, blast_damage));
401 vector attack_endpos = (w_shotorg + (w_shotdir * WEP_CVAR(shockwave, blast_distance)));
402 WarpZone_TraceLine(w_shotorg, attack_endpos, MOVE_NOMONSTERS, self);
403 vector attack_hitpos = trace_endpos;
404 float distance_to_end = vlen(w_shotorg - attack_endpos);
405 float distance_to_hit = vlen(w_shotorg - attack_hitpos);
406 //entity transform = WarpZone_trace_transform;
408 // do the firing effect now
409 //SendCSQCShockwaveParticle(attack_endpos); // WEAPONTODO
412 WEP_CVAR(shockwave, blast_splash_damage),
413 WEP_CVAR(shockwave, blast_splash_edgedamage),
414 WEP_CVAR(shockwave, blast_splash_radius),
415 w_shotdir * WEP_CVAR(shockwave, blast_splash_force),
421 // splash damage/jumping trace
422 head = WarpZone_FindRadius(
425 WEP_CVAR(shockwave, blast_splash_radius),
426 WEP_CVAR(shockwave, blast_jump_radius)
435 float distance_to_head = vlen(attack_hitpos - head.WarpZone_findradius_nearest);
437 if((head == self) && (distance_to_head <= WEP_CVAR(shockwave, blast_jump_radius)))
439 // ========================
440 // BLAST JUMP CALCULATION
441 // ========================
443 // calculate importance of distance and accuracy for this attack
444 multiplier_from_accuracy = (1 -
446 min(1, (distance_to_head / WEP_CVAR(shockwave, blast_jump_radius)))
451 multiplier_from_distance = (1 -
453 min(1, (distance_to_hit / distance_to_end))
460 WEP_CVAR(shockwave, blast_jump_multiplier_min),
462 (multiplier_from_accuracy * WEP_CVAR(shockwave, blast_jump_multiplier_accuracy))
464 (multiplier_from_distance * WEP_CVAR(shockwave, blast_jump_multiplier_distance))
468 // calculate damage from multiplier: 1 = "highest" damage, 0 = "lowest" edgedamage
471 (WEP_CVAR(shockwave, blast_jump_damage) * multiplier)
473 (WEP_CVAR(shockwave, blast_jump_edgedamage) * (1 - multiplier))
476 // figure out the direction of force
477 vel = normalize(combine_to_vector(head.velocity_x, head.velocity_y, 0));
480 bound(0, (vlen(vel) / autocvar_sv_maxspeed), 1)
482 WEP_CVAR(shockwave, blast_jump_force_velocitybias)
484 final_force = normalize((CENTER_OR_VIEWOFS(head) - attack_hitpos) + vel);
486 // now multiply the direction by force units
487 final_force *= (WEP_CVAR(shockwave, blast_jump_force) * multiplier);
488 final_force_z *= WEP_CVAR(shockwave, blast_jump_force_zscale);
490 // trigger damage with this calculated info
501 #ifdef DEBUG_SHOCKWAVE
503 "SELF HIT: multiplier = %f, damage = %f, force = %f... "
504 "multiplier_from_accuracy = %f, multiplier_from_distance = %f.\n",
508 multiplier_from_accuracy,
509 multiplier_from_distance
513 else if(distance_to_head <= WEP_CVAR(shockwave, blast_splash_radius))
515 // ==========================
516 // BLAST SPLASH CALCULATION
517 // ==========================
519 // calculate importance of distance and accuracy for this attack
520 multiplier_from_accuracy = (1 -
522 min(1, (distance_to_head / WEP_CVAR(shockwave, blast_splash_radius)))
527 multiplier_from_distance = (1 -
529 min(1, (distance_to_hit / distance_to_end))
536 WEP_CVAR(shockwave, blast_splash_multiplier_min),
538 (multiplier_from_accuracy * WEP_CVAR(shockwave, blast_splash_multiplier_accuracy))
540 (multiplier_from_distance * WEP_CVAR(shockwave, blast_splash_multiplier_distance))
544 // calculate damage from multiplier: 1 = "highest" damage, 0 = "lowest" edgedamage
547 (WEP_CVAR(shockwave, blast_splash_damage) * multiplier)
549 (WEP_CVAR(shockwave, blast_splash_edgedamage) * (1 - multiplier))
552 // figure out the direction of force
553 final_force = (w_shotdir * WEP_CVAR(shockwave, blast_splash_force_forwardbias));
554 final_force = normalize(CENTER_OR_VIEWOFS(head) - (attack_hitpos - final_force));
555 //te_lightning2(world, attack_hitpos, (attack_hitpos + (final_force * 200)));
557 // now multiply the direction by force units
558 final_force *= (WEP_CVAR(shockwave, blast_splash_force) * multiplier);
559 final_force_z *= WEP_CVAR(shockwave, blast_force_zscale);
561 // queue damage with this calculated info
562 if(W_Shockwave_Attack_CheckHit(queue, head, final_force, final_damage)) { ++queue; }
564 #ifdef DEBUG_SHOCKWAVE
566 "SPLASH HIT: multiplier = %f, damage = %f, force = %f... "
567 "multiplier_from_accuracy = %f, multiplier_from_distance = %f.\n",
571 multiplier_from_accuracy,
572 multiplier_from_distance
581 head = WarpZone_FindRadius(w_shotorg, WEP_CVAR(shockwave, blast_distance), FALSE);
584 if((head != self) && head.takedamage)
586 // ========================
587 // BLAST CONE CALCULATION
588 // ========================
590 // if it's a player, use the view origin as reference (stolen from RadiusDamage functions in g_damage.qc)
591 center = CENTER_OR_VIEWOFS(head);
593 // find the closest point on the enemy to the center of the attack
594 float ang; // angle between shotdir and h
595 float h; // hypotenuse, which is the distance between attacker to head
596 float a; // adjacent side, which is the distance between attacker and the point on w_shotdir that is closest to head.origin
598 h = vlen(center - self.origin);
599 ang = acos(dotproduct(normalize(center - self.origin), w_shotdir));
601 // WEAPONTODO: replace with simpler method
603 vector nearest_on_line = (w_shotorg + a * w_shotdir);
604 vector nearest_to_attacker = WarpZoneLib_NearestPointOnBox(center + head.mins, center + head.maxs, nearest_on_line);
605 float distance_to_target = vlen(w_shotorg - nearest_to_attacker); // WEAPONTODO: use the findradius function for this
607 if((distance_to_target <= WEP_CVAR(shockwave, blast_distance))
608 && (W_Shockwave_Attack_IsVisible(head, nearest_on_line, w_shotorg, attack_endpos)))
610 // calculate importance of distance and accuracy for this attack
611 multiplier_from_accuracy = (1 -
612 W_Shockwave_Attack_CheckSpread(
619 multiplier_from_distance = (1 -
621 min(1, (distance_to_target / distance_to_end))
628 WEP_CVAR(shockwave, blast_multiplier_min),
630 (multiplier_from_accuracy * WEP_CVAR(shockwave, blast_multiplier_accuracy))
632 (multiplier_from_distance * WEP_CVAR(shockwave, blast_multiplier_distance))
636 // calculate damage from multiplier: 1 = "highest" damage, 0 = "lowest" edgedamage
639 (WEP_CVAR(shockwave, blast_damage) * multiplier)
641 (WEP_CVAR(shockwave, blast_edgedamage) * (1 - multiplier))
644 // figure out the direction of force
645 final_force = (w_shotdir * WEP_CVAR(shockwave, blast_force_forwardbias));
646 final_force = normalize(center - (nearest_on_line - final_force));
647 //te_lightning2(world, nearest_on_line, (attack_hitpos + (final_force * 200)));
649 // now multiply the direction by force units
650 final_force *= (WEP_CVAR(shockwave, blast_force) * multiplier);
651 final_force_z *= WEP_CVAR(shockwave, blast_force_zscale);
653 // queue damage with this calculated info
654 if(W_Shockwave_Attack_CheckHit(queue, head, final_force, final_damage)) { ++queue; }
656 #ifdef DEBUG_SHOCKWAVE
658 "BLAST HIT: multiplier = %f, damage = %f, force = %f... "
659 "multiplier_from_accuracy = %f, multiplier_from_distance = %f.\n",
663 multiplier_from_accuracy,
664 multiplier_from_distance
672 for(i = 1; i <= queue; ++i)
674 head = shockwave_hit[i];
675 final_force = shockwave_hit_force[i];
676 final_damage = shockwave_hit_damage[i];
688 #ifdef DEBUG_SHOCKWAVE
690 "SHOCKWAVE by %s: damage = %f, force = %f.\n",
697 shockwave_hit[i] = world;
698 shockwave_hit_force[i] = '0 0 0';
699 shockwave_hit_damage[i] = 0;
703 float W_Shockwave(float req)
709 if(vlen(self.origin - self.enemy.origin) <= WEP_CVAR(shockwave, melee_range))
710 { self.BUTTON_ATCK2 = bot_aim(1000000, 0, 0.001, FALSE); }
712 { self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, FALSE); }
720 switch(WEP_CVAR(shockwave, primary))
724 if(time >= self.shockwave_pelletstime) // handle refire separately so the secondary can be fired straight after a primary
726 if(weapon_prepareattack(0, WEP_CVAR(shockwave, pellets_animtime)))
728 W_Shockwave_Attack();
729 self.shockwave_pelletstime = time + WEP_CVAR(shockwave, pellets_refire) * W_WeaponRateFactor();
730 weapon_thinkf(WFRAME_FIRE1, WEP_CVAR(shockwave, pellets_animtime), w_ready);
737 if(time >= self.shockwave_pelletstime) // handle refire separately so the secondary can be fired straight after a primary
739 if(weapon_prepareattack(0, WEP_CVAR(shockwave, pellets_animtime)))
741 W_Shockwave_Pellets();
742 self.shockwave_pelletstime = time + WEP_CVAR(shockwave, pellets_refire) * W_WeaponRateFactor();
743 weapon_thinkf(WFRAME_FIRE1, WEP_CVAR(shockwave, pellets_animtime), w_ready);
751 if(self.clip_load >= 0) // we are not currently reloading
752 if(!self.crouch) // no crouchmelee please
753 if(self.BUTTON_ATCK2 && WEP_CVAR(shockwave, secondary))
754 if(weapon_prepareattack(1, WEP_CVAR(shockwave, melee_refire)))
756 // attempt forcing playback of the anim by switching to another anim (that we never play) here...
757 weapon_thinkf(WFRAME_FIRE1, 0, W_Shockwave_Melee);
764 precache_model("models/uziflash.md3");
765 precache_model("models/weapons/g_shockwave.md3");
766 precache_model("models/weapons/v_shockwave.md3");
767 precache_model("models/weapons/h_shockwave.iqm");
768 precache_sound("misc/itempickup.wav");
769 precache_sound("weapons/shockwave_fire.wav");
770 precache_sound("weapons/shockwave_melee.wav");
771 SHOCKWAVE_SETTINGS(WEP_SKIPCVAR, WEP_SET_PROP)
777 // shockwave has infinite ammo
782 SHOCKWAVE_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS)
787 W_Reload(0, "weapons/reload.wav");
790 case WR_SUICIDEMESSAGE:
792 return WEAPON_THINKING_WITH_PORTALS;
796 if(w_deathtype & HITTYPE_SECONDARY)
797 return WEAPON_SHOCKWAVE_MURDER_SLAP;
799 return WEAPON_SHOCKWAVE_MURDER;
806 float W_Shockwave(float req)
810 case WR_IMPACTEFFECT:
813 org2 = w_org + w_backoff * 2;
814 pointparticles(particleeffectnum("shockwave_impact"), org2, w_backoff * 1000, 1);
819 //precache_sound("weapons/ric1.wav");
820 //precache_sound("weapons/ric2.wav");
821 //precache_sound("weapons/ric3.wav");