[nexuiz-commits] r6921 - trunk/data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Mon Jun 8 13:10:09 EDT 2009


Author: div0
Date: 2009-06-08 13:10:09 -0400 (Mon, 08 Jun 2009)
New Revision: 6921

Modified:
   trunk/data/qcsrc/server/cl_player.qc
Log:
tuba: let blood come out of the ears ;)


Modified: trunk/data/qcsrc/server/cl_player.qc
===================================================================
--- trunk/data/qcsrc/server/cl_player.qc	2009-06-08 15:33:46 UTC (rev 6920)
+++ trunk/data/qcsrc/server/cl_player.qc	2009-06-08 17:10:09 UTC (rev 6921)
@@ -334,7 +334,36 @@
 			damage /= sqrt(bound(1.0, attacker.cvar_cl_handicap, 100.0));
 	}
 
-	Violence_GibSplash_At(hitloc, force, 2, bound(0, damage, 200) / 16);
+	if(DEATH_ISWEAPON(deathtype, WEP_TUBA))
+	{
+		// tuba causes blood to come out of the ears
+		vector ear1, ear2;
+		vector d;
+		float f;
+		ear1 = self.origin;
+		ear1_z += 0.25 * self.view_ofs_z + 0.75 * self.maxs_z; // middle of headshot bbox
+		ear2 = ear1;
+		makevectors(self.angles);
+		ear1 += v_right * -10;
+		ear2 += v_right * +10;
+		d = inflictor.origin - self.origin;
+		f = (d * v_right) / vlen(d); // this is cos of angle of d and v_right!
+		force = v_right * vlen(force);
+		Violence_GibSplash_At(ear1, force * -1, 2, bound(0, damage, 200) / 16 * (0.5 - 0.5 * f));
+		Violence_GibSplash_At(ear2, force,      2, bound(0, damage, 200) / 16 * (0.5 + 0.5 * f));
+		if(f > 0)
+		{
+			hitloc = ear1;
+			force = force * -1;
+		}
+		else
+		{
+			hitloc = ear2;
+			// force is already good
+		}
+	}
+	else
+		Violence_GibSplash_At(hitloc, force, 2, bound(0, damage, 200) / 16);
 
 	if(g_arena)
 	if(numspawned < 2)



More information about the nexuiz-commits mailing list