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_movingavg_factor 0.9
// }}}
// {{{ 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_movingavg_factor 0.9
// }}}
// {{{ 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_movingavg_factor 0.9
// }}}
// {{{ 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_movingavg_factor 0.9
// }}}
// {{{ minstanex
set g_balance_minstanex_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
// }}}
// {{{ minstanex
set g_balance_minstanex_refire 1.25
float nex_minvelocity;
float nex_maxvelocity;
+float nex_speed_falloff_factor;
+float nex_speed;
float cr_maxbullets;
case TE_CSQC_NEX_VELOCITY:
nex_minvelocity = ReadShort();
nex_maxvelocity = ReadShort();
+ nex_speed_falloff_factor = ReadShort()/10000;
bHandled = true;
break;
case TE_CSQC_CR_MAXBULLETS:
float f, a;
wcross_size = drawgetimagesize(wcross_name) * wcross_scale;
+
+ float xyspeed;
+ xyspeed = vlen('1 0 0' * pmove_vel_x + '0 1 0' * pmove_vel_y);
+ if(xyspeed > nex_speed)
+ nex_speed = min(xyspeed, nex_maxvelocity);
+ else
+ nex_speed = (1 - nex_speed_falloff_factor) * nex_speed;
+
// ring around crosshair representing bullets left in camping rifle clip
if (activeweapon == WEP_CAMPINGRIFLE && cr_maxbullets)
{
bullets = getstati(STAT_BULLETS_LOADED);
- a = cvar("crosshair_campingrifle_bulletcounter_alpha");
f = bound(0, bullets / cr_maxbullets, 1);
+ a = cvar("crosshair_campingrifle_bulletcounter_alpha");
DrawCircleClippedPic(wcross_origin, wcross_size_x * ring_scale, "gfx/crosshair_ring.tga", f, wcross_color, wcross_alpha * a, DRAWFLAG_ADDITIVE);
}
else if (activeweapon == WEP_NEX) // ring around crosshair representing velocity-dependent damage for the nex
{
- float curvel;
- a = cvar("crosshair_nexvelocity_alpha");
- curvel = vlen('1 0 0' * pmove_vel_x + '0 1 0' * pmove_vel_y);
- f = bound(0, (curvel - nex_minvelocity) / (nex_maxvelocity - nex_minvelocity), 1);
+ f = bound(0, (nex_speed - nex_minvelocity) / (nex_maxvelocity - nex_minvelocity), 1);
+ a = cvar("crosshair_nexvelocity_alpha");
DrawCircleClippedPic(wcross_origin, wcross_size_x * ring_scale, "gfx/crosshair_ring.tga", f, wcross_color, wcross_alpha * a, DRAWFLAG_ADDITIVE);
}
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);
}
void send_CSQC_cr_maxbullets(entity e) {
.float multijump_ready;
.float prevjumpbutton;
+.float nexspeed;
+
/*
=============
PlayerJump
}
}
}
+
+ float f;
+ float xyspeed;
+ f = cvar("g_balance_nex_velocitydependent_falloff_factor");
+ 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;
:end
if(self.flags & FL_ONGROUND)
self.lastground = time;
float flying;
flying = IsFlying(self); // do this BEFORE to make the trace values from FireRailgunBullet last
- f = ExponentialFalloff(cvar("g_balance_nex_velocitydependent_minspeed"), cvar("g_balance_nex_velocitydependent_maxspeed"), cvar("g_balance_nex_velocitydependent_halflife"), vlen('1 0 0' * self.velocity_x + '0 1 0' * self.velocity_y));
+ f = ExponentialFalloff(cvar("g_balance_nex_velocitydependent_minspeed"), cvar("g_balance_nex_velocitydependent_maxspeed"), cvar("g_balance_nex_velocitydependent_halflife"), self.nexspeed);
// TODO: make it more obvious (through effects, indicator on weapon) that damage increases when speed increases
mydmg *= f;