vector forward, right, up;
float maxdmg;
- W_DecreaseAmmo(ammo_cells, WEP_CVAR_PRI(crylink, ammo), autocvar_g_balance_crylink_reload_ammo);
+ W_DecreaseAmmo(WEP_CVAR_PRI(crylink, ammo));
maxdmg = WEP_CVAR_PRI(crylink, damage) * WEP_CVAR_PRI(crylink, shots);
maxdmg *= 1 + WEP_CVAR_PRI(crylink, bouncedamagefactor) * WEP_CVAR_PRI(crylink, bounces);
vector forward, right, up;
float maxdmg;
- W_DecreaseAmmo(ammo_cells, WEP_CVAR_SEC(crylink, ammo), autocvar_g_balance_crylink_reload_ammo);
+ W_DecreaseAmmo(WEP_CVAR_SEC(crylink, ammo));
maxdmg = WEP_CVAR_SEC(crylink, damage) * WEP_CVAR_SEC(crylink, shots);
maxdmg *= 1 + WEP_CVAR_SEC(crylink, bouncedamagefactor) * WEP_CVAR_SEC(crylink, bounces);
entity missile;
entity flash;
- W_DecreaseAmmo(ammo_rockets, WEP_CVAR(devastator, ammo), WEP_CVAR(devastator, reload_ammo));
+ W_DecreaseAmmo(WEP_CVAR(devastator, ammo));
W_SetupShot_ProjectileSize (self, '-3 -3 -3', '3 3 3', FALSE, 5, "weapons/rocket_fire.wav", CH_WEAPON_A, WEP_CVAR(devastator, damage));
pointparticles(particleeffectnum("rocketlauncher_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
{
entity proj;
- W_DecreaseAmmo(ammo_cells, WEP_CVAR_PRI(electro, ammo), autocvar_g_balance_electro_reload_ammo);//weapontodo
+ W_DecreaseAmmo(WEP_CVAR_PRI(electro, ammo));
W_SetupShot_ProjectileSize(self, '0 0 -3', '0 0 -3', FALSE, 2, "weapons/electro_fire.wav", CH_WEAPON_A, WEP_CVAR_PRI(electro, damage));
void W_Electro_Attack_Orb(void)
{
- W_DecreaseAmmo(ammo_cells, WEP_CVAR_SEC(electro, ammo), autocvar_g_balance_electro_reload_ammo);//weapontodo
+ W_DecreaseAmmo(WEP_CVAR_SEC(electro, ammo));
W_SetupShot_ProjectileSize(self, '0 0 -4', '0 0 -4', FALSE, 2, "weapons/electro_fire2.wav", CH_WEAPON_A, WEP_CVAR_SEC(electro, damage));
{
entity missile;
- W_DecreaseAmmo(ammo_rockets, WEP_CVAR_PRI(hagar, ammo), autocvar_g_balance_hagar_reload_ammo);
+ W_DecreaseAmmo(WEP_CVAR_PRI(hagar, ammo));
W_SetupShot (self, FALSE, 2, "weapons/hagar_fire.wav", CH_WEAPON_A, WEP_CVAR_PRI(hagar, damage));
{
entity missile;
- W_DecreaseAmmo(ammo_rockets, WEP_CVAR_SEC(hagar, ammo), autocvar_g_balance_hagar_reload_ammo);
+ W_DecreaseAmmo(WEP_CVAR_SEC(hagar, ammo));
W_SetupShot (self, FALSE, 2, "weapons/hagar_fire.wav", CH_WEAPON_A, WEP_CVAR_SEC(hagar, damage));
{
// if we pressed primary fire while loading, unload all rockets and abort
self.weaponentity.state = WS_READY;
- W_DecreaseAmmo(ammo_rockets, WEP_CVAR_SEC(hagar, ammo) * self.hagar_load * -1, autocvar_g_balance_hagar_reload_ammo); // give back ammo
+ W_DecreaseAmmo(WEP_CVAR_SEC(hagar, ammo) * self.hagar_load * -1); // give back ammo
self.hagar_load = 0;
sound(self, CH_WEAPON_A, "weapons/hagar_beep.wav", VOL_BASE, ATTN_NORM);
{
if(!self.hagar_loadblock && self.hagar_loadstep < time)
{
- W_DecreaseAmmo(ammo_rockets, WEP_CVAR_SEC(hagar, ammo), autocvar_g_balance_hagar_reload_ammo);
+ W_DecreaseAmmo(WEP_CVAR_SEC(hagar, ammo));
self.weaponentity.state = WS_INUSE;
self.hagar_load += 1;
sound(self, CH_WEAPON_B, "weapons/hagar_load.wav", VOL_BASE * 0.8, ATTN_NORM); // sound is too loud according to most
if(self.hagar_load)
{
- W_DecreaseAmmo(ammo_rockets, WEP_CVAR_SEC(hagar, ammo) * self.hagar_load * -1, autocvar_g_balance_hagar_reload_ammo); // give back ammo if necessary
+ W_DecreaseAmmo(WEP_CVAR_SEC(hagar, ammo) * self.hagar_load * -1); // give back ammo if necessary
self.hagar_load = 0;
}
entity missile;
float spread;
- W_DecreaseAmmo(ammo_cells, WEP_CVAR_PRI(hlac, ammo), autocvar_g_balance_hlac_reload_ammo);
+ W_DecreaseAmmo(WEP_CVAR_PRI(hlac, ammo));
spread = WEP_CVAR_PRI(hlac, spread_min) + (WEP_CVAR_PRI(hlac, spread_add) * self.misc_bulletcounter);
spread = min(spread,WEP_CVAR_PRI(hlac, spread_max));
{
float i;
- W_DecreaseAmmo(ammo_cells, WEP_CVAR_SEC(hlac, ammo), autocvar_g_balance_hlac_reload_ammo);
+ W_DecreaseAmmo(WEP_CVAR_SEC(hlac, ammo));
for(i=WEP_CVAR_SEC(hlac, shots);i>0;--i)
W_HLAC_Attack2f();
{
entity gren;
- W_DecreaseAmmo(ammo_cells, WEP_CVAR_SEC(hook, ammo), FALSE);
+ W_DecreaseAmmo(WEP_CVAR_SEC(hook, ammo));
W_SetupShot (self, FALSE, 4, "weapons/hookbomb_fire.wav", CH_WEAPON_A, WEP_CVAR_SEC(hook, damage));
gren = spawn ();
if (time > self.hook_refire)
if (weapon_prepareattack(0, -1))
{
- W_DecreaseAmmo(ammo_fuel, WEP_CVAR_PRI(hook, ammo), FALSE);
+ W_DecreaseAmmo(WEP_CVAR_PRI(hook, ammo));
self.hook_state |= HOOK_FIRING;
weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(hook, animtime), w_ready);
}
{
if ( self.ammo_fuel >= (time - self.hook_time_fueldecrease) * hooked_fuel )
{
- W_DecreaseAmmo(ammo_fuel, (time - self.hook_time_fueldecrease) * hooked_fuel, FALSE);
+ W_DecreaseAmmo((time - self.hook_time_fueldecrease) * hooked_fuel);
self.hook_time_fueldecrease = time;
// decrease next frame again
}
SpawnCasing (((random () * 50 + 50) * v_right) - (v_forward * (random () * 25 + 25)) - ((random () * 5 - 70) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 3, self);
if (self.misc_bulletcounter == 1)
- W_DecreaseAmmo(ammo_nails, WEP_CVAR(uzi, first_ammo), autocvar_g_balance_uzi_reload_ammo);
+ W_DecreaseAmmo(WEP_CVAR(uzi, first_ammo));
else
- W_DecreaseAmmo(ammo_nails, WEP_CVAR(uzi, sustained_ammo), autocvar_g_balance_uzi_reload_ammo);
+ W_DecreaseAmmo(WEP_CVAR(uzi, sustained_ammo));
}
// weapon frames
return;
}
- W_DecreaseAmmo(ammo_nails, WEP_CVAR(uzi, sustained_ammo), autocvar_g_balance_uzi_reload_ammo);
+ W_DecreaseAmmo(WEP_CVAR(uzi, sustained_ammo));
W_SetupShot (self, TRUE, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, WEP_CVAR(uzi, sustained_damage));
if (!autocvar_g_norecoil)
return FALSE;
}
- W_DecreaseAmmo(ammo_nails, WEP_CVAR(uzi, burst_ammo), autocvar_g_balance_uzi_reload_ammo);
+ W_DecreaseAmmo(WEP_CVAR(uzi, burst_ammo));
self.misc_bulletcounter = WEP_CVAR(uzi, burst) * -1;
uzi_mode1_fire_burst();
}
}
- W_DecreaseAmmo(ammo_rockets, WEP_CVAR(minelayer, ammo), autocvar_g_balance_minelayer_reload_ammo);
+ W_DecreaseAmmo(WEP_CVAR(minelayer, ammo));
W_SetupShot_ProjectileSize (self, '-4 -4 -4', '4 4 4', FALSE, 5, "weapons/mine_fire.wav", CH_WEAPON_A, WEP_CVAR(minelayer, damage));
pointparticles(particleeffectnum("rocketlauncher_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
break;
}
- W_DecreaseAmmo(ammo_cells, ((g_minstagib) ? 1 : WEP_CVAR_PRI(minstanex, ammo)), WEP_CVAR(minstanex, reload_ammo));
+ W_DecreaseAmmo(((g_minstagib) ? 1 : WEP_CVAR_PRI(minstanex, ammo)));
}
float w_minstanex(float req)
// decrease ammo for the laser?
if(WEP_CVAR_SEC(minstanex, ammo))
- W_DecreaseAmmo(ammo_cells, WEP_CVAR_SEC(minstanex, ammo), WEP_CVAR(minstanex, reload_ammo));
+ W_DecreaseAmmo(WEP_CVAR_SEC(minstanex, ammo));
// ugly minstagib hack to reuse the fire mode of the laser
float w;
{
entity gren;
- W_DecreaseAmmo(ammo_rockets, WEP_CVAR_PRI(mortar, ammo), autocvar_g_balance_mortar_reload_ammo); // WEAPONTODO
+ W_DecreaseAmmo(WEP_CVAR_PRI(mortar, ammo));
W_SetupShot_ProjectileSize (self, '-3 -3 -3', '3 3 3', FALSE, 4, "weapons/grenade_fire.wav", CH_WEAPON_A, WEP_CVAR_PRI(mortar, damage));
w_shotdir = v_forward; // no TrueAim for grenades please
{
entity gren;
- W_DecreaseAmmo(ammo_rockets, WEP_CVAR_SEC(mortar, ammo), autocvar_g_balance_mortar_reload_ammo);
+ W_DecreaseAmmo(WEP_CVAR_SEC(mortar, ammo));
W_SetupShot_ProjectileSize (self, '-3 -3 -3', '3 3 3', FALSE, 4, "weapons/grenade_fire.wav", CH_WEAPON_A, WEP_CVAR_SEC(mortar, damage));
w_shotdir = v_forward; // no TrueAim for grenades please
//beam and muzzle flash done on client
SendCSQCNexBeamParticle(charge);
- W_DecreaseAmmo(ammo_cells, myammo, autocvar_g_balance_nex_reload_ammo);
+ W_DecreaseAmmo(myammo);
}
void spawnfunc_weapon_nex (void); // defined in t_items.qc
{
float i;
- W_DecreaseAmmo(ammo_nails, pAmmo, autocvar_g_balance_rifle_reload_ammo);
+ W_DecreaseAmmo(pAmmo);
W_SetupShot (self, TRUE, 2, pSound, CH_WEAPON_A, pDamage * pShots);
{
entity missile;
- W_DecreaseAmmo(ammo_rockets, WEP_CVAR(seeker, missile_ammo), autocvar_g_balance_seeker_reload_ammo);
+ W_DecreaseAmmo(WEP_CVAR(seeker, missile_ammo));
makevectors(self.v_angle);
W_SetupShot_ProjectileSize (self, '-2 -2 -2', '2 2 2', FALSE, 2, "weapons/seeker_fire.wav", CH_WEAPON_A, 0);
vector f_diff;
float c;
- W_DecreaseAmmo(ammo_rockets, WEP_CVAR(seeker, flac_ammo), autocvar_g_balance_seeker_reload_ammo);
+ W_DecreaseAmmo(WEP_CVAR(seeker, flac_ammo));
c = mod(self.bulletcounter, 4);
switch(c)
void W_Seeker_Fire_Tag()
{
entity missile;
- W_DecreaseAmmo(ammo_rockets, WEP_CVAR(seeker, tag_ammo), autocvar_g_balance_seeker_reload_ammo);
+ W_DecreaseAmmo(WEP_CVAR(seeker, tag_ammo));
W_SetupShot_ProjectileSize (self, '-2 -2 -2', '2 2 2', FALSE, 2, "weapons/tag_fire.wav", CH_WEAPON_A, WEP_CVAR(seeker, missile_damage) * WEP_CVAR(seeker, missile_count));
}
}
-void W_DecreaseAmmo(.float ammo_type, float ammo_use, float ammo_reload) // WEAPONTODO: why does this have ammo_type?
+void W_DecreaseAmmo(float ammo_use)
{
- if((self.items & IT_UNLIMITED_WEAPON_AMMO) && !ammo_reload)
+ if((self.items & IT_UNLIMITED_WEAPON_AMMO) && !self.reloading_ammo)
return;
// if this weapon is reloadable, decrease its load. Else decrease the player's ammo
- if(ammo_reload)
+ if(self.reloading_ammo)
{
self.clip_load -= ammo_use;
self.(weapon_load[self.weapon]) = self.clip_load;