set g_balance_nex_velocitydependent_halflife 0
set g_balance_nex_velocitydependent_minspeed 400
set g_balance_nex_velocitydependent_maxspeed 1000
-set g_balance_nex_velocitydependent_falloff_factor 0.001
+set g_balance_nex_velocitydependent_falloff_rate 0.001
// }}}
// {{{ minstanex
set g_balance_minstanex_refire 1
set g_balance_nex_velocitydependent_halflife 0
set g_balance_nex_velocitydependent_minspeed 400
set g_balance_nex_velocitydependent_maxspeed 1000
-set g_balance_nex_velocitydependent_falloff_factor 0.001
+set g_balance_nex_velocitydependent_falloff_rate 0.001
// }}}
// {{{ minstanex
set g_balance_minstanex_refire 1
set g_balance_nex_velocitydependent_halflife 0
set g_balance_nex_velocitydependent_minspeed 400
set g_balance_nex_velocitydependent_maxspeed 1000
-set g_balance_nex_velocitydependent_falloff_factor 0.001
+set g_balance_nex_velocitydependent_falloff_rate 0.001
// }}}
// {{{ minstanex
set g_balance_minstanex_refire 1
set g_balance_nex_velocitydependent_halflife 0
set g_balance_nex_velocitydependent_minspeed 400
set g_balance_nex_velocitydependent_maxspeed 1000
-set g_balance_nex_velocitydependent_falloff_factor 0.001
+set g_balance_nex_velocitydependent_falloff_rate 0.001
// }}}
// {{{ minstanex
set g_balance_minstanex_refire 1
set g_balance_nex_primary_damagefalloff_forcehalflife 2000
set g_balance_nex_secondary 1
+set g_balance_nex_secondary_charge 1
+set g_balance_nex_secondary_charge_rate 20
+set g_balance_nex_secondary_charge_ammo 20
set g_balance_nex_secondary_damage 125
set g_balance_nex_secondary_force -700
set g_balance_nex_secondary_refire 1
set g_balance_nex_velocitydependent_halflife -500
set g_balance_nex_velocitydependent_minspeed 400
set g_balance_nex_velocitydependent_maxspeed 1000
-set g_balance_nex_velocitydependent_falloff_factor 0.001
+set g_balance_nex_velocitydependent_falloff_rate 20
// }}}
// {{{ minstanex
set g_balance_minstanex_refire 1.25
float nex_minvelocity;
float nex_maxvelocity;
-float nex_speed_falloff_factor;
+float nex_speed_falloff_rate;
float nex_speed;
+float nex_charge;
+float nex_charge_rate;
float cr_maxbullets;
case TE_CSQC_NEX_VELOCITY:
nex_minvelocity = ReadShort();
nex_maxvelocity = ReadShort();
- nex_speed_falloff_factor = ReadShort()/10000;
+ nex_speed_falloff_rate = ReadByte();
+ nex_charge = ReadByte();
+ nex_charge_rate = ReadByte();
bHandled = true;
break;
case TE_CSQC_CR_MAXBULLETS:
if(xyspeed > nex_speed)
nex_speed = min(xyspeed, nex_maxvelocity);
else
- nex_speed = (1 - nex_speed_falloff_factor) * nex_speed;
+ nex_speed = max(nex_minvelocity, nex_speed - nex_speed_falloff_rate * frametime);
+
+ if (activeweapon == WEP_NEX && button_attack2 && nex_charge)
+ nex_speed = min(nex_maxvelocity, nex_speed + nex_charge_rate * frametime);
// ring around crosshair representing bullets left in camping rifle clip
if (activeweapon == WEP_CAMPINGRIFLE && cr_maxbullets)
WriteByte(MSG_ONE, TE_CSQC_NEX_VELOCITY);
WriteShort(MSG_ONE, cvar("g_balance_nex_velocitydependent_minspeed"));
WriteShort(MSG_ONE, cvar("g_balance_nex_velocitydependent_maxspeed"));
- WriteShort(MSG_ONE, cvar("g_balance_nex_velocitydependent_falloff_factor") * 10000);
+ WriteByte(MSG_ONE, cvar("g_balance_nex_velocitydependent_falloff_rate"));
+ WriteByte(MSG_ONE, cvar("g_balance_nex_secondary_charge"));
+ WriteByte(MSG_ONE, cvar("g_balance_nex_secondary_charge_rate"));
}
void send_CSQC_cr_maxbullets(entity e) {
float f;
float xyspeed;
- f = cvar("g_balance_nex_velocitydependent_falloff_factor");
+ f = cvar("g_balance_nex_velocitydependent_falloff_rate");
xyspeed = vlen('1 0 0' * self.velocity_x + '0 1 0' * self.velocity_y);
if(xyspeed > self.nexspeed)
self.nexspeed = min(xyspeed, cvar("g_balance_nex_velocitydependent_maxspeed"));
else
- self.nexspeed = (1 - f) * self.nexspeed;
+ self.nexspeed = max(cvar("g_balance_nex_velocitydependent_minspeed"), self.nexspeed - f * frametime);
:end
if(self.flags & FL_ONGROUND)
self.lastground = time;
}
else if (req == WR_THINK)
{
+ print(ftos(self.nexspeed), "\n");
if (self.BUTTON_ATCK)
{
if (weapon_prepareattack(0, cvar("g_balance_nex_primary_refire")))
}
if (self.BUTTON_ATCK2)
{
- if(cvar("g_balance_nex_secondary"))
+ if(cvar("g_balance_nex_secondary_charge"))
+ {
+ self.nexspeed = min(cvar("g_balance_nex_velocitydependent_maxspeed"), self.nexspeed + cvar("g_balance_nex_secondary_charge_rate") * frametime / W_TICSPERFRAME);
+ self.ammo_cells = max(0, self.ammo_cells - cvar("g_balance_nex_secondary_charge_ammo") * frametime / W_TICSPERFRAME);
+ }
+ else if(cvar("g_balance_nex_secondary"))
{
if (weapon_prepareattack(0, cvar("g_balance_nex_secondary_refire")))
{