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 ""
.float beam_maxangle;
.float beam_range;
.float beam_returnspeed;
+.float beam_tightness;
.vector beam_shotorigin;
.vector beam_dir;
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) );
self.beam_maxangle = ReadShort();
self.beam_range = ReadCoord();
self.beam_returnspeed = ReadShort();
+ self.beam_tightness = (ReadByte() / 10);
}
if(sf & 2) // starting location
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) \
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
{
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) );