From 16d4f8a6fc6a727503f1a61cbbdf7433bcbeaded Mon Sep 17 00:00:00 2001 From: lordhavoc Date: Sat, 10 Jun 2006 13:14:53 +0000 Subject: [PATCH] changed shotorg positions for most weapons, they are now all inside the player bounding box, and most are the same (15 8 -8), only the poorly placed nex, hagar, and rocket launcher models are other values changed electro shots to use EF_LOWPRECISION, EF_FULLBRIGHT, and removed EF_ADDITIVE and glow_size From the secondary shots, they're now much more obvious and quicker to render changed mortar shots to be EF_LOWPRECISION git-svn-id: svn://svn.icculus.org/nexuiz/trunk@1545 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/qcsrc/server/gamec/cl_weaponsystem.c | 11 +++--- data/qcsrc/server/gamec/defs.h | 3 -- data/qcsrc/server/gamec/w_crylink.c | 7 ++-- data/qcsrc/server/gamec/w_electro.c | 40 ++++----------------- data/qcsrc/server/gamec/w_grenadelauncher.c | 8 ++--- data/qcsrc/server/gamec/w_hagar.c | 4 +-- data/qcsrc/server/gamec/w_laser.c | 2 +- data/qcsrc/server/gamec/w_nex.c | 2 +- data/qcsrc/server/gamec/w_rocketlauncher.c | 2 +- data/qcsrc/server/gamec/w_shotgun.c | 10 +++--- data/qcsrc/server/gamec/w_uzi.c | 6 ++-- 11 files changed, 34 insertions(+), 61 deletions(-) diff --git a/data/qcsrc/server/gamec/cl_weaponsystem.c b/data/qcsrc/server/gamec/cl_weaponsystem.c index 7f9233bf0..8c1899ca3 100644 --- a/data/qcsrc/server/gamec/cl_weaponsystem.c +++ b/data/qcsrc/server/gamec/cl_weaponsystem.c @@ -23,8 +23,6 @@ vector w_shotdir; void(entity ent, vector vecs, float antilag, float recoil, string snd) W_SetupShot = { local vector trueaimpoint; - local vector startorg; - local vector idealorg; traceline_hitcorpse(self, self.origin + self.view_ofs, self.origin + self.view_ofs + v_forward * 8192, MOVE_NOMONSTERS, self); trueaimpoint = trace_endpos; @@ -38,12 +36,17 @@ void(entity ent, vector vecs, float antilag, float recoil, string snd) W_SetupSh if (cvar("g_antilag")) trueaimpoint = self.cursor_trace_ent.origin; + /* + // don't allow the shot to start inside a wall + local vector startorg; + local vector idealorg; startorg = ent.origin + ent.view_ofs;// - '0 0 8'; idealorg = ent.origin + ent.view_ofs + v_forward * vecs_x + v_right * vecs_y + v_up * vecs_z; - - // don't allow the shot to start inside a wall traceline_hitcorpse (ent, startorg, idealorg, MOVE_NOMONSTERS, ent); w_shotorg = trace_endpos; + */ + // all positions in the code are now required to be inside the player box + w_shotorg = ent.origin + ent.view_ofs + v_forward * vecs_x + v_right * vecs_y + v_up * vecs_z; w_shotdir = normalize(trueaimpoint - w_shotorg); diff --git a/data/qcsrc/server/gamec/defs.h b/data/qcsrc/server/gamec/defs.h index 743148827..53fb7420d 100644 --- a/data/qcsrc/server/gamec/defs.h +++ b/data/qcsrc/server/gamec/defs.h @@ -75,9 +75,6 @@ string newlines = "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"; .float respawntime; //.float chasecam; -.float electrocount; -//.float crylinkcount; - .float damageforcescale; //.float gravity; diff --git a/data/qcsrc/server/gamec/w_crylink.c b/data/qcsrc/server/gamec/w_crylink.c index a61b1c11e..55e7c0fdc 100644 --- a/data/qcsrc/server/gamec/w_crylink.c +++ b/data/qcsrc/server/gamec/w_crylink.c @@ -75,7 +75,7 @@ void W_Crylink_Attack (void) if (cvar("g_use_ammunition")) self.ammo_cells = self.ammo_cells - cvar("g_balance_crylink_primary_ammo"); - W_SetupShot (self, '24 7 -8', FALSE, 2, "weapons/crylink_fire.ogg"); + W_SetupShot (self, '15 8 -8', FALSE, 2, "weapons/crylink_fire.ogg"); te_smallflash(w_shotorg); shots = cvar("g_balance_crylink_primary_shots"); @@ -119,7 +119,7 @@ void W_Crylink_Attack2 (void) if (cvar("g_use_ammunition")) self.ammo_cells = self.ammo_cells - cvar("g_balance_crylink_secondary_ammo"); - W_SetupShot (self, '20 7 -8', FALSE, 2, "weapons/crylink_fire.ogg"); + W_SetupShot (self, '15 8 -8', FALSE, 2, "weapons/crylink_fire.ogg"); te_smallflash(w_shotorg); shots = cvar("g_balance_crylink_secondary_shots"); @@ -162,7 +162,8 @@ void W_Crylink_Attack3 (void) { if (cvar("g_use_ammunition")) self.ammo_cells = self.ammo_cells - cvar("g_balance_crylink_primary_ammo"); - W_SetupShot(self, '10 5 -14', TRUE, 0, "weapons/crylink_fire.ogg"); + //W_SetupShot(self, '10 5 -14', TRUE, 0, "weapons/crylink_fire.ogg"); + W_SetupShot (self, '15 7 -8', TRUE, 0, "weapons/crylink_fire.ogg"); // use traceline_hitcorpse to make sure it can hit gibs and corpses too traceline_hitcorpse(self, w_shotorg, w_shotorg + w_shotdir * 1000, FALSE, self); diff --git a/data/qcsrc/server/gamec/w_electro.c b/data/qcsrc/server/gamec/w_electro.c index 281f66215..8260c75e8 100644 --- a/data/qcsrc/server/gamec/w_electro.c +++ b/data/qcsrc/server/gamec/w_electro.c @@ -86,21 +86,7 @@ void() W_Electro_Attack { local entity proj; - if (self.electrocount == 0) - { - self.electrocount = 1; - W_SetupShot (self, '24 5.5 -11', FALSE, 2, "weapons/electro_fire.ogg"); - } - else if (self.electrocount == 1) - { - self.electrocount = 2; - W_SetupShot (self, '24 8 -8.1', FALSE, 2, "weapons/electro_fire.ogg"); - } - else - { - self.electrocount = 0; - W_SetupShot (self, '24 10.5 -11', FALSE, 2, "weapons/electro_fire.ogg"); - } + W_SetupShot (self, '15 8 -8', FALSE, 2, "weapons/electro_fire.ogg"); proj = spawn (); proj.classname = "plasma_prim"; @@ -114,7 +100,7 @@ void() W_Electro_Attack if (cvar("g_use_ammunition")) self.ammo_cells = self.ammo_cells - cvar("g_balance_electro_primary_ammo"); - proj.effects = EF_BRIGHTFIELD | EF_FULLBRIGHT | EF_NOSHADOW; + proj.effects = EF_BRIGHTFIELD | EF_FULLBRIGHT | EF_NOSHADOW | EF_LOWPRECISION; proj.movetype = MOVETYPE_FLY; proj.velocity = w_shotdir * cvar("g_balance_electro_primary_speed"); proj.angles = vectoangles(proj.velocity); @@ -130,21 +116,7 @@ void() W_Electro_Attack2 { local entity proj; - if (self.electrocount == 0) - { - self.electrocount = 1; - W_SetupShot (self, '24 6 -12', FALSE, 2, "weapons/electro_fire2.ogg"); - } - else if (self.electrocount == 1) - { - self.electrocount = 2; - W_SetupShot (self, '24 8 -10', FALSE, 2, "weapons/electro_fire2.ogg"); - } - else - { - self.electrocount = 0; - W_SetupShot (self, '24 10 -12', FALSE, 2, "weapons/electro_fire2.ogg"); - } + W_SetupShot (self, '15 8 -8', FALSE, 2, "weapons/electro_fire.ogg"); proj = spawn (); proj.classname = "plasma"; @@ -158,9 +130,9 @@ void() W_Electro_Attack2 if (cvar("g_use_ammunition")) self.ammo_cells = self.ammo_cells - cvar("g_balance_electro_secondary_ammo"); - proj.effects = EF_ADDITIVE | EF_NOSHADOW; - proj.glow_size = 50; - proj.glow_color = 45; + proj.effects = EF_FULLBRIGHT | EF_NOSHADOW | EF_LOWPRECISION; + //proj.glow_size = 50; + //proj.glow_color = 45; proj.movetype = MOVETYPE_BOUNCE; proj.velocity = v_forward * cvar("g_balance_electro_secondary_speed") + v_up * cvar("g_balance_electro_secondary_speed_up"); proj.touch = W_Plasma_Touch; diff --git a/data/qcsrc/server/gamec/w_grenadelauncher.c b/data/qcsrc/server/gamec/w_grenadelauncher.c index 21154b960..7cc470c74 100644 --- a/data/qcsrc/server/gamec/w_grenadelauncher.c +++ b/data/qcsrc/server/gamec/w_grenadelauncher.c @@ -75,7 +75,7 @@ void W_Grenade_Attack (void) if (cvar("g_use_ammunition")) self.ammo_rockets = self.ammo_rockets - cvar("g_balance_grenadelauncher_primary_ammo"); - W_SetupShot (self, '24 8 -10', FALSE, 4, "weapons/grenade_fire.ogg"); + W_SetupShot (self, '15 8 -8', FALSE, 4, "weapons/grenade_fire.ogg"); gren = spawn (); gren.owner = self; @@ -84,7 +84,7 @@ void W_Grenade_Attack (void) gren.bot_dodgerating = cvar("g_balance_grenadelauncher_primary_damage"); gren.movetype = MOVETYPE_BOUNCE; gren.solid = SOLID_BBOX; - gren.effects = EF_NOSHADOW; + gren.effects = EF_NOSHADOW | EF_LOWPRECISION; setmodel(gren, "models/grenademodel.md3"); setsize(gren, '0 0 0', '0 0 0'); setorigin(gren, w_shotorg); @@ -105,7 +105,7 @@ void W_Grenade_Attack2 (void) if (cvar("g_use_ammunition")) self.ammo_rockets = self.ammo_rockets - cvar("g_balance_grenadelauncher_secondary_ammo"); - W_SetupShot (self, '24 8 -10', FALSE, 4, "weapons/grenade_fire.ogg"); + W_SetupShot (self, '15 8 -8', FALSE, 4, "weapons/grenade_fire.ogg"); gren = spawn (); gren.owner = self; @@ -114,7 +114,7 @@ void W_Grenade_Attack2 (void) gren.bot_dodgerating = cvar("g_balance_grenadelauncher_secondary_damage"); gren.movetype = MOVETYPE_BOUNCE; gren.solid = SOLID_BBOX; - gren.effects = EF_NOSHADOW; + gren.effects = EF_NOSHADOW | EF_LOWPRECISION; setmodel(gren, "models/grenademodel.md3"); setsize(gren, '0 0 -3', '0 0 -3'); setorigin(gren, w_shotorg); diff --git a/data/qcsrc/server/gamec/w_hagar.c b/data/qcsrc/server/gamec/w_hagar.c index 5a20493d1..bded43431 100644 --- a/data/qcsrc/server/gamec/w_hagar.c +++ b/data/qcsrc/server/gamec/w_hagar.c @@ -81,7 +81,7 @@ void W_Hagar_Attack (void) if (cvar("g_use_ammunition")) self.ammo_rockets = self.ammo_rockets - cvar("g_balance_hagar_primary_ammo"); - W_SetupShot (self, '18 5 -8', FALSE, 2, "weapons/hagar_fire.ogg"); + W_SetupShot (self, '15 5 -8', FALSE, 2, "weapons/hagar_fire.ogg"); missile = spawn (); missile.owner = self; @@ -115,7 +115,7 @@ void W_Hagar_Attack2 (void) if (cvar("g_use_ammunition")) self.ammo_rockets = self.ammo_rockets - cvar("g_balance_hagar_secondary_ammo"); - W_SetupShot (self, '18 5 -8', FALSE, 2, "weapons/hagar_fire.ogg"); + W_SetupShot (self, '15 5 -8', FALSE, 2, "weapons/hagar_fire.ogg"); missile = spawn (); missile.owner = self; diff --git a/data/qcsrc/server/gamec/w_laser.c b/data/qcsrc/server/gamec/w_laser.c index ff0e263b2..b703f3b61 100644 --- a/data/qcsrc/server/gamec/w_laser.c +++ b/data/qcsrc/server/gamec/w_laser.c @@ -30,7 +30,7 @@ void W_Laser_Attack (void) { local entity missile; - W_SetupShot (self, '24 9 -9', FALSE, 3, "weapons/lasergun_fire.ogg"); + W_SetupShot (self, '15 8 -8', FALSE, 3, "weapons/lasergun_fire.ogg"); //te_customflash(w_shotorg, 160, 0.2, '1 0 0'); missile = spawn (); diff --git a/data/qcsrc/server/gamec/w_nex.c b/data/qcsrc/server/gamec/w_nex.c index 90daea48d..22d08c096 100644 --- a/data/qcsrc/server/gamec/w_nex.c +++ b/data/qcsrc/server/gamec/w_nex.c @@ -2,7 +2,7 @@ void W_Nex_Attack (void) { //w_shotorg = self.origin + self.view_ofs + v_forward * 5 + v_right * 14 + v_up * -7; - W_SetupShot(self, '5 14 -7', TRUE, 5, "weapons/nexfire.ogg"); + W_SetupShot(self, '5 14 -8', TRUE, 5, "weapons/nexfire.ogg"); // assure that nexdamage is high enough in minstagib if (cvar("g_minstagib")) diff --git a/data/qcsrc/server/gamec/w_rocketlauncher.c b/data/qcsrc/server/gamec/w_rocketlauncher.c index 3462a47ac..7df2ec256 100644 --- a/data/qcsrc/server/gamec/w_rocketlauncher.c +++ b/data/qcsrc/server/gamec/w_rocketlauncher.c @@ -183,7 +183,7 @@ void W_Rocket_Attack (void) if (cvar("g_use_ammunition") && !cvar("g_rocketarena")) self.ammo_rockets = self.ammo_rockets - cvar("g_balance_rocketlauncher_ammo"); - W_SetupShot (self, '15 3 -11', FALSE, 5, "weapons/rocket_fire.ogg"); + W_SetupShot (self, '15 3 -8', FALSE, 5, "weapons/rocket_fire.ogg"); te_smallflash(w_shotorg); missile = spawn (); diff --git a/data/qcsrc/server/gamec/w_shotgun.c b/data/qcsrc/server/gamec/w_shotgun.c index 51f946761..cb744c0b0 100644 --- a/data/qcsrc/server/gamec/w_shotgun.c +++ b/data/qcsrc/server/gamec/w_shotgun.c @@ -10,7 +10,7 @@ void W_Shotgun_Attack (void) d = cvar("g_balance_shotgun_primary_damage"); spread = cvar("g_balance_shotgun_primary_spread"); - W_SetupShot (self, '26 9 -10', TRUE, 5, "weapons/shotgun_fire.ogg"); + W_SetupShot (self, '15 8 -8', TRUE, 5, "weapons/shotgun_fire.ogg"); for (sc = 0;sc < bullets;sc = sc + 1) fireBullet (w_shotorg, w_shotdir, spread, d, IT_SHOTGUN, sc < 3); if (cvar("g_use_ammunition")) @@ -21,7 +21,7 @@ void W_Shotgun_Attack (void) // casing code if (cvar("g_casings") >= 1) - SpawnCasing (w_shotorg + v_forward * -6 + v_right * -1 + v_up * 2, ((random () * 50 + 50) * v_right) - ((random () * 25 + 25) * v_forward) - ((random () * 5 - 30) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 1); + SpawnCasing (w_shotorg, ((random () * 50 + 50) * v_right) - ((random () * 25 + 25) * v_forward) - ((random () * 5 - 30) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 1); } void W_Shotgun_Attack2 (void) @@ -35,18 +35,18 @@ void W_Shotgun_Attack2 (void) d = cvar("g_balance_shotgun_secondary_damage"); spread = cvar("g_balance_shotgun_secondary_spread"); - W_SetupShot (self, '26 9 -10', TRUE, 5, "weapons/shotgun_fire.ogg"); + W_SetupShot (self, '15 8 -8', TRUE, 5, "weapons/shotgun_fire.ogg"); for (sc = 0;sc < bullets;sc = sc + 1) fireBullet (w_shotorg, w_shotdir, spread, d, IT_SHOTGUN, sc < 3); if (cvar("g_use_ammunition")) self.ammo_shells = self.ammo_shells - cvar("g_balance_shotgun_secondary_ammo"); - W_Smoke(w_shotorg, v_forward, 12); + W_Smoke(w_shotorg + v_forward * 8, v_forward, 12); //te_smallflash(w_shotorg); // casing code if (cvar("g_casings") >= 1) - SpawnCasing (w_shotorg + v_forward * -6 + v_right * -1 + v_up * 2, ((random () * 50 + 50) * v_right) - ((random () * 25 + 25) * v_forward) - ((random () * 5 - 30) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 1); + SpawnCasing (w_shotorg, ((random () * 50 + 50) * v_right) - ((random () * 25 + 25) * v_forward) - ((random () * 5 - 30) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 1); } // weapon frames diff --git a/data/qcsrc/server/gamec/w_uzi.c b/data/qcsrc/server/gamec/w_uzi.c index b9ac230dc..6de310321 100644 --- a/data/qcsrc/server/gamec/w_uzi.c +++ b/data/qcsrc/server/gamec/w_uzi.c @@ -11,7 +11,7 @@ void W_Uzi_Attack (void) else self.ammo_nails = self.ammo_nails - cvar("g_balance_uzi_sustained_ammo"); } - W_SetupShot (self, '32 6 -8', TRUE, 0, "weapons/uzi_fire.ogg"); + W_SetupShot (self, '15 8 -8', TRUE, 0, "weapons/uzi_fire.ogg"); if (!cvar("g_norecoil")) { self.punchangle_x = random () - 0.5; @@ -27,7 +27,7 @@ void W_Uzi_Attack (void) fireBullet (w_shotorg, w_shotdir, cvar("g_balance_uzi_sustained_spread"), cvar("g_balance_uzi_sustained_damage"), IT_UZI, (self.uzi_bulletcounter & 3) == 0); flash = spawn (); - setorigin (flash, w_shotorg); + setorigin (flash, w_shotorg + v_forward * 17); setmodel (flash, "models/uziflash.md3"); flash.angles = vectoangles (w_shotdir); flash.angles_z=flash.v_angle_z + random () * 180; @@ -38,7 +38,7 @@ void W_Uzi_Attack (void) // casing code if (cvar("g_casings") >= 2) - SpawnCasing (w_shotorg + v_forward * -17, ((random () * 50 + 50) * v_right) - ((random () * 25 + 25) * v_forward) - ((random () * 5 - 70) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 3); + SpawnCasing (w_shotorg + v_forward * 10, ((random () * 50 + 50) * v_right) - ((random () * 25 + 25) * v_forward) - ((random () * 5 - 70) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 3); } // weapon frames -- 2.39.2