e = get_weaponinfo(self.weapon);
// our weapon is fully loaded, no need to reload
- if (self.ammo_loaded >= cvar(strcat("g_balance_", e.netname, "_reload_ammo")))
+ if (self.clip_load >= cvar(strcat("g_balance_", e.netname, "_reload_ammo")))
return 0;
// no ammo, so nothing to load
self.reload_complain = time + 1;
}
// is there's no more ammo to reload, only switch to another weapon if there's no more load in this one
- if(!self.ammo_loaded)
+ if(!self.clip_load)
{
- self.ammo_loaded = -1; // reload later
+ self.clip_load = -1; // reload later
W_SwitchToOtherWeapon(self);
}
return 0;
float client_cefc_accumulatortime;
#endif
-.float ammo_loaded;
-.float old_ammo_loaded;
-.float ammo_max;
+.float clip_load;
+.float old_clip_load;
+.float clip_size;
.float wish_reload;
#define PROJECTILE_MAKETRIGGER(e) (e).solid = SOLID_CORPSE; (e).dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE
addstat(STAT_FUEL, AS_INT, ammo_fuel);
addstat(STAT_SHOTORG, AS_INT, stat_shotorg);
addstat(STAT_LEADLIMIT, AS_FLOAT, stat_leadlimit);
- addstat(STAT_WEAPON_CLIPLOAD, AS_INT, ammo_loaded);
- addstat(STAT_WEAPON_CLIPSIZE, AS_INT, ammo_max);
+ addstat(STAT_WEAPON_CLIPLOAD, AS_INT, clip_load);
+ addstat(STAT_WEAPON_CLIPSIZE, AS_INT, clip_size);
addstat(STAT_LAST_PICKUP, AS_FLOAT, last_pickup);
addstat(STAT_NEX_CHARGE, AS_FLOAT, nex_charge);
void W_Shotgun_SetAmmoCounter()
{
- // set ammo_loaded to the weapon we have switched to, if the gun uses reloading
+ // set clip_load to the weapon we have switched to, if the gun uses reloading
if(!autocvar_g_balance_shotgun_reload_ammo)
- self.ammo_loaded = 0; // also keeps crosshair ammo from displaying
+ self.clip_load = 0; // also keeps crosshair ammo from displaying
else
{
- self.ammo_loaded = self.shotgun_load;
- self.ammo_max = autocvar_g_balance_shotgun_reload_ammo; // for the crosshair ammo display
+ self.clip_load = self.shotgun_load;
+ self.clip_size = autocvar_g_balance_shotgun_reload_ammo; // for the crosshair ammo display
}
}
float t;
// now do the ammo transfer
- self.ammo_loaded = self.old_ammo_loaded; // restore the ammo counter, in case we still had ammo in the weapon before reloading
- while(self.ammo_loaded < autocvar_g_balance_shotgun_reload_ammo && self.ammo_shells) // make sure we don't add more ammo than we have
+ self.clip_load = self.old_clip_load; // restore the ammo counter, in case we still had ammo in the weapon before reloading
+ while(self.clip_load < autocvar_g_balance_shotgun_reload_ammo && self.ammo_shells) // make sure we don't add more ammo than we have
{
- self.ammo_loaded += 1;
+ self.clip_load += 1;
self.ammo_shells -= 1;
}
- self.shotgun_load = self.ammo_loaded;
+ self.shotgun_load = self.clip_load;
t = ATTACK_FINISHED(self) - autocvar_g_balance_shotgun_reload_time - 1;
ATTACK_FINISHED(self) = t;
weapon_thinkf(WFRAME_RELOAD, autocvar_g_balance_shotgun_reload_time, W_Shotgun_ReloadedAndReady);
- self.old_ammo_loaded = self.ammo_loaded;
- self.ammo_loaded = -1;
+ self.old_clip_load = self.clip_load;
+ self.clip_load = -1;
}
void W_Shotgun_Attack (void)
float bulletconstant;
local entity flash;
- if(autocvar_g_balance_shotgun_reload_ammo && self.ammo_loaded <= 0)
+ if(autocvar_g_balance_shotgun_reload_ammo && self.clip_load <= 0)
return; // reloading, so we are done
ammoamount = autocvar_g_balance_shotgun_primary_ammo;
self.ammo_shells -= ammoamount;
else
{
- self.ammo_loaded -= ammoamount;
- self.shotgun_load = self.ammo_loaded;
+ self.clip_load -= ammoamount;
+ self.shotgun_load = self.clip_load;
}
}
}
self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, FALSE);
else if (req == WR_THINK)
{
- if(autocvar_g_balance_shotgun_reload_ammo && self.ammo_loaded <= 0) // forced reload
+ if(autocvar_g_balance_shotgun_reload_ammo && self.clip_load <= 0) // forced reload
W_Shotgun_Reload();
else
{
void W_SniperRifle_SetAmmoCounter()
{
- // set ammo_loaded to the weapon we have switched to, if the gun uses reloading
+ // set clip_load to the weapon we have switched to, if the gun uses reloading
if(!autocvar_g_balance_sniperrifle_reload_ammo)
- self.ammo_loaded = 0; // also keeps crosshair ammo from displaying
+ self.clip_load = 0; // also keeps crosshair ammo from displaying
else
{
- self.ammo_loaded = self.sniperrifle_load;
- self.ammo_max = autocvar_g_balance_sniperrifle_reload_ammo; // for the crosshair ammo display
+ self.clip_load = self.sniperrifle_load;
+ self.clip_size = autocvar_g_balance_sniperrifle_reload_ammo; // for the crosshair ammo display
}
}
float t;
// now do the ammo transfer
- self.ammo_loaded = self.old_ammo_loaded; // restore the ammo counter, in case we still had ammo in the weapon before reloading
- while(self.ammo_loaded < autocvar_g_balance_sniperrifle_reload_ammo && self.ammo_nails) // make sure we don't add more ammo than we have
+ self.clip_load = self.old_clip_load; // restore the ammo counter, in case we still had ammo in the weapon before reloading
+ while(self.clip_load < autocvar_g_balance_sniperrifle_reload_ammo && self.ammo_nails) // make sure we don't add more ammo than we have
{
- self.ammo_loaded += 1;
+ self.clip_load += 1;
self.ammo_nails -= 1;
}
- self.sniperrifle_load = self.ammo_loaded;
+ self.sniperrifle_load = self.clip_load;
t = ATTACK_FINISHED(self) - autocvar_g_balance_sniperrifle_reload_time - 1;
ATTACK_FINISHED(self) = t;
weapon_thinkf(WFRAME_RELOAD, autocvar_g_balance_sniperrifle_reload_time, W_SniperRifle_ReloadedAndReady);
- self.old_ammo_loaded = self.ammo_loaded;
- self.ammo_loaded = -1;
+ self.old_clip_load = self.clip_load;
+ self.clip_load = -1;
}
void W_SniperRifle_FireBullet(float pSpread, float pDamage, float pHeadshotAddedDamage, float pForce, float pSpeed, float pLifetime, float pAmmo, float deathtype, float pBulletConstant)
self.ammo_nails -= pAmmo;
else
{
- self.ammo_loaded -= pAmmo;
- self.sniperrifle_load = self.ammo_loaded;
+ self.clip_load -= pAmmo;
+ self.sniperrifle_load = self.clip_load;
}
}
}
{
float r, sw, af;
- if(autocvar_g_balance_sniperrifle_reload_ammo && self.ammo_loaded <= 0)
+ if(autocvar_g_balance_sniperrifle_reload_ammo && self.clip_load <= 0)
return; // reloading, so we are done
sw = self.switchweapon; // make it not detect weapon changes as reason to abort firing
}
else if (req == WR_THINK)
{
- if(autocvar_g_balance_sniperrifle_reload_ammo && self.ammo_loaded <= 0) // forced reload
+ if(autocvar_g_balance_sniperrifle_reload_ammo && self.clip_load <= 0) // forced reload
W_SniperRifle_Reload();
else
{
else if (req == WR_RESETPLAYER)
{
self.sniperrifle_accumulator = time - autocvar_g_balance_sniperrifle_bursttime;
- self.ammo_loaded = autocvar_g_balance_sniperrifle_reload_ammo;
+ self.clip_load = autocvar_g_balance_sniperrifle_reload_ammo;
}
return TRUE;
};