change speed_up_zonly to an extra speed_z variable
authordiv0 <div0@f962a42d-fe04-0410-a3ab-8c8b0445ebaa>
Tue, 2 Mar 2010 08:28:32 +0000 (08:28 +0000)
committerdiv0 <div0@f962a42d-fe04-0410-a3ab-8c8b0445ebaa>
Tue, 2 Mar 2010 08:28:32 +0000 (08:28 +0000)
git-svn-id: svn://svn.icculus.org/nexuiz/trunk@8735 f962a42d-fe04-0410-a3ab-8c8b0445ebaa

data/balance.cfg
data/balance25.cfg
data/balanceHavoc.cfg
data/balanceNexrun.cfg
data/balanceSamual.cfg
data/qcsrc/server/cl_weaponsystem.qc
data/qcsrc/server/g_hook.qc
data/qcsrc/server/w_common.qc
data/qcsrc/server/w_crylink.qc
data/qcsrc/server/w_grenadelauncher.qc

index 6651d70..670f866 100644 (file)
@@ -289,6 +289,7 @@ set g_balance_grenadelauncher_primary_force 400
 set g_balance_grenadelauncher_primary_radius 140
 set g_balance_grenadelauncher_primary_speed 2200
 set g_balance_grenadelauncher_primary_speed_up 220
+set g_balance_grenadelauncher_primary_speed_z 0
 set g_balance_grenadelauncher_primary_spread 0
 set g_balance_grenadelauncher_primary_lifetime 30
 set g_balance_grenadelauncher_primary_refire 0.8
@@ -300,7 +301,7 @@ set g_balance_grenadelauncher_secondary_force 400
 set g_balance_grenadelauncher_secondary_radius 140
 set g_balance_grenadelauncher_secondary_speed 1400
 set g_balance_grenadelauncher_secondary_speed_up 150
-set g_balance_grenadelauncher_secondary_speed_up_zonly 0
+set g_balance_grenadelauncher_secondary_speed_z 0
 set g_balance_grenadelauncher_secondary_spread 0
 set g_balance_grenadelauncher_secondary_lifetime 1
 set g_balance_grenadelauncher_secondary_refire 0.7
@@ -329,6 +330,7 @@ set g_balance_electro_secondary_force 200
 set g_balance_electro_secondary_radius 150
 set g_balance_electro_secondary_speed 900
 set g_balance_electro_secondary_speed_up 200
+set g_balance_electro_secondary_speed_z 0
 set g_balance_electro_secondary_spread 0
 set g_balance_electro_secondary_lifetime 2.5
 set g_balance_electro_secondary_refire 0.2
@@ -564,6 +566,7 @@ set g_balance_fireball_primary_lifetime 7
 set g_balance_fireball_primary_refire 2
 set g_balance_fireball_primary_speed 900
 set g_balance_fireball_primary_speed_up 100
+set g_balance_fireball_primary_speed_z 0
 set g_balance_fireball_primary_spread 0
 set g_balance_fireball_secondary_ammo 25
 set g_balance_fireball_secondary_animtime 0.15
index 9563df9..5323852 100644 (file)
@@ -288,6 +288,7 @@ set g_balance_grenadelauncher_primary_force 400
 set g_balance_grenadelauncher_primary_radius 140
 set g_balance_grenadelauncher_primary_speed 2000
 set g_balance_grenadelauncher_primary_speed_up 200
+set g_balance_grenadelauncher_primary_speed_z 0
 set g_balance_grenadelauncher_primary_spread 0
 set g_balance_grenadelauncher_primary_lifetime 30
 set g_balance_grenadelauncher_primary_refire 0.8
@@ -299,7 +300,7 @@ set g_balance_grenadelauncher_secondary_force 400
 set g_balance_grenadelauncher_secondary_radius 140
 set g_balance_grenadelauncher_secondary_speed 1400
 set g_balance_grenadelauncher_secondary_speed_up 200
-set g_balance_grenadelauncher_secondary_speed_up_zonly 0
+set g_balance_grenadelauncher_secondary_speed_z 0
 set g_balance_grenadelauncher_secondary_spread 0
 set g_balance_grenadelauncher_secondary_lifetime 2.5
 set g_balance_grenadelauncher_secondary_refire 0.7
@@ -328,6 +329,7 @@ set g_balance_electro_secondary_force 200
 set g_balance_electro_secondary_radius 150
 set g_balance_electro_secondary_speed 900
 set g_balance_electro_secondary_speed_up 200
+set g_balance_electro_secondary_speed_z 0
 set g_balance_electro_secondary_spread 0
 set g_balance_electro_secondary_lifetime 5
 set g_balance_electro_secondary_refire 0.3
@@ -563,6 +565,7 @@ set g_balance_fireball_primary_lifetime 7
 set g_balance_fireball_primary_refire 1.5
 set g_balance_fireball_primary_speed 700
 set g_balance_fireball_primary_speed_up 100
+set g_balance_fireball_primary_speed_z 0
 set g_balance_fireball_primary_spread 0
 set g_balance_fireball_secondary_ammo 15
 set g_balance_fireball_secondary_animtime 0.15
index 36ccc96..1364768 100644 (file)
@@ -288,6 +288,7 @@ set g_balance_grenadelauncher_primary_force 400
 set g_balance_grenadelauncher_primary_radius 140
 set g_balance_grenadelauncher_primary_speed 2000
 set g_balance_grenadelauncher_primary_speed_up 200
+set g_balance_grenadelauncher_primary_speed_z 0
 set g_balance_grenadelauncher_primary_spread 0
 set g_balance_grenadelauncher_primary_lifetime 30
 set g_balance_grenadelauncher_primary_refire 0.8
@@ -299,7 +300,7 @@ set g_balance_grenadelauncher_secondary_force 400
 set g_balance_grenadelauncher_secondary_radius 140
 set g_balance_grenadelauncher_secondary_speed 1400
 set g_balance_grenadelauncher_secondary_speed_up 200
-set g_balance_grenadelauncher_secondary_speed_up_zonly 0
+set g_balance_grenadelauncher_secondary_speed_z 0
 set g_balance_grenadelauncher_secondary_spread 0
 set g_balance_grenadelauncher_secondary_lifetime 0.3
 set g_balance_grenadelauncher_secondary_refire 1
@@ -328,6 +329,7 @@ set g_balance_electro_secondary_force 200
 set g_balance_electro_secondary_radius 90
 set g_balance_electro_secondary_speed 900
 set g_balance_electro_secondary_speed_up 200
+set g_balance_electro_secondary_speed_z 0
 set g_balance_electro_secondary_spread 0
 set g_balance_electro_secondary_lifetime 1
 set g_balance_electro_secondary_refire 0.3
@@ -563,6 +565,7 @@ set g_balance_fireball_primary_lifetime 4.5
 set g_balance_fireball_primary_refire 1.5
 set g_balance_fireball_primary_speed 700
 set g_balance_fireball_primary_speed_up 100
+set g_balance_fireball_primary_speed_z 0
 set g_balance_fireball_primary_spread 0
 set g_balance_fireball_secondary_ammo 15
 set g_balance_fireball_secondary_animtime 0.15
index 26e151d..a7f7dfe 100644 (file)
@@ -289,6 +289,7 @@ set g_balance_grenadelauncher_primary_force 250
 set g_balance_grenadelauncher_primary_radius 100
 set g_balance_grenadelauncher_primary_speed 2000
 set g_balance_grenadelauncher_primary_speed_up 200
+set g_balance_grenadelauncher_primary_speed_z 0
 set g_balance_grenadelauncher_primary_spread 0
 set g_balance_grenadelauncher_primary_lifetime 5
 set g_balance_grenadelauncher_primary_refire 0.7
@@ -299,8 +300,8 @@ set g_balance_grenadelauncher_secondary_edgedamage 10
 set g_balance_grenadelauncher_secondary_force 300
 set g_balance_grenadelauncher_secondary_radius 200
 set g_balance_grenadelauncher_secondary_speed 800
-set g_balance_grenadelauncher_secondary_speed_up 200
-set g_balance_grenadelauncher_secondary_speed_up_zonly 1
+set g_balance_grenadelauncher_secondary_speed_up 0
+set g_balance_grenadelauncher_secondary_speed_z 200
 set g_balance_grenadelauncher_secondary_spread 0
 set g_balance_grenadelauncher_secondary_lifetime 2
 set g_balance_grenadelauncher_secondary_refire 0.8
@@ -329,6 +330,7 @@ set g_balance_electro_secondary_force 100
 set g_balance_electro_secondary_radius 150
 set g_balance_electro_secondary_speed 900
 set g_balance_electro_secondary_speed_up 200
+set g_balance_electro_secondary_speed_z 0
 set g_balance_electro_secondary_spread 0.05
 set g_balance_electro_secondary_lifetime 2.5
 set g_balance_electro_secondary_refire 0.1
@@ -565,6 +567,7 @@ set g_balance_fireball_primary_refire 2
 set g_balance_fireball_primary_speed 900
 set g_balance_fireball_primary_spread 0
 set g_balance_fireball_primary_speed_up 100
+set g_balance_fireball_primary_speed_z 0
 set g_balance_fireball_secondary_ammo 25
 set g_balance_fireball_secondary_animtime 0.15
 set g_balance_fireball_secondary_bfgdamage 100
index 2a42a52..814f254 100644 (file)
@@ -289,6 +289,7 @@ set g_balance_grenadelauncher_primary_force 400
 set g_balance_grenadelauncher_primary_radius 140
 set g_balance_grenadelauncher_primary_speed 2200
 set g_balance_grenadelauncher_primary_speed_up 220
+set g_balance_grenadelauncher_primary_speed_z 0
 set g_balance_grenadelauncher_primary_spread 0
 set g_balance_grenadelauncher_primary_lifetime 30
 set g_balance_grenadelauncher_primary_refire 0.8
@@ -300,7 +301,7 @@ set g_balance_grenadelauncher_secondary_force 400
 set g_balance_grenadelauncher_secondary_radius 140
 set g_balance_grenadelauncher_secondary_speed 1400
 set g_balance_grenadelauncher_secondary_speed_up 150
-set g_balance_grenadelauncher_secondary_speed_up_zonly 0
+set g_balance_grenadelauncher_secondary_speed_z 0
 set g_balance_grenadelauncher_secondary_spread 0
 set g_balance_grenadelauncher_secondary_lifetime 1
 set g_balance_grenadelauncher_secondary_refire 0.7
@@ -329,6 +330,7 @@ set g_balance_electro_secondary_force 200
 set g_balance_electro_secondary_radius 150
 set g_balance_electro_secondary_speed 900
 set g_balance_electro_secondary_speed_up 200
+set g_balance_electro_secondary_speed_z 0
 set g_balance_electro_secondary_spread 0
 set g_balance_electro_secondary_lifetime 2.5
 set g_balance_electro_secondary_refire 0.2
@@ -564,6 +566,7 @@ set g_balance_fireball_primary_lifetime 7
 set g_balance_fireball_primary_refire 2
 set g_balance_fireball_primary_speed 900
 set g_balance_fireball_primary_speed_up 100
+set g_balance_fireball_primary_speed_z 0
 set g_balance_fireball_primary_spread 0
 set g_balance_fireball_secondary_ammo 25
 set g_balance_fireball_secondary_animtime 0.15
index 93b8123..7e904a3 100644 (file)
@@ -1531,12 +1531,13 @@ float mspercallsum;
 float mspercallsstyle;
 float mspercallcount;
 #endif
-void W_SetupProjectileVelocityEx(entity missile, vector dir, vector upDir, float pSpeed, float pUpSpeed, float spread)
+void W_SetupProjectileVelocityEx(entity missile, vector dir, vector upDir, float pSpeed, float pUpSpeed, float pZSpeed, float spread)
 {
        if(missile.owner == world)
                error("Unowned missile");
 
        dir = dir + upDir * (pUpSpeed / pSpeed);
+       dir_z += pZSpeed / pSpeed;
        pSpeed *= vlen(dir);
        dir = normalize(dir);
 
@@ -1563,5 +1564,5 @@ void W_SetupProjectileVelocity(entity missile, float pSpeed, float spread)
        W_SetupProjectileVelocityEx(missile, w_shotdir, v_up, pSpeed, 0, spread);
 }
 
-#define W_SETUPPROJECTILEVELOCITY_UP(m,s) W_SetupProjectileVelocityEx(m, w_shotdir, v_up, cvar(#s "_speed"), cvar(#s "_speed_up"), cvar(#s "_spread"))
-#define W_SETUPPROJECTILEVELOCITY(m,s) W_SetupProjectileVelocityEx(m, w_shotdir, v_up, cvar(#s "_speed"), 0, cvar(#s "_spread"))
+#define W_SETUPPROJECTILEVELOCITY_UP(m,s) W_SetupProjectileVelocityEx(m, w_shotdir, v_up, cvar(#s "_speed"), cvar(#s "_speed_up"), cvar(#s "_speed_z"), cvar(#s "_spread"))
+#define W_SETUPPROJECTILEVELOCITY(m,s) W_SetupProjectileVelocityEx(m, w_shotdir, v_up, cvar(#s "_speed"), 0, 0, cvar(#s "_spread"))
index 0d1a7de..93f7ed9 100644 (file)
@@ -307,7 +307,7 @@ void FireGrapplingHook (void)
 
        missile.state = 0; // not latched onto anything
 
-       W_SetupProjectileVelocityEx(missile, v_forward, v_up, cvar("g_balance_grapplehook_speed_fly"), 0, 0);
+       W_SetupProjectileVelocityEx(missile, v_forward, v_up, cvar("g_balance_grapplehook_speed_fly"), 0, 0, 0);
 
        missile.angles = vectoangles (missile.velocity);
        //missile.glow_color = 250; // 244, 250
index 0f738ba..ec30752 100644 (file)
@@ -349,7 +349,7 @@ void fireBallisticBullet(vector start, vector dir, float spread, float pSpeed, f
                proj.movetype = MOVETYPE_FLY;
        proj.think = SUB_Remove;
        proj.nextthink = time + lifetime; // min(pLifetime, vlen(world.maxs - world.mins) / pSpeed);
-       W_SetupProjectileVelocityEx(proj, dir, v_up, pSpeed, 0, spread);
+       W_SetupProjectileVelocityEx(proj, dir, v_up, pSpeed, 0, 0, spread);
        proj.angles = vectoangles(proj.velocity);
        proj.dmg_radius = cvar("g_ballistics_materialconstant") / bulletconstant;
        // so: bulletconstant = bullet mass / area of bullet circle
index c3c5690..ba67686 100644 (file)
@@ -104,7 +104,7 @@ void W_Crylink_Attack (void)
                        s_z = v_forward_y;
                }
                s = s * cvar("g_balance_crylink_primary_spread") * g_weaponspreadfactor;
-               W_SetupProjectileVelocityEx(proj, w_shotdir + right * s_y + up * s_z, v_up, cvar("g_balance_crylink_primary_speed"), 0, 0);
+               W_SetupProjectileVelocityEx(proj, w_shotdir + right * s_y + up * s_z, v_up, cvar("g_balance_crylink_primary_speed"), 0, 0, 0);
                proj.touch = W_Crylink_Touch;
                if(counter == 0)
                        SUB_SetFade(proj, time + cvar("g_balance_crylink_primary_middle_lifetime"), cvar("g_balance_crylink_primary_middle_fadetime"));
@@ -155,7 +155,7 @@ void W_Crylink_Attack2 (void)
                setorigin (proj, w_shotorg);
                setsize(proj, '0 0 0', '0 0 0');
 
-               W_SetupProjectileVelocityEx(proj, (w_shotdir + (((counter + 0.5) / shots) * 2 - 1) * v_right * cvar("g_balance_crylink_secondary_spread") * g_weaponspreadfactor), v_up, cvar("g_balance_crylink_secondary_speed"), 0, 0);
+               W_SetupProjectileVelocityEx(proj, (w_shotdir + (((counter + 0.5) / shots) * 2 - 1) * v_right * cvar("g_balance_crylink_secondary_spread") * g_weaponspreadfactor), v_up, cvar("g_balance_crylink_secondary_speed"), 0, 0, 0);
                proj.touch = W_Crylink_Touch2;
                if(counter == (shots - 1) / 2)
                        SUB_SetFade(proj, time + cvar("g_balance_crylink_secondary_middle_lifetime"), cvar("g_balance_crylink_secondary_middle_fadetime"));
index 05f11d2..80b7020 100644 (file)
@@ -140,10 +140,7 @@ void W_Grenade_Attack2 (void)
        gren.health = cvar("g_balance_grenadelauncher_secondary_health");
        gren.damageforcescale = cvar("g_balance_grenadelauncher_secondary_damageforcescale");
        gren.event_damage = W_Grenade_Damage;
-       if(cvar("g_balance_grenadelauncher_secondary_speed_up_zonly"))
-               W_SetupProjectileVelocityEx(gren, w_shotdir, '0 0 1', cvar("g_balance_grenadelauncher_secondary_speed"), cvar("g_balance_grenadelauncher_secondary_speed_up"), cvar("g_balance_grenadelauncher_secondary_spread"));
-       else
-               W_SETUPPROJECTILEVELOCITY_UP(gren, g_balance_grenadelauncher_secondary);
+       W_SETUPPROJECTILEVELOCITY_UP(gren, g_balance_grenadelauncher_secondary);
 
        gren.angles = vectoangles (gren.velocity);
        gren.flags = FL_PROJECTILE;