.float freezetag_frozen;
.float freezetag_beginrevive_time;
.float freezetag_revive_progress;
+
+.entity muzzle_flash;
+.float misc_bulletcounter; // replaces uzi & hlac bullet counter.
sound (self, CHAN_WEAPON, "weapons/uzi_fire.wav", VOL_BASE, ATTN_NORM);
fireBallisticBullet (self.tur_shotorg, self.tur_shotdir_updated,self.shot_spread, self.shot_speed, 5, self.shot_dmg, 0, self.shot_force, DEATH_TURRET, 0, 1, autocvar_g_balance_uzi_bulletconstant);
endFireBallisticBullet();
- if (self.uzi_bulletcounter == 2)
+ if (self.misc_bulletcounter == 2)
{
UziFlash();
setattachment(self.muzzle_flash, self.tur_head, "tag_fire");
- self.uzi_bulletcounter = 0;
+ self.misc_bulletcounter = 0;
}
- self.uzi_bulletcounter = self.uzi_bulletcounter + 1;
+ self.misc_bulletcounter = self.misc_bulletcounter + 1;
self.tur_head.frame = self.tur_head.frame + 1;
}
{
// Fire bullets, alternating trails left<->right
self = self.owner;
- if(self.uzi_bulletcounter == 1)
+ if(self.misc_bulletcounter == 1)
{
spiderbot_minigun_fire(self.vehicle.gun1, 0);
spiderbot_minigun_fire(self.vehicle.gun2, 1);
- self.uzi_bulletcounter = 0;
+ self.misc_bulletcounter = 0;
}
else
{
spiderbot_minigun_fire(self.vehicle.gun1, 1);
spiderbot_minigun_fire(self.vehicle.gun2, 0);
- self.uzi_bulletcounter += 1;
+ self.misc_bulletcounter += 1;
}
self = self.vehicle;
REGISTER_WEAPON(HLAC, w_hlac, IT_CELLS, 6, WEP_FLAG_NORMAL | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "hlac", "hlac", "Heavy Laser Assault Cannon");
#else
#ifdef SVQC
-.float HLAC_bulletcounter;
-void W_HLAC_Touch (void)
-{
- PROJECTILE_TOUCH;
- self.event_damage = SUB_Null;
-
- RadiusDamage (self, self.owner, autocvar_g_balance_hlac_primary_damage, autocvar_g_balance_hlac_primary_edgedamage, autocvar_g_balance_hlac_primary_radius, world, autocvar_g_balance_hlac_primary_force, self.projectiledeathtype, other);
-
- remove (self);
-}
-
-void W_HLAC_Touch2 (void)
+void W_HLAC_Touch (void)
{
PROJECTILE_TOUCH;
self.event_damage = SUB_Null;
-
- RadiusDamage (self, self.owner, autocvar_g_balance_hlac_secondary_damage, autocvar_g_balance_hlac_secondary_edgedamage, autocvar_g_balance_hlac_secondary_radius, world, autocvar_g_balance_hlac_secondary_force, self.projectiledeathtype, other);
+
+ if(self.projectiledeathtype & HITTYPE_SECONDARY)
+ RadiusDamage (self, self.owner, autocvar_g_balance_hlac_secondary_damage, autocvar_g_balance_hlac_secondary_edgedamage, autocvar_g_balance_hlac_secondary_radius, world, autocvar_g_balance_hlac_secondary_force, self.projectiledeathtype, other);
+ else
+ RadiusDamage (self, self.owner, autocvar_g_balance_hlac_primary_damage, autocvar_g_balance_hlac_primary_edgedamage, autocvar_g_balance_hlac_primary_radius, world, autocvar_g_balance_hlac_primary_force, self.projectiledeathtype, other);
remove (self);
}
self.ammo_cells = 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.HLAC_bulletcounter);
+ 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)
spread = spread * autocvar_g_balance_hlac_primary_spread_crouchmod;
missile = spawn ();
missile.owner = self;
missile.classname = "hlacbolt";
- // missile.dmg = issecondary;
missile.bot_dodge = TRUE;
missile.bot_dodgerating = autocvar_g_balance_hlac_primary_damage;
setsize(missile, '0 0 0', '0 0 0');
W_SetupProjectileVelocity(missile, autocvar_g_balance_hlac_primary_speed, spread);
- missile.angles = vectoangles (missile.velocity);
+ //missile.angles = vectoangles (missile.velocity); // csqc
missile.touch = W_HLAC_Touch;
missile.think = SUB_Remove;
missile = spawn ();
missile.owner = self;
missile.classname = "hlacbolt";
- // missile.dmg = issecondary;
missile.bot_dodge = TRUE;
missile.bot_dodgerating = autocvar_g_balance_hlac_secondary_damage;
setsize(missile, '0 0 0', '0 0 0');
W_SetupProjectileVelocity(missile, autocvar_g_balance_hlac_secondary_speed, spread);
- missile.angles = vectoangles (missile.velocity);
+ //missile.angles = vectoangles (missile.velocity); // csqc
- missile.touch = W_HLAC_Touch2;
+ missile.touch = W_HLAC_Touch;
missile.think = SUB_Remove;
missile.nextthink = time + autocvar_g_balance_hlac_secondary_lifetime;
ATTACK_FINISHED(self) = time + autocvar_g_balance_hlac_primary_refire * W_WeaponRateFactor();
W_HLAC_Attack();
- self.HLAC_bulletcounter = self.HLAC_bulletcounter + 1;
+ self.misc_bulletcounter = self.misc_bulletcounter + 1;
weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_hlac_primary_refire, HLAC_fire1_02);
}
else
if (self.BUTTON_ATCK)
if (weapon_prepareattack(0, autocvar_g_balance_hlac_primary_refire))
{
- self.HLAC_bulletcounter = 0;
+ self.misc_bulletcounter = 0;
W_HLAC_Attack();
weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_hlac_primary_refire, HLAC_fire1_02);
}
REGISTER_WEAPON(UZI, w_uzi, IT_NAILS, 3, WEP_FLAG_NORMAL | WEP_TYPE_HITSCAN, BOT_PICKUP_RATING_MID, "uzi", "uzi", "Machine Gun");
#else
#ifdef SVQC
-.entity muzzle_flash;
// leilei's fancy muzzleflash stuff
void Uzi_Flash_Go()
self.muzzle_flash.owner = self;
}
-.float uzi_bulletcounter;
void W_Uzi_Attack (float deathtype)
{
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
{
- if (self.uzi_bulletcounter == 1)
+ if (self.misc_bulletcounter == 1)
self.ammo_nails = self.ammo_nails - autocvar_g_balance_uzi_first_ammo;
else
self.ammo_nails = self.ammo_nails - autocvar_g_balance_uzi_sustained_ammo;
}
- W_SetupShot (self, autocvar_g_antilag_bullets && autocvar_g_balance_uzi_speed >= autocvar_g_antilag_bullets, 0, "weapons/uzi_fire.wav", CHAN_WEAPON, ((self.uzi_bulletcounter == 1) ? autocvar_g_balance_uzi_first_damage : autocvar_g_balance_uzi_sustained_damage));
+ W_SetupShot (self, autocvar_g_antilag_bullets && autocvar_g_balance_uzi_speed >= autocvar_g_antilag_bullets, 0, "weapons/uzi_fire.wav", CHAN_WEAPON, ((self.misc_bulletcounter == 1) ? autocvar_g_balance_uzi_first_damage : autocvar_g_balance_uzi_sustained_damage));
if (!g_norecoil)
{
self.punchangle_x = random () - 0.5;
// this attack_finished just enforces a cooldown at the end of a burst
ATTACK_FINISHED(self) = time + autocvar_g_balance_uzi_first_refire * W_WeaponRateFactor();
- if (self.uzi_bulletcounter == 1)
+ if (self.misc_bulletcounter == 1)
fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_first_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_first_damage, 0, autocvar_g_balance_uzi_first_force, deathtype, 0, 1, autocvar_g_balance_uzi_bulletconstant);
else
fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_sustained_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, 0, autocvar_g_balance_uzi_sustained_force, deathtype, 0, 1, autocvar_g_balance_uzi_bulletconstant);
w_ready();
return;
}
- self.uzi_bulletcounter = self.uzi_bulletcounter + 1;
+ self.misc_bulletcounter = self.misc_bulletcounter + 1;
W_Uzi_Attack(WEP_UZI);
weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_uzi_sustained_refire, uzi_fire1_02);
}
self.punchangle_y = random () - 0.5;
}
- uzi_spread = bound(autocvar_g_balance_uzi_spread_min, autocvar_g_balance_uzi_spread_min + (autocvar_g_balance_uzi_spread_add * self.uzi_bulletcounter), autocvar_g_balance_uzi_spread_max);
+ uzi_spread = bound(autocvar_g_balance_uzi_spread_min, autocvar_g_balance_uzi_spread_min + (autocvar_g_balance_uzi_spread_add * self.misc_bulletcounter), autocvar_g_balance_uzi_spread_max);
fireBallisticBullet(w_shotorg, w_shotdir, uzi_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, 0, autocvar_g_balance_uzi_sustained_force, WEP_UZI, 0, 1, autocvar_g_balance_uzi_bulletconstant);
endFireBallisticBullet();
- self.uzi_bulletcounter = self.uzi_bulletcounter + 1;
+ self.misc_bulletcounter = self.misc_bulletcounter + 1;
pointparticles(particleeffectnum("uzi_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
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);
- self.uzi_bulletcounter = self.uzi_bulletcounter + 1;
- if (self.uzi_bulletcounter == 0)
+ self.misc_bulletcounter = self.misc_bulletcounter + 1;
+ if (self.misc_bulletcounter == 0)
weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_uzi_burst_refire2, w_ready);
else
{
weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_uzi_burst_refire, uzi_mode1_fire_burst);
- dprint("bullets:", ftos(self.uzi_bulletcounter),"\n");
}
}
if (self.BUTTON_ATCK)
if (weapon_prepareattack(0, 0))
{
- self.uzi_bulletcounter = 0;
+ self.misc_bulletcounter = 0;
uzi_mode1_fire_auto();
}
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
self.ammo_nails = self.ammo_nails - autocvar_g_balance_uzi_burst_ammo;
- self.uzi_bulletcounter = autocvar_g_balance_uzi_burst * -1;
+ self.misc_bulletcounter = autocvar_g_balance_uzi_burst * -1;
uzi_mode1_fire_burst();
}
}
if (self.BUTTON_ATCK)
if (weapon_prepareattack(0, 0))
{
- self.uzi_bulletcounter = 1;
+ self.misc_bulletcounter = 1;
W_Uzi_Attack(WEP_UZI); // sets attack_finished
weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_uzi_sustained_refire, uzi_fire1_02);
}
if (self.BUTTON_ATCK2 && autocvar_g_balance_uzi_first)
if (weapon_prepareattack(1, 0))
{
- self.uzi_bulletcounter = 1;
+ self.misc_bulletcounter = 1;
W_Uzi_Attack(WEP_UZI | HITTYPE_SECONDARY); // sets attack_finished
weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_uzi_first_refire, w_ready);
}