REGISTER_WEAPON(NEX, w_nex, IT_CELLS, 7, WEP_FLAG_NORMAL | WEP_TYPE_HITSCAN, BOT_PICKUP_RATING_HIGH, "nex", "nex", "Nex");
#else
#ifdef SVQC
REGISTER_WEAPON(NEX, w_nex, IT_CELLS, 7, WEP_FLAG_NORMAL | WEP_TYPE_HITSCAN, BOT_PICKUP_RATING_HIGH, "nex", "nex", "Nex");
#else
#ifdef SVQC
vector v;
v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
WriteByte(MSG_BROADCAST, SVC_TEMPENTITY);
WriteByte(MSG_BROADCAST, TE_CSQC_NEXGUNBEAMPARTICLE);
vector v;
v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
WriteByte(MSG_BROADCAST, SVC_TEMPENTITY);
WriteByte(MSG_BROADCAST, TE_CSQC_NEXGUNBEAMPARTICLE);
WriteCoord(MSG_BROADCAST, w_shotorg_x);
WriteCoord(MSG_BROADCAST, w_shotorg_y);
WriteCoord(MSG_BROADCAST, w_shotorg_z);
WriteCoord(MSG_BROADCAST, v_x);
WriteCoord(MSG_BROADCAST, v_y);
WriteCoord(MSG_BROADCAST, v_z);
WriteCoord(MSG_BROADCAST, w_shotorg_x);
WriteCoord(MSG_BROADCAST, w_shotorg_y);
WriteCoord(MSG_BROADCAST, w_shotorg_z);
WriteCoord(MSG_BROADCAST, v_x);
WriteCoord(MSG_BROADCAST, v_y);
WriteCoord(MSG_BROADCAST, v_z);
- float mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, myammo, f;
+ float mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, myammo, charge;
- 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"))
+ {
+ charge = cvar("g_balance_nex_charge_mindmg") / mydmg + (1 - cvar("g_balance_nex_charge_mindmg") / mydmg) * self.nex_charge;
+ self.nex_charge *= cvar("g_balance_nex_charge_shot_multiplier"); // do this AFTER setting mydmg/myforce
+ }
+ else
+ charge = 1;
+ mydmg *= charge;
+ myforce *= charge;
W_SetupShot (self, TRUE, 5, "weapons/nexfire.wav", mydmg);
W_SetupShot (self, TRUE, 5, "weapons/nexfire.wav", mydmg);
AnnounceTo(self, "yoda");
//beam and muzzle flash done on client
AnnounceTo(self, "yoda");
//beam and muzzle flash done on client
// flash and burn the wall
if (trace_ent.solid == SOLID_BSP && !(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT))
// flash and burn the wall
if (trace_ent.solid == SOLID_BSP && !(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT))
if (req == WR_AIM)
{
self.BUTTON_ATCK = bot_aim(1000000, 0, 1, FALSE);
if (req == WR_AIM)
{
self.BUTTON_ATCK = bot_aim(1000000, 0, 1, FALSE);
- 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);
+ dt = min(dt, (1 - self.nex_charge) / cvar("g_balance_nex_secondary_charge_rate"));
+ if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
+ {
+ if(cvar("g_balance_nex_secondary_ammo"))
+ {
+ dt = min(dt, (self.ammo_cells - cvar("g_balance_nex_primary_ammo")) / cvar("g_balance_nex_secondary_ammo"));
+ dt = max(0, dt);
+ if(dt > 0)
+ {
+ 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");
else if (req == WR_CHECKAMMO1)
return self.ammo_cells >= cvar("g_balance_nex_primary_ammo");
else if (req == WR_CHECKAMMO2)
else if (req == WR_CHECKAMMO1)
return self.ammo_cells >= cvar("g_balance_nex_primary_ammo");
else if (req == WR_CHECKAMMO2)