From 38997ea582f868c0dc33d2a756837aff3e86770a Mon Sep 17 00:00:00 2001 From: FruitieX Date: Sun, 3 Oct 2010 13:31:42 +0300 Subject: [PATCH] use ExponentialFalloff() --- balance25.cfg | 2 +- balanceLeeStricklin.cfg | 2 +- balanceNexSVN.cfg | 2 +- balanceSamual.cfg | 2 +- balanceXonotic.cfg | 2 +- qcsrc/server/w_nex.qc | 14 +++++--------- 6 files changed, 10 insertions(+), 14 deletions(-) diff --git a/balance25.cfg b/balance25.cfg index b79f68d69..09abd6bc6 100644 --- a/balance25.cfg +++ b/balance25.cfg @@ -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 // }}} diff --git a/balanceLeeStricklin.cfg b/balanceLeeStricklin.cfg index 10078ea49..7799e510c 100644 --- a/balanceLeeStricklin.cfg +++ b/balanceLeeStricklin.cfg @@ -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 // }}} diff --git a/balanceNexSVN.cfg b/balanceNexSVN.cfg index 2cf5e8688..792485c14 100644 --- a/balanceNexSVN.cfg +++ b/balanceNexSVN.cfg @@ -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 // }}} diff --git a/balanceSamual.cfg b/balanceSamual.cfg index dd20eee40..486896142 100644 --- a/balanceSamual.cfg +++ b/balanceSamual.cfg @@ -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 // }}} diff --git a/balanceXonotic.cfg b/balanceXonotic.cfg index 0f8abc017..bc931daa2 100644 --- a/balanceXonotic.cfg +++ b/balanceXonotic.cfg @@ -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 // }}} diff --git a/qcsrc/server/w_nex.qc b/qcsrc/server/w_nex.qc index e6b16d193..8bce2ebc4 100644 --- a/qcsrc/server/w_nex.qc +++ b/qcsrc/server/w_nex.qc @@ -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); -- 2.39.2