]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
cl_gentle version of the damage flash
authorFruitieX <fruitiex@gmail.com>
Thu, 18 Nov 2010 14:23:13 +0000 (16:23 +0200)
committerFruitieX <fruitiex@gmail.com>
Thu, 18 Nov 2010 14:23:13 +0000 (16:23 +0200)
defaultXonotic.cfg
qcsrc/client/View.qc
qcsrc/client/autocvars.qh

index 1da4d94354457a12a2e53710f48ff1d7c2807c82..ee4658857d0b00723aa98d96725fd3aebf6c36a0 100644 (file)
@@ -1368,6 +1368,7 @@ seta hud_showbinds 1      "the way to show the keys to press in HUD messages: 0 displ
 seta hud_showbinds_limit 2     "maximum number of bound keys to show for a command. 0 for unlimited"
 
 seta hud_damage 1 "an improved version of gl_polyblend, draw an image instead when hurt"
+seta hud_damage_gentle_alpha_multiplier 0.25 "how much to multiply alpha of flash when using the cl_gentle version, it's much more opaque than the non-gentle version"
 seta hud_damage_color "1 0 0" "color of flash"
 seta hud_damage_factor 0.05 "(damage * factor) = how much to add to the alpha value"
 seta hud_damage_fade_rate 1 "how much to subtract from the alpha value each second"
@@ -1682,6 +1683,7 @@ seta sv_gentle 0          "force gentle mode for everyone, also remove references to act
 seta cl_gentle 0               "client side gentle mode, master switch for removing both gibs and messages"
 seta cl_gentle_gibs 0          "client side gentle mode (only replaces gibs); when set to 1, white smoke replaces gibs, when set to 2, colorful clouds replace gibs"
 seta cl_gentle_messages 0      "client side gentle mode (only replaces frag messages/centerprints)"
+seta cl_gentle_damage 0                "client side gentle mode (only replaces damage flash); when set to 1, a white flash replaces the blood image, when set to 2, a randomily colored flash is used instead"
 
 seta cl_racetimer_position 0.25 "Y-axis positioning of the race timer (from 0 to 1)"
 seta cl_showpressedkeys        0       "Show which movement keys someone is pressing: 1 for spectating, 2 for always"
index e417ddbed9d136ba018547a368ca78afa6d57803..87891a034471b697e26bc487b24fdfd04274dfc7 100644 (file)
@@ -355,6 +355,8 @@ float use_nex_charge_pool;
 float myhealth, myhealth_prev;
 float myhealth_flash;
 
+vector myhealth_gentlergb;
+
 void CSQC_UpdateView(float w, float h)
 {
        entity e;
@@ -665,6 +667,7 @@ void CSQC_UpdateView(float w, float h)
        }
 
        // improved polyblend
+       vector rgb;
        if(cvar("hud_damage"))
        {
                float myhealth_flash_temp;
@@ -708,7 +711,22 @@ void CSQC_UpdateView(float w, float h)
 
                myhealth_prev = myhealth;
 
-               drawpic(reticle_pos, "gfx/blood", reticle_size, stov(cvar_string("hud_damage_color")), bound(0, myhealth_flash_temp, 1), DRAWFLAG_NORMAL);
+               if(autocvar_cl_gentle_damage || cvar("cl_gentle"))
+               {
+                       if(autocvar_cl_gentle_damage == 2)
+                       {
+                               if(myhealth_flash < pain_treshold) // only randomize when the flash is gone
+                               {
+                                       myhealth_gentlergb = eX * random() + eY * random() + eZ * random();
+                               }
+                       }
+                       else
+                               myhealth_gentlergb = '1 0.7 1';
+
+                       drawfill('0 0 0', eX * vid_conwidth + eY * vid_conheight, myhealth_gentlergb, cvar("hud_damage_gentle_alpha_multiplier") * bound(0, myhealth_flash_temp, 1), DRAWFLAG_NORMAL);
+               }
+               else
+                       drawpic(reticle_pos, "gfx/blood", reticle_size, stov(cvar_string("hud_damage_color")), bound(0, myhealth_flash_temp, 1), DRAWFLAG_NORMAL);
        }
 
        // Draw the mouse cursor
@@ -922,7 +940,6 @@ void CSQC_UpdateView(float w, float h)
                        }
                        else if (activeweapon == WEP_NEX && nex_charge) // ring around crosshair representing velocity-dependent damage for the nex
                        {
-                               vector rgb;
                                if(nex_charge_pool || use_nex_charge_pool)
                                {
                                        use_nex_charge_pool = 1;
index 28340719323309f095a63751e6c9e423332151fa..873df14a358e435d0b68d3e8e0634028575b6f94 100644 (file)
@@ -6,6 +6,8 @@ var float autocvar_cl_gibs_sloppy = 1;
 var float autocvar_cl_casings_ticrate = 0.1;
 var float autocvar_cl_casings_sloppy = 1;
 
+var float autocvar_cl_gentle_damage;
+
 var float autocvar_scoreboard_color_bg_team;
 
 var float autocvar__menu_alpha;