set g_balance_sniperrifle_primary_burstcost 0
set g_balance_sniperrifle_primary_bullethail 0 // empty magazine on shot
set g_balance_sniperrifle_secondary 1
+set g_balance_sniperrifle_secondary_reload 0
set g_balance_sniperrifle_secondary_tracer 0
set g_balance_sniperrifle_secondary_damage 35
set g_balance_sniperrifle_secondary_headshotaddeddamage 15 // 50 damage only on head
set g_balance_sniperrifle_primary_burstcost 0 // require same cooldown as secondary, note it's smaller than primary refire time
set g_balance_sniperrifle_primary_bullethail 0 // empty magazine on shot
set g_balance_sniperrifle_secondary 1
+set g_balance_sniperrifle_secondary_reload 0
set g_balance_sniperrifle_secondary_tracer 0
set g_balance_sniperrifle_secondary_damage 40
set g_balance_sniperrifle_secondary_headshotaddeddamage 20
set g_balance_sniperrifle_primary_burstcost 0
set g_balance_sniperrifle_primary_bullethail 0 // empty magazine on shot
set g_balance_sniperrifle_secondary 1
+set g_balance_sniperrifle_secondary_reload 0
set g_balance_sniperrifle_secondary_tracer 0
set g_balance_sniperrifle_secondary_damage 50
set g_balance_sniperrifle_secondary_headshotaddeddamage 50 // 50 damage only on head
set g_balance_sniperrifle_primary_burstcost 0
set g_balance_sniperrifle_primary_bullethail 0 // empty magazine on shot
set g_balance_sniperrifle_secondary 1
+set g_balance_sniperrifle_secondary_reload 1
set g_balance_sniperrifle_secondary_tracer 0
set g_balance_sniperrifle_secondary_damage 42
set g_balance_sniperrifle_secondary_headshotaddeddamage 42
set g_balance_sniperrifle_primary_burstcost 0
set g_balance_sniperrifle_primary_bullethail 0 // empty magazine on shot
set g_balance_sniperrifle_secondary 1
+set g_balance_sniperrifle_secondary_reload 0
set g_balance_sniperrifle_secondary_tracer 0
set g_balance_sniperrifle_secondary_damage 50
set g_balance_sniperrifle_secondary_headshotaddeddamage 50 // 50 damage only on head
float autocvar_g_balance_sniperrifle_secondary_force;
float autocvar_g_balance_sniperrifle_secondary_headshotaddeddamage;
float autocvar_g_balance_sniperrifle_secondary_lifetime;
+float autocvar_g_balance_sniperrifle_secondary_reload;
float autocvar_g_balance_sniperrifle_secondary_refire;
float autocvar_g_balance_sniperrifle_secondary_speed;
float autocvar_g_balance_sniperrifle_secondary_spread;
self.cnt = self.switchweapon;
self.weapon = 0;
+ self.wish_reload = 0;
+
if(!self.alivetime)
self.alivetime = time;
} else if(self.classname == "observer" || (g_ca && !allowed_to_spawn)) {
void W_Reload()
{
- if(self.switchweapon == self.weapon)
- if(self.weaponentity.state == WS_READY)
- weapon_action(self.weapon, WR_RELOAD);
+ self.wish_reload = 1;
}
// switch between weapons
#endif
.float sniperrifle_bulletcounter;
+.float wish_reload;
#define PROJECTILE_MAKETRIGGER(e) (e).solid = SOLID_CORPSE; (e).dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE
// when doing this, hagar can go through clones
{
if(self.sniperrifle_bulletcounter < 0) // forced reload (e.g. because interrupted)
{
- if(self.switchweapon == self.weapon)
- if(self.weaponentity.state == WS_READY)
- W_SniperRifle_Reload();
+ self.wish_reload = 1;
}
else
{
{
if (autocvar_g_balance_sniperrifle_secondary)
{
- if (weapon_prepareattack_check(1, autocvar_g_balance_sniperrifle_secondary_refire))
- if (time >= self.sniperrifle_accumulator + autocvar_g_balance_sniperrifle_secondary_burstcost)
- {
- weapon_prepareattack_do(1, autocvar_g_balance_sniperrifle_secondary_refire);
- W_SniperRifle_BulletHail(autocvar_g_balance_sniperrifle_secondary_bullethail, W_SniperRifle_Attack2, WFRAME_FIRE2, autocvar_g_balance_sniperrifle_secondary_animtime, autocvar_g_balance_sniperrifle_primary_refire);
- self.sniperrifle_accumulator += autocvar_g_balance_sniperrifle_secondary_burstcost;
- }
+ if(autocvar_g_balance_sniperrifle_secondary_reload)
+ self.wish_reload = 1;
+ else
+ {
+ if (weapon_prepareattack_check(1, autocvar_g_balance_sniperrifle_secondary_refire))
+ if (time >= self.sniperrifle_accumulator + autocvar_g_balance_sniperrifle_secondary_burstcost)
+ {
+ weapon_prepareattack_do(1, autocvar_g_balance_sniperrifle_secondary_refire);
+ W_SniperRifle_BulletHail(autocvar_g_balance_sniperrifle_secondary_bullethail, W_SniperRifle_Attack2, WFRAME_FIRE2, autocvar_g_balance_sniperrifle_secondary_animtime, autocvar_g_balance_sniperrifle_primary_refire);
+ self.sniperrifle_accumulator += autocvar_g_balance_sniperrifle_secondary_burstcost;
+ }
+ }
}
}
}
+ if(self.wish_reload)
+ {
+ if(self.switchweapon == self.weapon)
+ {
+ if(self.weaponentity.state == WS_READY)
+ {
+ self.wish_reload = 0;
+ W_SniperRifle_Reload();
+ }
+ }
+ }
}
else if (req == WR_PRECACHE)
{
return self.ammo_nails >= autocvar_g_balance_sniperrifle_secondary_ammo;
else if (req == WR_RELOAD)
{
- W_SniperRifle_Reload();
+ self.wish_reload = 1;
}
else if (req == WR_RESETPLAYER)
{