about summary refs log tree commit diff
path: root/src/game/client/gc_effects.cpp
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2008-03-17 01:41:11 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2008-03-17 01:41:11 +0000
commit22360b5d795164df0c7a80a88f5b7cb1c230e6f0 (patch)
treedf7a55964ebd5a054689ed53ad7b1c56b4284314 /src/game/client/gc_effects.cpp
parent412958bae395c50892ce390b84e309ce827e9b13 (diff)
downloadzcatch-22360b5d795164df0c7a80a88f5b7cb1c230e6f0.tar.gz
zcatch-22360b5d795164df0c7a80a88f5b7cb1c230e6f0.zip
blood color depending on skin fixed
Diffstat (limited to 'src/game/client/gc_effects.cpp')
-rw-r--r--src/game/client/gc_effects.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/game/client/gc_effects.cpp b/src/game/client/gc_effects.cpp
index 094392e5..1f2c0b63 100644
--- a/src/game/client/gc_effects.cpp
+++ b/src/game/client/gc_effects.cpp
@@ -1,5 +1,6 @@
 #include <engine/e_client_interface.h>
 #include "gc_client.h"
+#include "gc_skin.h"
 #include "../generated/gc_data.h"
 
 static bool add_50hz = false;
@@ -123,8 +124,20 @@ void effect_playerspawn(vec2 pos)
 	}
 }
 
-void effect_playerdeath(vec2 pos)
+void effect_playerdeath(vec2 pos, int cid)
 {
+	vec3 blood_color(1.0f,1.0f,1.0f);
+
+	if(cid >= 0)	
+	{
+		const skin *s = skin_get(client_datas[cid].skin_id);
+		if(s)
+		{
+			dbg_msg("", "good blood color!");
+			blood_color = s->blood_color;
+		}
+	}
+	
 	for(int i = 0; i < 64; i++)
 	{
 		particle p;
@@ -139,9 +152,9 @@ void effect_playerdeath(vec2 pos)
 		p.rotspeed = (frandom()-0.5f) * pi;
 		p.gravity = 800.0f;
 		p.friction = 0.8f;
-		p.color = mix(vec4(0.75f,0.2f,0.2f,0.75f), vec4(0.5f,0.1f,0.1f,0.75f), frandom());
+		vec3 c = blood_color * (0.75f + frandom()*0.25f);
+		p.color = vec4(c.r, c.g, c.b, 0.75f);
 		particle_add(PARTGROUP_GENERAL, &p);
-		
 	}
 }