r5874 - in trunk/data/qcsrc: client server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Fri Feb 13 15:53:02 EST 2009


Author: div0
Date: 2009-02-13 15:53:02 -0500 (Fri, 13 Feb 2009)
New Revision: 5874

Modified:
   trunk/data/qcsrc/client/damage.qc
   trunk/data/qcsrc/server/g_damage.qc
   trunk/data/qcsrc/server/w_hook.qc
Log:
decal fixes


Modified: trunk/data/qcsrc/client/damage.qc
===================================================================
--- trunk/data/qcsrc/client/damage.qc	2009-02-13 20:38:16 UTC (rev 5873)
+++ trunk/data/qcsrc/client/damage.qc	2009-02-13 20:53:02 UTC (rev 5874)
@@ -1,6 +1,6 @@
 void Ent_DamageInfo()
 {
-	float hittype, dmg, rad, edge, thisdmg;
+	float hittype, dmg, rad, edge, thisdmg, forcemul;
 	vector force, org, thisforce;
 	entity oldself;
 
@@ -16,6 +16,14 @@
 	edge = ReadByte();
 	force = decompressShortVector(ReadShort());
 
+	if(rad < 0)
+	{
+		rad = -rad;
+		forcemul = -1;
+	}
+	else
+		forcemul = 1;
+
 	for(self = findradius(org, rad); self; self = self.chain)
 	{
 		if(rad)
@@ -26,18 +34,18 @@
 			if(dmg)
 			{
 				thisdmg = dmg + (edge - dmg) * thisdmg;
-				thisforce = vlen(force) * (thisdmg / dmg) * normalize(self.origin - org);
+				thisforce = forcemul * vlen(force) * (thisdmg / dmg) * normalize(self.origin - org);
 			}
 			else
 			{
 				thisdmg = 0;
-				thisforce = vlen(force) * normalize(self.origin - org);
+				thisforce = forcemul * vlen(force) * normalize(self.origin - org);
 			}
 		}
 		else
 		{
 			thisdmg = dmg;
-			thisforce = force;
+			thisforce = forcemul * force;
 		}
 
 		if(self.damageforcescale)
@@ -70,7 +78,7 @@
 		r = prandom();
 
 		traceline(org - normalize(force) * 16, org + normalize(force) * 16, MOVE_NOMONSTERS, world);
-		if(trace_fraction < 1)
+		if(trace_fraction < 1 && hitwep != WEP_NEX && hitwep != WEP_MINSTANEX)
 			backoff = trace_plane_normal;
 		else
 			backoff = -1 * normalize(force);
@@ -78,12 +86,13 @@
 		switch(hitwep)
 		{
 			case WEP_LASER:
-				org2 = org + backoff * 8;
+				org2 = org + backoff * 6;
+				pointparticles(particleeffectnum("laser_impact"), org2, backoff * 1000, 1);
 				sound (self, CHAN_PROJECTILE, "weapons/laserimpact.wav", VOL_BASE, ATTN_NORM);
-				pointparticles(particleeffectnum("laser_impact"), org2, backoff * 1000, 1);
 				break;
 			case WEP_SHOTGUN:
-				pointparticles(particleeffectnum("shotgun_impact"), org, backoff * 1000, 1);
+				org2 = org + backoff * 2;
+				pointparticles(particleeffectnum("shotgun_impact"), org2, backoff * 1000, 1);
 				if(r < 0.05)
 					sound(self, CHAN_PROJECTILE, "weapons/ric1.wav", VOL_BASE, ATTN_NORM);
 				else if(r < 0.1)
@@ -92,7 +101,8 @@
 					sound(self, CHAN_PROJECTILE, "weapons/ric3.wav", VOL_BASE, ATTN_NORM);
 				break;
 			case WEP_UZI:
-				pointparticles(particleeffectnum("machinegun_impact"), org, backoff * 1000, 1);
+				org2 = org + backoff * 2;
+				pointparticles(particleeffectnum("machinegun_impact"), org2, backoff * 1000, 1);
 				if(r < 0.05)
 					sound(self, CHAN_PROJECTILE, "weapons/ric1.wav", VOL_BASE, ATTN_NORM);
 				else if(r < 0.1)
@@ -106,93 +116,96 @@
 				sound (self, CHAN_PROJECTILE, "weapons/grenade_impact.wav", VOL_BASE, ATTN_NORM);
 				break;
 			case WEP_ELECTRO:
-				org2 = org + backoff * 8;
+				org2 = org + backoff * 6;
 				if(secondary)
 				{
+					pointparticles(particleeffectnum("electro_ballexplode"), org2, '0 0 0', 1);
 					sound (self, CHAN_PROJECTILE, "weapons/electro_impact.wav", VOL_BASE, ATTN_NORM);
-					pointparticles(particleeffectnum("electro_ballexplode"), org2, '0 0 0', 1);
 				}
 				else
 				{
 					if(bounce)
 					{
 						// this is sent as "primary bounce" to distinguish it from secondary bounced balls
+						pointparticles(particleeffectnum("electro_combo"), org2, '0 0 0', 1);
 						sound (self, CHAN_PROJECTILE, "weapons/electro_impact_combo.wav", VOL_BASE, ATTN_NORM);
-						pointparticles(particleeffectnum("electro_combo"), org2, '0 0 0', 1);
 					}
 					else
 					{
+						pointparticles(particleeffectnum("electro_impact"), org2, '0 0 0', 1);
 						sound (self, CHAN_PROJECTILE, "weapons/electro_impact.wav", VOL_BASE, ATTN_NORM);
-						pointparticles(particleeffectnum("electro_impact"), org2, '0 0 0', 1);
 					}
 				}
 				break;
 			case WEP_CRYLINK:
+				org2 = org + backoff * 2;
 				if(secondary)
 				{
+					pointparticles(particleeffectnum("crylink_impact"), org2, '0 0 0', 1);
 					sound (self, CHAN_PROJECTILE, "weapons/crylink_impact2.wav", VOL_BASE, ATTN_NORM);
-					pointparticles(particleeffectnum("crylink_impact"), org, '0 0 0', 1);
 				}
 				else
 				{
+					pointparticles(particleeffectnum("crylink_impactbig"), org2, '0 0 0', 1);
 					sound (self, CHAN_PROJECTILE, "weapons/crylink_impact.wav", VOL_BASE, ATTN_NORM);
-					pointparticles(particleeffectnum("crylink_impactbig"), org, '0 0 0', 1);
 				}
 				break;
 			case WEP_NEX:
+				org2 = org + backoff * 6;
+				pointparticles(particleeffectnum("nex_impact"), org2, '0 0 0', 1);
 				sound(self, CHAN_PROJECTILE, "weapons/neximpact.wav", VOL_BASE, ATTN_NORM);
-				pointparticles(particleeffectnum("nex_impact"), org - normalize(force) * 6, '0 0 0', 1);
 				break;
 			case WEP_HAGAR:
-				org2 = org + backoff * 12;
+				org2 = org + backoff * 6;
+				pointparticles(particleeffectnum("hagar_explode"), org2, '0 0 0', 1);
 				if (r<0.15)
 					sound (self, CHAN_PROJECTILE, "weapons/hagexp1.wav", VOL_BASE, ATTN_NORM);
 				else if (r<0.7)
 					sound (self, CHAN_PROJECTILE, "weapons/hagexp2.wav", VOL_BASE, ATTN_NORM);
 				else
 					sound (self, CHAN_PROJECTILE, "weapons/hagexp3.wav", VOL_BASE, ATTN_NORM);
-				pointparticles(particleeffectnum("hagar_explode"), org2, '0 0 0', 1);
 				break;
 			case WEP_ROCKET_LAUNCHER:
-				org2 = org + backoff * 16;
+				org2 = org + backoff * 12;
+				pointparticles(particleeffectnum("rocket_explode"), org2, '0 0 0', 1);
 				sound (self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
-				pointparticles(particleeffectnum("rocket_explode"), org2, '0 0 0', 1);
 				break;
 			case WEP_PORTO:
 				print("Since when does Porto send DamageInfo?\n");
 				break;
 			case WEP_MINSTANEX:
+				org2 = org + backoff * 6;
+				pointparticles(particleeffectnum("nex_impact"), org2, '0 0 0', 1);
 				sound(self, CHAN_PROJECTILE, "weapons/neximpact.wav", VOL_BASE, ATTN_NORM);
-				pointparticles(particleeffectnum("nex_impact"), org - normalize(force) * 6, '0 0 0', 1);
 				break;
 			case WEP_HOOK:
-				org2 = org + backoff * 12;
+				org2 = org + backoff * 2;
+				pointparticles(particleeffectnum("hookbomb_explode"), org2, '0 0 0', 1);
 				sound (self, CHAN_PROJECTILE, "weapons/hookbomb_impact.wav", VOL_BASE, ATTN_NORM);
-				pointparticles(particleeffectnum("hookbomb_explode"), org2, '0 0 0', 1);
 				break;
 			case WEP_SEEKER:
-				org2 = org + backoff * 12;
+				org2 = org + backoff * 6;
 				if(secondary)
 				{
+					pointparticles(particleeffectnum("flac_explode"), org2, '0 0 0', 1);
 					if (r<0.15)
 						sound (self, CHAN_PROJECTILE, "weapons/flacexp1.wav", 1, ATTN_NORM);
 					else if (r<0.7)
 						sound (self, CHAN_PROJECTILE, "weapons/flacexp2.wav", 1, ATTN_NORM);
 					else
 						sound (self, CHAN_PROJECTILE, "weapons/flacexp3.wav", 1, ATTN_NORM);
-					pointparticles(particleeffectnum("flac_explode"), org2, '0 0 0', 1);
 				}
 				else
 				{
 					if(bounce)
 					{
+						pointparticles(particleeffectnum("hagar_explode"), org2, '0 0 0', 1);
 						if (r<0.15)
 							sound (self, CHAN_PROJECTILE, "weapons/tagexp1.wav", 1, ATTN_NORM);
 						else if (r<0.7)
 							sound (self, CHAN_PROJECTILE, "weapons/tagexp2.wav", 1, ATTN_NORM);
 						else
 							sound (self, CHAN_PROJECTILE, "weapons/tagexp3.wav", 1, ATTN_NORM);
-						pointparticles(particleeffectnum("hagar_explode"), org2, '0 0 0', 1);
 					}
 					else if(headshot)
 					{
@@ -200,23 +213,24 @@
 					}
 					else
 					{
+						pointparticles(particleeffectnum("hagar_explode"), org2, '0 0 0', 1);
 						if (r<0.15)
 							sound (self, CHAN_PROJECTILE, "weapons/seekerexp1.wav", 1, ATTN_NORM);
 						else if (r<0.7)
 							sound (self, CHAN_PROJECTILE, "weapons/seekerexp2.wav", 1, ATTN_NORM);
 						else
 							sound (self, CHAN_PROJECTILE, "weapons/seekerexp3.wav", 1, ATTN_NORM);
-						pointparticles(particleeffectnum("hagar_explode"), org2, '0 0 0', 1);
 					}
 				}
 				break;
 			case WEP_HLAC:
-				org2 = org + backoff * 12;
+				org2 = org + backoff * 6;
+				pointparticles(particleeffectnum("laser_impact"), org2, backoff * 1000, 1);
 				sound (self, CHAN_PROJECTILE, "weapons/laserimpact.wav", VOL_BASE, ATTN_NORM);
-				pointparticles(particleeffectnum("laser_impact"), org2, backoff * 1000, 1);
 				break;
 			case WEP_CAMPINGRIFLE:
-				pointparticles(particleeffectnum("machinegun_impact"), org, backoff * 1000, 1);
+				org2 = org + backoff * 2;
+				pointparticles(particleeffectnum("machinegun_impact"), org2, backoff * 1000, 1);
 				if(r < 0.2)
 					sound(self, CHAN_PROJECTILE, "weapons/ric1.wav", VOL_BASE, ATTN_NORM);
 				else if(r < 0.4)

Modified: trunk/data/qcsrc/server/g_damage.qc
===================================================================
--- trunk/data/qcsrc/server/g_damage.qc	2009-02-13 20:38:16 UTC (rev 5873)
+++ trunk/data/qcsrc/server/g_damage.qc	2009-02-13 20:53:02 UTC (rev 5874)
@@ -958,7 +958,10 @@
 			force = '0 0 -1';
 		else
 			force = normalize(force);
-		Damage_DamageInfo(blastorigin, coredamage, edgedamage, rad, forceintensity * force, deathtype);
+		if(forceintensity >= 0)
+			Damage_DamageInfo(blastorigin, coredamage, edgedamage, rad, forceintensity * force, deathtype);
+		else
+			Damage_DamageInfo(blastorigin, coredamage, edgedamage, -rad, (-forceintensity) * force, deathtype);
 	}
 
 	targ = findradius (blastorigin, rad);

Modified: trunk/data/qcsrc/server/w_hook.qc
===================================================================
--- trunk/data/qcsrc/server/w_hook.qc	2009-02-13 20:38:16 UTC (rev 5873)
+++ trunk/data/qcsrc/server/w_hook.qc	2009-02-13 20:53:02 UTC (rev 5874)
@@ -33,6 +33,7 @@
 {
 	self.event_damage = SUB_Null;
 	self.touch = SUB_Null;
+	self.effects |= EF_NODRAW;
 
 	self.think = W_Hook_ExplodeThink;
 	self.nextthink = time;




More information about the nexuiz-commits mailing list