]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
use ExponentialFalloff()
authorFruitieX <rasse@rasse-laptop.(none)>
Sun, 3 Oct 2010 10:31:42 +0000 (13:31 +0300)
committerFruitieX <rasse@rasse-laptop.(none)>
Sun, 3 Oct 2010 10:31:42 +0000 (13:31 +0300)
balance25.cfg
balanceLeeStricklin.cfg
balanceNexSVN.cfg
balanceSamual.cfg
balanceXonotic.cfg
qcsrc/server/w_nex.qc

index b79f68d6975338e6209ca8dd61a83bbceb0a7ab8..09abd6bc6c92655e4c906cb0905a8bb326c96c91 100644 (file)
@@ -406,7 +406,7 @@ set g_balance_nex_secondary_damagefalloff_maxdist 0
 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
 // }}}
index 10078ea49c77c22082cba5f662cca3cc6feaad44..7799e510cd8ae52832ebf12184b058f4fc467a2d 100644 (file)
@@ -417,7 +417,7 @@ set g_balance_nex_secondary_damagefalloff_maxdist 9999999
 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
 // }}}
index 2cf5e8688110f61bb4585d4d46c5a3bd0c05ead1..792485c147cfd04889c126c04ecf8d7561efe0c1 100644 (file)
@@ -406,7 +406,7 @@ set g_balance_nex_secondary_damagefalloff_maxdist 3000
 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
 // }}}
index dd20eee40cefe043625123dd7212082cf16ad68e..48689614220de9a00add30f2c33bbb97a0d20363 100644 (file)
@@ -406,7 +406,7 @@ set g_balance_nex_secondary_damagefalloff_maxdist 3000
 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
 // }}}
index 0f8abc017b88969030ce42efe6163c2f21afdd89..bc931daa255c37984ad2c1e8f189bf473eb52b3a 100644 (file)
@@ -406,7 +406,7 @@ set g_balance_nex_secondary_damagefalloff_maxdist 4500
 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
 // }}}
index e6b16d193e5f517babe1eb8fbe2c0a4f414a4c69..8bce2ebc429f04be578795c3a89abc6ea4591246 100644 (file)
@@ -18,7 +18,7 @@ void SendCSQCNexBeamParticle() {
 
 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");
@@ -43,15 +43,11 @@ void W_Nex_Attack (float issecondary)
        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);