#ifdef REGISTER_WEAPON
REGISTER_WEAPON(LASER, w_laser, 0, 1, WEP_FLAG_NORMAL | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH, 0, "laser", "laser", "Laser");
#else
+#ifdef SVQC
void(float imp) W_SwitchWeapon;
void W_Laser_Touch (void)
{
W_SetupShot (self, TRUE, 0, "weapons/gauntlet_fire.wav", cvar("g_balance_laser_primary_damage"));
- WarpZone_traceline_antilag(self, w_shotorg, w_shotorg + w_shotdir * cvar("g_balance_laser_primary_radius"), FALSE, self, ANTILAG_LATENCY(self));
+ WarpZone_traceline_antilag(self, w_shotorg, w_shotorg + w_shotdir * (cvar("g_balance_laser_primary_radius") + vlen(eX * self.velocity_x + eY * self.velocity_y)/5), FALSE, self, ANTILAG_LATENCY(self));
- pointparticles(particleeffectnum("laser_gauntlet"), w_shotorg + w_shotdir * cvar("g_balance_laser_primary_radius"), '0 0 0', 1);
+ pointparticles(particleeffectnum("laser_gauntletmuzzleflash"), w_shotorg, w_shotdir * 1000, 1);
+ pointparticles(particleeffectnum("laser_gauntlet"), w_shotorg + w_shotdir * (cvar("g_balance_laser_primary_radius") + vlen(eX * self.velocity_x + eY * self.velocity_y)/5), w_shotdir * 1000, 1);
+ pointparticles(particleeffectnum("laser_gauntlet"), w_shotorg + w_shotdir * (cvar("g_balance_laser_primary_radius") + vlen(eX * self.velocity_x + eY * self.velocity_y)/5) * 0.5, w_shotdir * 1000, 1);
if (trace_fraction < 1)
Damage(trace_ent, self, self, cvar("g_balance_laser_primary_damage"), WEP_LASER | HITTYPE_SECONDARY, trace_endpos, cvar("g_balance_laser_primary_force") * w_shotdir);
return TRUE;
else if (req == WR_CHECKAMMO2)
return TRUE;
+ return TRUE;
+};
+#endif
+#ifdef CSQC
+float w_laser(float req)
+{
+ if(req == WR_IMPACTEFFECT)
+ {
+ vector org2;
+ org2 = w_org + w_backoff * 6;
+ pointparticles(particleeffectnum("laser_impact"), org2, w_backoff * 1000, 1);
+ if(!w_issilent)
+ sound(self, CHAN_PROJECTILE, "weapons/laserimpact.wav", VOL_BASE, ATTN_NORM);
+ }
+ else if(req == WR_PRECACHE)
+ {
+ precache_sound("weapons/laserimpact.wav");
+ }
else if (req == WR_SUICIDEMESSAGE)
w_deathtypestring = "lasered themself to hell";
else if (req == WR_KILLMESSAGE)
w_deathtypestring = "was lasered to death by"; // unchecked: SPLASH
}
return TRUE;
-};
+}
+#endif
#endif