additionally to zscale, also add a velocitybias (biases the laser push to your curren...
authorRudolf Polzer <divverent@alientrap.org>
Sat, 6 Nov 2010 21:38:04 +0000 (22:38 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Sat, 6 Nov 2010 21:38:04 +0000 (22:38 +0100)
balance25.cfg
balanceLeeStricklin.cfg
balanceNexSVN.cfg
balanceSamual.cfg
balanceTest.cfg
balanceXonotic.cfg
balancetZork.cfg
qcsrc/server/g_damage.qc

index 5db0f0ddbc91aa265d14d4bb50b51769572594b0..673f08ab74348d2590880b15c6e4b5bbe5642faf 100644 (file)
@@ -224,6 +224,8 @@ set g_balance_laser_primary_lifetime 30
 set g_balance_laser_primary_shotangle 0
 set g_balance_laser_primary_delay 0
 set g_balance_laser_primary_gauntlet 0
+set g_balance_laser_primary_force_zscale 1
+set g_balance_laser_primary_force_velocitybias 0
 set g_balance_laser_secondary 0 // when 1, a secondary laser mode exists
 set g_balance_laser_secondary_damage 35
 set g_balance_laser_secondary_edgedamage 10
@@ -237,7 +239,8 @@ set g_balance_laser_secondary_lifetime 30
 set g_balance_laser_secondary_shotangle 0
 set g_balance_laser_secondary_delay 0
 set g_balance_laser_secondary_gauntlet 0
-set g_balance_laser_force_zscale 0
+set g_balance_laser_secondary_force_zscale 1
+set g_balance_laser_secondary_force_velocitybias 0
 // }}}
 // {{{ shotgun
 set g_balance_shotgun_primary_bullets 6
index 593aa2d05d8d8a2465748bffbd1e920941c249f3..e56a0c9d6e5a755f707054b628e5b4834509f169 100644 (file)
@@ -235,6 +235,8 @@ set g_balance_laser_primary_lifetime 30
 set g_balance_laser_primary_shotangle 0
 set g_balance_laser_primary_delay 0.03
 set g_balance_laser_primary_gauntlet 0
+set g_balance_laser_primary_force_zscale 1
+set g_balance_laser_primary_force_velocitybias 0
 set g_balance_laser_secondary 0 // when 1, a secondary laser mode exists
 set g_balance_laser_secondary_damage 25
 set g_balance_laser_secondary_edgedamage 10
@@ -248,7 +250,8 @@ set g_balance_laser_secondary_lifetime 30
 set g_balance_laser_secondary_shotangle -90
 set g_balance_laser_secondary_delay 0
 set g_balance_laser_secondary_gauntlet 0
-set g_balance_laser_force_zscale 0
+set g_balance_laser_secondary_force_zscale 1
+set g_balance_laser_secondary_force_velocitybias 0
 // }}}
 // {{{ shotgun
 set g_balance_shotgun_primary_bullets 5
index 54e4b823ca52ab7d8db084ebb7713d5caf6a2cd9..80049f339617f49a067af0065029d0ffbf32f4e5 100644 (file)
@@ -224,6 +224,8 @@ set g_balance_laser_primary_lifetime 30
 set g_balance_laser_primary_shotangle 0
 set g_balance_laser_primary_delay 0.03
 set g_balance_laser_primary_gauntlet 0
+set g_balance_laser_primary_force_zscale 1
+set g_balance_laser_primary_force_velocitybias 0
 set g_balance_laser_secondary 0 // when 1, a secondary laser mode exists
 set g_balance_laser_secondary_damage 35
 set g_balance_laser_secondary_edgedamage 10
@@ -237,7 +239,8 @@ set g_balance_laser_secondary_lifetime 30
 set g_balance_laser_secondary_shotangle 0
 set g_balance_laser_secondary_delay 0
 set g_balance_laser_secondary_gauntlet 0
-set g_balance_laser_force_zscale 0
+set g_balance_laser_secondary_force_zscale 1
+set g_balance_laser_secondary_force_velocitybias 0
 // }}
 // {{{ shotgun
 set g_balance_shotgun_primary_bullets 6
index 55c00c6ff23c1cfa6094584393da462f7d3b8459..f9f04722cb8143c3656aedba56a1797661d98b35 100644 (file)
@@ -224,6 +224,8 @@ set g_balance_laser_primary_lifetime 30
 set g_balance_laser_primary_shotangle 0
 set g_balance_laser_primary_delay 0.03
 set g_balance_laser_primary_gauntlet 0
+set g_balance_laser_primary_force_zscale 1
+set g_balance_laser_primary_force_velocitybias 0
 set g_balance_laser_secondary 0 // when 1, a secondary laser mode exists
 set g_balance_laser_secondary_damage 25
 set g_balance_laser_secondary_edgedamage 10
@@ -237,7 +239,8 @@ set g_balance_laser_secondary_lifetime 30
 set g_balance_laser_secondary_shotangle -90
 set g_balance_laser_secondary_delay 0
 set g_balance_laser_secondary_gauntlet 0
-set g_balance_laser_force_zscale 0
+set g_balance_laser_secondary_force_zscale 1
+set g_balance_laser_secondary_force_velocitybias 0
 // }}}
 // {{{ shotgun
 set g_balance_shotgun_primary_bullets 6
index 0006eb704177d82e3c86365da7bd30ff50ae5879..a6e66c8d8b93e58c49137e5491ef63a7ccd8b134 100644 (file)
@@ -224,6 +224,8 @@ set g_balance_laser_primary_lifetime 5
 set g_balance_laser_primary_shotangle 0
 set g_balance_laser_primary_delay 0
 set g_balance_laser_primary_gauntlet 0
+set g_balance_laser_primary_force_zscale 1
+set g_balance_laser_primary_force_velocitybias 0.25
 set g_balance_laser_secondary 0 // when 1, a secondary laser mode exists
 set g_balance_laser_secondary_damage 35
 set g_balance_laser_secondary_edgedamage 10
@@ -237,7 +239,8 @@ set g_balance_laser_secondary_lifetime 30
 set g_balance_laser_secondary_shotangle 0
 set g_balance_laser_secondary_delay 0
 set g_balance_laser_secondary_gauntlet 0
-set g_balance_laser_force_zscale 0
+set g_balance_laser_secondary_force_zscale 1
+set g_balance_laser_secondary_force_velocitybias 0.25
 // }}}
 // {{{ shotgun
 set g_balance_shotgun_primary_bullets 10
index 96a46ecb2ab9487edcb8a3bfcd2624c96a2dfb2f..7f9a843cee2f061728de464257bf37f0cb9ee734 100644 (file)
@@ -224,6 +224,8 @@ set g_balance_laser_primary_lifetime 5
 set g_balance_laser_primary_shotangle 0
 set g_balance_laser_primary_delay 0
 set g_balance_laser_primary_gauntlet 0
+set g_balance_laser_primary_zscale 1.25
+set g_balance_laser_primary_velocitybias 0
 set g_balance_laser_secondary 0 // when 1, a secondary laser mode exists
 set g_balance_laser_secondary_damage 200 // dps
 set g_balance_laser_secondary_edgedamage 0
@@ -237,7 +239,8 @@ set g_balance_laser_secondary_lifetime 0
 set g_balance_laser_secondary_shotangle 0
 set g_balance_laser_secondary_delay 0
 set g_balance_laser_secondary_gauntlet 1
-set g_balance_laser_force_zscale 1.25
+set g_balance_laser_secondary_zscale 1.25
+set g_balance_laser_secondary_velocitybias 0
 // }}}
 // {{{ shotgun
 set g_balance_shotgun_primary_bullets 20
index 942984786e277bfeaab84daefd6096c799244234..38b77306f2257e103d7fa7bc2fec6745c58bb8bd 100644 (file)
@@ -224,6 +224,8 @@ set g_balance_laser_primary_lifetime 5
 set g_balance_laser_primary_shotangle 0
 set g_balance_laser_primary_delay 0
 set g_balance_laser_primary_gauntlet 0
+set g_balance_laser_primary_force_zscale 1
+set g_balance_laser_primary_force_velocitybias 0
 set g_balance_laser_secondary 0 // when 1, a secondary laser mode exists
 set g_balance_laser_secondary_damage 35
 set g_balance_laser_secondary_edgedamage 10
@@ -237,7 +239,8 @@ set g_balance_laser_secondary_lifetime 30
 set g_balance_laser_secondary_shotangle 0
 set g_balance_laser_secondary_delay 0
 set g_balance_laser_secondary_gauntlet 0
-set g_balance_laser_force_zscale 0
+set g_balance_laser_secondary_force_zscale 1
+set g_balance_laser_secondary_force_velocitybias 0
 // }}}
 // {{{ shotgun
 set g_balance_shotgun_primary_bullets 10
index ef0224264ffd0bf74a109118ba852526f7809b77..1246d2681cebedb8775c03fee96cd48898337b55 100644 (file)
@@ -994,8 +994,37 @@ float RadiusDamage (entity inflictor, entity attacker, float coredamage, float e
                                                a = bound(0, tfloorforce + (1-tfloorforce) * hitratio, 1);
                                                force = force * a;
 
-                                               if(deathtype == WEP_LASER && cvar("g_balance_laser_force_zscale")) // scale laser push force on the z-axis
-                                                       force_z = force_z * cvar("g_balance_laser_force_zscale");
+                                               // laser force adjustments :P
+                                               if(DEATH_WEAPONOF(deathtype) == WEP_LASER)
+                                               {
+                                                       vector vel;
+
+                                                       float force_zscale;
+                                                       float force_velocitybiasramp;
+                                                       float force_velocitybias;
+
+                                                       force_velocitybiasramp = cvar("sv_maxspeed");
+                                                       if(deathtype & HITTYPE_SECONDARY)
+                                                       {
+                                                               force_zscale = cvar("g_balance_laser_secondary_force_zscale");
+                                                               force_velocitybias = cvar("g_balance_laser_secondary_force_velocitybias");
+                                                       }
+                                                       else
+                                                       {
+                                                               force_zscale = cvar("g_balance_laser_primary_force_zscale");
+                                                               force_velocitybias = cvar("g_balance_laser_primary_force_velocitybias");
+                                                       }
+
+                                                       vel = targ.velocity;
+                                                       vel_z = 0;
+                                                       vel = normalize(vel) * bound(0, vlen(vel) / force_velocitybiasramp, 1) * force_velocitybias;
+                                                       force =
+                                                               vlen(force)
+                                                               *
+                                                               normalize(normalize(force) + vel);
+
+                                                       force_z *= force_zscale;
+                                               }
 
                                                //if (targ == attacker)
                                                //{