]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Death unglow effect. When a player dies, their glow slowly fades away to black. Nice...
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Wed, 14 Jul 2010 14:29:55 +0000 (17:29 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Wed, 14 Jul 2010 14:29:55 +0000 (17:29 +0300)
defaultXonotic.cfg
qcsrc/server/cl_client.qc

index 19fe9fef501474f09ddbd1450be10692d2196a65..f9747406fbc48092248fdf762f185aefd01a7ffe 100644 (file)
@@ -849,6 +849,8 @@ set g_bloodloss 0   "amount of health below which blood loss occurs"
 
 set g_footsteps 0      "serverside footstep sounds"
 
+set g_deathglow 0.05 "the glow of a player slowly decreases to black after they die"
+
 // effects
 r_picmipsprites 0 // Xonotic uses sprites that should never be picmipped (team mate, typing, waypoints)
 r_mipsprites 1
index 73c9169e5e6929341cca72c4f50377ec92c32125..8403f3dc735852f61e430a026784c8096c3b7c32 100644 (file)
@@ -2599,7 +2599,23 @@ void PlayerPreThink (void)
 
                if(frametime)
                {
-                       self.glowmod = colormapPaletteColor(self.clientcolors & 0x0F, TRUE) * 2;
+                       if(self.health <= 0 && cvar("g_deathglow"))
+                       {
+                               if(self.glowmod_x > 0)
+                                       self.glowmod_x -= cvar("g_deathglow");
+                               else
+                                       self.glowmod_x = 0;
+                               if(self.glowmod_y > 0)
+                                       self.glowmod_y -= cvar("g_deathglow");
+                               else
+                                       self.glowmod_y = 0;
+                               if(self.glowmod_z > 0)
+                                       self.glowmod_z -= cvar("g_deathglow");
+                               else
+                                       self.glowmod_z = 0;
+                       }
+                       else
+                               self.glowmod = colormapPaletteColor(self.clientcolors & 0x0F, TRUE) * 2;
                        player_powerups();
                }