]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
revive the low health/armor hud effect from fruitiex/goldenhealth, also set both...
authorFruitieX <fruitiex@gmail.com>
Mon, 11 Apr 2011 11:58:48 +0000 (14:58 +0300)
committerFruitieX <fruitiex@gmail.com>
Mon, 11 Apr 2011 11:58:48 +0000 (14:58 +0300)
defaultXonotic.cfg
qcsrc/client/hud.qc

index cd72450680d6879e1322514cf93272bbb30edb28..f7351e2fa7a3893e325214e6951bf32b6908b081 100644 (file)
@@ -1420,8 +1420,8 @@ seta hud_panel_weapons_ammo_full_fuel 100 "show 100% of the status bar at this a
 
 seta hud_panel_ammo_maxammo "40" "when you have this much ammo, the ammo status bar is full"
 
-seta hud_panel_healtharmor_maxhealth "250" "when you have this much health, the health status bar is full"
-seta hud_panel_healtharmor_maxarmor "150" "when you have this much armor, the armor status bar is full"
+seta hud_panel_healtharmor_maxhealth "200" "when you have this much health, the health status bar is full"
+seta hud_panel_healtharmor_maxarmor "200" "when you have this much armor, the armor status bar is full"
 
 seta hud_panel_notify_time 10 "time that a new entry stays until it fades out"
 seta hud_panel_notify_fadetime 3 "fade out time"
index 18c18455c6dd1288a65646f875b760c78ca08b96..37f10b884f5eb3184cf774c464eba82312fcaf2e 100644 (file)
@@ -89,11 +89,12 @@ void draw_BorderPicture(vector theOrigin, string pic, vector theSize, vector the
 
 vector HUD_Get_Num_Color (float x, float maxvalue)
 {
+    float blinkingamt;
        vector color;
-       if(x > maxvalue) {
-               color_x = 0;
+       if(x >= maxvalue) {
+               color_x = sin(2*M_PI*time);
                color_y = 1;
-               color_z = 0;
+               color_z = sin(2*M_PI*time);
        }
        else if(x > maxvalue * 0.75) {
                color_x = 0.4 - (x-150)*0.02 * 0.4; //red value between 0.4 -> 0
@@ -120,6 +121,14 @@ vector HUD_Get_Num_Color (float x, float maxvalue)
                color_y = 0;
                color_z = 0;
        }
+
+    blinkingamt = (1 - x/maxvalue/0.25);
+    if(blinkingamt > 0)
+    {
+        color_x = color_x - color_x * blinkingamt * sin(2*M_PI*time);
+        color_y = color_y - color_y * blinkingamt * sin(2*M_PI*time);
+        color_z = color_z - color_z * blinkingamt * sin(2*M_PI*time);
+    }
        return color;
 }