set g_balance_nex_secondary 0
set g_balance_nex_secondary_charge 0
set g_balance_nex_secondary_charge_rate 0.1
+set g_balance_nex_secondary_charge_pool 0
+set g_balance_nex_secondary_charge_pool_regen 0.15
+set g_balance_nex_secondary_charge_pool_pause_regen 1
+set g_balance_nex_secondary_charge_pool_pause_health_regen 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 0
set g_balance_nex_secondary_charge 0
set g_balance_nex_secondary_charge_rate 0.1
+set g_balance_nex_secondary_charge_pool 0
+set g_balance_nex_secondary_charge_pool_regen 0.15
+set g_balance_nex_secondary_charge_pool_pause_regen 1
+set g_balance_nex_secondary_charge_pool_pause_health_regen 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 0
set g_balance_nex_secondary_charge 0
set g_balance_nex_secondary_charge_rate 0.1
+set g_balance_nex_secondary_charge_pool 0
+set g_balance_nex_secondary_charge_pool_regen 0.15
+set g_balance_nex_secondary_charge_pool_pause_regen 1
+set g_balance_nex_secondary_charge_pool_pause_health_regen 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 0
set g_balance_nex_secondary_charge 0
set g_balance_nex_secondary_charge_rate 0.1
+set g_balance_nex_secondary_charge_pool 0
+set g_balance_nex_secondary_charge_pool_regen 0.15
+set g_balance_nex_secondary_charge_pool_pause_regen 1
+set g_balance_nex_secondary_charge_pool_pause_health_regen 1
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 1
set g_balance_nex_secondary_charge 1
set g_balance_nex_secondary_charge_rate 0.55
+set g_balance_nex_secondary_charge_pool 0
+set g_balance_nex_secondary_charge_pool_regen 0.15
+set g_balance_nex_secondary_charge_pool_pause_regen 1
+set g_balance_nex_secondary_charge_pool_pause_health_regen 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_animtime 0.3
-set g_balance_nex_secondary_ammo 5
+set g_balance_nex_secondary_ammo 0
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_primary_damage 100
set g_balance_nex_primary_force 500
set g_balance_nex_primary_refire 1
-set g_balance_nex_primary_animtime 0.75
+set g_balance_nex_primary_animtime 0.4
set g_balance_nex_primary_ammo 5
-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_primary_damagefalloff_mindist 0
+set g_balance_nex_primary_damagefalloff_maxdist 0
+set g_balance_nex_primary_damagefalloff_halflife 0
+set g_balance_nex_primary_damagefalloff_forcehalflife 0
set g_balance_nex_secondary 1
set g_balance_nex_secondary_charge 1
-set g_balance_nex_secondary_charge_rate 0.125
+set g_balance_nex_secondary_charge_rate 0.55
+set g_balance_nex_secondary_charge_pool 1
+set g_balance_nex_secondary_charge_pool_regen 0.15
+set g_balance_nex_secondary_charge_pool_pause_regen 1
+set g_balance_nex_secondary_charge_pool_pause_health_regen 1
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 2
+set g_balance_nex_secondary_ammo 0.25
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_charge 1
-set g_balance_nex_charge_mindmg 40
+set g_balance_nex_charge_mindmg 30
set g_balance_nex_charge_start 0.5
-set g_balance_nex_charge_rate 0.05
+set g_balance_nex_charge_rate 0.6
set g_balance_nex_charge_limit 0.5
-set g_balance_nex_charge_rot_rate 0.01
-set g_balance_nex_charge_rot_pause 0 // Dont rot down untill this long after release of charge button
-set g_balance_nex_charge_shot_multiplier 0.675
-set g_balance_nex_charge_velocity_rate 0.2
-set g_balance_nex_charge_minspeed 400
+set g_balance_nex_charge_rot_rate 0.1
+set g_balance_nex_charge_rot_pause 1 // Dont rot down until this long after release of charge button
+set g_balance_nex_charge_shot_multiplier 0
+set g_balance_nex_charge_velocity_rate 0
+set g_balance_nex_charge_minspeed 600
set g_balance_nex_charge_maxspeed 1000
// }}}
// {{{ minstanex
set g_balance_nex_secondary 1
set g_balance_nex_secondary_charge 1
set g_balance_nex_secondary_charge_rate 0.55
+set g_balance_nex_secondary_charge_pool 0
+set g_balance_nex_secondary_charge_pool_regen 0.15
+set g_balance_nex_secondary_charge_pool_pause_regen 1
+set g_balance_nex_secondary_charge_pool_pause_health_regen 1
set g_balance_nex_secondary_damage 100
set g_balance_nex_secondary_force 600
set g_balance_nex_secondary_refire 1.5
entity nightvision_noise, nightvision_noise2;
float pickup_crosshair_time, pickup_crosshair_size;
+float use_nex_charge_pool;
void CSQC_UpdateView(float w, float h)
{
wcross_size = drawgetimagesize(wcross_name) * wcross_scale;
- float nex_charge;
+ float nex_charge, nex_charge_pool;
nex_charge = getstatf(STAT_NEX_CHARGE);
+ nex_charge_pool = getstatf(STAT_NEX_CHARGEPOOL);
if(nex_charge_movingavg == 0) // this should only happen if we have just loaded up the game
nex_charge_movingavg = nex_charge;
else if (activeweapon == WEP_NEX && nex_charge) // ring around crosshair representing velocity-dependent damage for the nex
{
vector rgb;
- // indicate how much we're charging right now with an inner circle
- a = cvar("crosshair_nexvelocity_currentcharge_alpha");
- nex_charge_movingavg = (1 - cvar("crosshair_nexvelocity_currentcharge_movingavg_rate")) * nex_charge_movingavg + cvar("crosshair_nexvelocity_currentcharge_movingavg_rate") * nex_charge;
+ if(nex_charge_pool || use_nex_charge_pool)
+ {
+ use_nex_charge_pool = 1;
+
+ a = cvar("crosshair_nexvelocity_alpha");
+ rgb = eX * cvar("crosshair_nexvelocity_currentcharge_color_red") + eY * cvar("crosshair_nexvelocity_currentcharge_color_green") + eZ * cvar("crosshair_nexvelocity_currentcharge_color_blue");
+ DrawCircleClippedPic(wcross_origin, wcross_size_x * ring_scale, "gfx/crosshair_ring_inner.tga", nex_charge_pool, rgb, wcross_alpha * a, DRAWFLAG_ADDITIVE);
+ }
+ else
+ {
+ // indicate how much we're charging right now with an inner circle
+ a = cvar("crosshair_nexvelocity_currentcharge_alpha");
+ nex_charge_movingavg = (1 - cvar("crosshair_nexvelocity_currentcharge_movingavg_rate")) * nex_charge_movingavg + cvar("crosshair_nexvelocity_currentcharge_movingavg_rate") * nex_charge;
- rgb = eX * cvar("crosshair_nexvelocity_currentcharge_color_red") + eY * cvar("crosshair_nexvelocity_currentcharge_color_green") + eZ * cvar("crosshair_nexvelocity_currentcharge_color_blue");
- DrawCircleClippedPic(wcross_origin, wcross_size_x * ring_scale, "gfx/crosshair_ring_inner.tga", bound(0, cvar("crosshair_nexvelocity_currentcharge_scale") * (nex_charge - nex_charge_movingavg), 1), rgb, wcross_alpha * a, DRAWFLAG_ADDITIVE);
+ rgb = eX * cvar("crosshair_nexvelocity_currentcharge_color_red") + eY * cvar("crosshair_nexvelocity_currentcharge_color_green") + eZ * cvar("crosshair_nexvelocity_currentcharge_color_blue");
+ DrawCircleClippedPic(wcross_origin, wcross_size_x * ring_scale, "gfx/crosshair_ring_inner.tga", bound(0, cvar("crosshair_nexvelocity_currentcharge_scale") * (nex_charge - nex_charge_movingavg), 1), rgb, wcross_alpha * a, DRAWFLAG_ADDITIVE);
+ }
// draw the charge
a = cvar("crosshair_nexvelocity_alpha");
const float STAT_LEADLIMIT = 47;
const float STAT_BULLETS_LOADED = 48;
const float STAT_NEX_CHARGE = 49;
-const float STAT_LAST_PICKUP = 50;
+const float STAT_LAST_PICKUP = 50;
const float STAT_HUD = 51;
+const float STAT_NEX_CHARGEPOOL = 52;
// see DP source, quakedef.h
const float STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW = 222;
self.air_finished = time + 12;
self.dmg = 2;
if(cvar("g_balance_nex_charge"))
+ {
+ if(cvar("g_balance_nex_secondary_charge_pool"))
+ self.nex_charge_pool_ammo = 1;
self.nex_charge = cvar("g_balance_nex_charge_start");
+ }
if(inWarmupStage)
{
.float nex_charge;
.float nex_charge_rottime;
+.float nex_charge_pool_ammo;
float allowed_to_spawn; // boolean variable used by the clan arena code to determine if a player can spawn (after the round has ended)
addstat(STAT_LAST_PICKUP, AS_FLOAT, last_pickup);
addstat(STAT_NEX_CHARGE, AS_FLOAT, nex_charge);
+ addstat(STAT_NEX_CHARGEPOOL, AS_FLOAT, nex_charge_pool_ammo);
if(g_ca)
{
void spawnfunc_weapon_nex (void); // defined in t_items.qc
+.float nex_charge_pool_pauseregen_finished;
float w_nex(float req)
{
float dt;
if(cvar("g_balance_nex_charge") && self.nex_charge < cvar("g_balance_nex_charge_limit"))
self.nex_charge = min(1, self.nex_charge + cvar("g_balance_nex_charge_rate") * frametime / W_TICSPERFRAME);
+ if(cvar("g_balance_nex_secondary_charge_pool"))
+ if(self.nex_charge_pool_ammo < 1)
+ {
+ if(self.nex_charge_pool_pauseregen_finished < time)
+ self.nex_charge_pool_ammo = min(1, self.nex_charge_pool_ammo + cvar("g_balance_nex_secondary_charge_pool_regen") * frametime / W_TICSPERFRAME);
+ self.pauseregen_finished = max(self.pauseregen_finished, time + cvar("g_balance_nex_secondary_charge_pool_pause_health_regen"));
+ }
+
if (self.BUTTON_ATCK)
{
if (weapon_prepareattack(0, cvar("g_balance_nex_primary_refire")))
{
self.nex_charge_rottime = time + cvar("g_balance_nex_charge_rot_pause");
dt = frametime / W_TICSPERFRAME;
- if(self.nex_charge < 1)
+
+ if(cvar("g_balance_nex_secondary_charge_pool"))
+ {
+ if(cvar("g_balance_nex_secondary_ammo"))
+ {
+ // always deplete if secondary is held
+ self.nex_charge_pool_ammo = max(0, self.nex_charge_pool_ammo - cvar("g_balance_nex_secondary_ammo") * dt);
+
+ dt = min(dt, (1 - self.nex_charge) / cvar("g_balance_nex_secondary_charge_rate"));
+ self.nex_charge_pool_pauseregen_finished = time + cvar("g_balance_nex_secondary_charge_pool_pause_regen");
+ dt = min(dt, self.nex_charge_pool_ammo);
+ dt = max(0, dt);
+
+ self.nex_charge += dt * cvar("g_balance_nex_secondary_charge_rate");
+ }
+ }
+
+ else if(cvar("g_balance_nex_secondary_ammo"))
{
- dt = min(dt, (1 - self.nex_charge) / cvar("g_balance_nex_secondary_charge_rate"));
- if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
+ if(self.nex_charge < 1)
{
- if(cvar("g_balance_nex_secondary_ammo"))
+ dt = min(dt, (1 - self.nex_charge) / cvar("g_balance_nex_secondary_charge_rate"));
+ if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
{
dt = min(dt, (self.ammo_cells - cvar("g_balance_nex_primary_ammo")) / cvar("g_balance_nex_secondary_ammo"));
dt = max(0, dt);
self.ammo_cells = max(cvar("g_balance_nex_secondary_ammo"), self.ammo_cells - cvar("g_balance_nex_secondary_ammo") * dt);
}
}
+ self.nex_charge += dt * cvar("g_balance_nex_secondary_charge_rate");
}
- self.nex_charge += dt * cvar("g_balance_nex_secondary_charge_rate");
}
}
else if(cvar("g_balance_nex_secondary"))
return self.ammo_cells >= cvar("g_balance_nex_primary_ammo");
else if (req == WR_CHECKAMMO2)
{
- if(cvar("g_balance_nex_secondary_charge"))
+ if(cvar("g_balance_nex_secondary_charge_pool"))
+ return TRUE;
+ if(cvar("g_balance_nex_secondary_charge") && cvar("g_balance_nex_secondary_ammo")) // if charge consumes ammo, don't allow consuming so much that we cant fire a primary anymore
return self.ammo_cells >= cvar("g_balance_nex_primary_ammo");
return self.ammo_cells >= cvar("g_balance_nex_secondary_ammo");
}