.entity queuenext;
.entity queueprev;
-void W_Crylink_Reload()
-{
- W_Reload(ammo_cells, min(autocvar_g_balance_crylink_primary_ammo, autocvar_g_balance_crylink_secondary_ammo), autocvar_g_balance_crylink_reload_ammo, autocvar_g_balance_crylink_reload_time, "weapons/reload.wav");
-}
-
void W_Crylink_CheckLinks(entity e)
{
float i;
else if (req == WR_THINK)
{
if(autocvar_g_balance_crylink_reload_ammo && self.clip_load < min(autocvar_g_balance_crylink_primary_ammo, autocvar_g_balance_crylink_secondary_ammo)) // forced reload
- W_Crylink_Reload();
+ weapon_action(self.weapon, WR_RELOAD);
else if (self.BUTTON_ATCK)
{
if (!self.crylink_waitrelease)
}
else if (req == WR_RELOAD)
{
- W_Crylink_Reload();
+ W_Reload(ammo_cells, min(autocvar_g_balance_crylink_primary_ammo, autocvar_g_balance_crylink_secondary_ammo), autocvar_g_balance_crylink_reload_ammo, autocvar_g_balance_crylink_reload_time, "weapons/reload.wav");
}
return TRUE;
};
.float electro_count;
.float electro_secondarytime;
-void W_Electro_Reload()
-{
- W_Reload(ammo_cells, min(autocvar_g_balance_electro_primary_ammo, autocvar_g_balance_electro_secondary_ammo), autocvar_g_balance_electro_reload_ammo, autocvar_g_balance_electro_reload_time, "weapons/reload.wav");
-}
-
void W_Plasma_Explode_Combo (void);
void W_Plasma_TriggerCombo(vector org, float rad, entity own)
if(!ammo_amount)
{
- W_Electro_Reload();
+ weapon_action(self.weapon, WR_RELOAD);
return FALSE;
}
}
}
else if (req == WR_RELOAD)
{
- W_Electro_Reload();
+ W_Reload(ammo_cells, min(autocvar_g_balance_electro_primary_ammo, autocvar_g_balance_electro_secondary_ammo), autocvar_g_balance_electro_reload_ammo, autocvar_g_balance_electro_reload_time, "weapons/reload.wav");
}
return TRUE;
};
.vector fireball_impactvec;
.float fireball_primarytime;
-void W_Fireball_Reload()
-{
- // fuel can be a non-whole number, which brakes stuff here when between 0 and 1
- if(self.ammo_fuel < 1)
- self.ammo_fuel = 0;
-
- W_Reload(ammo_fuel, min(autocvar_g_balance_fireball_primary_ammo, autocvar_g_balance_fireball_secondary_ammo), autocvar_g_balance_fireball_reload_ammo, autocvar_g_balance_fireball_reload_time, "weapons/reload.wav");
-}
-
void W_Fireball_Explode (void)
{
entity e;
else if (req == WR_THINK)
{
if(autocvar_g_balance_fireball_reload_ammo && self.clip_load < min(autocvar_g_balance_fireball_primary_ammo, autocvar_g_balance_fireball_secondary_ammo)) // forced reload
- W_Fireball_Reload();
+ weapon_action(self.weapon, WR_RELOAD);
else if (self.BUTTON_ATCK)
{
if (time >= self.fireball_primarytime)
}
else if (req == WR_RELOAD)
{
- W_Fireball_Reload();
+ // fuel can be a non-whole number, which brakes stuff here when between 0 and 1
+ if(self.ammo_fuel < 1)
+ self.ammo_fuel = 0;
+
+ W_Reload(ammo_fuel, min(autocvar_g_balance_fireball_primary_ammo, autocvar_g_balance_fireball_secondary_ammo), autocvar_g_balance_fireball_reload_ammo, autocvar_g_balance_fireball_reload_time, "weapons/reload.wav");
}
return TRUE;
};
.float gl_detonate_later;
.float gl_bouncecnt;
-void W_GrenadeLauncher_Reload()
-{
- W_Reload(ammo_rockets, min(autocvar_g_balance_grenadelauncher_primary_ammo, autocvar_g_balance_grenadelauncher_secondary_ammo), autocvar_g_balance_grenadelauncher_reload_ammo, autocvar_g_balance_grenadelauncher_reload_time, "weapons/reload.wav");
-}
-
void W_Grenade_Explode (void)
{
if(other.takedamage == DAMAGE_AIM)
else if (req == WR_THINK)
{
if(autocvar_g_balance_grenadelauncher_reload_ammo && self.clip_load < min(autocvar_g_balance_grenadelauncher_primary_ammo, autocvar_g_balance_grenadelauncher_secondary_ammo)) // forced reload
- W_GrenadeLauncher_Reload();
+ weapon_action(self.weapon, WR_RELOAD);
else if (self.BUTTON_ATCK)
{
if (weapon_prepareattack(0, autocvar_g_balance_grenadelauncher_primary_refire))
}
else if (req == WR_RELOAD)
{
- W_GrenadeLauncher_Reload();
+ W_Reload(ammo_rockets, min(autocvar_g_balance_grenadelauncher_primary_ammo, autocvar_g_balance_grenadelauncher_secondary_ammo), autocvar_g_balance_grenadelauncher_reload_ammo, autocvar_g_balance_grenadelauncher_reload_time, "weapons/reload.wav");
}
return TRUE;
};
#ifdef SVQC
// NO bounce protection, as bounces are limited!
-void W_Hagar_Reload()
-{
- W_Reload(ammo_rockets, min(autocvar_g_balance_hagar_primary_ammo, autocvar_g_balance_hagar_secondary_ammo), autocvar_g_balance_hagar_reload_ammo, autocvar_g_balance_hagar_reload_time, "weapons/reload.wav");
-}
-
void W_Hagar_Explode (void)
{
self.event_damage = SUB_Null;
else if (req == WR_THINK)
{
if(autocvar_g_balance_hagar_reload_ammo && self.clip_load < min(autocvar_g_balance_hagar_primary_ammo, autocvar_g_balance_hagar_secondary_ammo)) // forced reload
- W_Hagar_Reload();
+ weapon_action(self.weapon, WR_RELOAD);
else if (self.BUTTON_ATCK)
{
if (weapon_prepareattack(0, autocvar_g_balance_hagar_primary_refire))
}
else if (req == WR_RELOAD)
{
- W_Hagar_Reload();
+ W_Reload(ammo_rockets, min(autocvar_g_balance_hagar_primary_ammo, autocvar_g_balance_hagar_secondary_ammo), autocvar_g_balance_hagar_reload_ammo, autocvar_g_balance_hagar_reload_time, "weapons/reload.wav");
}
return TRUE;
};
#else
#ifdef SVQC
-void W_HLAC_Reload()
-{
- W_Reload(ammo_cells, min(autocvar_g_balance_hlac_primary_ammo, autocvar_g_balance_hlac_secondary_ammo), autocvar_g_balance_hlac_reload_ammo, autocvar_g_balance_hlac_reload_time, "weapons/reload.wav");
-}
-
void W_HLAC_Touch (void)
{
PROJECTILE_TOUCH;
else if (req == WR_THINK)
{
if(autocvar_g_balance_hlac_reload_ammo && self.clip_load < min(autocvar_g_balance_hlac_primary_ammo, autocvar_g_balance_hlac_secondary_ammo)) // forced reload
- W_HLAC_Reload();
+ weapon_action(self.weapon, WR_RELOAD);
else if (self.BUTTON_ATCK)
{
if (weapon_prepareattack(0, autocvar_g_balance_hlac_primary_refire))
}
else if (req == WR_RELOAD)
{
- W_HLAC_Reload();
+ W_Reload(ammo_cells, min(autocvar_g_balance_hlac_primary_ammo, autocvar_g_balance_hlac_secondary_ammo), autocvar_g_balance_hlac_reload_ammo, autocvar_g_balance_hlac_reload_time, "weapons/reload.wav");
}
return TRUE;
};
#ifdef SVQC
void(float imp) W_SwitchWeapon;
-void W_Laser_Reload()
-{
- W_Reload(zero_ammo, 0, autocvar_g_balance_laser_reload_ammo, autocvar_g_balance_laser_reload_time, "weapons/reload.wav");
-}
-
void W_Laser_Touch (void)
{
PROJECTILE_TOUCH;
else if (req == WR_THINK)
{
if(autocvar_g_balance_laser_reload_ammo && self.clip_load < 1) // forced reload
- W_Laser_Reload();
+ weapon_action(self.weapon, WR_RELOAD);
else if (self.BUTTON_ATCK)
{
if (weapon_prepareattack(0, autocvar_g_balance_laser_primary_refire))
}
else if (req == WR_RELOAD)
{
- W_Laser_Reload();
+ W_Reload(zero_ammo, 0, autocvar_g_balance_laser_reload_ammo, autocvar_g_balance_laser_reload_time, "weapons/reload.wav");
}
return TRUE;
};
.float minelayer_detonate, minelayer_mines;
.float mine_time;
-void W_MineLayer_Reload()
-{
- W_Reload(ammo_rockets, autocvar_g_balance_minelayer_ammo, autocvar_g_balance_minelayer_reload_ammo, autocvar_g_balance_minelayer_reload_time, "weapons/reload.wav");
-}
-
void spawnfunc_weapon_minelayer (void)
{
weapon_defaultspawnfunc(WEP_MINE_LAYER);
else if (req == WR_THINK)
{
if(autocvar_g_balance_minelayer_reload_ammo && self.clip_load < autocvar_g_balance_minelayer_ammo) // forced reload
- W_MineLayer_Reload();
+ weapon_action(self.weapon, WR_RELOAD);
else if (self.BUTTON_ATCK)
{
if(weapon_prepareattack(0, autocvar_g_balance_minelayer_refire))
}
else if (req == WR_RELOAD)
{
- W_MineLayer_Reload();
+ W_Reload(ammo_rockets, autocvar_g_balance_minelayer_ammo, autocvar_g_balance_minelayer_reload_ammo, autocvar_g_balance_minelayer_reload_time, "weapons/reload.wav");
}
return TRUE;
};
#ifdef SVQC
.float minstanex_lasthit;
-void W_Minstanex_Reload()
-{
- if(autocvar_g_balance_minstanex_laser_ammo)
- W_Reload(ammo_cells, min(autocvar_g_balance_minstanex_ammo, autocvar_g_balance_minstanex_laser_ammo), autocvar_g_balance_minstanex_reload_ammo, autocvar_g_balance_minstanex_reload_time, "weapons/reload.wav");
- else
- W_Reload(ammo_cells, autocvar_g_balance_minstanex_ammo, autocvar_g_balance_minstanex_reload_ammo, autocvar_g_balance_minstanex_reload_time, "weapons/reload.wav");
-}
-
void W_MinstaNex_Attack (void)
{
float flying;
// if the laser uses load, we also consider its ammo for reloading
if(autocvar_g_balance_minstanex_reload_ammo && autocvar_g_balance_minstanex_laser_ammo && self.clip_load < min(minstanex_ammo, autocvar_g_balance_minstanex_laser_ammo)) // forced reload
- W_Minstanex_Reload();
+ weapon_action(self.weapon, WR_RELOAD);
else if(autocvar_g_balance_minstanex_reload_ammo && self.clip_load < minstanex_ammo) // forced reload
- W_Minstanex_Reload();
+ weapon_action(self.weapon, WR_RELOAD);
else if (self.BUTTON_ATCK)
{
if (weapon_prepareattack(0, autocvar_g_balance_minstanex_refire))
}
else if (req == WR_RELOAD)
{
- W_Minstanex_Reload();
+ if(autocvar_g_balance_minstanex_laser_ammo)
+ W_Reload(ammo_cells, min(autocvar_g_balance_minstanex_ammo, autocvar_g_balance_minstanex_laser_ammo), autocvar_g_balance_minstanex_reload_ammo, autocvar_g_balance_minstanex_reload_time, "weapons/reload.wav");
+ else
+ W_Reload(ammo_cells, autocvar_g_balance_minstanex_ammo, autocvar_g_balance_minstanex_reload_ammo, autocvar_g_balance_minstanex_reload_time, "weapons/reload.wav");
}
return TRUE;
};
#else
#ifdef SVQC
-void W_Nex_Reload()
-{
- W_Reload(ammo_cells, min(autocvar_g_balance_nex_primary_ammo, autocvar_g_balance_nex_secondary_ammo), autocvar_g_balance_nex_reload_ammo, autocvar_g_balance_nex_reload_time, "weapons/reload.wav");
-}
-
void SendCSQCNexBeamParticle(float charge) {
vector v;
v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
}
if(autocvar_g_balance_nex_reload_ammo && self.clip_load < min(autocvar_g_balance_nex_primary_ammo, autocvar_g_balance_nex_secondary_ammo)) // forced reload
- W_Nex_Reload();
+ weapon_action(self.weapon, WR_RELOAD);
else
{
if (self.BUTTON_ATCK)
}
else if (req == WR_RELOAD)
{
- W_Nex_Reload();
+ W_Reload(ammo_cells, min(autocvar_g_balance_nex_primary_ammo, autocvar_g_balance_nex_secondary_ammo), autocvar_g_balance_nex_reload_ammo, autocvar_g_balance_nex_reload_time, "weapons/reload.wav");
}
return TRUE;
.float rl_release;
.float rl_detonate_later;
-void W_RocketLauncher_Reload()
-{
- W_Reload(ammo_rockets, autocvar_g_balance_rocketlauncher_ammo, autocvar_g_balance_rocketlauncher_reload_ammo, autocvar_g_balance_rocketlauncher_reload_time, "weapons/reload.wav");
-}
-
void W_Rocket_Unregister()
{
if(self.owner && self.owner.lastrocket == self)
else if (req == WR_THINK)
{
if(autocvar_g_balance_rocketlauncher_reload_ammo && self.clip_load < autocvar_g_balance_rocketlauncher_ammo) // forced reload
- W_RocketLauncher_Reload();
+ weapon_action(self.weapon, WR_RELOAD);
else
{
if (self.BUTTON_ATCK)
}
else if (req == WR_RELOAD)
{
- W_RocketLauncher_Reload();
+ W_Reload(ammo_rockets, autocvar_g_balance_rocketlauncher_ammo, autocvar_g_balance_rocketlauncher_reload_ammo, autocvar_g_balance_rocketlauncher_reload_time, "weapons/reload.wav");
}
return TRUE;
};
//.float proxytime; = autoswitch
//.float tl; = wait
-void W_Seeker_Reload()
-{
- W_Reload(ammo_rockets, min(autocvar_g_balance_seeker_missile_ammo, autocvar_g_balance_seeker_tag_ammo), autocvar_g_balance_seeker_reload_ammo, autocvar_g_balance_seeker_reload_time, "weapons/reload.wav");
-}
-
void Seeker_Missile_Explode ()
{
self.event_damage = SUB_Null;
else if (req == WR_THINK)
{
if(autocvar_g_balance_seeker_reload_ammo && self.clip_load < min(autocvar_g_balance_seeker_missile_ammo, autocvar_g_balance_seeker_tag_ammo)) // forced reload
- W_Seeker_Reload();
+ weapon_action(self.weapon, WR_RELOAD);
else if (self.BUTTON_ATCK)
{
}
else if (req == WR_RELOAD)
{
- W_Seeker_Reload();
+ W_Reload(ammo_rockets, min(autocvar_g_balance_seeker_missile_ammo, autocvar_g_balance_seeker_tag_ammo), autocvar_g_balance_seeker_reload_ammo, autocvar_g_balance_seeker_reload_time, "weapons/reload.wav");
}
return TRUE;
};
#else
#ifdef SVQC
-void W_Shotgun_Reload()
-{
- W_Reload(ammo_shells, autocvar_g_balance_shotgun_primary_ammo, autocvar_g_balance_shotgun_reload_ammo, autocvar_g_balance_shotgun_reload_time, "weapons/reload.wav");
-}
-
void W_Shotgun_Attack (void)
{
float sc;
{
// don't force reload an empty shotgun if its melee attack is active
if not(autocvar_g_balance_shotgun_secondary && self.ammo_shells < autocvar_g_balance_shotgun_primary_ammo)
- W_Shotgun_Reload();
+ weapon_action(self.weapon, WR_RELOAD);
}
else
{
}
else if (req == WR_RELOAD)
{
- W_Shotgun_Reload();
+ W_Reload(ammo_shells, autocvar_g_balance_shotgun_primary_ammo, autocvar_g_balance_shotgun_reload_ammo, autocvar_g_balance_shotgun_reload_time, "weapons/reload.wav");
}
return TRUE;
};
.float sniperrifle_accumulator;
-void W_SniperRifle_Reload()
-{
- W_Reload(ammo_nails, min(autocvar_g_balance_sniperrifle_primary_ammo, autocvar_g_balance_sniperrifle_secondary_ammo), autocvar_g_balance_sniperrifle_reload_ammo, autocvar_g_balance_sniperrifle_reload_time, "weapons/reload.wav");
-}
-
void W_SniperRifle_FireBullet(float pSpread, float pDamage, float pHeadshotAddedDamage, float pForce, float pSpeed, float pLifetime, float pAmmo, float deathtype, float pBulletConstant)
{
// if this weapon is reloadable, decrease its load. Else decrease the player's ammo
else if (req == WR_THINK)
{
if(autocvar_g_balance_sniperrifle_reload_ammo && self.clip_load < min(autocvar_g_balance_sniperrifle_primary_ammo, autocvar_g_balance_sniperrifle_secondary_ammo)) // forced reload
- W_SniperRifle_Reload();
+ weapon_action(self.weapon, WR_RELOAD);
else
{
self.sniperrifle_accumulator = bound(time - autocvar_g_balance_sniperrifle_bursttime, self.sniperrifle_accumulator, time);
if (autocvar_g_balance_sniperrifle_secondary)
{
if(autocvar_g_balance_sniperrifle_secondary_reload)
- W_SniperRifle_Reload();
+ weapon_action(self.weapon, WR_RELOAD);
else
{
if (weapon_prepareattack_check(1, autocvar_g_balance_sniperrifle_secondary_refire))
}
else if (req == WR_RELOAD)
{
- W_SniperRifle_Reload();
+ W_Reload(ammo_nails, min(autocvar_g_balance_sniperrifle_primary_ammo, autocvar_g_balance_sniperrifle_secondary_ammo), autocvar_g_balance_sniperrifle_reload_ammo, autocvar_g_balance_sniperrifle_reload_time, "weapons/reload.wav");
}
return TRUE;
};
#else
#ifdef SVQC
-void W_UZI_Reload()
-{
- W_Reload(ammo_nails, min(max(autocvar_g_balance_uzi_sustained_ammo, autocvar_g_balance_uzi_first_ammo), autocvar_g_balance_uzi_burst_ammo), autocvar_g_balance_uzi_reload_ammo, autocvar_g_balance_uzi_reload_time, "weapons/reload.wav");
-}
-
// leilei's fancy muzzleflash stuff
void UZI_Flash_Go()
{
else if (req == WR_THINK)
{
if(autocvar_g_balance_uzi_reload_ammo && self.clip_load < min(max(autocvar_g_balance_uzi_sustained_ammo, autocvar_g_balance_uzi_first_ammo), autocvar_g_balance_uzi_burst_ammo)) // forced reload
- W_UZI_Reload();
+ weapon_action(self.weapon, WR_RELOAD);
else if(autocvar_g_balance_uzi_mode == 1)
{
if (self.BUTTON_ATCK)
}
else if (req == WR_RELOAD)
{
- W_UZI_Reload();
+ W_Reload(ammo_nails, min(max(autocvar_g_balance_uzi_sustained_ammo, autocvar_g_balance_uzi_first_ammo), autocvar_g_balance_uzi_burst_ammo), autocvar_g_balance_uzi_reload_ammo, autocvar_g_balance_uzi_reload_time, "weapons/reload.wav");
}
return TRUE;
};