}
// draw ammo status bar
- if(autocvar_hud_panel_weapons_ammo && self.current_ammo != ammo_none)
+ if(autocvar_hud_panel_weapons_ammo && self.ammo_field != ammo_none)
{
a = 0;
ammo_type = GetAmmoTypeForWep(self.weapon);
case WR_SETUP:
{
- self.current_ammo = ammo_none;
+ self.ammo_field = ammo_none;
return TRUE;
}
}
case WR_SETUP:
{
- self.current_ammo = ammo_none;
+ self.ammo_field = ammo_none;
return TRUE;
}
case WR_CHECKAMMO1:
}
case WR_SETUP:
{
- self.current_ammo = ammo_none;
+ self.ammo_field = ammo_none;
return TRUE;
}
case WR_RESETPLAYER:
}
case WR_SETUP:
{
- self.current_ammo = ammo_none;
+ self.ammo_field = ammo_none;
return TRUE;
}
case WR_CHECKAMMO1:
}
case WR_SETUP:
{
- self.current_ammo = ammo_none;
+ self.ammo_field = ammo_none;
self.tuba_instrument = 0;
return TRUE;
}
}
case WR_SETUP:
{
- self.current_ammo = AMMO_VAL(WEP_VAPORIZER);
+ self.ammo_field = AMMO_VAL(WEP_VAPORIZER);
self.vaporizer_lasthit = 0;
return TRUE;
}
e.model2 = strzone(strcat("wpn-", ftos(id)));
e.impulse = i;
e.bot_pickupbasevalue = pickupbasevalue;
- e.current_ammo = ammotype;
+ e.ammo_field = ammotype;
#ifndef MENUQC
func(WR_INIT);
dummy_weapon_info.model2 = "";
dummy_weapon_info.impulse = -1;
dummy_weapon_info.bot_pickupbasevalue = 0;
- dummy_weapon_info.current_ammo = ammo_none;
+ dummy_weapon_info.ammo_field = ammo_none;
float i;
weaponorder_byid = "";
.float impulse; // weapon impulse
.float bot_pickupbasevalue; // bot weapon priority
.string model2; // wpn- sprite name
-..float current_ammo; // main ammo field
+..float ammo_field; // main ammo field
// other useful macros
#define WEP_ACTION(wpn,wrequest) (get_weaponinfo(wpn)).weapon_func(wrequest)
-#define AMMO_VAL(wpn) ((get_weaponinfo(wpn)).current_ammo)
+#define AMMO_VAL(wpn) ((get_weaponinfo(wpn)).ammo_field)
// =====================
// Weapon Registration
if(self.items & IT_UNLIMITED_WEAPON_AMMO)
{
- switch(e.current_ammo)
+ switch(e.ammo_field)
{
case ammo_shells: self.ammo_shells = autocvar_g_pickup_shells_max; break;
case ammo_nails: self.ammo_nails = autocvar_g_pickup_nails_max; break;
}
else
{
- switch(e.current_ammo)
+ switch(e.ammo_field)
{
case ammo_shells: self.ammo_shells = autocvar_g_balance_nix_ammo_shells; break;
case ammo_nails: self.ammo_nails = autocvar_g_balance_nix_ammo_nails; break;
if(!(self.items & IT_UNLIMITED_WEAPON_AMMO) && time > self.nix_nextincr)
{
- switch(e.current_ammo)
+ switch(e.ammo_field)
{
case ammo_shells: self.ammo_shells += autocvar_g_balance_nix_ammoincr_shells; break;
case ammo_nails: self.ammo_nails += autocvar_g_balance_nix_ammoincr_nails; break;
Item_ScheduleRespawnIn(e, game_starttime - time + ITEM_RESPAWNTIME_INITIAL(e));
}
-float Item_GiveAmmoTo(entity item, entity player, .float ammofield, float ammomax, float mode)
+float Item_GiveAmmoTo(entity item, entity player, .float ammotype, float ammomax, float mode)
{
- if (!item.ammofield)
+ if (!item.ammotype)
return FALSE;
if (item.spawnshieldtime)
{
- if ((player.ammofield < ammomax) || item.pickup_anyway)
+ if ((player.ammotype < ammomax) || item.pickup_anyway)
{
- player.ammofield = bound(player.ammofield, ammomax, player.ammofield + item.ammofield);
+ player.ammotype = bound(player.ammotype, ammomax, player.ammotype + item.ammotype);
goto YEAH;
}
}
else if(g_weapon_stay == 2)
{
- float mi = min(item.ammofield, ammomax);
- if (player.ammofield < mi)
+ float mi = min(item.ammotype, ammomax);
+ if (player.ammotype < mi)
{
- player.ammofield = mi;
+ player.ammotype = mi;
goto YEAH;
}
}
float ITEM_MODE_HEALTH = 1;
float ITEM_MODE_ARMOR = 2;
float ITEM_MODE_FUEL = 3;
-float Item_GiveAmmoTo(entity item, entity player, .float ammofield, float ammomax, float mode);
+float Item_GiveAmmoTo(entity item, entity player, .float ammotype, float ammomax, float mode);
float Item_GiveTo(entity item, entity player);
self.superweapons_finished = autocvar_g_balance_superweapons_time;
// if we don't already have ammo, give us some ammo
- if(!self.(e.current_ammo))
+ if(!self.(e.ammo_field))
{
- switch(e.current_ammo)
+ switch(e.ammo_field)
{
case ammo_shells: self.ammo_shells = cvar("g_pickup_shells_weapon"); break;
case ammo_nails: self.ammo_nails = cvar("g_pickup_nails_weapon"); break;
{
if(e.items & j)
{
- ammofield = Item_CounterField(j);
- if(!self.ammofield)
- self.ammofield = cvar(strcat("g_pickup_", Item_CounterFieldName(j), "_weapon"));
+ ammotype = Item_CounterField(j);
+ if(!self.ammotype)
+ self.ammotype = cvar(strcat("g_pickup_", Item_CounterFieldName(j), "_weapon"));
}
}
}
entity oldself, wep;
float thisammo, i;
string s;
- var .float ammofield = (get_weaponinfo(wpn)).current_ammo;
+ var .float ammotype = (get_weaponinfo(wpn)).ammo_field;
wep = spawn();
wep.pickup_anyway = TRUE; // these are ALWAYS pickable
//wa = W_AmmoItemCode(wpn);
- if(ammofield == ammo_none)
+ if(ammotype == ammo_none)
{
return "";
}
// if our weapon is loaded, give its load back to the player
if(self.(weapon_load[self.weapon]) > 0)
{
- own.ammofield += self.(weapon_load[self.weapon]);
+ own.ammotype += self.(weapon_load[self.weapon]);
self.(weapon_load[self.weapon]) = -1; // schedule the weapon for reloading
}
- wep.ammofield = 0;
+ wep.ammotype = 0;
}
else if(doreduce)
{
// if our weapon is loaded, give its load back to the player
if(self.(weapon_load[self.weapon]) > 0)
{
- own.ammofield += self.(weapon_load[self.weapon]);
+ own.ammotype += self.(weapon_load[self.weapon]);
self.(weapon_load[self.weapon]) = -1; // schedule the weapon for reloading
}
- thisammo = min(own.ammofield, wep.ammofield);
- wep.ammofield = thisammo;
- own.ammofield -= thisammo;
+ thisammo = min(own.ammotype, wep.ammotype);
+ wep.ammotype = thisammo;
+ own.ammotype -= thisammo;
- switch(ammofield)
+ switch(ammotype)
{
case ammo_shells: s = sprintf("%s and %d shells", s, thisammo); break;
case ammo_nails: s = sprintf("%s and %d nails", s, thisammo); break;
// start weapons that take no ammo can't be dropped (this prevents dropping the laser, as long as it continues to use no ammo)
if(start_items & IT_UNLIMITED_WEAPON_AMMO)
return 0;
- if((get_weaponinfo(w)).current_ammo == ammo_none)
+ if((get_weaponinfo(w)).ammo_field == ammo_none)
return 0;
}
self.weapon = self.switchweapon;
self.weaponname = newwep.mdl;
self.bulletcounter = 0; // WEAPONTODO
- //self.current_ammo = newwep.current_ammo;
+ //self.ammo_field = newwep.ammo_field;
WEP_ACTION(self.switchweapon, WR_SETUP);
self.weaponentity.state = WS_RAISE;
self.(weapon_load[self.weapon]) = self.clip_load;
}
else
- self.(wep.current_ammo) -= ammo_use;
+ self.(wep.ammo_field) -= ammo_use;
}
// weapon reloading code
self.clip_load = self.old_clip_load; // restore the ammo counter, in case we still had ammo in the weapon before reloading
// if the gun uses no ammo, max out weapon load, else decrease ammo as we increase weapon load
- if(!self.reload_ammo_min || self.items & IT_UNLIMITED_WEAPON_AMMO || self.current_ammo == ammo_none)
+ if(!self.reload_ammo_min || self.items & IT_UNLIMITED_WEAPON_AMMO || self.ammo_field == ammo_none)
self.clip_load = self.reload_ammo_amount;
else
{
- while(self.clip_load < self.reload_ammo_amount && self.(self.current_ammo)) // make sure we don't add more ammo than we have
+ while(self.clip_load < self.reload_ammo_amount && self.(self.ammo_field)) // make sure we don't add more ammo than we have
{
self.clip_load += 1;
- self.(self.current_ammo) -= 1;
+ self.(self.ammo_field) -= 1;
}
}
self.(weapon_load[self.weapon]) = self.clip_load;
return;
// no ammo, so nothing to load
- if(self.current_ammo != ammo_none)
- if(!self.(self.current_ammo) && self.reload_ammo_min)
+ if(self.ammo_field != ammo_none)
+ if(!self.(self.ammo_field) && self.reload_ammo_min)
if (!(self.items & IT_UNLIMITED_WEAPON_AMMO))
{
if(IS_REAL_CLIENT(self) && self.reload_complain < time)