.vector ok_deathloc;
.float ok_spawnsys_timer;
-.float ok_lastwep;
+.Weapon ok_lastwep[MAX_WEAPONSLOTS];
.float ok_item;
- .float ok_pauseregen_finished;
-.float ok_notice_time;
-.float ammo_charge[Weapons_MAX];
-.float ok_use_ammocharge = _STAT(OK_AMMO_CHARGE);
-.float ok_ammo_charge = _STAT(OK_AMMO_CHARGEPOOL);
-
-void(entity ent, float wep) ok_DecreaseCharge;
--
void ok_Initialize();
REGISTER_MUTATOR(ok, cvar("g_overkill") && !cvar("g_instagib") && !g_nexball && cvar_string("g_mod_balance") == "Overkill")
if(IS_DEAD(player) || !IS_PLAYER(player) || STAT(FROZEN, player))
return;
- if(player.ok_lastwep)
+ for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
{
- Weapon newwep = Weapons_from(player.ok_lastwep);
- if(player.ok_lastwep == WEP_HMG.m_id)
- newwep = WEP_MACHINEGUN;
- if(player.ok_lastwep == WEP_RPC.m_id)
- newwep = WEP_VORTEX;
- PS(player).m_switchweapon = newwep;
- player.ok_lastwep = 0;
- }
+ .entity weaponentity = weaponentities[slot];
+ entity thiswep = player.(weaponentity);
- ok_IncreaseCharge(player, PS(player).m_weapon.m_id);
+ if(player.ok_lastwep[slot] && player.ok_lastwep[slot] != WEP_Null)
+ {
+ Weapon newwep = player.ok_lastwep[slot];
+ if(player.ok_lastwep[slot] == WEP_HMG)
+ newwep = WEP_MACHINEGUN;
+ if(player.ok_lastwep[slot] == WEP_RPC)
+ newwep = WEP_VORTEX;
+ thiswep.m_switchweapon = newwep;
+ player.ok_lastwep[slot] = WEP_Null;
+ }
+ }
if(PHYS_INPUT_BUTTON_ATCK2(player))
- if(!forbidWeaponUse(player) || player.weapon_blocked) // allow if weapon is blocked
+ if( !forbidWeaponUse(player) || player.weapon_blocked // allow if weapon is blocked
+ || (round_handler_IsActive() && !round_handler_IsRoundStarted()) )
if(time >= player.jump_interval)
{
player.jump_interval = time + WEP_CVAR_PRI(blaster, refire) * W_WeaponRateFactor(player);
{
entity player = M_ARGV(0, entity);
- if(autocvar_g_overkill_ammo_charge)
- {
- FOREACH(Weapons, it != WEP_Null, LAMBDA(player.ammo_charge[it.m_id] = autocvar_g_overkill_ammo_charge_limit));
-
- player.ok_use_ammocharge = 1;
- player.ok_notice_time = time;
- }
- else
- player.ok_use_ammocharge = 0;
-
// if player changed their weapon while dead, don't switch to their death weapon
if(player.impulse)
- player.ok_lastwep = 0;
+ {
+ for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ {
+ player.ok_lastwep[slot] = WEP_Null;
+ }
+ }
-
- player.ok_pauseregen_finished = time + 2;
}
void self_spawnfunc_weapon_hmg(entity this) { spawnfunc_weapon_hmg(this); }