From: MirceaKitsune Date: Tue, 2 Aug 2011 16:30:48 +0000 (+0300) Subject: Speed helper X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=82f5fc1d72e50e69efd30a871bb06b58f970b973;p=voretournament%2Fvoretournament.git Speed helper --- diff --git a/data/defaultVT.cfg b/data/defaultVT.cfg index d0c83f28..9af077ee 100644 --- a/data/defaultVT.cfg +++ b/data/defaultVT.cfg @@ -680,6 +680,7 @@ seta cl_helper_pause 2 "number of seconds that must pass before the helper syste seta cl_helper_health_value 25 "the helper will warn you when going below this amount of health" seta cl_helper_armor_value 25 "the helper will warn you when going below this amount of armor" seta cl_helper_ammo_fuel 25 "the helper will warn you when going below this amount of ammo" +seta cl_helper_speed_value 1000 "the helper will warn you when going faster than this speed" seta cl_eventchase_death 1 "camera goes into 3rd person mode when the player is dead" seta cl_eventchase_distance 140 "final camera distance" diff --git a/data/qcsrc/client/View.qc b/data/qcsrc/client/View.qc index 0b4bde25..d1bc5ce4 100644 --- a/data/qcsrc/client/View.qc +++ b/data/qcsrc/client/View.qc @@ -258,7 +258,7 @@ float stomachsplash_alpha; float volume_modify_1, volume_modify_2, volume_modify_default_1, volume_modify_default_2; float volume_modify_changed_1, volume_modify_changed_2; float eventchase_current_distance; -float helper_pause, helper_health, helper_armor, helper_ammo; +float helper_pause, helper_health, helper_armor, helper_ammo, helper_speed; vector myhealth_gentlergb; vector liquidcolor_prev; vector damage_blurpostprocess, content_blurpostprocess; @@ -349,6 +349,19 @@ void CSQC_UpdateView(float w, float h) } else if(helper_ammo) helper_ammo = FALSE; + + // speed helper + if(vlen(pmove_vel) >= cvar("cl_helper_speed_value")) + { + if(!helper_speed) + { + sound(self, CHAN_VOICE, strcat("helper/", cvar_string("cl_helper_voice"), "/speed_fast.wav"), VOL_BASEVOICE, ATTN_NONE); + helper_speed = TRUE; + helper_pause = time + cvar("cl_helper_pause"); + } + } + else if(helper_speed) + helper_speed = FALSE; } } diff --git a/data/qcsrc/client/miscfunctions.qc b/data/qcsrc/client/miscfunctions.qc index 39fc32f8..33d61d61 100644 --- a/data/qcsrc/client/miscfunctions.qc +++ b/data/qcsrc/client/miscfunctions.qc @@ -184,6 +184,7 @@ void Announcer_Precache () { precache_sound (strcat("helper/", cvar_string("cl_helper_voice"), "/health_low.wav")); precache_sound (strcat("helper/", cvar_string("cl_helper_voice"), "/armor_low.wav")); precache_sound (strcat("helper/", cvar_string("cl_helper_voice"), "/ammo_low.wav")); + precache_sound (strcat("helper/", cvar_string("cl_helper_voice"), "/speed_fast.wav")); } void AuditLists() diff --git a/data/sound/helper/default/speed_fast.wav b/data/sound/helper/default/speed_fast.wav new file mode 100644 index 00000000..27e1218f Binary files /dev/null and b/data/sound/helper/default/speed_fast.wav differ