]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/client/View.qc
Beginning of a helper system (voice that speaks to warn you of things, such as low...
[voretournament/voretournament.git] / data / qcsrc / client / View.qc
index aed53ade42fb5300c4baec8435bdb186847f822e..d8ea89ba780871107665b4c680f8a1af8a347ea2 100644 (file)
@@ -258,6 +258,7 @@ float stomachsplash_alpha;
 float volume_modify_1, volume_modify_2, volume_modify_default_1, volume_modify_default_2;\r
 float volume_modify_changed_1, volume_modify_changed_2;\r
 float eventchase_current_distance;\r
+float helper_pause, helper_health;\r
 vector myhealth_gentlergb;\r
 vector liquidcolor_prev;\r
 vector damage_blurpostprocess, content_blurpostprocess;\r
@@ -297,6 +298,23 @@ void CSQC_UpdateView(float w, float h)
        if not(spectatee_status && last_spectatee != spectatee_status) // not if we switched players and that detects a different health\r
                respawned = TRUE; // stays true for one frame\r
 \r
+       // helper system\r
+       if(cvar("cl_helper"))\r
+       if(helper_pause <= time)\r
+       {\r
+               if(getstati(STAT_HEALTH) <= cvar("cl_helper_health_value"))\r
+               {\r
+                       if(!helper_health)\r
+                       {\r
+                               sound(self, CHAN_VOICE, strcat("helper/", cvar_string("cl_helper_voice"), "/health_low.wav"), VOL_BASEVOICE, ATTN_NONE);\r
+                               helper_health = TRUE;\r
+                               helper_pause = time + cvar("cl_helper_pause");\r
+                       }\r
+               }\r
+               else if(helper_health)\r
+                       helper_health = FALSE;\r
+       }\r
+\r
        // event chase camera\r
        if(cvar("chase_active") <= 0) // greater than 0 means it's enabled manually, and this code is skipped\r
        {\r