#ifdef REGISTER_WEAPON
-REGISTER_WEAPON(NEX, w_nex, IT_CELLS, 7, WEP_FLAG_NORMAL | WEP_TYPE_HITSCAN, BOT_PICKUP_RATING_HIGH, "nex", "nex", _("Nex"))
+REGISTER_WEAPON(NEX, w_nex, IT_CELLS, 7, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN, BOT_PICKUP_RATING_HIGH, "nex", "nex", _("Nex"))
#else
#ifdef SVQC
-// weapon load persistence, for weapons that support reloading
-.float nex_load;
-
-void W_Nex_SetAmmoCounter()
-{
- // set clip_load to the weapon we have switched to, if the gun uses reloading
- if(!autocvar_g_balance_nex_reload_ammo)
- self.clip_load = 0; // also keeps crosshair ammo from displaying
- else
- {
- self.clip_load = self.nex_load;
- self.clip_size = autocvar_g_balance_nex_reload_ammo; // for the crosshair ammo display
- }
-}
-
-void W_Nex_Reload()
-{
- self.reload_ammo_player = ammo_fuel;
- self.reload_ammo_min = min(autocvar_g_balance_nex_primary_ammo, autocvar_g_balance_nex_secondary_ammo);
- self.reload_ammo_amount = autocvar_g_balance_nex_reload_ammo;
- self.reload_time = autocvar_g_balance_nex_reload_time;
- self.reload_sound = "weapons/reload.wav";
-
- W_Reload();
-}
-
void SendCSQCNexBeamParticle(float charge) {
vector v;
v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
mydmg *= charge;
myforce *= charge;
- W_SetupShot (self, TRUE, 5, "weapons/nexfire.wav", CHAN_WEAPON, mydmg);
- if(charge > autocvar_g_balance_nex_charge_limit && autocvar_g_balance_nex_charge_limit) // if the Nex is overcharged, we play an extra sound
+ W_SetupShot (self, TRUE, 5, "weapons/nexfire.wav", CH_WEAPON_A, mydmg);
+ if(charge > autocvar_g_balance_nex_charge_animlimit && autocvar_g_balance_nex_charge_animlimit) // if the Nex is overcharged, we play an extra sound
{
- sound (self, CHAN_WEAPON2, "weapons/nexcharge.wav", VOL_BASE * (charge - 0.5 * autocvar_g_balance_nex_charge_limit) / (1 - 0.5 * autocvar_g_balance_nex_charge_limit), ATTN_NORM);
+ asound (self, CH_WEAPON_B, "weapons/nexcharge.wav", VOL_BASE * (charge - 0.5 * autocvar_g_balance_nex_charge_animlimit) / (1 - 0.5 * autocvar_g_balance_nex_charge_animlimit), ATTN_NORM);
}
yoda = 0;
if (trace_ent.solid == SOLID_BSP && !(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT))
Damage_DamageInfo(trace_endpos, mydmg, 0, 0, myforce * w_shotdir, WEP_NEX, self);
- // if this weapon is reloadable, decrease its load. Else decrease the player's ammo
- if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
- {
- if(autocvar_g_balance_nex_reload_ammo)
- {
- self.clip_load -= myammo;
- self.nex_load = self.clip_load;
- }
- else
- self.ammo_cells -= myammo;
- }
+ W_DecreaseAmmo(ammo_cells, myammo, autocvar_g_balance_nex_reload_ammo);
}
void spawnfunc_weapon_nex (void); // defined in t_items.qc
float ammo_amount;
if (req == WR_AIM)
{
- self.BUTTON_ATCK = bot_aim(1000000, 0, 1, FALSE);
- self.BUTTON_ATCK2 = bot_aim(1000000, 0, 1, FALSE);
+ if(bot_aim(1000000, 0, 1, FALSE))
+ self.BUTTON_ATCK = TRUE;
+ else
+ {
+ if(autocvar_g_balance_nex_charge)
+ self.BUTTON_ATCK2 = TRUE;
+ }
}
else if (req == WR_THINK)
{
}
if(autocvar_g_balance_nex_reload_ammo && self.clip_load < min(autocvar_g_balance_nex_primary_ammo, autocvar_g_balance_nex_secondary_ammo)) // forced reload
- W_Nex_Reload();
+ weapon_action(self.weapon, WR_RELOAD);
else
{
if (self.BUTTON_ATCK)
weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_nex_primary_animtime, w_ready);
}
}
- if ((autocvar_g_balance_nex_secondary_charge && !autocvar_g_balance_nex_secondary) ? self.BUTTON_ZOOM : self.BUTTON_ATCK2)
+ if ((autocvar_g_balance_nex_secondary_charge && !autocvar_g_balance_nex_secondary) ? (self.BUTTON_ZOOM | self.BUTTON_ZOOMSCRIPT) : self.BUTTON_ATCK2)
{
if(autocvar_g_balance_nex_secondary_charge)
{
{
self.clip_load = max(autocvar_g_balance_nex_secondary_ammo, self.clip_load - autocvar_g_balance_nex_secondary_ammo * dt);
}
- self.nex_load = self.clip_load;
+ self.weapon_load[WEP_NEX] = self.clip_load;
}
else
{
}
}
}
-
- if(autocvar_g_balance_nex_charge)
- {
- self.weaponentity_glowmod_x = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_red_half * min(1, self.nex_charge / autocvar_g_balance_nex_charge_limit);
- self.weaponentity_glowmod_y = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_green_half * min(1, self.nex_charge / autocvar_g_balance_nex_charge_limit);
- self.weaponentity_glowmod_z = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_blue_half * min(1, self.nex_charge / autocvar_g_balance_nex_charge_limit);
-
- if(self.nex_charge > autocvar_g_balance_nex_charge_limit)
- {
- self.weaponentity_glowmod_x = self.weaponentity_glowmod_x + autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_red_full * (self.nex_charge - autocvar_g_balance_nex_charge_limit) / (1 - autocvar_g_balance_nex_charge_limit);
- self.weaponentity_glowmod_y = self.weaponentity_glowmod_y + autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_green_full * (self.nex_charge - autocvar_g_balance_nex_charge_limit) / (1 - autocvar_g_balance_nex_charge_limit);
- self.weaponentity_glowmod_z = self.weaponentity_glowmod_z + autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_blue_full * (self.nex_charge - autocvar_g_balance_nex_charge_limit) / (1 - autocvar_g_balance_nex_charge_limit);
- }
- }
}
else if (req == WR_PRECACHE)
{
precache_sound ("weapons/nexwhoosh1.wav");
precache_sound ("weapons/nexwhoosh2.wav");
precache_sound ("weapons/nexwhoosh3.wav");
- precache_sound ("weapons/reload.wav");
+ //precache_sound ("weapons/reload.wav"); // until weapons have individual reload sounds, precache the reload sound somewhere else
}
else if (req == WR_SETUP)
{
weapon_setup(WEP_NEX);
- W_Nex_SetAmmoCounter();
+ self.current_ammo = ammo_cells;
}
else if (req == WR_CHECKAMMO1)
{
ammo_amount = self.ammo_cells >= autocvar_g_balance_nex_primary_ammo;
- ammo_amount += (autocvar_g_balance_nex_reload_ammo && self.nex_load >= autocvar_g_balance_nex_primary_ammo);
+ ammo_amount += (autocvar_g_balance_nex_reload_ammo && self.weapon_load[WEP_NEX] >= autocvar_g_balance_nex_primary_ammo);
return ammo_amount;
}
else if (req == WR_CHECKAMMO2)
{
// don't allow charging if we don't have enough ammo
ammo_amount = self.ammo_cells >= autocvar_g_balance_nex_secondary_ammo;
- ammo_amount += self.nex_load >= autocvar_g_balance_nex_secondary_ammo;
+ ammo_amount += self.weapon_load[WEP_NEX] >= autocvar_g_balance_nex_secondary_ammo;
return ammo_amount;
}
- else if (req == WR_RESETPLAYER)
- {
- // all weapons must be fully loaded when we spawn
- self.nex_load = autocvar_g_balance_nex_reload_ammo;
- }
else if (req == WR_RELOAD)
{
- W_Nex_Reload();
+ W_Reload(min(autocvar_g_balance_nex_primary_ammo, autocvar_g_balance_nex_secondary_ammo), autocvar_g_balance_nex_reload_ammo, autocvar_g_balance_nex_reload_time, "weapons/reload.wav");
}
return TRUE;
org2 = w_org + w_backoff * 6;
pointparticles(particleeffectnum("nex_impact"), org2, '0 0 0', 1);
if(!w_issilent)
- sound(self, CHAN_PROJECTILE, "weapons/neximpact.wav", VOL_BASE, ATTN_NORM);
+ asound(self, CH_SHOTS, "weapons/neximpact.wav", VOL_BASE, ATTN_NORM);
}
else if(req == WR_PRECACHE)
{
precache_sound("weapons/neximpact.wav");
}
else if (req == WR_SUICIDEMESSAGE)
- w_deathtypestring = _("%s did the impossible");
+ w_deathtypestring = _("%s is now thinking with portals");
else if (req == WR_KILLMESSAGE)
w_deathtypestring = _("%s has been vaporized by %s");
return TRUE;