]> git.xonotic.org Git - voretournament/voretournament.git/commitdiff
Ammo helper
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 2 Aug 2011 16:24:10 +0000 (19:24 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 2 Aug 2011 16:24:10 +0000 (19:24 +0300)
data/defaultVT.cfg
data/qcsrc/client/View.qc
data/qcsrc/client/miscfunctions.qc

index e60ce318132d4f233ecdc4065bcee55366182fd5..d0c83f28ca117e3672f061602601b2962dd7d460 100644 (file)
@@ -679,6 +679,7 @@ seta cl_helper_voice default "name of the helper you wish to use from data/sound
 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
+seta cl_helper_ammo_fuel 25 "the helper will warn you when going below this amount of ammo"\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 87b8f15cf76f27a3d01644b87395535d6dc6163c..0b4bde252bca64ef8fed06d5c38dbb8911c567b0 100644 (file)
@@ -318,6 +318,7 @@ void CSQC_UpdateView(float w, float h)
                                        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
+                                       helper_ammo = time + cvar("cl_helper_pause");\r
                                }\r
                        }\r
                        else if(helper_health)\r
@@ -335,6 +336,19 @@ void CSQC_UpdateView(float w, float h)
                        }\r
                        else if(helper_armor)\r
                                helper_armor = FALSE;\r
+\r
+                       // ammo helper\r
+                       if(getstati(STAT_FUEL) <= cvar("cl_helper_ammo_fuel"))\r
+                       {\r
+                               if(!helper_ammo)\r
+                               {\r
+                                       sound(self, CHAN_VOICE, strcat("helper/", cvar_string("cl_helper_voice"), "/ammo_low.wav"), VOL_BASEVOICE, ATTN_NONE);\r
+                                       helper_ammo = TRUE;\r
+                                       helper_pause = time + cvar("cl_helper_pause");\r
+                               }\r
+                       }\r
+                       else if(helper_ammo)\r
+                               helper_ammo = FALSE;\r
                }\r
        }\r
 \r
index 994cf71c1c7be839b1dda9794cd98404a539a36e..39fc32f844090a4a0bfe0ff68961d9adcb9c28a1 100644 (file)
@@ -183,6 +183,7 @@ void Announcer_Precache () {
 \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
+       precache_sound (strcat("helper/", cvar_string("cl_helper_voice"), "/ammo_low.wav"));\r
 }\r
 \r
 void AuditLists()\r