From: FruitieX Date: Sun, 3 Oct 2010 10:31:42 +0000 (+0300) Subject: use ExponentialFalloff() X-Git-Tag: xonotic-v0.1.0preview~299^2~15 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=38997ea582f868c0dc33d2a756837aff3e86770a use ExponentialFalloff() --- diff --git a/balance25.cfg b/balance25.cfg index b79f68d697..09abd6bc6c 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 10078ea49c..7799e510cd 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 2cf5e86881..792485c147 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 dd20eee40c..4868961422 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 0f8abc017b..bc931daa25 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 e6b16d193e..8bce2ebc42 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);