From 00cc23dd6e38b76a2e42da8f6cbbb92dc91b7308 Mon Sep 17 00:00:00 2001 From: FruitieX Date: Sat, 2 Oct 2010 21:03:56 +0300 Subject: [PATCH] velocity dependent nex damage and force --- balance25.cfg | 4 ++++ balanceLeeStricklin.cfg | 4 ++++ balanceNexSVN.cfg | 4 ++++ balanceSamual.cfg | 4 ++++ balanceXonotic.cfg | 20 ++++++++++++-------- qcsrc/server/w_nex.qc | 14 +++++++++++++- 6 files changed, 41 insertions(+), 9 deletions(-) diff --git a/balance25.cfg b/balance25.cfg index ec040c4cd..899b7fc9b 100644 --- a/balance25.cfg +++ b/balance25.cfg @@ -405,6 +405,10 @@ set g_balance_nex_secondary_damagefalloff_mindist 0 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_minspeed 400 +set g_balance_nex_velocitydependent_minspeed 1000 // }}} // {{{ minstanex set g_balance_minstanex_refire 1 diff --git a/balanceLeeStricklin.cfg b/balanceLeeStricklin.cfg index 6df076b18..23977eadf 100644 --- a/balanceLeeStricklin.cfg +++ b/balanceLeeStricklin.cfg @@ -416,6 +416,10 @@ set g_balance_nex_secondary_damagefalloff_mindist 9999999 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_minspeed 400 +set g_balance_nex_velocitydependent_minspeed 1000 // }}} // {{{ minstanex set g_balance_minstanex_refire 1 diff --git a/balanceNexSVN.cfg b/balanceNexSVN.cfg index 6c5a74655..e32819dc7 100644 --- a/balanceNexSVN.cfg +++ b/balanceNexSVN.cfg @@ -405,6 +405,10 @@ set g_balance_nex_secondary_damagefalloff_mindist 1000 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_minspeed 400 +set g_balance_nex_velocitydependent_minspeed 1000 // }}} // {{{ minstanex set g_balance_minstanex_refire 1 diff --git a/balanceSamual.cfg b/balanceSamual.cfg index 17c3e1410..e1a6f7442 100644 --- a/balanceSamual.cfg +++ b/balanceSamual.cfg @@ -405,6 +405,10 @@ set g_balance_nex_secondary_damagefalloff_mindist 1000 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_minspeed 400 +set g_balance_nex_velocitydependent_minspeed 1000 // }}} // {{{ minstanex set g_balance_minstanex_refire 1 diff --git a/balanceXonotic.cfg b/balanceXonotic.cfg index bffb0a64e..e34a2472b 100644 --- a/balanceXonotic.cfg +++ b/balanceXonotic.cfg @@ -385,26 +385,30 @@ set g_balance_crylink_secondary_line_lifetime 2 // range: 4000 full, fades to 80 set g_balance_crylink_secondary_line_fadetime 2 // }}} // {{{ nex -set g_balance_nex_primary_damage 80 +set g_balance_nex_primary_damage 125 set g_balance_nex_primary_force 400 -set g_balance_nex_primary_refire 1.25 +set g_balance_nex_primary_refire 1 set g_balance_nex_primary_animtime 0.75 set g_balance_nex_primary_ammo 5 -set g_balance_nex_primary_damagefalloff_mindist 0 -set g_balance_nex_primary_damagefalloff_maxdist 4000 +set g_balance_nex_primary_damagefalloff_mindist 500 +set g_balance_nex_primary_damagefalloff_maxdist 4500 set g_balance_nex_primary_damagefalloff_halflife 2000 set g_balance_nex_primary_damagefalloff_forcehalflife 2000 set g_balance_nex_secondary 1 -set g_balance_nex_secondary_damage 80 +set g_balance_nex_secondary_damage 125 set g_balance_nex_secondary_force -500 -set g_balance_nex_secondary_refire 1.25 +set g_balance_nex_secondary_refire 1 set g_balance_nex_secondary_animtime 0.75 set g_balance_nex_secondary_ammo 5 -set g_balance_nex_secondary_damagefalloff_mindist 0 -set g_balance_nex_secondary_damagefalloff_maxdist 4000 +set g_balance_nex_secondary_damagefalloff_mindist 500 +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_minspeed 400 +set g_balance_nex_velocitydependent_minspeed 1000 // }}} // {{{ minstanex set g_balance_minstanex_refire 1.25 diff --git a/qcsrc/server/w_nex.qc b/qcsrc/server/w_nex.qc index a6ec07d6a..b5eacda72 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; + float mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, myammo, myvel; if(issecondary) { mydmg = cvar("g_balance_nex_secondary_damage"); @@ -43,6 +43,18 @@ 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); + + if(myvel < cvar("g_balance_nex_velocitydependent_minspeed")) + 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 *= cvar("g_balance_nex_velocitydependent_maxspeed") / myvel; + myforce *= cvar("g_balance_nex_velocitydependent_maxspeed") / myvel; + } + W_SetupShot (self, TRUE, 5, "weapons/nexfire.wav", mydmg); yoda = 0; -- 2.39.2