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
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
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
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
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
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
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
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
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
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
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
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
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
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
// 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;
if(avg_dist == 0)
return avg_origin; // no change needed
- if(joinspeed == 0)
+ if(jspeed == 0 && jtime == 0)
{
e.velocity = avg_velocity;
UpdateCSQCProjectile(e);
}
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
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;