float w_crylink(float req)
{
+ float ammo_amount;
if (req == WR_AIM)
{
if (random() < 0.10)
if(self.crylink_lastgroup && self.crylink_waitrelease)
return TRUE;
- if(autocvar_g_balance_crylink_reload_ammo)
- return self.crylink_load >= autocvar_g_balance_crylink_primary_ammo;
- else
- return self.ammo_cells >= autocvar_g_balance_crylink_primary_ammo;
+ ammo_amount = self.ammo_cells >= autocvar_g_balance_crylink_primary_ammo;
+ ammo_amount += (autocvar_g_balance_crylink_reload_ammo && self.crylink_load >= autocvar_g_balance_crylink_primary_ammo);
+ return ammo_amount;
}
else if (req == WR_CHECKAMMO2)
{
if(self.crylink_lastgroup && self.crylink_waitrelease)
return TRUE;
- if(autocvar_g_balance_crylink_reload_ammo)
- return self.crylink_load >= autocvar_g_balance_crylink_secondary_ammo;
- else
- return self.ammo_cells >= autocvar_g_balance_crylink_secondary_ammo;
+ ammo_amount = self.ammo_cells >= autocvar_g_balance_crylink_secondary_ammo;
+ ammo_amount += (autocvar_g_balance_crylink_reload_ammo && self.crylink_load >= autocvar_g_balance_crylink_secondary_ammo);
+ return ammo_amount;
}
else if (req == WR_RELOAD)
{
.float BUTTON_ATCK_prev;
float w_electro(float req)
{
+ float ammo_amount;
if (req == WR_AIM)
{
self.BUTTON_ATCK=FALSE;
}
else if (req == WR_CHECKAMMO1)
{
- if(autocvar_g_balance_electro_reload_ammo)
- {
- if(autocvar_g_balance_electro_lightning)
- return !autocvar_g_balance_electro_primary_ammo || (self.electro_load > 0);
- else
- return self.electro_load >= autocvar_g_balance_electro_primary_ammo;
- }
+ if(autocvar_g_balance_electro_lightning)
+ ammo_amount = !autocvar_g_balance_electro_primary_ammo || (self.ammo_cells > 0);
else
+ ammo_amount = self.ammo_cells >= autocvar_g_balance_electro_primary_ammo;
+ if(autocvar_g_balance_electro_reload_ammo)
{
if(autocvar_g_balance_electro_lightning)
- return !autocvar_g_balance_electro_primary_ammo || (self.ammo_cells > 0);
+ ammo_amount += !autocvar_g_balance_electro_primary_ammo || (self.electro_load > 0);
else
- return self.ammo_cells >= autocvar_g_balance_electro_primary_ammo;
+ ammo_amount += self.electro_load >= autocvar_g_balance_electro_primary_ammo;
}
+ return ammo_amount;
}
else if (req == WR_CHECKAMMO2)
{
- if(autocvar_g_balance_electro_reload_ammo)
- return self.electro_load >= autocvar_g_balance_electro_secondary_ammo;
- else
- return self.ammo_cells >= autocvar_g_balance_electro_secondary_ammo;
+ ammo_amount = self.ammo_cells >= autocvar_g_balance_electro_secondary_ammo;
+ ammo_amount += (autocvar_g_balance_electro_reload_ammo && self.electro_load >= autocvar_g_balance_electro_secondary_ammo);
+ return ammo_amount;
}
else if (req == WR_RESETPLAYER)
{
float w_fireball(float req)
{
+ float ammo_amount;
if (req == WR_AIM)
{
self.BUTTON_ATCK = FALSE;
}
else if (req == WR_CHECKAMMO1)
{
- if(autocvar_g_balance_fireball_reload_ammo)
- return self.fireball_load >= autocvar_g_balance_fireball_primary_ammo;
- else
- return self.ammo_fuel >= autocvar_g_balance_fireball_primary_ammo;
+ ammo_amount = self.ammo_fuel >= autocvar_g_balance_fireball_primary_ammo;
+ ammo_amount += (autocvar_g_balance_fireball_reload_ammo && self.fireball_load >= autocvar_g_balance_fireball_primary_ammo);
+ return ammo_amount;
}
else if (req == WR_CHECKAMMO2)
{
- if(autocvar_g_balance_fireball_reload_ammo)
- return self.fireball_load >= autocvar_g_balance_fireball_secondary_ammo;
- else
- return self.ammo_fuel >= autocvar_g_balance_fireball_secondary_ammo;
+ ammo_amount = self.ammo_fuel >= autocvar_g_balance_fireball_secondary_ammo;
+ ammo_amount += (autocvar_g_balance_fireball_reload_ammo && self.fireball_load >= autocvar_g_balance_fireball_secondary_ammo);
+ return ammo_amount;
}
else if (req == WR_RESETPLAYER)
{
{
entity nade;
float nadefound;
+ float ammo_amount;
if (req == WR_AIM)
{
}
else if (req == WR_CHECKAMMO1)
{
- if(autocvar_g_balance_grenadelauncher_reload_ammo)
- return self.grenadelauncher_load >= autocvar_g_balance_grenadelauncher_primary_ammo;
- else
- return self.ammo_rockets >= autocvar_g_balance_grenadelauncher_primary_ammo;
+ ammo_amount = self.ammo_rockets >= autocvar_g_balance_grenadelauncher_primary_ammo;
+ ammo_amount += (autocvar_g_balance_grenadelauncher_reload_ammo && self.grenadelauncher_load >= autocvar_g_balance_grenadelauncher_primary_ammo);
+ return ammo_amount;
}
else if (req == WR_CHECKAMMO2)
{
- if(autocvar_g_balance_grenadelauncher_reload_ammo)
- return self.grenadelauncher_load >= autocvar_g_balance_grenadelauncher_secondary_ammo;
- else
- return self.ammo_rockets >= autocvar_g_balance_grenadelauncher_secondary_ammo;
+ ammo_amount = self.ammo_rockets >= autocvar_g_balance_grenadelauncher_secondary_ammo;
+ ammo_amount += (autocvar_g_balance_grenadelauncher_reload_ammo && self.grenadelauncher_load >= autocvar_g_balance_grenadelauncher_secondary_ammo);
+ return ammo_amount;
}
else if (req == WR_RELOAD)
{
float w_hagar(float req)
{
+ float ammo_amount;
if (req == WR_AIM)
if (random()>0.15)
self.BUTTON_ATCK = bot_aim(autocvar_g_balance_hagar_primary_speed, 0, autocvar_g_balance_hagar_primary_lifetime, FALSE);
}
else if (req == WR_CHECKAMMO1)
{
- if(autocvar_g_balance_hagar_reload_ammo)
- return self.hagar_load >= autocvar_g_balance_hagar_primary_ammo;
- else
- return self.ammo_rockets >= autocvar_g_balance_hagar_primary_ammo;
+ ammo_amount = self.ammo_rockets >= autocvar_g_balance_hagar_primary_ammo;
+ ammo_amount += (autocvar_g_balance_hagar_reload_ammo && self.hagar_load >= autocvar_g_balance_hagar_primary_ammo);
+ return ammo_amount;
}
else if (req == WR_CHECKAMMO2)
{
- if(autocvar_g_balance_hagar_reload_ammo)
- return self.hagar_load >= autocvar_g_balance_hagar_secondary_ammo;
- else
- return self.ammo_rockets >= autocvar_g_balance_hagar_secondary_ammo;
+ ammo_amount = self.ammo_rockets >= autocvar_g_balance_hagar_secondary_ammo;
+ ammo_amount += (autocvar_g_balance_hagar_reload_ammo && self.hagar_load >= autocvar_g_balance_hagar_secondary_ammo);
+ return ammo_amount;
}
else if (req == WR_RELOAD)
{
float w_hlac(float req)
{
+ float ammo_amount;
if (req == WR_AIM)
self.BUTTON_ATCK = bot_aim(autocvar_g_balance_hlac_primary_speed, 0, autocvar_g_balance_hlac_primary_lifetime, FALSE);
else if (req == WR_THINK)
}
else if (req == WR_CHECKAMMO1)
{
- if(autocvar_g_balance_hlac_reload_ammo)
- return self.hlac_load >= autocvar_g_balance_hlac_primary_ammo;
- else
- return self.ammo_cells >= autocvar_g_balance_hlac_primary_ammo;
+ ammo_amount = self.ammo_cells >= autocvar_g_balance_hlac_primary_ammo;
+ ammo_amount += (autocvar_g_balance_hlac_reload_ammo && self.hlac_load >= autocvar_g_balance_hlac_primary_ammo);
+ return ammo_amount;
}
else if (req == WR_CHECKAMMO2)
{
- if(autocvar_g_balance_hlac_reload_ammo)
- return self.hlac_load >= autocvar_g_balance_hlac_secondary_ammo;
- else
- return self.ammo_cells >= autocvar_g_balance_hlac_secondary_ammo;
+ ammo_amount = self.ammo_cells >= autocvar_g_balance_hlac_secondary_ammo;
+ ammo_amount += (autocvar_g_balance_hlac_reload_ammo && self.hlac_load >= autocvar_g_balance_hlac_secondary_ammo);
+ return ammo_amount;
}
else if (req == WR_RELOAD)
{
{
entity mine;
float minfound;
+ float ammo_amount;
+
if (req == WR_AIM)
{
// aim and decide to fire if appropriate
else if (req == WR_CHECKAMMO1)
{
// don't switch while placing a mine
- if(autocvar_g_balance_electro_reload_ammo)
- {
- if ((ATTACK_FINISHED(self) <= time || self.weapon != WEP_MINE_LAYER)
- && self.clip_load < autocvar_g_balance_minelayer_ammo)
- return FALSE;
- }
- else
+ if (ATTACK_FINISHED(self) <= time || self.weapon != WEP_MINE_LAYER)
{
- if ((ATTACK_FINISHED(self) <= time || self.weapon != WEP_MINE_LAYER)
- && self.ammo_rockets < autocvar_g_balance_minelayer_ammo)
- return FALSE;
+ if(self.ammo_rockets < autocvar_g_balance_minelayer_ammo)
+ ammo_amount = FALSE;
+ if(autocvar_g_balance_electro_reload_ammo && self.minelayer_load < autocvar_g_balance_minelayer_ammo)
+ ammo_amount = FALSE;
}
+ return ammo_amount;
}
else if (req == WR_CHECKAMMO2)
{
float minstanex_ammo;
float w_minstanex(float req)
{
+ float ammo_amount;
if (req == WR_AIM)
{
if(self.ammo_cells > 0)
}
else if (req == WR_CHECKAMMO1)
{
- if(autocvar_g_balance_minstanex_reload_ammo)
- return self.clip_load >= minstanex_ammo;
- else
- return self.ammo_cells >= minstanex_ammo;
+ ammo_amount = self.ammo_cells >= autocvar_g_balance_minstanex_ammo;
+ ammo_amount += (autocvar_g_balance_minstanex_reload_ammo && self.minstanex_load >= autocvar_g_balance_minstanex_ammo);
+ return ammo_amount;
}
else if (req == WR_CHECKAMMO2)
{
if(!autocvar_g_balance_minstanex_laser_ammo)
return TRUE;
- if(autocvar_g_balance_minstanex_reload_ammo)
- return self.clip_load >= autocvar_g_balance_minstanex_laser_ammo;
- else
- return self.ammo_cells >= autocvar_g_balance_minstanex_laser_ammo;
+ ammo_amount = self.ammo_cells >= autocvar_g_balance_minstanex_laser_ammo;
+ ammo_amount += (autocvar_g_balance_minstanex_reload_ammo && self.minstanex_load >= autocvar_g_balance_minstanex_laser_ammo);
+ return ammo_amount;
}
else if (req == WR_RESETPLAYER)
{
float w_nex(float req)
{
float dt;
+ float ammo_amount;
if (req == WR_AIM)
{
self.BUTTON_ATCK = bot_aim(1000000, 0, 1, FALSE);
}
else if (req == WR_CHECKAMMO1)
{
- if(autocvar_g_balance_nex_reload_ammo)
- return self.clip_load >= autocvar_g_balance_nex_primary_ammo;
- else
- return self.ammo_cells >= autocvar_g_balance_nex_primary_ammo;
+ 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);
+ return ammo_amount;
}
else if (req == WR_CHECKAMMO2)
{
- if(autocvar_g_balance_nex_reload_ammo)
- return self.clip_load >= autocvar_g_balance_nex_primary_ammo; // don't allow charging if we don't have enough ammo
- else
- return self.ammo_cells >= autocvar_g_balance_nex_primary_ammo; // don't allow charging if we don't have enough ammo
+ // don't allow charging if we don't have enough ammo
+ ammo_amount = self.ammo_cells >= autocvar_g_balance_nex_secondary_ammo;
+ ammo_amount += (autocvar_g_balance_nex_reload_ammo && self.nex_load >= autocvar_g_balance_nex_secondary_ammo);
+ return ammo_amount;
}
else if (req == WR_RELOAD)
{
{
entity rock;
float rockfound;
+ float ammo_amount;
+
if (req == WR_AIM)
{
// aim and decide to fire if appropriate
}
else if (req == WR_CHECKAMMO1)
{
- if(autocvar_g_balance_rocketlauncher_reload_ammo)
- {
- // don't switch while guiding a missile
- if ((ATTACK_FINISHED(self) <= time || self.weapon != WEP_ROCKET_LAUNCHER)
- && self.clip_load < autocvar_g_balance_rocketlauncher_ammo)
- return FALSE;
- }
- else
+ // don't switch while guiding a missile
+ if (ATTACK_FINISHED(self) <= time || self.weapon != WEP_ROCKET_LAUNCHER)
{
- // don't switch while guiding a missile
- if ((ATTACK_FINISHED(self) <= time || self.weapon != WEP_ROCKET_LAUNCHER)
- && self.ammo_rockets < autocvar_g_balance_rocketlauncher_ammo)
- return FALSE;
+ if(self.ammo_rockets < autocvar_g_balance_rocketlauncher_ammo)
+ ammo_amount = FALSE;
+ if(autocvar_g_balance_electro_reload_ammo && self.minelayer_load < autocvar_g_balance_rocketlauncher_ammo)
+ ammo_amount = FALSE;
}
+ return ammo_amount;
}
else if (req == WR_CHECKAMMO2)
return FALSE;
float w_seeker(float req)
{
+ float ammo_amount;
+
if (req == WR_AIM)
self.BUTTON_ATCK = bot_aim(autocvar_g_balance_seeker_tag_speed, 0, 20, FALSE);
}
else if (req == WR_CHECKAMMO1)
{
- if(autocvar_g_balance_seeker_reload_ammo)
- return self.clip_load >= autocvar_g_balance_seeker_tag_ammo + autocvar_g_balance_seeker_missile_ammo;
- else
- return self.ammo_rockets >= autocvar_g_balance_seeker_tag_ammo + autocvar_g_balance_seeker_missile_ammo;
+ ammo_amount = self.ammo_cells >= autocvar_g_balance_seeker_missile_ammo;
+ ammo_amount += (autocvar_g_balance_seeker_reload_ammo && self.seeker_load >= autocvar_g_balance_seeker_missile_ammo);
+ return ammo_amount;
}
else if (req == WR_CHECKAMMO2)
{
- if(autocvar_g_balance_seeker_reload_ammo)
- return self.clip_load >= autocvar_g_balance_seeker_flac_ammo;
- else
- return self.ammo_rockets >= autocvar_g_balance_seeker_flac_ammo;
+ ammo_amount = self.ammo_cells >= autocvar_g_balance_seeker_flac_ammo;
+ ammo_amount += (autocvar_g_balance_seeker_reload_ammo && self.seeker_load >= autocvar_g_balance_seeker_flac_ammo);
+ return ammo_amount;
}
else if (req == WR_RELOAD)
{
.float bot_secondary_sniperriflemooth;
float w_sniperrifle(float req)
{
+ float ammo_amount;
+
if (req == WR_AIM)
{
self.BUTTON_ATCK=FALSE;
}
else if (req == WR_CHECKAMMO1)
{
- if(autocvar_g_balance_sniperrifle_reload_ammo)
- return self.sniperrifle_load >= autocvar_g_balance_sniperrifle_primary_ammo;
- else
- return self.ammo_nails >= autocvar_g_balance_sniperrifle_primary_ammo;
+ ammo_amount = self.ammo_cells >= autocvar_g_balance_sniperrifle_primary_ammo;
+ ammo_amount += (autocvar_g_balance_sniperrifle_reload_ammo && self.sniperrifle_load >= autocvar_g_balance_sniperrifle_primary_ammo);
+ return ammo_amount;
}
else if (req == WR_CHECKAMMO2)
{
- if(autocvar_g_balance_sniperrifle_reload_ammo)
- return self.sniperrifle_load >= autocvar_g_balance_sniperrifle_secondary_ammo;
- else
- return self.ammo_nails >= autocvar_g_balance_sniperrifle_secondary_ammo;
+ ammo_amount = self.ammo_cells >= autocvar_g_balance_sniperrifle_secondary_ammo;
+ ammo_amount += (autocvar_g_balance_sniperrifle_reload_ammo && self.sniperrifle_load >= autocvar_g_balance_sniperrifle_secondary_ammo);
+ return ammo_amount;
}
else if (req == WR_RELOAD)
{
float w_uzi(float req)
{
+ float ammo_amount;
if (req == WR_AIM)
if(vlen(self.origin-self.enemy.origin) < 3000 - bound(0, skill, 10) * 200)
self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, FALSE);
else if (req == WR_CHECKAMMO1)
{
if(autocvar_g_balance_uzi_mode == 1)
- return self.ammo_nails >= autocvar_g_balance_uzi_sustained_ammo;
+ ammo_amount = self.ammo_nails >= autocvar_g_balance_uzi_sustained_ammo;
else
- return self.ammo_nails >= autocvar_g_balance_uzi_first_ammo;
+ ammo_amount = self.ammo_nails >= autocvar_g_balance_uzi_first_ammo;
+
+ if(autocvar_g_balance_uzi_reload_ammo)
+ {
+ if(autocvar_g_balance_uzi_mode == 1)
+ ammo_amount += self.uzi_load >= autocvar_g_balance_uzi_sustained_ammo;
+ else
+ ammo_amount += self.uzi_load >= autocvar_g_balance_uzi_first_ammo;
+ }
+ return ammo_amount;
}
else if (req == WR_CHECKAMMO2)
{
if(autocvar_g_balance_uzi_mode == 1)
- return self.ammo_nails >= autocvar_g_balance_uzi_burst_ammo;
+ ammo_amount = self.ammo_nails >= autocvar_g_balance_uzi_burst_ammo;
else
- return self.ammo_nails >= autocvar_g_balance_uzi_first_ammo;
+ ammo_amount = self.ammo_nails >= autocvar_g_balance_uzi_first_ammo;
+
+ if(autocvar_g_balance_uzi_reload_ammo)
+ {
+ if(autocvar_g_balance_uzi_mode == 1)
+ ammo_amount += self.uzi_load >= autocvar_g_balance_uzi_burst_ammo;
+ else
+ ammo_amount += self.uzi_load >= autocvar_g_balance_uzi_first_ammo;
+ }
+ return ammo_amount;
}
else if (req == WR_RELOAD)
{