]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Armor helper
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 2 Aug 2011 16:16:07 +0000 (19:16 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 2 Aug 2011 16:16:07 +0000 (19:16 +0300)
data/defaultVT.cfg
data/qcsrc/client/View.qc
data/qcsrc/client/miscfunctions.qc
data/sound/helper/default/armor_low.wav [new file with mode: 0644]

index 18eceece9ec0da27ca07971e79d6229a60dd7810..e60ce318132d4f233ecdc4065bcee55366182fd5 100644 (file)
@@ -678,6 +678,7 @@ seta cl_helper 1 "enable helper system"
 seta cl_helper_voice default "name of the helper you wish to use from data/sound/helper"\r
 seta cl_helper_pause 2 "number of seconds that must pass before the helper system can be triggered again"\r
 seta cl_helper_health_value 25 "the helper will warn you when going below this amount of health"\r
+seta cl_helper_armor_value 25 "the helper will warn you when going below this amount of armor"\r
 \r
 seta cl_eventchase_death 1 "camera goes into 3rd person mode when the player is dead"\r
 seta cl_eventchase_distance 140 "final camera distance"\r
index 5d91a7ef6e9fe32f5dcbd243ea9e0e4707613fd1..87b8f15cf76f27a3d01644b87395535d6dc6163c 100644 (file)
@@ -258,7 +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
+float helper_pause, helper_health, helper_armor, helper_ammo;\r
 vector myhealth_gentlergb;\r
 vector liquidcolor_prev;\r
 vector damage_blurpostprocess, content_blurpostprocess;\r
@@ -300,20 +300,42 @@ void CSQC_UpdateView(float w, float h)
 \r
        // helper system\r
        if(cvar("cl_helper"))\r
-       if(helper_pause <= time)\r
-       if(!intermission && !respawned && spectatee_status >= 0 && getstati(STAT_HEALTH) > 0 && !getstati(STAT_VORE_EATEN))\r
        {\r
-               if(getstati(STAT_HEALTH) <= cvar("cl_helper_health_value"))\r
+               if(intermission || respawned || spectatee_status < 0 || getstati(STAT_HEALTH) <= 0 || getstati(STAT_VORE_EATEN))\r
                {\r
-                       if(!helper_health)\r
+                       // Set these helper messages as having been triggered, so that the player must first reach them before they complain.\r
+                       // Otherwise, if you don't have any start armor for instance, the helper will complain about low armor when we spawn.\r
+                       helper_health = TRUE;\r
+                       helper_armor = TRUE;\r
+               }\r
+               else if(helper_pause <= time)\r
+               {\r
+                       // health helper\r
+                       if(getstati(STAT_HEALTH) <= cvar("cl_helper_health_value"))\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
+                               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
+                       // armor helper\r
+                       if(getstati(STAT_ARMOR) <= cvar("cl_helper_armor_value"))\r
+                       {\r
+                               if(!helper_armor)\r
+                               {\r
+                                       sound(self, CHAN_VOICE, strcat("helper/", cvar_string("cl_helper_voice"), "/armor_low.wav"), VOL_BASEVOICE, ATTN_NONE);\r
+                                       helper_armor = TRUE;\r
+                                       helper_pause = time + cvar("cl_helper_pause");\r
+                               }\r
                        }\r
+                       else if(helper_armor)\r
+                               helper_armor = FALSE;\r
                }\r
-               else if(helper_health)\r
-                       helper_health = FALSE;\r
        }\r
 \r
        // event chase camera\r
index 1c3da912326e42b4750bab6ccfeb8b5453b33116..994cf71c1c7be839b1dda9794cd98404a539a36e 100644 (file)
@@ -182,6 +182,7 @@ void Announcer_Precache () {
        precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/narrowly.wav"));\r
 \r
        precache_sound (strcat("helper/", cvar_string("cl_helper_voice"), "/health_low.wav"));\r
+       precache_sound (strcat("helper/", cvar_string("cl_helper_voice"), "/armor_low.wav"));\r
 }\r
 \r
 void AuditLists()\r
diff --git a/data/sound/helper/default/armor_low.wav b/data/sound/helper/default/armor_low.wav
new file mode 100644 (file)
index 0000000..f25888a
Binary files /dev/null and b/data/sound/helper/default/armor_low.wav differ