set g_balance_electro_combo_radius 250
set g_balance_electro_combo_comboradius 0
set g_balance_electro_combo_speed 2000
+set g_balance_electro_combo_safeammocheck 0
set g_balance_electro_reload_ammo 0 //default: 20
set g_balance_electro_reload_time 2
// }}}
set g_balance_electro_combo_radius 250
set g_balance_electro_combo_comboradius 0
set g_balance_electro_combo_speed 400
+set g_balance_electro_combo_safeammocheck 1
set g_balance_electro_reload_ammo 0 //default: 20
set g_balance_electro_reload_time 2
// }}}
set g_balance_electro_combo_radius 175
set g_balance_electro_combo_comboradius 275
set g_balance_electro_combo_speed 2000
+set g_balance_electro_combo_safeammocheck 0
set g_balance_electro_reload_ammo 0 //default: 20
set g_balance_electro_reload_time 2
// }}}
set g_balance_electro_combo_radius 175
set g_balance_electro_combo_comboradius 275
set g_balance_electro_combo_speed 2000
+set g_balance_electro_combo_safeammocheck 1
set g_balance_electro_reload_ammo 0 //default: 20
set g_balance_electro_reload_time 2
// }}}
float autocvar_g_balance_electro_combo_force;
float autocvar_g_balance_electro_combo_radius;
float autocvar_g_balance_electro_combo_speed;
+float autocvar_g_balance_electro_combo_safeammocheck;
float autocvar_g_balance_electro_lightning;
float autocvar_g_balance_electro_primary_ammo;
float autocvar_g_balance_electro_primary_animtime;
if(ww)
W_SwitchWeapon_Force(pl, ww);
}
+
+string PrimaryOrSecondary(float secondary)
+{
+ if(secondary)
+ return "secondary";
+ else
+ return "primary";
+}
+
.float prevdryfire;
+.float prevwarntime;
float weapon_prepareattack_checkammo(float secondary)
{
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
self.prevdryfire = time;
}
- W_SwitchToOtherWeapon(self);
+ if(weapon_action(self.weapon, WR_CHECKAMMO2 - secondary)) // check if the other firing mode has enough ammo
+ {
+ if(time - self.prevwarntime > 1)
+ {
+ sprint(self, strcat("^2", W_Name(self.weapon), " ", PrimaryOrSecondary(secondary), "^7 is unable to fire, but its ^2", PrimaryOrSecondary(1 - secondary), "^7 can.\n"));
+ }
+ self.prevwarntime = time;
+ }
+ else // this weapon is totally unable to fire, switch to another one
+ {
+ W_SwitchToOtherWeapon(self);
+ }
+
return FALSE;
}
return TRUE;
}
else if (req == WR_CHECKAMMO2)
{
- ammo_amount = self.ammo_cells >= autocvar_g_balance_electro_secondary_ammo;
- ammo_amount += self.(weapon_load[WEP_ELECTRO]) >= autocvar_g_balance_electro_secondary_ammo;
+ if(autocvar_g_balance_electro_combo_safeammocheck) // true if you can fire at least one secondary blob AND one primary shot after it, otherwise false.
+ {
+ ammo_amount = self.ammo_cells >= autocvar_g_balance_electro_secondary_ammo + autocvar_g_balance_electro_primary_ammo;
+ ammo_amount += self.(weapon_load[WEP_ELECTRO]) >= autocvar_g_balance_electro_secondary_ammo + autocvar_g_balance_electro_primary_ammo;
+ }
+ else
+ {
+ ammo_amount = self.ammo_cells >= autocvar_g_balance_electro_secondary_ammo;
+ ammo_amount += self.(weapon_load[WEP_ELECTRO]) >= autocvar_g_balance_electro_secondary_ammo;
+ }
return ammo_amount;
}
else if (req == WR_RESETPLAYER)
if(W_Mine_Count(self) >= autocvar_g_balance_minelayer_limit)
{
// the refire delay keeps this message from being spammed
- sprint(self, strcat("You cannot place more than ^2", ftos(autocvar_g_balance_minelayer_limit), " ^7mines at a time\n") );
+ sprint(self, strcat("minelayer: You cannot place more than ^2", ftos(autocvar_g_balance_minelayer_limit), " ^7mines at a time\n") );
play2(self, "weapons/unavailable.wav");
return;
}
}
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.(weapon_load[WEP_NEX]) >= autocvar_g_balance_nex_secondary_ammo;
- return ammo_amount;
+ if(autocvar_g_balance_nex_secondary)
+ {
+ // 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.(weapon_load[WEP_NEX]) >= autocvar_g_balance_nex_secondary_ammo;
+ return ammo_amount;
+ }
+ else
+ {
+ return FALSE; // zoom is not a fire mode
+ }
}
else if (req == WR_RELOAD)
{