From: Rudolf Polzer Date: Thu, 11 Nov 2010 21:52:16 +0000 (+0100) Subject: also add jointime parameter X-Git-Tag: xonotic-v0.1.0preview~158 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b46e83ce5d0d3275d24ad072029f4ff35edcb14d;p=xonotic%2Fxonotic-data.pk3dir.git also add jointime parameter --- diff --git a/balance25.cfg b/balance25.cfg index 4a32553ef..dbf2c8ea1 100644 --- a/balance25.cfg +++ b/balance25.cfg @@ -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 diff --git a/balanceLeeStricklin.cfg b/balanceLeeStricklin.cfg index 353286f5c..fa2c255a3 100644 --- a/balanceLeeStricklin.cfg +++ b/balanceLeeStricklin.cfg @@ -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 diff --git a/balanceNexSVN.cfg b/balanceNexSVN.cfg index 3b30bd768..cd8cb05d5 100644 --- a/balanceNexSVN.cfg +++ b/balanceNexSVN.cfg @@ -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 diff --git a/balanceSamual.cfg b/balanceSamual.cfg index e33f740b2..94ec26279 100644 --- a/balanceSamual.cfg +++ b/balanceSamual.cfg @@ -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 diff --git a/balanceTest.cfg b/balanceTest.cfg index c75500c44..37cc8be55 100644 --- a/balanceTest.cfg +++ b/balanceTest.cfg @@ -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 diff --git a/balanceXonotic.cfg b/balanceXonotic.cfg index 6205fb1fc..2b2c16e66 100644 --- a/balanceXonotic.cfg +++ b/balanceXonotic.cfg @@ -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 diff --git a/balancetZork.cfg b/balancetZork.cfg index e3fd4d5d1..56ea71c18 100644 --- a/balancetZork.cfg +++ b/balancetZork.cfg @@ -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 diff --git a/qcsrc/server/w_crylink.qc b/qcsrc/server/w_crylink.qc index bd0ae4e79..2dcd433c7 100644 --- a/qcsrc/server/w_crylink.qc +++ b/qcsrc/server/w_crylink.qc @@ -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;