/* netname */ "shockwave",
/* fullname */ _("Shockwave")
);
+
+#define SHOCKWAVE_SETTINGS(w_cvar,w_prop) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_damage) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_distance) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_edgedamage) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_force) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_force_forwardbias) \
+ /*w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_force_velocitybias)*/ \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_force_zscale) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_jump_damage) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_jump_edgedamage) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_jump_force) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_jump_force_velocitybias) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_jump_force_zscale) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_jump_multiplier_accuracy) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_jump_multiplier_distance) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_jump_multiplier_min) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_jump_radius) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_multiplier_accuracy) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_multiplier_distance) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_multiplier_min) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_splash_damage) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_splash_edgedamage) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_splash_force) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_splash_force_forwardbias) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_splash_multiplier_accuracy) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_splash_multiplier_distance) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_splash_multiplier_min) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_splash_radius) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_spread_max) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, blast_spread_min) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, melee_animtime) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, melee_damage) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, melee_delay) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, melee_force) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, melee_multihit) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, melee_no_doubleslap) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, melee_nonplayerdamage) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, melee_range) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, melee_refire) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, melee_swing_side) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, melee_swing_up) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, melee_time) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, melee_traces) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, pellets_ammo) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, pellets_animtime) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, pellets_bulletconstant) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, pellets_bullets) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, pellets_damage) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, pellets_force) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, pellets_refire) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, pellets_speed) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, pellets_spread) \
+ w_cvar(WEP_SHOCKWAVE, shockwave, MO_NONE, secondary) \
+ w_prop(WEP_SHOCKWAVE, shockwave, reloading_ammo, reload_ammo) \
+ w_prop(WEP_SHOCKWAVE, shockwave, reloading_time, reload_time) \
+ w_prop(WEP_SHOCKWAVE, shockwave, switchdelay_raise, switchdelay_raise) \
+ w_prop(WEP_SHOCKWAVE, shockwave, switchdelay_drop, switchdelay_drop)
+
+#ifdef SVQC
+SHOCKWAVE_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
+#endif
#else
#ifdef SVQC
void spawnfunc_weapon_shockwave()
}
weapon_defaultspawnfunc(WEP_SHOCKWAVE);
}
-/*
+
.float swing_prev;
.entity swing_alreadyhit;
.float shockwave_pelletstime;
W_DecreaseAmmo(ammo_shells, ammoamount, autocvar_g_balance_shockwave_reload_ammo);
- W_SetupShot (self, TRUE, 5, "weapons/shockwave_fire.wav", CH_WEAPON_A, d * bullets);
- for (sc = 0;sc < bullets;sc = sc + 1)
+ W_SetupShot(self, TRUE, 5, "weapons/shockwave_fire.wav", CH_WEAPON_A, d * bullets);
+ for(sc = 0;sc < bullets;sc = sc + 1)
fireBallisticBullet(w_shotorg, w_shotdir, spread, bulletspeed, 5, d, f, WEP_SHOCKWAVE, 0, bulletconstant);
endFireBallisticBullet();
pointparticles(particleeffectnum("shockwave_muzzleflash"), w_shotorg, w_shotdir * 1000, autocvar_g_balance_shockwave_pellets_ammo);
// casing code
- if (autocvar_g_casings >= 1)
- for (sc = 0;sc < ammoamount;sc = sc + 1)
- SpawnCasing (((random () * 50 + 50) * v_right) - (v_forward * (random () * 25 + 25)) - ((random () * 5 - 30) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 1, self);
+ if(autocvar_g_casings >= 1)
+ for(sc = 0;sc < ammoamount;sc = sc + 1)
+ SpawnCasing(((random () * 50 + 50) * v_right) - (v_forward * (random () * 25 + 25)) - ((random () * 5 - 30) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 1, self);
// muzzle flash for 1st person view
flash = spawn();
makevectors(self.realowner.v_angle); // update values for v_* vectors
// calculate swing percentage based on time
- meleetime = autocvar_g_balance_laser_melee_time * W_WeaponRateFactor();
+ meleetime = WEP_CVAR(shockwave, melee_time) * W_WeaponRateFactor();
swing = bound(0, (self.cnt + meleetime - time) / meleetime, 10);
- f = ((1 - swing) * autocvar_g_balance_laser_melee_traces);
+ f = ((1 - swing) * WEP_CVAR(shockwave, melee_traces));
// check to see if we can still continue, otherwise give up now
- if((self.realowner.deadflag != DEAD_NO) && autocvar_g_balance_laser_melee_no_doubleslap)
+ if((self.realowner.deadflag != DEAD_NO) && WEP_CVAR(shockwave, melee_no_doubleslap))
{
remove(self);
return;
// if okay, perform the traces needed for this frame
for(i=self.swing_prev; i < f; ++i)
{
- swing_factor = ((1 - (i / autocvar_g_balance_laser_melee_traces)) * 2 - 1);
+ swing_factor = ((1 - (i / WEP_CVAR(shockwave, melee_traces))) * 2 - 1);
targpos = (self.realowner.origin + self.realowner.view_ofs
- + (v_forward * autocvar_g_balance_laser_melee_range)
- + (v_up * swing_factor * autocvar_g_balance_laser_melee_swing_up)
- + (v_right * swing_factor * autocvar_g_balance_laser_melee_swing_side));
+ + (v_forward * WEP_CVAR(shockwave, melee_range))
+ + (v_up * swing_factor * WEP_CVAR(shockwave, melee_swing_up))
+ + (v_right * swing_factor * WEP_CVAR(shockwave, melee_swing_side)));
WarpZone_traceline_antilag(self.realowner, self.realowner.origin + self.realowner.view_ofs, targpos, FALSE, self.realowner, ANTILAG_LATENCY(self.realowner));
if((trace_fraction < 1) // if trace is good, apply the damage and remove self
&& (trace_ent.takedamage == DAMAGE_AIM)
&& (trace_ent != self.swing_alreadyhit)
- && (is_player || autocvar_g_balance_laser_melee_nonplayerdamage))
+ && (is_player || WEP_CVAR(shockwave, melee_nonplayerdamage)))
{
target_victim = trace_ent; // so it persists through other calls
if(is_player) // this allows us to be able to nerf the non-player damage done in e.g. assault or onslaught.
- swing_damage = (autocvar_g_balance_laser_melee_damage * min(1, swing_factor + 1));
+ swing_damage = (WEP_CVAR(shockwave, melee_damage * min(1, swing_factor + 1)));
else
- swing_damage = (autocvar_g_balance_laser_melee_nonplayerdamage * min(1, swing_factor + 1));
+ swing_damage = (WEP_CVAR(shockwave, melee_nonplayerdamage * min(1, swing_factor + 1)));
//print(strcat(self.realowner.netname, " hitting ", target_victim.netname, " with ", strcat(ftos(swing_damage), " damage (factor: ", ftos(swing_factor), ") at "), ftos(time), " seconds.\n"));
Damage(target_victim, self.realowner, self.realowner,
swing_damage, WEP_SHOCKWAVE | HITTYPE_SECONDARY,
self.realowner.origin + self.realowner.view_ofs,
- v_forward * autocvar_g_balance_laser_melee_force);
+ v_forward * WEP_CVAR(shockwave, melee_force));
if(accuracy_isgooddamage(self.realowner, target_victim)) { accuracy_add(self.realowner, WEP_SHOCKWAVE, 0, swing_damage); }
- if(autocvar_g_balance_laser_melee_multihit) // allow multiple hits with one swing, but not against the same player twice.
+ if(WEP_CVAR(shockwave, melee_multihit)) // allow multiple hits with one swing, but not against the same player twice.
{
self.swing_alreadyhit = target_victim;
continue; // move along to next trace
void W_Shockwave_Melee()
{
sound(self, CH_WEAPON_A, "weapons/shotgun_melee.wav", VOL_BASE, ATTN_NORM);
- weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_laser_melee_animtime, w_ready);
+ weapon_thinkf(WFRAME_FIRE2, WEP_CVAR(shockwave, melee_animtime), w_ready);
entity meleetemp;
meleetemp = spawn();
meleetemp.owner = meleetemp.realowner = self;
meleetemp.think = W_Shockwave_Melee_Think;
- meleetemp.nextthink = time + autocvar_g_balance_shockwave_melee_delay * W_WeaponRateFactor();
- W_SetupShot_Range(self, TRUE, 0, "", 0, autocvar_g_balance_shockwave_melee_damage, autocvar_g_balance_shockwave_melee_range);
+ meleetemp.nextthink = time + WEP_CVAR(shockwave, melee_delay) * W_WeaponRateFactor();
+ W_SetupShot_Range(self, TRUE, 0, "", 0, WEP_CVAR(shockwave, melee_damage), WEP_CVAR(shockwave, melee_range));
}
// SHOCKWAVE ATTACK MODE
float distance_from_line = vlen(targetorg - nearest_on_line);
spreadlimit = (distance_of_attack ? min(1, (vlen(sw_shotorg - nearest_on_line) / distance_of_attack)) : 1);
- spreadlimit = (autocvar_g_balance_laser_shockwave_spread_min * (1 - spreadlimit) + autocvar_g_balance_laser_shockwave_spread_max * spreadlimit);
+ spreadlimit = (WEP_CVAR(shockwave, blast_spread_min) * (1 - spreadlimit) + WEP_CVAR(shockwave, blast_spread_max) * spreadlimit);
if(
(spreadlimit && (distance_from_line <= spreadlimit))
float i, queue = 0;
// set up the shot direction
- W_SetupShot(self, FALSE, 3, "weapons/lasergun_fire.wav", CH_WEAPON_B, autocvar_g_balance_laser_shockwave_damage);
- vector attack_endpos = (w_shotorg + (w_shotdir * autocvar_g_balance_laser_shockwave_distance));
+ W_SetupShot(self, FALSE, 3, "weapons/lasergun_fire.wav", CH_WEAPON_B, WEP_CVAR(shockwave, blast_damage));
+ vector attack_endpos = (w_shotorg + (w_shotdir * WEP_CVAR(shockwave, blast_distance)));
WarpZone_TraceLine(w_shotorg, attack_endpos, MOVE_NOMONSTERS, self);
vector attack_hitpos = trace_endpos;
float distance_to_end = vlen(w_shotorg - attack_endpos);
//entity transform = WarpZone_trace_transform;
// do the firing effect now
- SendCSQCShockwaveParticle(attack_endpos);
- Damage_DamageInfo(attack_hitpos, autocvar_g_balance_laser_shockwave_splash_damage, autocvar_g_balance_laser_shockwave_splash_edgedamage, autocvar_g_balance_laser_shockwave_splash_radius, w_shotdir * autocvar_g_balance_laser_shockwave_splash_force, WEP_SHOCKWAVE, 0, self);
+ //SendCSQCShockwaveParticle(attack_endpos);
+ Damage_DamageInfo(attack_hitpos, WEP_CVAR(shockwave, blast_splash_damage), WEP_CVAR(shockwave, blast_splash_edgedamage), WEP_CVAR(shockwave, blast_splash_radius), w_shotdir * WEP_CVAR(shockwave, blast_splash_force), WEP_SHOCKWAVE, 0, self);
// splash damage/jumping trace
- head = WarpZone_FindRadius(attack_hitpos, max(autocvar_g_balance_laser_shockwave_splash_radius, autocvar_g_balance_laser_shockwave_jump_radius), FALSE);
+ head = WarpZone_FindRadius(attack_hitpos, max(WEP_CVAR(shockwave, blast_splash_radius), WEP_CVAR(shockwave, blast_jump_radius)), FALSE);
while(head)
{
next = head.chain;
if(head.takedamage)
{
- center = PLAYER_CENTER(head);
+ center = CENTER_OR_VIEWOFS(head);
float distance_to_head = vlen(attack_hitpos - head.WarpZone_findradius_nearest);
- if((head == self) && (distance_to_head <= autocvar_g_balance_laser_shockwave_jump_radius))
+ if((head == self) && (distance_to_head <= WEP_CVAR(shockwave, blast_jump_radius)))
{
- multiplier_from_accuracy = (1 - (distance_to_head ? min(1, (distance_to_head / autocvar_g_balance_laser_shockwave_jump_radius)) : 0));
+ multiplier_from_accuracy = (1 - (distance_to_head ? min(1, (distance_to_head / WEP_CVAR(shockwave, blast_jump_radius))) : 0));
multiplier_from_distance = (1 - (distance_to_hit ? min(1, (distance_to_hit / distance_to_end)) : 0));
- multiplier = max(autocvar_g_balance_laser_shockwave_jump_multiplier_min, ((multiplier_from_accuracy * autocvar_g_balance_laser_shockwave_jump_multiplier_accuracy) + (multiplier_from_distance * autocvar_g_balance_laser_shockwave_jump_multiplier_distance)));
+ multiplier = max(WEP_CVAR(shockwave, blast_jump_multiplier_min), ((multiplier_from_accuracy * WEP_CVAR(shockwave, blast_jump_multiplier_accuracy)) + (multiplier_from_distance * WEP_CVAR(shockwave, blast_jump_multiplier_distance))));
- final_force = ((normalize(center - attack_hitpos) * autocvar_g_balance_laser_shockwave_jump_force) * multiplier);
+ final_force = ((normalize(center - attack_hitpos) * WEP_CVAR(shockwave, blast_jump_force)) * multiplier);
vel = head.velocity; vel_z = 0;
- vel = normalize(vel) * bound(0, vlen(vel) / autocvar_sv_maxspeed, 1) * autocvar_g_balance_laser_shockwave_jump_force_velocitybias;
+ vel = normalize(vel) * bound(0, vlen(vel) / autocvar_sv_maxspeed, 1) * WEP_CVAR(shockwave, blast_jump_force_velocitybias);
final_force = (vlen(final_force) * normalize(normalize(final_force) + vel));
- final_force_z *= autocvar_g_balance_laser_shockwave_jump_force_zscale;
- final_damage = (autocvar_g_balance_laser_shockwave_jump_damage * multiplier + autocvar_g_balance_laser_shockwave_jump_edgedamage * (1 - multiplier));
+ final_force_z *= WEP_CVAR(shockwave, blast_jump_force_zscale);
+ final_damage = (WEP_CVAR(shockwave, blast_jump_damage) * multiplier + WEP_CVAR(shockwave, blast_jump_edgedamage) * (1 - multiplier));
Damage(head, self, self, final_damage, WEP_SHOCKWAVE, head.origin, final_force);
//print("SELF HIT: multiplier = ", ftos(multiplier), strcat(", damage = ", ftos(final_damage), ", force = ", ftos(vlen(final_force))),"... multiplier_from_accuracy = ", ftos(multiplier_from_accuracy), ", multiplier_from_distance = ", ftos(multiplier_from_distance), ".\n");
}
- else if (distance_to_head <= autocvar_g_balance_laser_shockwave_splash_radius)
+ else if (distance_to_head <= WEP_CVAR(shockwave, blast_splash_radius))
{
- multiplier_from_accuracy = (1 - (distance_to_head ? min(1, (distance_to_head / autocvar_g_balance_laser_shockwave_splash_radius)) : 0));
+ multiplier_from_accuracy = (1 - (distance_to_head ? min(1, (distance_to_head / WEP_CVAR(shockwave, blast_splash_radius))) : 0));
multiplier_from_distance = (1 - (distance_to_hit ? min(1, (distance_to_hit / distance_to_end)) : 0));
- multiplier = max(autocvar_g_balance_laser_shockwave_splash_multiplier_min, ((multiplier_from_accuracy * autocvar_g_balance_laser_shockwave_splash_multiplier_accuracy) + (multiplier_from_distance * autocvar_g_balance_laser_shockwave_splash_multiplier_distance)));
+ multiplier = max(WEP_CVAR(shockwave, blast_splash_multiplier_min), ((multiplier_from_accuracy * WEP_CVAR(shockwave, blast_splash_multiplier_accuracy)) + (multiplier_from_distance * WEP_CVAR(shockwave, blast_splash_multiplier_distance))));
- final_force = normalize(center - (attack_hitpos - (w_shotdir * autocvar_g_balance_laser_shockwave_splash_force_forwardbias)));
+ final_force = normalize(center - (attack_hitpos - (w_shotdir * WEP_CVAR(shockwave, blast_splash_force_forwardbias))));
//te_lightning2(world, attack_hitpos, (attack_hitpos + (final_force * 200)));
- final_force = ((final_force * autocvar_g_balance_laser_shockwave_splash_force) * multiplier);
- final_force_z *= autocvar_g_balance_laser_shockwave_force_zscale;
- final_damage = (autocvar_g_balance_laser_shockwave_splash_damage * multiplier + autocvar_g_balance_laser_shockwave_splash_edgedamage * (1 - multiplier));
+ final_force = ((final_force * WEP_CVAR(shockwave, blast_splash_force)) * multiplier);
+ final_force_z *= WEP_CVAR(shockwave, blast_force_zscale);
+ final_damage = (WEP_CVAR(shockwave, blast_splash_damage) * multiplier + WEP_CVAR(shockwave, blast_splash_edgedamage) * (1 - multiplier));
if(W_Shockwave_Attack_CheckHit(queue, head, final_force, final_damage)) { ++queue; }
//print("SPLASH HIT: multiplier = ", ftos(multiplier), strcat(", damage = ", ftos(final_damage), ", force = ", ftos(vlen(final_force))),"... multiplier_from_accuracy = ", ftos(multiplier_from_accuracy), ", multiplier_from_distance = ", ftos(multiplier_from_distance), ".\n");
}
// cone damage trace
- head = WarpZone_FindRadius(w_shotorg, autocvar_g_balance_laser_shockwave_distance, FALSE);
+ head = WarpZone_FindRadius(w_shotorg, WEP_CVAR(shockwave, blast_distance), FALSE);
while(head)
{
next = head.chain;
vector nearest_to_attacker = WarpZoneLib_NearestPointOnBox(center + head.mins, center + head.maxs, nearest_on_line);
float distance_to_target = vlen(w_shotorg - nearest_to_attacker); // todo: use the findradius function for this
- if((distance_to_target <= autocvar_g_balance_laser_shockwave_distance)
+ if((distance_to_target <= WEP_CVAR(shockwave, blast_distance))
&& (W_Shockwave_Attack_IsVisible(head, nearest_on_line, w_shotorg, attack_endpos)))
{
multiplier_from_accuracy = (1 - W_Shockwave_Attack_CheckSpread(nearest_to_attacker, nearest_on_line, w_shotorg, attack_endpos));
multiplier_from_distance = (1 - (distance_to_hit ? min(1, (distance_to_target / distance_to_end)) : 0));
- multiplier = max(autocvar_g_balance_laser_shockwave_multiplier_min, ((multiplier_from_accuracy * autocvar_g_balance_laser_shockwave_multiplier_accuracy) + (multiplier_from_distance * autocvar_g_balance_laser_shockwave_multiplier_distance)));
+ multiplier = max(WEP_CVAR(shockwave, blast_multiplier_min), ((multiplier_from_accuracy * WEP_CVAR(shockwave, blast_multiplier_accuracy)) + (multiplier_from_distance * WEP_CVAR(shockwave, blast_multiplier_distance))));
- final_force = normalize(center - (nearest_on_line - (w_shotdir * autocvar_g_balance_laser_shockwave_force_forwardbias)));
+ final_force = normalize(center - (nearest_on_line - (w_shotdir * WEP_CVAR(shockwave, blast_force_forwardbias))));
//te_lightning2(world, nearest_on_line, (attack_hitpos + (final_force * 200)));
- final_force = ((final_force * autocvar_g_balance_laser_shockwave_force) * multiplier);
- final_force_z *= autocvar_g_balance_laser_shockwave_force_zscale;
- final_damage = (autocvar_g_balance_laser_shockwave_damage * multiplier + autocvar_g_balance_laser_shockwave_edgedamage * (1 - multiplier));
+ final_force = ((final_force * WEP_CVAR(shockwave, blast_force)) * multiplier);
+ final_force_z *= WEP_CVAR(shockwave, blast_force_zscale);
+ final_damage = (WEP_CVAR(shockwave, blast_damage) * multiplier + WEP_CVAR(shockwave, blast_edgedamage) * (1 - multiplier));
if(W_Shockwave_Attack_CheckHit(queue, head, final_force, final_damage)) { ++queue; }
//print("CONE HIT: multiplier = ", ftos(multiplier), strcat(", damage = ", ftos(final_damage), ", force = ", ftos(vlen(final_force))),"... multiplier_from_accuracy = ", ftos(multiplier_from_accuracy), ", multiplier_from_distance = ", ftos(multiplier_from_distance), ".\n");
}
//print("queue was ", ftos(queue), ".\n\n");
}
-*/
+
float W_Shockwave(float req)
{
- float ammo_amount = 0;
-
+ float ammo_amount;
switch(req)
{
- /*
case WR_AIM:
{
- if(vlen(self.origin-self.enemy.origin) <= autocvar_g_balance_shockwave_secondary_melee_range)
- self.BUTTON_ATCK2 = bot_aim(1000000, 0, 0.001, FALSE);
+ if(vlen(self.origin-self.enemy.origin) <= WEP_CVAR(shockwave, melee_range))
+ { self.BUTTON_ATCK2 = bot_aim(1000000, 0, 0.001, FALSE); }
else
- self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, FALSE);
- {
- if(autocvar_g_antilag_bullets)
- self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, FALSE);
- else
- self.BUTTON_ATCK = bot_aim(autocvar_g_balance_shockwave_pellets_speed, 0, 0.001, FALSE);
- }
+ { self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, FALSE); }
return TRUE;
}
if(autocvar_g_balance_shockwave_reload_ammo && self.clip_load < autocvar_g_balance_shockwave_pellets_ammo) // forced reload
{
// don't force reload an empty shockwave if its melee attack is active
- if not(autocvar_g_balance_shockwave_secondary && self.ammo_shells < autocvar_g_balance_shockwave_pellets_ammo)
+ if(!(autocvar_g_balance_shockwave_secondary && self.ammo_shells < autocvar_g_balance_shockwave_pellets_ammo))
WEP_ACTION(self.weapon, WR_RELOAD);
}
else
if (self.clip_load >= 0) // we are not currently reloading
if (!self.crouch) // no crouchmelee please
if (self.BUTTON_ATCK2 && autocvar_g_balance_shockwave_secondary)
- if (weapon_prepareattack(1, autocvar_g_balance_shockwave_secondary_refire))
+ if (weapon_prepareattack(1, WEP_CVAR(shockwave, melee_refire)))
{
// attempt forcing playback of the anim by switching to another anim (that we never play) here...
weapon_thinkf(WFRAME_FIRE1, 0, W_Shockwave_Melee);
return TRUE;
}
- */
case WR_INIT:
{
- precache_model ("models/uziflash.md3");
- precache_model ("models/weapons/g_shockwave.md3");
- precache_model ("models/weapons/v_shockwave.md3");
- precache_model ("models/weapons/h_shockwave.iqm");
- precache_sound ("misc/itempickup.wav");
- precache_sound ("weapons/shockwave_fire.wav");
- precache_sound ("weapons/shockwave_melee.wav");
+ precache_model("models/uziflash.md3");
+ precache_model("models/weapons/g_shockwave.md3");
+ precache_model("models/weapons/v_shockwave.md3");
+ precache_model("models/weapons/h_shockwave.iqm");
+ precache_sound("misc/itempickup.wav");
+ precache_sound("weapons/shockwave_fire.wav");
+ precache_sound("weapons/shockwave_melee.wav");
+ SHOCKWAVE_SETTINGS(WEP_SKIPCVAR, WEP_SET_PROP)
return TRUE;
}
case WR_SETUP:
}
case WR_CHECKAMMO1:
{
- /*
ammo_amount = self.ammo_shells >= autocvar_g_balance_shockwave_pellets_ammo;
- ammo_amount += self.(weapon_load[WEP_SHOCKWAVE]) >= autocvar_g_balance_shockwave_pellets_ammo;*/
+ ammo_amount += self.(weapon_load[WEP_SHOCKWAVE]) >= autocvar_g_balance_shockwave_pellets_ammo;
return ammo_amount;
}
case WR_CHECKAMMO2:
// melee attack is always available
return TRUE;
}
+ case WR_CONFIG:
+ {
+ SHOCKWAVE_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS)
+ return TRUE;
+ }
case WR_RELOAD:
{
- //W_Reload(autocvar_g_balance_shockwave_pellets_ammo, "weapons/reload.wav");
+ W_Reload(autocvar_g_balance_shockwave_pellets_ammo, "weapons/reload.wav");
return TRUE;
}
case WR_SUICIDEMESSAGE:
}
#endif
#ifdef CSQC
-.float prevric;
float W_Shockwave(float req)
{
switch(req)
vector org2;
org2 = w_org + w_backoff * 2;
pointparticles(particleeffectnum("shockwave_impact"), org2, w_backoff * 1000, 1);
- if(!w_issilent && time - self.prevric > 0.25)
- {
- if(w_random < 0.0165)
- sound(self, CH_SHOTS, "weapons/ric1.wav", VOL_BASE, ATTEN_NORM);
- else if(w_random < 0.033)
- sound(self, CH_SHOTS, "weapons/ric2.wav", VOL_BASE, ATTEN_NORM);
- else if(w_random < 0.05)
- sound(self, CH_SHOTS, "weapons/ric3.wav", VOL_BASE, ATTEN_NORM);
- self.prevric = time;
- }
return TRUE;
}
case WR_INIT:
{
- precache_sound("weapons/ric1.wav");
- precache_sound("weapons/ric2.wav");
- precache_sound("weapons/ric3.wav");
- return TRUE;
+ //precache_sound("weapons/ric1.wav");
+ //precache_sound("weapons/ric2.wav");
+ //precache_sound("weapons/ric3.wav");
+ return FALSE;
}
}
return TRUE;