set g_balance_nex_secondary_damagefalloff_halflife 0
set g_balance_nex_secondary_damagefalloff_forcehalflife 0
-set g_balance_nex_velocitydependent 0
+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_secondary_damagefalloff_halflife 9999999
set g_balance_nex_secondary_damagefalloff_forcehalflife 9999999
-set g_balance_nex_velocitydependent 0
+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_secondary_damagefalloff_halflife 1500
set g_balance_nex_secondary_damagefalloff_forcehalflife 1500
-set g_balance_nex_velocitydependent 0
+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_secondary_damagefalloff_halflife 1500
set g_balance_nex_secondary_damagefalloff_forcehalflife 1500
-set g_balance_nex_velocitydependent 0
+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_secondary_damagefalloff_halflife 2000
set g_balance_nex_secondary_damagefalloff_forcehalflife 2000
-set g_balance_nex_velocitydependent 1
+set g_balance_nex_velocitydependent_halflife -500
set g_balance_nex_velocitydependent_minspeed 400
set g_balance_nex_velocitydependent_maxspeed 1000
// }}}
void W_Nex_Attack (float issecondary)
{
- float mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, myammo, myvel;
+ float mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, myammo, f;
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);
- myvel = bound(cvar("g_balance_nex_velocitydependent_minspeed"), myvel, cvar("g_balance_nex_velocitydependent_maxspeed"));
+ f = ExponentiaFalloff(cvar("g_balance_nex_velocitydependent_minspeed"), cvar("g_balance_nex_velocitydependent_maxspeed"), cvar("g_balance_nex_velocitydependent_halflife"), vlen(self.velocity));
- // TODO: make it more obvious (through effects, indicator on weapon) that damage increases when speed increases
- mydmg *= myvel / cvar("g_balance_nex_velocitydependent_maxspeed");
- myforce *= myvel / cvar("g_balance_nex_velocitydependent_maxspeed");
- }
+ // TODO: make it more obvious (through effects, indicator on weapon) that damage increases when speed increases
+ mydmg *= f;
+ myforce *= f;
W_SetupShot (self, TRUE, 5, "weapons/nexfire.wav", mydmg);