set g_balance_nex_secondary 0
set g_balance_nex_secondary_charge 0
-set g_balance_nex_secondary_charge_rate 200
-set g_balance_nex_secondary_charge_ammo 10
+set g_balance_nex_secondary_charge_rate 0.1
set g_balance_nex_secondary_damage 100
set g_balance_nex_secondary_force 600
set g_balance_nex_secondary_refire 1.5
set g_balance_nex_secondary_damagefalloff_halflife 0
set g_balance_nex_secondary_damagefalloff_forcehalflife 0
-set g_balance_nex_velocitydependent_halflife 0
-set g_balance_nex_velocitydependent_minspeed 400
-set g_balance_nex_velocitydependent_maxspeed 1000
-set g_balance_nex_velocitydependent_falloff_rate 0.001
+set g_balance_nex_charge 0
+set g_balance_nex_charge_rate 0.1
+set g_balance_nex_charge_shot_multiplier 0.5
+set g_balance_nex_charge_velocity_rate 0.2
+set g_balance_nex_charge_minspeed 400
+set g_balance_nex_charge_maxspeed 1000
// }}}
// {{{ minstanex
set g_balance_minstanex_refire 1
set g_balance_nex_secondary 0
set g_balance_nex_secondary_charge 0
-set g_balance_nex_secondary_charge_rate 200
-set g_balance_nex_secondary_charge_ammo 10
+set g_balance_nex_secondary_charge_rate 0.1
set g_balance_nex_secondary_damage 80
set g_balance_nex_secondary_force -500
set g_balance_nex_secondary_refire 1.25
set g_balance_nex_secondary_damagefalloff_halflife 9999999
set g_balance_nex_secondary_damagefalloff_forcehalflife 9999999
-set g_balance_nex_velocitydependent_halflife 0
-set g_balance_nex_velocitydependent_minspeed 400
-set g_balance_nex_velocitydependent_maxspeed 1000
-set g_balance_nex_velocitydependent_falloff_rate 0.001
+set g_balance_nex_charge 0
+set g_balance_nex_charge_rate 0.1
+set g_balance_nex_charge_shot_multiplier 0.5
+set g_balance_nex_charge_velocity_rate 0.2
+set g_balance_nex_charge_minspeed 400
+set g_balance_nex_charge_maxspeed 1000
// }}}
// {{{ minstanex
set g_balance_minstanex_refire 1
set g_balance_nex_secondary 0
set g_balance_nex_secondary_charge 0
-set g_balance_nex_secondary_charge_rate 200
-set g_balance_nex_secondary_charge_ammo 10
+set g_balance_nex_secondary_charge_rate 0.1
set g_balance_nex_secondary_damage 90
set g_balance_nex_secondary_force 200
set g_balance_nex_secondary_refire 1.5
set g_balance_nex_secondary_damagefalloff_halflife 1500
set g_balance_nex_secondary_damagefalloff_forcehalflife 1500
-set g_balance_nex_velocitydependent_halflife 0
-set g_balance_nex_velocitydependent_minspeed 400
-set g_balance_nex_velocitydependent_maxspeed 1000
-set g_balance_nex_velocitydependent_falloff_rate 0.001
+set g_balance_nex_charge 0
+set g_balance_nex_charge_rate 0.1
+set g_balance_nex_charge_shot_multiplier 0.5
+set g_balance_nex_charge_velocity_rate 0.2
+set g_balance_nex_charge_minspeed 400
+set g_balance_nex_charge_maxspeed 1000
// }}}
// {{{ minstanex
set g_balance_minstanex_refire 1
set g_balance_nex_secondary 0
set g_balance_nex_secondary_charge 0
-set g_balance_nex_secondary_charge_rate 200
-set g_balance_nex_secondary_charge_ammo 10
+set g_balance_nex_secondary_charge_rate 0.1
set g_balance_nex_secondary_damage 90
set g_balance_nex_secondary_force 300
set g_balance_nex_secondary_refire 1.5
set g_balance_nex_secondary_damagefalloff_halflife 1500
set g_balance_nex_secondary_damagefalloff_forcehalflife 1500
-set g_balance_nex_velocitydependent_halflife 0
-set g_balance_nex_velocitydependent_minspeed 400
-set g_balance_nex_velocitydependent_maxspeed 1000
-set g_balance_nex_velocitydependent_falloff_rate 0.001
+set g_balance_nex_charge 0
+set g_balance_nex_charge_rate 0.1
+set g_balance_nex_charge_shot_multiplier 0.5
+set g_balance_nex_charge_velocity_rate 0.2
+set g_balance_nex_charge_minspeed 400
+set g_balance_nex_charge_maxspeed 1000
// }}}
// {{{ minstanex
set g_balance_minstanex_refire 1
set g_balance_nex_primary_refire 1
set g_balance_nex_primary_animtime 0.75
set g_balance_nex_primary_ammo 5
-set g_balance_nex_primary_damagefalloff_mindist 500
-set g_balance_nex_primary_damagefalloff_maxdist 4500
-set g_balance_nex_primary_damagefalloff_halflife 2000
+set g_balance_nex_primary_damagefalloff_mindist 1000
+set g_balance_nex_primary_damagefalloff_maxdist 3000
+set g_balance_nex_primary_damagefalloff_halflife 1000
set g_balance_nex_primary_damagefalloff_forcehalflife 2000
set g_balance_nex_secondary 1
set g_balance_nex_secondary_charge 1
-set g_balance_nex_secondary_charge_rate 200
-set g_balance_nex_secondary_charge_ammo 10
-set g_balance_nex_secondary_damage 125
-set g_balance_nex_secondary_force -700
-set g_balance_nex_secondary_refire 1
-set g_balance_nex_secondary_animtime 0.75
+set g_balance_nex_secondary_charge_rate 0.125
+set g_balance_nex_secondary_damage 0
+set g_balance_nex_secondary_force 0
+set g_balance_nex_secondary_refire 0
+set g_balance_nex_secondary_animtime 0
set g_balance_nex_secondary_ammo 5
-set g_balance_nex_secondary_damagefalloff_mindist 500
-set g_balance_nex_secondary_damagefalloff_maxdist 4500
-set g_balance_nex_secondary_damagefalloff_halflife 4000
-set g_balance_nex_secondary_damagefalloff_forcehalflife 4000
+set g_balance_nex_secondary_damagefalloff_mindist 0
+set g_balance_nex_secondary_damagefalloff_maxdist 0
+set g_balance_nex_secondary_damagefalloff_halflife 0
+set g_balance_nex_secondary_damagefalloff_forcehalflife 0
-set g_balance_nex_velocitydependent_halflife -500
-set g_balance_nex_velocitydependent_minspeed 400
-set g_balance_nex_velocitydependent_maxspeed 1000
-set g_balance_nex_velocitydependent_falloff_rate 40
+set g_balance_nex_charge 1
+set g_balance_nex_charge_rate 0.075
+set g_balance_nex_charge_shot_multiplier 0.5
+set g_balance_nex_charge_velocity_rate 0.25
+set g_balance_nex_charge_minspeed 400
+set g_balance_nex_charge_maxspeed 1000
// }}}
// {{{ minstanex
set g_balance_minstanex_refire 1.25
float campingrifle_scope;
float nex_scope;
-float nex_velocitydependent;
-float nex_minvelocity;
-float nex_maxvelocity;
-float nex_speed_falloff_rate;
-float nex_speed;
-float nex_charge;
-float nex_charge_rate;
-
float cr_maxbullets;
Net_WeaponComplain();
bHandled = true;
break;
- case TE_CSQC_NEX_VELOCITY:
- nex_velocitydependent = ReadByte();
- nex_minvelocity = ReadShort();
- nex_maxvelocity = ReadShort();
- nex_speed_falloff_rate = ReadByte();
- nex_charge = ReadByte();
- nex_charge_rate = ReadByte();
- bHandled = true;
- break;
case TE_CSQC_CR_MAXBULLETS:
cr_maxbullets = ReadByte();
bHandled = true;
float f, a;
wcross_size = drawgetimagesize(wcross_name) * wcross_scale;
- float xyspeed;
- xyspeed = vlen('1 0 0' * pmove_vel_x + '0 1 0' * pmove_vel_y);
- if(xyspeed > nex_speed)
- nex_speed = min(xyspeed, nex_maxvelocity);
- else
- nex_speed = max(nex_minvelocity, nex_speed - nex_speed_falloff_rate * frametime);
-
- if (activeweapon == WEP_NEX && button_attack2 && nex_charge && getstati(GetAmmoStat(3)))
- nex_speed = min(nex_maxvelocity, nex_speed + nex_charge_rate * frametime);
+ float nex_charge;
+ nex_charge = getstatf(STAT_NEX_CHARGE);
// ring around crosshair representing bullets left in camping rifle clip
if (activeweapon == WEP_CAMPINGRIFLE && cr_maxbullets)
a = cvar("crosshair_campingrifle_bulletcounter_alpha");
DrawCircleClippedPic(wcross_origin, wcross_size_x * ring_scale, "gfx/crosshair_ring.tga", f, wcross_color, wcross_alpha * a, DRAWFLAG_ADDITIVE);
}
- else if (activeweapon == WEP_NEX && nex_velocitydependent && nex_speed > nex_minvelocity) // ring around crosshair representing velocity-dependent damage for the nex
+ else if (activeweapon == WEP_NEX && nex_charge) // ring around crosshair representing velocity-dependent damage for the nex
{
- f = bound(0, (nex_speed - nex_minvelocity) / (nex_maxvelocity - nex_minvelocity), 1);
-
a = cvar("crosshair_nexvelocity_alpha");
- DrawCircleClippedPic(wcross_origin, wcross_size_x * ring_scale, "gfx/crosshair_ring.tga", f, wcross_color, wcross_alpha * a, DRAWFLAG_ADDITIVE);
+ DrawCircleClippedPic(wcross_origin, wcross_size_x * ring_scale, "gfx/crosshair_ring.tga", nex_charge, wcross_color, wcross_alpha * a, DRAWFLAG_ADDITIVE);
}
#define CROSSHAIR_DO_BLUR(M,sz,wcross_name,wcross_alpha) \
const float TE_CSQC_WEAPONCOMPLAIN = 113;
const float TE_CSQC_CAMPINGRIFLE_SCOPE = 115;
const float TE_CSQC_NEX_SCOPE = 116;
-const float TE_CSQC_NEX_VELOCITY = 117;
-const float TE_CSQC_CR_MAXBULLETS = 118;
+const float TE_CSQC_CR_MAXBULLETS = 117;
const float RACE_NET_CHECKPOINT_HIT_QUALIFYING = 0; // byte checkpoint, short time, short recordtime, string recordholder
const float RACE_NET_CHECKPOINT_CLEAR = 1;
const float STAT_SHOTORG = 46; // compressShotOrigin
const float STAT_LEADLIMIT = 47;
const float STAT_BULLETS_LOADED = 48;
+const float STAT_NEX_CHARGE = 49;
// see DP source, quakedef.h
const float STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW = 222;
WriteByte(0, TE_CSQC_TEAMNAGGER);
}
-void send_CSQC_nexvelocity(entity e) {
- msg_entity = e;
- WriteByte(MSG_ONE, SVC_TEMPENTITY);
- WriteByte(MSG_ONE, TE_CSQC_NEX_VELOCITY);
- WriteByte(MSG_ONE, bound(0, fabs(cvar("g_balance_nex_velocitydependent_halflife")), 1));
- WriteShort(MSG_ONE, cvar("g_balance_nex_velocitydependent_minspeed"));
- WriteShort(MSG_ONE, cvar("g_balance_nex_velocitydependent_maxspeed"));
- WriteByte(MSG_ONE, cvar("g_balance_nex_velocitydependent_falloff_rate"));
- WriteByte(MSG_ONE, cvar("g_balance_nex_secondary_charge"));
- WriteByte(MSG_ONE, cvar("g_balance_nex_secondary_charge_rate"));
-}
-
void send_CSQC_cr_maxbullets(entity e) {
msg_entity = e;
WriteByte(MSG_ONE, SVC_TEMPENTITY);
else if(cvar("sv_teamnagger") && !(cvar("bot_vs_human") && (c3==-1 && c4==-1)) && !g_ca) // teamnagger is currently bad for ca
send_CSQC_teamnagger();
- send_CSQC_nexvelocity(self);
send_CSQC_cr_maxbullets(self);
CheatInitClient();
}
}
- float f;
float xyspeed;
- f = cvar("g_balance_nex_velocitydependent_falloff_rate");
xyspeed = vlen('1 0 0' * self.velocity_x + '0 1 0' * self.velocity_y);
- if(xyspeed > self.nexspeed)
- self.nexspeed = min(xyspeed, cvar("g_balance_nex_velocitydependent_maxspeed"));
- else
- self.nexspeed = max(cvar("g_balance_nex_velocitydependent_minspeed"), self.nexspeed - f * frametime);
+ if(self.weapon == WEP_NEX && cvar("g_balance_nex_charge") && cvar("g_balance_nex_charge_velocity_rate") && xyspeed > cvar("g_balance_nex_charge_minspeed"))
+ {
+ // add a maximum of charge_velocity_rate when going fast (f = 1), gradually increasing from minspeed (f = 0) to maxspeed
+ xyspeed = min(xyspeed, cvar("g_balance_nex_charge_maxspeed"));
+ float f;
+ f = (xyspeed - cvar("g_balance_nex_charge_minspeed")) / (cvar("g_balance_nex_charge_maxspeed") - cvar("g_balance_nex_charge_minspeed"));
+ // add the extra charge
+ self.nex_charge += cvar("g_balance_nex_charge_velocity_rate") * f * frametime;
+ }
:end
if(self.flags & FL_ONGROUND)
self.lastground = time;
.float active;
.float (float act_state) setactive;
.entity realowner;
+
+.float nex_charge;
addstat(STAT_LEADLIMIT, AS_FLOAT, stat_leadlimit);
addstat(STAT_BULLETS_LOADED, AS_INT, campingrifle_bulletcounter);
+ addstat(STAT_NEX_CHARGE, AS_FLOAT, nex_charge);
+
// g_movementspeed hack
addstat(STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW, AS_FLOAT, stat_sv_airspeedlimit_nonqw);
addstat(STAT_MOVEVARS_AIRACCEL_QW, AS_FLOAT, stat_sv_airaccel_qw);
void W_Nex_Attack (float issecondary)
{
- float mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, myammo, f;
+ float mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, myammo;
if(issecondary)
{
mydmg = cvar("g_balance_nex_secondary_damage");
float flying;
flying = IsFlying(self); // do this BEFORE to make the trace values from FireRailgunBullet last
- f = ExponentialFalloff(cvar("g_balance_nex_velocitydependent_minspeed"), cvar("g_balance_nex_velocitydependent_maxspeed"), cvar("g_balance_nex_velocitydependent_halflife"), self.nexspeed);
-
- // TODO: make it more obvious (through effects, indicator on weapon) that damage increases when speed increases
- mydmg *= f;
- myforce *= f;
- //print("^1Damage: ^7", ftos(mydmg), "\n");
+ if(cvar("g_balance_nex_charge"))
+ {
+ mydmg *= self.nex_charge;
+ myforce *= self.nex_charge;
+ //print("^1Damage: ^7", ftos(mydmg), "\n");
+ self.nex_charge *= cvar("g_balance_nex_charge_shot_multiplier"); // do this AFTER setting mydmg/myforce
+ }
W_SetupShot (self, TRUE, 5, "weapons/nexfire.wav", mydmg);
}
else if (req == WR_THINK)
{
+ if(cvar("g_balance_nex_charge"))
+ self.nex_charge = min(1, self.nex_charge + cvar("g_balance_nex_charge_rate") * frametime / W_TICSPERFRAME);
if (self.BUTTON_ATCK)
{
if (weapon_prepareattack(0, cvar("g_balance_nex_primary_refire")))
{
if(self.ammo_cells)
{
- self.nexspeed = min(cvar("g_balance_nex_velocitydependent_maxspeed"), self.nexspeed + cvar("g_balance_nex_secondary_charge_rate") * frametime / W_TICSPERFRAME);
- self.ammo_cells = max(0, self.ammo_cells - cvar("g_balance_nex_secondary_charge_ammo") * frametime / W_TICSPERFRAME);
+ self.nex_charge = min(1, self.nex_charge + cvar("g_balance_nex_secondary_charge_rate") * frametime / W_TICSPERFRAME);
+ self.ammo_cells = max(0, self.ammo_cells - cvar("g_balance_nex_secondary_ammo") * frametime / W_TICSPERFRAME);
}
}
else if(cvar("g_balance_nex_secondary"))