vector forward, right, up;
float maxdmg;
+ // if this weapon is reloadable, decrease its load. Else decrease the player's ammo
+ if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
+ {
+ if(autocvar_g_balance_crylink_reload_ammo)
+ {
+ self.clip_load -= autocvar_g_balance_crylink_primary_ammo;
+ self.crylink_load = self.clip_load;
+ }
+ else
+ self.ammo_cells -= autocvar_g_balance_crylink_primary_ammo;
+ }
+
maxdmg = autocvar_g_balance_crylink_primary_damage*autocvar_g_balance_crylink_primary_shots;
maxdmg *= 1 + autocvar_g_balance_crylink_primary_bouncedamagefactor * autocvar_g_balance_crylink_primary_bounces;
if(autocvar_g_balance_crylink_primary_joinexplode)
counter = counter + 1;
}
self.crylink_lastgroup = proj;
+}
+
+void W_Crylink_Attack2 (void)
+{
+ local float counter, shots;
+ local entity proj, prevproj, firstproj;
+ float maxdmg;
// if this weapon is reloadable, decrease its load. Else decrease the player's ammo
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
{
if(autocvar_g_balance_crylink_reload_ammo)
{
- self.clip_load -= autocvar_g_balance_crylink_primary_ammo;
+ self.clip_load -= autocvar_g_balance_crylink_secondary_ammo;
self.crylink_load = self.clip_load;
}
else
- self.ammo_cells -= autocvar_g_balance_crylink_primary_ammo;
+ self.ammo_cells -= autocvar_g_balance_crylink_secondary_ammo;
}
-}
-
-void W_Crylink_Attack2 (void)
-{
- local float counter, shots;
- local entity proj, prevproj, firstproj;
- float maxdmg;
maxdmg = autocvar_g_balance_crylink_secondary_damage*autocvar_g_balance_crylink_secondary_shots;
maxdmg *= 1 + autocvar_g_balance_crylink_secondary_bouncedamagefactor * autocvar_g_balance_crylink_secondary_bounces;
counter = counter + 1;
}
self.crylink_lastgroup = proj;
-
- // if this weapon is reloadable, decrease its load. Else decrease the player's ammo
- if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
- {
- if(autocvar_g_balance_crylink_reload_ammo)
- {
- self.clip_load -= autocvar_g_balance_crylink_secondary_ammo;
- self.crylink_load = self.clip_load;
- }
- else
- self.ammo_cells -= autocvar_g_balance_crylink_secondary_ammo;
- }
}
void spawnfunc_weapon_crylink (void)
{
local entity proj;
+ // if this weapon is reloadable, decrease its load. Else decrease the player's ammo
+ if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
+ {
+ if(autocvar_g_balance_electro_reload_ammo)
+ {
+ self.clip_load -= autocvar_g_balance_electro_primary_ammo;
+ self.electro_load = self.clip_load;
+ }
+ else
+ self.ammo_cells -= autocvar_g_balance_electro_primary_ammo;
+ }
+
W_SetupShot_ProjectileSize (self, '0 0 -3', '0 0 -3', FALSE, 2, "weapons/electro_fire.wav", CHAN_WEAPON, autocvar_g_balance_electro_primary_damage);
pointparticles(particleeffectnum("electro_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
CSQCProjectile(proj, TRUE, PROJECTILE_ELECTRO_BEAM, TRUE);
other = proj; MUTATOR_CALLHOOK(EditProjectile);
+}
+
+void W_Electro_Attack2()
+{
+ local entity proj;
// if this weapon is reloadable, decrease its load. Else decrease the player's ammo
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
{
if(autocvar_g_balance_electro_reload_ammo)
{
- self.clip_load -= autocvar_g_balance_electro_primary_ammo;
+ self.clip_load -= autocvar_g_balance_electro_secondary_ammo;
self.electro_load = self.clip_load;
}
else
- self.ammo_cells -= autocvar_g_balance_electro_primary_ammo;
+ self.ammo_cells -= autocvar_g_balance_electro_secondary_ammo;
}
-}
-
-void W_Electro_Attack2()
-{
- local entity proj;
W_SetupShot_ProjectileSize (self, '0 0 -4', '0 0 -4', FALSE, 2, "weapons/electro_fire2.wav", CHAN_WEAPON, autocvar_g_balance_electro_secondary_damage);
CSQCProjectile(proj, TRUE, PROJECTILE_ELECTRO, FALSE); // no culling, it has sound
other = proj; MUTATOR_CALLHOOK(EditProjectile);
-
- // if this weapon is reloadable, decrease its load. Else decrease the player's ammo
- if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
- {
- if(autocvar_g_balance_electro_reload_ammo)
- {
- self.clip_load -= autocvar_g_balance_electro_secondary_ammo;
- self.electro_load = self.clip_load;
- }
- else
- self.ammo_cells -= autocvar_g_balance_electro_secondary_ammo;
- }
}
.vector hook_start, hook_end;
float dt, f;
dt = frametime;
+ // if this weapon is reloadable, decrease its load. Else decrease the player's ammo
if not(self.owner.items & IT_UNLIMITED_WEAPON_AMMO)
{
- // if this weapon is reloadable, decrease its load. Else decrease the player's ammo
if(autocvar_g_balance_electro_primary_ammo)
{
if(autocvar_g_balance_electro_reload_ammo)
{
local entity gren;
+ // if this weapon is reloadable, decrease its load. Else decrease the player's ammo
+ if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
+ {
+ if(autocvar_g_balance_grenadelauncher_reload_ammo)
+ {
+ self.clip_load -= autocvar_g_balance_grenadelauncher_primary_ammo;
+ self.grenadelauncher_load = self.clip_load;
+ }
+ else
+ self.ammo_rockets -= autocvar_g_balance_grenadelauncher_primary_ammo;
+ }
+
W_SetupShot_ProjectileSize (self, '-3 -3 -3', '3 3 3', FALSE, 4, "weapons/grenade_fire.wav", CHAN_WEAPON, autocvar_g_balance_grenadelauncher_primary_damage);
w_shotdir = v_forward; // no TrueAim for grenades please
CSQCProjectile(gren, TRUE, PROJECTILE_GRENADE_BOUNCING, TRUE);
other = gren; MUTATOR_CALLHOOK(EditProjectile);
+}
+
+void W_Grenade_Attack2 (void)
+{
+ local entity gren;
// if this weapon is reloadable, decrease its load. Else decrease the player's ammo
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
{
if(autocvar_g_balance_grenadelauncher_reload_ammo)
{
- self.clip_load -= autocvar_g_balance_grenadelauncher_primary_ammo;
+ self.clip_load -= autocvar_g_balance_grenadelauncher_secondary_ammo;
self.grenadelauncher_load = self.clip_load;
}
else
- self.ammo_rockets -= autocvar_g_balance_grenadelauncher_primary_ammo;
+ self.ammo_rockets -= autocvar_g_balance_grenadelauncher_secondary_ammo;
}
-}
-
-void W_Grenade_Attack2 (void)
-{
- local entity gren;
W_SetupShot_ProjectileSize (self, '-3 -3 -3', '3 3 3', FALSE, 4, "weapons/grenade_fire.wav", CHAN_WEAPON, autocvar_g_balance_grenadelauncher_secondary_damage);
w_shotdir = v_forward; // no TrueAim for grenades please
CSQCProjectile(gren, TRUE, PROJECTILE_GRENADE_BOUNCING, TRUE);
other = gren; MUTATOR_CALLHOOK(EditProjectile);
-
- // if this weapon is reloadable, decrease its load. Else decrease the player's ammo
- if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
- {
- if(autocvar_g_balance_grenadelauncher_reload_ammo)
- {
- self.clip_load -= autocvar_g_balance_grenadelauncher_secondary_ammo;
- self.grenadelauncher_load = self.clip_load;
- }
- else
- self.ammo_rockets -= autocvar_g_balance_grenadelauncher_secondary_ammo;
- }
}
void spawnfunc_weapon_grenadelauncher (void)
local entity missile;
float spread;
+ // if this weapon is reloadable, decrease its load. Else decrease the player's ammo
+ if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
+ {
+ if(autocvar_g_balance_hlac_reload_ammo)
+ {
+ self.clip_load -= autocvar_g_balance_hlac_primary_ammo;
+ self.hlac_load = self.clip_load;
+ }
+ else
+ self.ammo_cells -= autocvar_g_balance_hlac_primary_ammo;
+ }
+
spread = autocvar_g_balance_hlac_primary_spread_min + (autocvar_g_balance_hlac_primary_spread_add * self.misc_bulletcounter);
spread = min(spread,autocvar_g_balance_hlac_primary_spread_max);
if(self.crouch)
CSQCProjectile(missile, TRUE, PROJECTILE_HLAC, TRUE);
other = missile; MUTATOR_CALLHOOK(EditProjectile);
-
- // if this weapon is reloadable, decrease its load. Else decrease the player's ammo
- if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
- {
- if(autocvar_g_balance_hlac_reload_ammo)
- {
- self.clip_load -= autocvar_g_balance_hlac_primary_ammo;
- self.hlac_load = self.clip_load;
- }
- else
- self.ammo_cells -= autocvar_g_balance_hlac_primary_ammo;
- }
}
void W_HLAC_Attack2f (void)
{
float i;
- for(i=autocvar_g_balance_hlac_secondary_shots;i>0;--i)
- W_HLAC_Attack2f();
-
- if (!g_norecoil)
- {
- self.punchangle_x = random () - 0.5;
- self.punchangle_y = random () - 0.5;
- }
-
// if this weapon is reloadable, decrease its load. Else decrease the player's ammo
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
{
else
self.ammo_cells -= autocvar_g_balance_hlac_secondary_ammo;
}
+
+ for(i=autocvar_g_balance_hlac_secondary_shots;i>0;--i)
+ W_HLAC_Attack2f();
+
+ if (!g_norecoil)
+ {
+ self.punchangle_x = random () - 0.5;
+ self.punchangle_y = random () - 0.5;
+ }
}
// weapon frames
}
}
+ // if this weapon is reloadable, decrease its load. Else decrease the player's ammo
+ if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
+ {
+ if(autocvar_g_balance_minelayer_reload_ammo)
+ {
+ self.clip_load -= autocvar_g_balance_minelayer_ammo;
+ self.minelayer_load = self.clip_load;
+ }
+ else
+ self.ammo_rockets -= autocvar_g_balance_minelayer_ammo;
+ }
+
W_SetupShot_ProjectileSize (self, '-4 -4 -4', '4 4 4', FALSE, 5, "weapons/mine_fire.wav", CHAN_WEAPON, autocvar_g_balance_minelayer_damage);
pointparticles(particleeffectnum("rocketlauncher_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
// common properties
other = mine; MUTATOR_CALLHOOK(EditProjectile);
-
- // if this weapon is reloadable, decrease its load. Else decrease the player's ammo
- if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
- {
- if(autocvar_g_balance_minelayer_reload_ammo)
- {
- self.clip_load -= autocvar_g_balance_minelayer_ammo;
- self.minelayer_load = self.clip_load;
- }
- else
- self.ammo_rockets -= autocvar_g_balance_minelayer_ammo;
- }
}
void spawnfunc_weapon_minelayer (void); // defined in t_items.qc
bulletspeed = autocvar_g_balance_shotgun_primary_speed;
bulletconstant = autocvar_g_balance_shotgun_primary_bulletconstant;
+ // if this weapon is reloadable, decrease its load. Else decrease the player's ammo
+ if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
+ {
+ if(autocvar_g_balance_shotgun_reload_ammo)
+ {
+ self.clip_load -= ammoamount;
+ self.shotgun_load = self.clip_load;
+ }
+ else
+ self.ammo_shells -= ammoamount;
+ }
+
W_SetupShot (self, autocvar_g_antilag_bullets && bulletspeed >= autocvar_g_antilag_bullets, 5, "weapons/shotgun_fire.wav", CHAN_WEAPON, d * bullets);
for (sc = 0;sc < bullets;sc = sc + 1)
fireBallisticBullet(w_shotorg, w_shotdir, spread, bulletspeed, 5, d, 0, f, WEP_SHOTGUN, 0, 1, bulletconstant);
flash.nextthink = time + 0.06;
flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
W_AttachToShotorg(flash, '5 0 0');
-
- // if this weapon is reloadable, decrease its load. Else decrease the player's ammo
- if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
- {
- if(autocvar_g_balance_shotgun_reload_ammo)
- {
- self.clip_load -= ammoamount;
- self.shotgun_load = self.clip_load;
- }
- else
- self.ammo_shells -= ammoamount;
- }
}
void shotgun_meleethink (void)
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
+ if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
+ {
+ if(autocvar_g_balance_sniperrifle_reload_ammo)
+ {
+ self.clip_load -= pAmmo;
+ self.sniperrifle_load = self.clip_load;
+ }
+ else
+ self.ammo_nails -= pAmmo;
+ }
+
if(deathtype & HITTYPE_SECONDARY)
W_SetupShot (self, autocvar_g_antilag_bullets && pSpeed >= autocvar_g_antilag_bullets, 2, "weapons/campingrifle_fire2.wav", CHAN_WEAPON, autocvar_g_balance_sniperrifle_secondary_damage + autocvar_g_balance_sniperrifle_secondary_headshotaddeddamage);
else
if (autocvar_g_casings >= 2)
SpawnCasing (((random () * 50 + 50) * v_right) - (v_forward * (random () * 25 + 25)) - ((random () * 5 - 70) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 3, self);
-
- // if this weapon is reloadable, decrease its load. Else decrease the player's ammo
- if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
- {
- if(autocvar_g_balance_sniperrifle_reload_ammo)
- {
- self.clip_load -= pAmmo;
- self.sniperrifle_load = self.clip_load;
- }
- else
- self.ammo_nails -= pAmmo;
- }
}
void W_SniperRifle_Attack()
void uzi_mode1_fire_auto()
{
float uzi_spread;
+
+ // if this weapon is reloadable, decrease its load. Else decrease the player's ammo
+ if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
+ {
+ if(autocvar_g_balance_uzi_reload_ammo)
+ {
+ self.clip_load -= autocvar_g_balance_uzi_sustained_ammo;
+ self.uzi_load = self.clip_load;
+ }
+ else
+ self.ammo_nails -= autocvar_g_balance_uzi_sustained_ammo;
+ }
if (self.BUTTON_ATCK)
weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_uzi_sustained_refire, uzi_mode1_fire_auto);
if (autocvar_g_casings >= 2) // casing code
SpawnCasing (((random () * 50 + 50) * v_right) - (v_forward * (random () * 25 + 25)) - ((random () * 5 - 70) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 3, self);
-
- // if this weapon is reloadable, decrease its load. Else decrease the player's ammo
- if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
- {
- if(autocvar_g_balance_uzi_reload_ammo)
- {
- self.clip_load -= autocvar_g_balance_uzi_sustained_ammo;
- self.uzi_load = self.clip_load;
- }
- else
- self.ammo_nails -= autocvar_g_balance_uzi_sustained_ammo;
- }
}
void uzi_mode1_fire_burst()