]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add an elasticity setting, beam "tightness"
authorSamual Lenks <samual@xonotic.org>
Wed, 19 Feb 2014 03:00:42 +0000 (22:00 -0500)
committerSamual Lenks <samual@xonotic.org>
Wed, 19 Feb 2014 03:00:42 +0000 (22:00 -0500)
bal-wep-xonotic.cfg
qcsrc/client/particles.qc
qcsrc/common/weapons/w_arc.qc

index a0b2fa94470f21e355ffd39805fe48e47760b038..04bc67fd37d631e32369d7dff1b5672e862f1bed 100644 (file)
@@ -259,6 +259,7 @@ set g_balance_arc_beam_nonplayerdamage 80
 set g_balance_arc_beam_range 1000
 set g_balance_arc_beam_refire 0.5
 set g_balance_arc_beam_returnspeed 8
+set g_balance_arc_beam_tightness 0.5
 set g_balance_arc_switchdelay_drop 0.3
 set g_balance_arc_switchdelay_raise 0.3
 set g_balance_arc_weaponreplace ""
index 07a88b9926e426c37c7ca97d5127495e696675c8..a139ae01fa5fa582dfdd3480b146a68571269b27 100644 (file)
@@ -377,6 +377,7 @@ void Net_ReadShockwaveParticle()
 .float beam_maxangle;
 .float beam_range;
 .float beam_returnspeed;
+.float beam_tightness;
 .vector beam_shotorigin;
 .vector beam_dir;
 void Draw_ArcBeam()
@@ -498,7 +499,7 @@ void Draw_ArcBeam()
        for(i = 1; i <= segments; ++i)
        {
                // calculate this on every segment to ensure that we always reach the full length of the attack
-               float segmentblend = (i/segments);
+               float segmentblend = bound(0, (i/segments) + self.beam_tightness, 1);
                float segmentdist = vlen(beam_endpos_estimate - last_origin) * (i/segments);
 
                vector new_dir = normalize( (wantdir * (1 - segmentblend)) + (normalize(beam_endpos_estimate - last_origin) * segmentblend) );
@@ -588,6 +589,7 @@ void Ent_ReadArcBeam(float isnew)
                self.beam_maxangle = ReadShort();
                self.beam_range = ReadCoord();
                self.beam_returnspeed = ReadShort();
+               self.beam_tightness = (ReadByte() / 10);
        }
 
        if(sf & 2) // starting location
index a8b0e08da083b0e0df8fc27ca60eb9ff3492cdeb..f7f9adc9c72429aa69e2eaa6cd04dbc58ebc2a38 100644 (file)
@@ -33,6 +33,7 @@ REGISTER_WEAPON(
        w_cvar(id, sn, NONE, beam_range) \
        w_cvar(id, sn, NONE, beam_refire) \
        w_cvar(id, sn, NONE, beam_returnspeed) \
+       w_cvar(id, sn, NONE, beam_tightness) \
        w_prop(id, sn, float,  switchdelay_raise, switchdelay_raise) \
        w_prop(id, sn, float,  switchdelay_drop, switchdelay_drop) \
        w_prop(id, sn, string, weaponreplace, weaponreplace) \
@@ -95,6 +96,7 @@ float W_Arc_Beam_Send(entity to, float sf)
                WriteShort(MSG_ENTITY, WEP_CVAR(arc, beam_maxangle));
                WriteCoord(MSG_ENTITY, WEP_CVAR(arc, beam_range));
                WriteShort(MSG_ENTITY, WEP_CVAR(arc, beam_returnspeed));
+               WriteByte(MSG_ENTITY, WEP_CVAR(arc, beam_tightness) * 10);
        }
        if(sf & 2) // starting location
        {
@@ -233,7 +235,7 @@ void W_Arc_Beam_Think(void)
        for(i = 1; i <= segments; ++i)
        {
                // calculate this on every segment to ensure that we always reach the full length of the attack
-               float segmentblend = (i/segments);
+               float segmentblend = bound(0, (i/segments) + WEP_CVAR(arc, beam_tightness), 1);
                float segmentdist = vlen(beam_endpos_estimate - last_origin) * (i/segments);
 
                vector new_dir = normalize( (w_shotdir * (1 - segmentblend)) + (normalize(beam_endpos_estimate - last_origin) * segmentblend) );