void W_Nex_Attack (float issecondary)
{
- float mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, myammo;
+ float mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, myammo, myvel;
if(issecondary)
{
mydmg = cvar("g_balance_nex_secondary_damage");
float flying;
flying = IsFlying(self); // do this BEFORE to make the trace values from FireRailgunBullet last
+ if(cvar("g_balance_nex_velocitydependent")) // player velocity dependent damage and force
+ {
+ myvel = vlen(self.velocity);
+
+ if(myvel < cvar("g_balance_nex_velocitydependent_minspeed"))
+ myvel = bound(cvar("g_balance_nex_velocitydependent_minspeed"), myvel, cvar("g_balance_nex_velocitydependent_maxspeed"));
+
+ // TODO: make it more obvious (through effects, indicator on weapon) that damage increases when speed increases
+ mydmg *= cvar("g_balance_nex_velocitydependent_maxspeed") / myvel;
+ myforce *= cvar("g_balance_nex_velocitydependent_maxspeed") / myvel;
+ }
+
W_SetupShot (self, TRUE, 5, "weapons/nexfire.wav", mydmg);
yoda = 0;