void W_Nex_Attack (float issecondary)
{
- float mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, myammo, myvel;
+ float mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, myammo;
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
+ if(cvar("g_balance_nex_charge"))
{
- myvel = vlen(self.velocity);
- 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 *= myvel / cvar("g_balance_nex_velocitydependent_maxspeed");
- myforce *= myvel / cvar("g_balance_nex_velocitydependent_maxspeed");
+ mydmg *= self.nex_charge;
+ myforce *= self.nex_charge;
+ //print("^1Damage: ^7", ftos(mydmg), "\n");
+ self.nex_charge *= cvar("g_balance_nex_charge_shot_multiplier"); // do this AFTER setting mydmg/myforce
}
W_SetupShot (self, TRUE, 5, "weapons/nexfire.wav", mydmg);
}
else if (req == WR_THINK)
{
+ 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 (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"))
+ {
+ if(self.ammo_cells)
+ {
+ 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);
+ }
+ }
+ else if(cvar("g_balance_nex_secondary"))
{
if (weapon_prepareattack(0, cvar("g_balance_nex_secondary_refire")))
{