velocity dependent nex damage and force
authorFruitieX <rasse@rasse-laptop.(none)>
Sat, 2 Oct 2010 18:03:56 +0000 (21:03 +0300)
committerFruitieX <rasse@rasse-laptop.(none)>
Sat, 2 Oct 2010 18:03:56 +0000 (21:03 +0300)
balance25.cfg
balanceLeeStricklin.cfg
balanceNexSVN.cfg
balanceSamual.cfg
balanceXonotic.cfg
qcsrc/server/w_nex.qc

index ec040c4cd321602e729398fde0deb57b903adb8a..899b7fc9bcf45e660a6a43dcb25da0685653e22d 100644 (file)
@@ -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
index 6df076b18b7baa4864766ddad4ec9cfcaf80c29e..23977eadf6c9cd376e0d40d5e32ab0d41ac0d6f8 100644 (file)
@@ -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
index 6c5a74655d5a26dab09ad8476b01ed06c388ffb8..e32819dc7f7430c6a7e1bc07a74fdad6935184f4 100644 (file)
@@ -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
index 17c3e1410587e6e09948741758c83a820f65c653..e1a6f7442cebcca70b3bcc38a0790b1cbb92e8bd 100644 (file)
@@ -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
index bffb0a64ee016ed07ad5d05d295dd711e1138632..e34a2472b30c63d1680d3fb95758729d3002ddb2 100644 (file)
@@ -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
index a6ec07d6a819791392f8716325d6556900668445..b5eacda72ab9dadab58463d62f9252105ba9e24f 100644 (file)
@@ -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;