From c2228ee5bf5b96b298b0e859fed9600b598a5f2d Mon Sep 17 00:00:00 2001 From: lordhavoc Date: Wed, 9 Jan 2008 11:38:47 +0000 Subject: [PATCH] added muzzleflash effects for all weapons (most emit light, all emit particles), this is in addition to the model flashes for some weapons added trail effect to mortar and hagar projectiles changed rocket trail and electro trail, and some other tweaks git-svn-id: svn://svn.icculus.org/nexuiz/trunk@3118 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/effectinfo.txt | 317 ++++++++++++++++++++++++- data/qcsrc/server/cl_client.qc | 5 + data/qcsrc/server/w_crylink.qc | 4 +- data/qcsrc/server/w_electro.qc | 4 + data/qcsrc/server/w_grenadelauncher.qc | 6 + data/qcsrc/server/w_hagar.qc | 6 + data/qcsrc/server/w_laser.qc | 1 + data/qcsrc/server/w_nex.qc | 16 +- data/qcsrc/server/w_rocketlauncher.qc | 3 +- data/qcsrc/server/w_shotgun.qc | 6 +- data/qcsrc/server/w_uzi.qc | 2 + 11 files changed, 344 insertions(+), 26 deletions(-) diff --git a/data/effectinfo.txt b/data/effectinfo.txt index 85ad7255a..4021ccb1a 100644 --- a/data/effectinfo.txt +++ b/data/effectinfo.txt @@ -948,7 +948,7 @@ alpha 256 256 0 originjitter 20 20 20 lightradius 250 lightradiusfade 250 -lightcolor 4 4 10 +lightcolor 3.125 4.375 10 // flare effect effect TE_TEI_PLASMAHIT countabsolute 1 @@ -984,11 +984,11 @@ velocityjitter 32 32 32 // rocket trail // smoke effect TR_ROCKET -trailspacing 3 +trailspacing 6 type smoke color 0x303030 0x606060 tex 0 8 -size 3 3 +size 7 7 alpha 32 32 32 lightradius 150 lighttime 0 @@ -996,14 +996,15 @@ lightcolor 6 3 1 // fire effect TR_ROCKET notunderwater -trailspacing 3 +trailspacing 6 type static -color 0x801010 0xFFA020 +color 0x805010 0xFFA020 tex 0 8 -size 3 3 -alpha 144 144 700 -velocityjitter 20 20 20 -velocitymultiplier -0.25 +size 6 6 +alpha 144 144 288 +airfriction 8 +velocityjitter 32 32 32 +velocitymultiplier -0.5 // bubbles effect TR_ROCKET underwater @@ -1017,6 +1018,21 @@ gravity -0.125 bounce 1.5 liquidfriction 4 velocityjitter 16 16 16 +// sparks +effect TR_ROCKET +trailspacing 10 +type spark +tex 40 40 +color 0xFFFDD9 0xFFFDD9 +size 2 2 +alpha 444 512 1866 +gravity 1 +bounce 1 +velocityoffset 0 0 15 +airfriction 12 +originjitter 1 1 1 +velocityjitter 200 200 200 +velocitymultiplier -0.5 // grenade trail // smoke @@ -1104,7 +1120,7 @@ trailspacing 4 type static color 0x283880 0x283880 size 4 4 -alpha 256 256 1024 +alpha 256 256 768 velocityjitter 16 16 16 lightradius 90 lighttime 0 @@ -1156,3 +1172,284 @@ velocityjitter 32 32 0 //lightradius 200 //lighttime 0 //lightcolor 0.4 0.9 0.9 + +effect laser_muzzleflash +count 1 +type smoke +color 0xFFFFFF 0xFFFFFF +tex 0 8 +size 5 5 +alpha 64 64 128 +airfriction 12 +originjitter 1.5 1.5 1.5 +velocityjitter 6 6 6 +velocitymultiplier 0.01 +lightradius 200 +lightradiusfade 2000 +lightcolor 3 0.1 0.1 + +effect shotgun_muzzleflash +count 3 +type smoke +color 0x202020 0x404040 +tex 0 8 +size 5 5 +alpha 256 256 512 +originjitter 1.5 1.5 1.5 +velocityjitter 6 6 6 +velocitymultiplier 0.01 +lightradius 200 +lightradiusfade 2000 +lightcolor 2 1.5 0.2 +effect shotgun_muzzleflash +count 10 +type spark +tex 40 40 +color 0xFFFDD9 0xFFFDD9 +size 2 2 +alpha 0 128 1024 +originjitter 1 1 1 +velocityjitter 200 200 200 +velocitymultiplier 0.5 +airfriction 12 + +effect uzi_muzzleflash +count 2 +type smoke +color 0x202020 0x404040 +tex 0 8 +size 5 5 +alpha 256 256 512 +originjitter 1.5 1.5 1.5 +velocityjitter 6 6 6 +velocitymultiplier 0.01 +lightradius 200 +lightradiusfade 2000 +lightcolor 2 1.5 0.2 +effect uzi_muzzleflash +count 20 +type spark +tex 40 40 +color 0xFFFDD9 0xFFFDD9 +size 2 2 +alpha 0 128 1024 +originjitter 1 1 1 +velocityjitter 300 300 300 +velocitymultiplier 0.5 +airfriction 12 + +effect grenadelauncher_muzzleflash +count 3 +type smoke +color 0x202020 0x404040 +tex 0 8 +size 5 5 +alpha 256 256 512 +originjitter 1.5 1.5 1.5 +airfriction 12 +velocityjitter 20 20 20 +velocitymultiplier 0.03 +lightradius 200 +lightradiusfade 2000 +lightcolor 2 1.5 0.2 +effect grenadelauncher_muzzleflash +count 30 +type spark +tex 40 40 +color 0xFFFDD9 0xFFFDD9 +size 3 3 +alpha 0 128 1024 +originjitter 1 1 1 +velocityjitter 300 300 300 +velocitymultiplier 0.5 +airfriction 12 + +effect electro_muzzleflash +count 1 +type smoke +color 0x202020 0x404040 +tex 0 8 +size 5 5 +alpha 256 256 512 +originjitter 1.5 1.5 1.5 +velocityjitter 6 6 6 +velocitymultiplier 0.01 +lightradius 200 +lightradiusfade 2000 +lightcolor 2 1.5 0.2 +effect electro_muzzleflash +count 30 +type spark +tex 41 41 +color 0xD9FDFF 0xD9FDFF +size 3 3 +alpha 0 128 1024 +originjitter 1 1 1 +velocityjitter 300 300 300 +velocitymultiplier 0.5 +airfriction 12 + +effect crylink_muzzleflash +count 1 +type smoke +color 0x202020 0x404040 +tex 0 8 +size 5 5 +alpha 128 128 256 +originjitter 1.5 1.5 1.5 +velocityjitter 6 6 6 +velocitymultiplier 0.01 +lightradius 200 +lightradiusfade 2000 +lightcolor 2 1.5 0.2 +effect crylink_muzzleflash +count 10 +type spark +tex 40 40 +color 0xA080C0 0xA080C0 +size 3 3 +alpha 0 128 1024 +originjitter 1 1 1 +velocityjitter 200 200 200 +velocitymultiplier 0.3 +airfriction 12 + +effect nex_muzzleflash +count 10 +type smoke +color 0x202020 0x404040 +tex 0 8 +size 16 16 +alpha 256 256 384 +originjitter 4 4 4 +velocityjitter 24 24 24 +velocitymultiplier 0.02 +lightradius 300 +lightradiusfade 300 +lightcolor 4 5 6 +effect nex_muzzleflash +count 150 +type spark +tex 41 41 +color 0xD9FDFF 0xD9FDFF +size 3 3 +alpha 0 128 512 +originjitter 1 1 1 +velocityjitter 600 600 600 +velocitymultiplier 0.5 +airfriction 9 + +effect hagar_muzzleflash +count 4 +type smoke +color 0x202020 0x404040 +tex 0 8 +size 5 5 +alpha 256 256 512 +originjitter 1.5 1.5 1.5 +velocityjitter 6 6 6 +velocitymultiplier 0.01 +lightradius 200 +lightradiusfade 2000 +lightcolor 2 1.5 0.2 +effect hagar_muzzleflash +count 30 +type spark +tex 40 40 +color 0xFFFDD9 0xFFFDD9 +size 3 3 +alpha 0 128 1024 +originjitter 1 1 1 +velocityjitter 300 300 300 +velocitymultiplier 0.5 +airfriction 12 + +effect rocketlauncher_muzzleflash +count 5 +type smoke +color 0x202020 0x404040 +tex 0 8 +size 5 5 +alpha 256 256 256 +airfriction 6 +originjitter 1.5 1.5 1.5 +velocityjitter 40 40 40 +velocitymultiplier 0.03 +//lightradius 200 +//lightradiusfade 2000 +//lightcolor 2 1.5 0.2 +effect rocketlauncher_muzzleflash +count 30 +type spark +tex 40 40 +color 0xFFFDD9 0xFFFDD9 +size 3 3 +alpha 0 128 1024 +originjitter 1 1 1 +velocityjitter 300 300 300 +velocitymultiplier 0.5 +airfriction 12 + +// nex beam +effect nex_beam +countabsolute 1 +type beam +tex 60 60 +color 0xFFFFFF 0xFFFFFF +size 6 6 +alpha 128 128 192 +// The RING smoke +// experimental +effect nex_beam +trailspacing 12 +color 0x0B3E4F 0x0B3E4F +size 4 4 +tex 32 32 +alpha 0 256 200 +airfriction 5 +sizeincrease 3 +type static +// The drifting smoke to accompany it +// experimental +effect nex_beam +trailspacing 8 +color 0x28404F 0x28404F +size 4 4 +tex 48 55 +alpha 128 192 200 +airfriction 9 +sizeincrease 12 +velocityjitter 64 64 64 +type static + +// nex impact +// decal +effect nex_impact +countabsolute 1 +type decal +tex 47 47 +size 24 24 +alpha 256 256 0 +originjitter 16 16 16 +lightradius 200 +lightradiusfade 250 +lightcolor 4 6 8 +// flare effect +effect nex_impact +countabsolute 1 +type static +tex 37 37 +color 0x80C0FF 0x80C0FF +size 8 8 +alpha 256 256 256 +// small sparks which form a sphere as they slow down +effect nex_impact +count 256 +type spark +color 0x2030FF 0x80C0FF +size 1 2 +alpha 256 256 512 +bounce 2 +airfriction 8 +liquidfriction 8 +velocityjitter 384 384 384 diff --git a/data/qcsrc/server/cl_client.qc b/data/qcsrc/server/cl_client.qc index 71d17e871..04c283908 100644 --- a/data/qcsrc/server/cl_client.qc +++ b/data/qcsrc/server/cl_client.qc @@ -1,3 +1,8 @@ +void info_player_survivor (void) +{ + info_player_deathmatch(); +} + void info_player_start (void) { info_player_deathmatch(); diff --git a/data/qcsrc/server/w_crylink.qc b/data/qcsrc/server/w_crylink.qc index 65f38566f..dfd55e375 100644 --- a/data/qcsrc/server/w_crylink.qc +++ b/data/qcsrc/server/w_crylink.qc @@ -79,6 +79,7 @@ void W_Crylink_Attack (void) te_smallflash(w_shotorg); shots = cvar("g_balance_crylink_primary_shots"); + pointparticles(particleeffectnum("crylink_muzzleflash"), w_shotorg + v_forward * 12, v_forward * 1000, shots); while (counter < shots) { proj = spawn (); @@ -121,9 +122,10 @@ void W_Crylink_Attack2 (void) self.ammo_cells = self.ammo_cells - cvar("g_balance_crylink_secondary_ammo"); W_SetupShot (self, '11 8 -8', FALSE, 2, "weapons/crylink_fire.wav"); - te_smallflash(w_shotorg); + //te_smallflash(w_shotorg); shots = cvar("g_balance_crylink_secondary_shots"); + pointparticles(particleeffectnum("crylink_muzzleflash"), w_shotorg + v_forward * 12, v_forward * 1000, shots); while (counter < shots) { proj = spawn (); diff --git a/data/qcsrc/server/w_electro.qc b/data/qcsrc/server/w_electro.qc index 3a1bfb639..adb2849bc 100644 --- a/data/qcsrc/server/w_electro.qc +++ b/data/qcsrc/server/w_electro.qc @@ -88,6 +88,8 @@ void() W_Electro_Attack W_SetupShot (self, '11 8 -8', FALSE, 2, "weapons/electro_fire.wav"); + pointparticles(particleeffectnum("electro_muzzleflash"), w_shotorg + v_forward * 8, v_forward * 1000, 1); + proj = spawn (); proj.classname = "plasma_prim"; proj.owner = self; @@ -120,6 +122,8 @@ void() W_Electro_Attack2 W_SetupShot (self, '8 4.5 -13', FALSE, 2, "weapons/electro_fire2.wav"); + pointparticles(particleeffectnum("electro_muzzleflash"), w_shotorg + v_forward * 8, v_forward * 1000, 1); + proj = spawn (); proj.classname = "plasma"; proj.owner = self; diff --git a/data/qcsrc/server/w_grenadelauncher.qc b/data/qcsrc/server/w_grenadelauncher.qc index 329bb1347..159c1f617 100644 --- a/data/qcsrc/server/w_grenadelauncher.qc +++ b/data/qcsrc/server/w_grenadelauncher.qc @@ -83,6 +83,8 @@ void W_Grenade_Attack (void) self.ammo_rockets = self.ammo_rockets - cvar("g_balance_grenadelauncher_primary_ammo"); W_SetupShot (self, '11 8 -8', FALSE, 4, "weapons/grenade_fire.wav"); + pointparticles(particleeffectnum("grenadelauncher_muzzleflash"), w_shotorg + v_forward * 8, v_forward * 1000, 1); + gren = spawn (); gren.owner = self; gren.classname = "grenade"; @@ -91,6 +93,7 @@ void W_Grenade_Attack (void) gren.movetype = MOVETYPE_BOUNCE; gren.solid = SOLID_BBOX; gren.effects = EF_LOWPRECISION; + gren.modelflags = MF_GRENADE; setmodel(gren, "models/grenademodel.md3"); // precision set above setsize(gren, '0 0 0', '0 0 0'); setorigin(gren, w_shotorg); @@ -114,6 +117,8 @@ void W_Grenade_Attack2 (void) self.ammo_rockets = self.ammo_rockets - cvar("g_balance_grenadelauncher_secondary_ammo"); W_SetupShot (self, '11 8 -8', FALSE, 4, "weapons/grenade_fire.wav"); + pointparticles(particleeffectnum("grenadelauncher_muzzleflash"), w_shotorg + v_forward * 8, v_forward * 1000, 1); + gren = spawn (); gren.owner = self; gren.classname = "grenade"; @@ -122,6 +127,7 @@ void W_Grenade_Attack2 (void) gren.movetype = MOVETYPE_BOUNCE; gren.solid = SOLID_BBOX; gren.effects = EF_LOWPRECISION; + gren.modelflags = MF_GRENADE; setmodel(gren, "models/grenademodel.md3"); // precision set above setsize(gren, '0 0 -3', '0 0 -3'); setorigin(gren, w_shotorg); diff --git a/data/qcsrc/server/w_hagar.qc b/data/qcsrc/server/w_hagar.qc index 3ed72d376..e99d9c838 100644 --- a/data/qcsrc/server/w_hagar.qc +++ b/data/qcsrc/server/w_hagar.qc @@ -83,6 +83,8 @@ void W_Hagar_Attack (void) self.ammo_rockets = self.ammo_rockets - cvar("g_balance_hagar_primary_ammo"); W_SetupShot (self, '11 5 -8', FALSE, 2, "weapons/hagar_fire.wav"); + pointparticles(particleeffectnum("hagar_muzzleflash"), w_shotorg + v_forward * 8, v_forward * 1000, 1); + missile = spawn (); missile.owner = self; missile.classname = "missile"; @@ -101,6 +103,7 @@ void W_Hagar_Attack (void) //missile.health = 10; //missile.event_damage = W_Hagar_Damage; missile.effects = EF_LOWPRECISION; + missile.modelflags = MF_GRENADE; missile.movetype = MOVETYPE_FLY; missile.velocity = (w_shotdir + randomvec() * cvar("g_balance_hagar_primary_spread")) * cvar("g_balance_hagar_primary_speed"); @@ -118,6 +121,8 @@ void W_Hagar_Attack2 (void) self.ammo_rockets = self.ammo_rockets - cvar("g_balance_hagar_secondary_ammo"); W_SetupShot (self, '11 5 -8', FALSE, 2, "weapons/hagar_fire.wav"); + pointparticles(particleeffectnum("hagar_muzzleflash"), w_shotorg + v_forward * 8, v_forward * 1000, 1); + missile = spawn (); missile.owner = self; missile.classname = "missile"; @@ -137,6 +142,7 @@ void W_Hagar_Attack2 (void) //missile.health = 10; //missile.event_damage = W_Hagar_Damage; missile.effects = EF_LOWPRECISION; + missile.modelflags = MF_GRENADE; missile.movetype = MOVETYPE_BOUNCEMISSILE; missile.velocity = (w_shotdir + randomvec() * cvar("g_balance_hagar_secondary_spread")) * cvar("g_balance_hagar_secondary_speed"); diff --git a/data/qcsrc/server/w_laser.qc b/data/qcsrc/server/w_laser.qc index 1c0079cec..0737e3a4e 100644 --- a/data/qcsrc/server/w_laser.qc +++ b/data/qcsrc/server/w_laser.qc @@ -36,6 +36,7 @@ void W_Laser_Attack (float issecondary) W_SetupShot (self, '11 8 -8', FALSE, 3, "weapons/lasergun_fire.wav"); //te_customflash(w_shotorg, 160, 0.2, '1 0 0'); + pointparticles(particleeffectnum("laser_muzzleflash"), w_shotorg + v_forward * 8, v_forward * 1000, 1); missile = spawn (); missile.owner = self; diff --git a/data/qcsrc/server/w_nex.qc b/data/qcsrc/server/w_nex.qc index 140d81236..7a076303a 100644 --- a/data/qcsrc/server/w_nex.qc +++ b/data/qcsrc/server/w_nex.qc @@ -10,24 +10,16 @@ void W_Nex_Attack (void) else FireRailgunBullet (w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, cvar("g_balance_nex_damage"), cvar("g_balance_nex_force"), IT_NEX); + pointparticles(particleeffectnum("nex_muzzleflash"), w_shotorg + v_forward * 32, v_forward * 1000, 1); + // show as if shot started outside of gun // muzzleflash light //te_smallflash (w_shotorg + w_shotdir * 24); // beam effect - WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); - WriteByte (MSG_BROADCAST, 76); - WriteCoord (MSG_BROADCAST, w_shotorg_x + w_shotdir_x * 18); - WriteCoord (MSG_BROADCAST, w_shotorg_y + w_shotdir_y * 18); - WriteCoord (MSG_BROADCAST, w_shotorg_z + w_shotdir_z * 18); - WriteCoord (MSG_BROADCAST, trace_endpos_x); - WriteCoord (MSG_BROADCAST, trace_endpos_y); - WriteCoord (MSG_BROADCAST, trace_endpos_z); - WriteCoord (MSG_BROADCAST, 0); - WriteCoord (MSG_BROADCAST, 0); - WriteCoord (MSG_BROADCAST, 0); + trailparticles(world, particleeffectnum("nex_beam"), w_shotorg + w_shotdir * 28, trace_endpos); // flash and burn the wall if (trace_ent.solid == SOLID_BSP && !(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)) - te_plasmaburn (trace_endpos - w_shotdir * 6); + pointparticles(particleeffectnum("nex_impact"), trace_endpos - w_shotdir * 6, '0 0 0', 1); // play a sound PointSound (trace_endpos, "weapons/neximpact.wav", 1, ATTN_NORM); diff --git a/data/qcsrc/server/w_rocketlauncher.qc b/data/qcsrc/server/w_rocketlauncher.qc index e2db719f0..ba0e99dbd 100644 --- a/data/qcsrc/server/w_rocketlauncher.qc +++ b/data/qcsrc/server/w_rocketlauncher.qc @@ -205,7 +205,8 @@ void W_Rocket_Attack (void) self.ammo_rockets = self.ammo_rockets - cvar("g_balance_rocketlauncher_ammo"); W_SetupShot (self, '8 3 -8', FALSE, 5, "weapons/rocket_fire.wav"); - te_smallflash(w_shotorg); + //te_smallflash(w_shotorg); + pointparticles(particleeffectnum("rocketlauncher_muzzleflash"), w_shotorg + v_forward * 12, v_forward * 1000, 1); missile = spawn (); missile.owner = self; diff --git a/data/qcsrc/server/w_shotgun.qc b/data/qcsrc/server/w_shotgun.qc index 6e50dd4cd..02142699a 100644 --- a/data/qcsrc/server/w_shotgun.qc +++ b/data/qcsrc/server/w_shotgun.qc @@ -19,7 +19,8 @@ void W_Shotgun_Attack (void) if (cvar("g_use_ammunition")) self.ammo_shells = self.ammo_shells - cvar("g_balance_shotgun_primary_ammo"); - W_Smoke(w_shotorg + v_forward * 8, v_forward, 12); + pointparticles(particleeffectnum("shotgun_muzzleflash"), w_shotorg + v_forward * 6, v_forward * 1000, cvar("g_balance_shotgun_primary_ammo")); + //W_Smoke(w_shotorg + v_forward * 8, v_forward, 12); //te_smallflash(w_shotorg); // casing code @@ -63,7 +64,8 @@ void W_Shotgun_Attack2 (void) if (cvar("g_use_ammunition")) self.ammo_shells = self.ammo_shells - cvar("g_balance_shotgun_secondary_ammo"); - W_Smoke(w_shotorg + v_forward * 8, v_forward, 12); + pointparticles(particleeffectnum("shotgun_muzzleflash"), w_shotorg + v_forward * 6, v_forward * 1000, cvar("g_balance_shotgun_secondary_ammo")); + //W_Smoke(w_shotorg + v_forward * 8, v_forward, 12); //te_smallflash(w_shotorg); // casing code diff --git a/data/qcsrc/server/w_uzi.qc b/data/qcsrc/server/w_uzi.qc index 3f48c9c3f..dd4ff0e0b 100644 --- a/data/qcsrc/server/w_uzi.qc +++ b/data/qcsrc/server/w_uzi.qc @@ -38,6 +38,8 @@ void W_Uzi_Attack (void) else fireBullet (w_shotorg, w_shotdir, cvar("g_balance_uzi_sustained_spread"), cvar("g_balance_uzi_sustained_damage"), cvar("g_balance_uzi_sustained_force"), IT_UZI, (self.uzi_bulletcounter & 3) == 0); + pointparticles(particleeffectnum("uzi_muzzleflash"), w_shotorg + v_forward * 14, v_forward * 1000, 1); + // muzzle flash for 1st person view flash = spawn(); setorigin(flash, '53 5 0'); -- 2.39.2