also add jointime parameter
authorRudolf Polzer <divverent@alientrap.org>
Thu, 11 Nov 2010 21:52:16 +0000 (22:52 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Thu, 11 Nov 2010 21:52:16 +0000 (22:52 +0100)
balance25.cfg
balanceLeeStricklin.cfg
balanceNexSVN.cfg
balanceSamual.cfg
balanceTest.cfg
balanceXonotic.cfg
balancetZork.cfg
qcsrc/server/w_crylink.qc

index 4a32553..dbf2c8e 100644 (file)
@@ -394,6 +394,7 @@ set g_balance_crylink_primary_animtime 0.3
 set g_balance_crylink_primary_ammo 2
 set g_balance_crylink_primary_bouncedamagefactor 0.5
 set g_balance_crylink_primary_joinspeed 0
+set g_balance_crylink_primary_jointime 0
 set g_balance_crylink_primary_linkexplode 1
 
 set g_balance_crylink_primary_middle_lifetime 5 // range: 35000 full, fades to 70000
@@ -415,6 +416,7 @@ set g_balance_crylink_secondary_animtime 0.3
 set g_balance_crylink_secondary_ammo 2
 set g_balance_crylink_secondary_bouncedamagefactor 0.5
 set g_balance_crylink_secondary_joinspeed 0
+set g_balance_crylink_secondary_jointime 0
 set g_balance_crylink_secondary_linkexplode 1
 
 set g_balance_crylink_secondary_middle_lifetime 5 // range: 35000 full, fades to 70000
index 353286f..fa2c255 100644 (file)
@@ -405,6 +405,7 @@ set g_balance_crylink_primary_animtime 0.30008
 set g_balance_crylink_primary_ammo 3
 set g_balance_crylink_primary_bouncedamagefactor 0.2
 set g_balance_crylink_primary_joinspeed 0
+set g_balance_crylink_primary_jointime 0
 set g_balance_crylink_primary_linkexplode 1
 
 set g_balance_crylink_primary_middle_lifetime 5 // range: 10000 full, fades to 20000
@@ -426,6 +427,7 @@ set g_balance_crylink_secondary_animtime 0.3
 set g_balance_crylink_secondary_ammo 3
 set g_balance_crylink_secondary_bouncedamagefactor 0.5
 set g_balance_crylink_secondary_joinspeed 0
+set g_balance_crylink_secondary_jointime 0
 set g_balance_crylink_secondary_linkexplode 1
 
 set g_balance_crylink_secondary_middle_lifetime 5 // range: 10000 full, fades to 10000
index 3b30bd7..cd8cb05 100644 (file)
@@ -393,6 +393,7 @@ set g_balance_crylink_primary_animtime 0.3
 set g_balance_crylink_primary_ammo 2
 set g_balance_crylink_primary_bouncedamagefactor 0.5
 set g_balance_crylink_primary_joinspeed 0
+set g_balance_crylink_primary_jointime 0
 set g_balance_crylink_primary_linkexplode 1
 
 set g_balance_crylink_primary_middle_lifetime 5 // range: 35000 full, fades to 70000
@@ -414,6 +415,7 @@ set g_balance_crylink_secondary_animtime 0.3
 set g_balance_crylink_secondary_ammo 2
 set g_balance_crylink_secondary_bouncedamagefactor 0.5
 set g_balance_crylink_secondary_joinspeed 0
+set g_balance_crylink_secondary_jointime 0
 set g_balance_crylink_secondary_linkexplode 1
 
 set g_balance_crylink_secondary_middle_lifetime 5 // range: 35000 full, fades to 70000
index e33f740..94ec262 100644 (file)
@@ -394,6 +394,7 @@ set g_balance_crylink_primary_animtime 0.3
 set g_balance_crylink_primary_ammo 2
 set g_balance_crylink_primary_bouncedamagefactor 0.5
 set g_balance_crylink_primary_joinspeed 0
+set g_balance_crylink_primary_jointime 0
 set g_balance_crylink_primary_linkexplode 1
 
 set g_balance_crylink_primary_middle_lifetime 5 // range: 35000 full, fades to 70000
@@ -415,6 +416,7 @@ set g_balance_crylink_secondary_animtime 0.1
 set g_balance_crylink_secondary_ammo 2
 set g_balance_crylink_secondary_bouncedamagefactor 0.5
 set g_balance_crylink_secondary_joinspeed 0
+set g_balance_crylink_secondary_jointime 0
 set g_balance_crylink_secondary_linkexplode 1
 
 set g_balance_crylink_secondary_middle_lifetime 5 // range: 35000 full, fades to 70000
index c75500c..37cc8be 100644 (file)
@@ -394,6 +394,7 @@ set g_balance_crylink_primary_animtime 0.4
 set g_balance_crylink_primary_ammo 2
 set g_balance_crylink_primary_bouncedamagefactor 0.2
 set g_balance_crylink_primary_joinspeed 250
+set g_balance_crylink_primary_jointime 0
 set g_balance_crylink_primary_linkexplode 0
 
 set g_balance_crylink_primary_middle_lifetime 5 // range: 10000 full, fades to 20000
@@ -415,6 +416,7 @@ set g_balance_crylink_secondary_animtime 0.15
 set g_balance_crylink_secondary_ammo 1
 set g_balance_crylink_secondary_bouncedamagefactor 0.5
 set g_balance_crylink_secondary_joinspeed 250
+set g_balance_crylink_secondary_jointime 0
 set g_balance_crylink_secondary_linkexplode 0
 
 set g_balance_crylink_secondary_middle_lifetime 5 // range: 10000 full, fades to 10000
index 6205fb1..2b2c16e 100644 (file)
@@ -394,6 +394,7 @@ set g_balance_crylink_primary_animtime 0.4
 set g_balance_crylink_primary_ammo 2
 set g_balance_crylink_primary_bouncedamagefactor 0.2
 set g_balance_crylink_primary_joinspeed 250
+set g_balance_crylink_primary_jointime 0
 set g_balance_crylink_primary_linkexplode 0
 
 set g_balance_crylink_primary_middle_lifetime 5 // range: 10000 full, fades to 20000
@@ -415,6 +416,7 @@ set g_balance_crylink_secondary_animtime 0.15
 set g_balance_crylink_secondary_ammo 1
 set g_balance_crylink_secondary_bouncedamagefactor 0.5
 set g_balance_crylink_secondary_joinspeed 0
+set g_balance_crylink_secondary_jointime 0
 set g_balance_crylink_secondary_linkexplode 1
 
 set g_balance_crylink_secondary_middle_lifetime 5 // range: 10000 full, fades to 10000
index e3fd4d5..56ea71c 100644 (file)
@@ -395,6 +395,7 @@ set g_balance_crylink_primary_animtime 0.4
 set g_balance_crylink_primary_ammo 2
 set g_balance_crylink_primary_bouncedamagefactor 0.2
 set g_balance_crylink_primary_joinspeed 0
+set g_balance_crylink_primary_jointime 0
 set g_balance_crylink_secondary_linkexplode 1
 
 set g_balance_crylink_primary_middle_lifetime 5 // range: 10000 full, fades to 20000
@@ -416,6 +417,7 @@ set g_balance_crylink_secondary_animtime 0.15
 set g_balance_crylink_secondary_ammo 1
 set g_balance_crylink_secondary_bouncedamagefactor 0.5
 set g_balance_crylink_secondary_joinspeed 0
+set g_balance_crylink_secondary_jointime 0
 set g_balance_crylink_primary_linkexplode 1
 
 set g_balance_crylink_secondary_middle_lifetime 5 // range: 10000 full, fades to 10000
index bd0ae4e..2dcd433 100644 (file)
@@ -44,8 +44,10 @@ void W_Crylink_LinkExplode (entity e, entity e2)
 // stored in w_crylink_linkjoin_time.
 // could possibly network this origin and time, and display a special particle
 // effect when projectiles meet there :P
+// jspeed: MINIMUM jing speed
+// jtime: MAXIMUM jing time (0: none)
 float w_crylink_linkjoin_time;
-vector W_Crylink_LinkJoin(entity e, float joinspeed)
+vector W_Crylink_LinkJoin(entity e, float jspeed, float jtime)
 {
        vector avg_origin, avg_velocity;
        vector targ_origin;
@@ -79,7 +81,7 @@ vector W_Crylink_LinkJoin(entity e, float joinspeed)
        if(avg_dist == 0)
                return avg_origin; // no change needed
 
-       if(joinspeed == 0)
+       if(jspeed == 0 && jtime == 0)
        {
                e.velocity = avg_velocity;
                UpdateCSQCProjectile(e);
@@ -91,27 +93,33 @@ vector W_Crylink_LinkJoin(entity e, float joinspeed)
        }
        else
        {
-               w_crylink_linkjoin_time = avg_dist / joinspeed;
+               if(jtime)
+               {
+                       if(jspeed)
+                               w_crylink_linkjoin_time = min(jtime, avg_dist / jspeed);
+                       else
+                               w_crylink_linkjoin_time = jtime;
+               }
                targ_origin = avg_origin + w_crylink_linkjoin_time * avg_velocity;
 
-               e.velocity = (targ_origin - e.origin) * (joinspeed / avg_dist);
+               e.velocity = (targ_origin - e.origin) * (1.0 / w_crylink_linkjoin_time);
                UpdateCSQCProjectile(e);
                for(p = e; (p = p.queuenext) != e; )
                {
-                       p.velocity = WarpZone_RefSys_TransformVelocity(e, p, (targ_origin - WarpZone_RefSys_TransformOrigin(p, e, p.origin)) * (joinspeed / avg_dist));
+                       p.velocity = WarpZone_RefSys_TransformVelocity(e, p, (targ_origin - WarpZone_RefSys_TransformOrigin(p, e, p.origin)) * (1.0 / w_crylink_linkjoin_time));
                        UpdateCSQCProjectile(p);
                }
 
                // analysis:
-               //   joinspeed -> +infinity:
+               //   jspeed -> +infinity:
                //      w_crylink_linkjoin_time -> +0
                //      targ_origin -> avg_origin
                //      p->velocity -> HUEG towards center
-               //   joinspeed -> 0:
+               //   jspeed -> 0:
                //      w_crylink_linkjoin_time -> +/- infinity
                //      targ_origin -> avg_velocity * +/- infinity
                //      p->velocity -> avg_velocity
-               //   joinspeed -> -infinity:
+               //   jspeed -> -infinity:
                //      w_crylink_linkjoin_time -> -0
                //      targ_origin -> avg_origin
                //      p->velocity -> HUEG away from center
@@ -468,11 +476,11 @@ float w_crylink(float req)
                                        vector pos;
                                        if(self.crylink_waitrelease == 1)
                                        {
-                                               pos = W_Crylink_LinkJoin(self.crylink_lastgroup, cvar("g_balance_crylink_primary_joinspeed"));
+                                               pos = W_Crylink_LinkJoin(self.crylink_lastgroup, cvar("g_balance_crylink_primary_joinspeed"), cvar("g_balance_crylink_primary_jointime"));
                                        }
                                        else
                                        {
-                                               pos = W_Crylink_LinkJoin(self.crylink_lastgroup, cvar("g_balance_crylink_secondary_joinspeed"));
+                                               pos = W_Crylink_LinkJoin(self.crylink_lastgroup, cvar("g_balance_crylink_secondary_joinspeed"), cvar("g_balance_crylink_secondary_jointime"));
                                        }
 
                                        entity linkjoineffect;