set g_balance_nex_charge 0
set g_balance_nex_charge_start 0
set g_balance_nex_charge_rate 0.1
+set g_balance_nex_charge_limit 0.5
set g_balance_nex_charge_shot_multiplier 0.5
set g_balance_nex_charge_velocity_rate 0.2
set g_balance_nex_charge_minspeed 400
set g_balance_nex_charge 0
set g_balance_nex_charge_start 0
set g_balance_nex_charge_rate 0.1
+set g_balance_nex_charge_limit 0.5
set g_balance_nex_charge_shot_multiplier 0.5
set g_balance_nex_charge_velocity_rate 0.2
set g_balance_nex_charge_minspeed 400
set g_balance_nex_charge 0
set g_balance_nex_charge_start 0
set g_balance_nex_charge_rate 0.1
+set g_balance_nex_charge_limit 0.5
set g_balance_nex_charge_shot_multiplier 0.5
set g_balance_nex_charge_velocity_rate 0.2
set g_balance_nex_charge_minspeed 400
set g_balance_nex_charge 0
set g_balance_nex_charge_start 0
set g_balance_nex_charge_rate 0.1
+set g_balance_nex_charge_limit 0.5
set g_balance_nex_charge_shot_multiplier 0.5
set g_balance_nex_charge_velocity_rate 0.2
set g_balance_nex_charge_minspeed 400
set g_balance_nex_secondary 1
set g_balance_nex_secondary_charge 1
-set g_balance_nex_secondary_charge_rate 0.1
+set g_balance_nex_secondary_charge_rate 0.15
set g_balance_nex_secondary_damage 0
set g_balance_nex_secondary_force 0
set g_balance_nex_secondary_refire 0
set g_balance_nex_secondary_animtime 0
-set g_balance_nex_secondary_ammo 5
+set g_balance_nex_secondary_ammo 4
set g_balance_nex_secondary_damagefalloff_mindist 0
set g_balance_nex_secondary_damagefalloff_maxdist 0
set g_balance_nex_secondary_damagefalloff_halflife 0
set g_balance_nex_secondary_damagefalloff_forcehalflife 0
set g_balance_nex_charge 1
-set g_balance_nex_charge_start 0.25
-set g_balance_nex_charge_rate 0.025
+set g_balance_nex_charge_start 0.2
+set g_balance_nex_charge_rate 0.05
+set g_balance_nex_charge_limit 0.5
set g_balance_nex_charge_shot_multiplier 0.675
-set g_balance_nex_charge_velocity_rate 0.175
+set g_balance_nex_charge_velocity_rate 0.15
set g_balance_nex_charge_minspeed 400
set g_balance_nex_charge_maxspeed 1000
// }}}
// use fake light if map has no lightmaps
r_fakelight 1
+
+// strength sound settings
+set sv_strengthsound_antispam_time 0.1 "minimum distance of strength sounds"
+set sv_strengthsound_antispam_refire_threshold 0.04 "apply minimum distance only if refire of the gun is smaller than this"
float f;
f = (xyspeed - cvar("g_balance_nex_charge_minspeed")) / (cvar("g_balance_nex_charge_maxspeed") - cvar("g_balance_nex_charge_minspeed"));
// add the extra charge
- self.nex_charge += cvar("g_balance_nex_charge_velocity_rate") * f * frametime;
+ self.nex_charge = min(1, self.nex_charge + cvar("g_balance_nex_charge_velocity_rate") * f * frametime);
}
:end
if(self.flags & FL_ONGROUND)
// this function calculates w_shotorg and w_shotdir based on the weapon model
// offset, trueaim and antilag, and won't put w_shotorg inside a wall.
// make sure you call makevectors first (FIXME?)
+.float prevstrengthsound;
+.float prevstrengthsoundattempt;
void W_SetupShot_Dir_ProjectileSize_Range(entity ent, vector s_forward, vector mi, vector ma, float antilag, float recoil, string snd, float maxdamage, float range)
{
float nudge = 1; // added to traceline target and subtracted from result
sound (ent, CHAN_WEAPON, snd, VOL_BASE, ATTN_NORM);
}
- if (ent.items & IT_STRENGTH)
- if (!g_minstagib)
- sound (ent, CHAN_AUTO, "weapons/strength_fire.wav", VOL_BASE, ATTN_NORM);
+ if(ent.items & IT_STRENGTH)
+ if(!g_minstagib)
+ if(
+ (time > ent.prevstrengthsound + cvar("sv_strengthsound_antispam_time"))
+ ||
+ (time > ent.prevstrengthsoundattempt + cvar("sv_strengthsound_antispam_refire_threshold"))
+ ) // prevent insane sound spam
+ {
+ sound(ent, CHAN_AUTO, "weapons/strength_fire.wav", VOL_BASE, ATTN_NORM);
+ ent.prevstrengthsound = time;
+ }
+ ent.prevstrengthsoundattempt = time;
// nudge w_shotend so a trace to w_shotend hits
w_shotend = w_shotend + normalize(w_shotend - w_shotorg) * nudge;
}
else if (req == WR_THINK)
{
- if(cvar("g_balance_nex_charge"))
+ if(cvar("g_balance_nex_charge") && self.nex_charge < cvar("g_balance_nex_charge_limit"))
self.nex_charge = min(1, self.nex_charge + cvar("g_balance_nex_charge_rate") * frametime / W_TICSPERFRAME);
if (self.BUTTON_ATCK)
{
{
if(cvar("g_balance_nex_secondary_charge"))
{
- if(self.ammo_cells)
+ if(self.ammo_cells && self.nex_charge < 1)
{
self.nex_charge = min(1, self.nex_charge + cvar("g_balance_nex_secondary_charge_rate") * frametime / W_TICSPERFRAME);
self.ammo_cells = max(0, self.ammo_cells - cvar("g_balance_nex_secondary_ammo") * frametime / W_TICSPERFRAME);