From: MirceaKitsune Date: Tue, 3 May 2011 17:01:10 +0000 (+0300) Subject: Add first actual functionality to the sbar ring; Showing the swallowing delay. X-Git-Url: http://de.git.xonotic.org/?p=voretournament%2Fvoretournament.git;a=commitdiff_plain;h=f0a1e43456813dcf3b5d0543c7aa313e118915f9 Add first actual functionality to the sbar ring; Showing the swallowing delay. --- diff --git a/data/qcsrc/client/sbar.qc b/data/qcsrc/client/sbar.qc index ade2c076..6e6fe0af 100644 --- a/data/qcsrc/client/sbar.qc +++ b/data/qcsrc/client/sbar.qc @@ -1992,22 +1992,35 @@ void Sbar_Ring() ring_alpha = sbar_alpha_fg * 1; text_size = '10 10 0'; - ring1_clip = 0.85; - ring2_clip = 0.95; - ring1_color = '1 0.25 0.25'; - ring2_color = '0.25 1 0.25'; - text1_msg = "Text 1 ssdfsdfdsfsdf"; - text2_msg = "Text 2 3453rf234f"; - - DrawCircleClippedPic(ring_pos, ring1_size, "gfx/hud/sb_ring.tga", ring1_clip, ring1_color, ring_alpha, DRAWFLAG_ADDITIVE); - text_pos_x = ring_pos_x - stringwidth(text1_msg, FALSE, text_size) / 2; - text_pos_y = ring_pos_y - ring1_size / 2; - drawstring(text_pos, text1_msg, text_size, ring1_color, sbar_alpha_fg, DRAWFLAG_NORMAL); - - DrawCircleClippedPic(ring_pos, ring2_size, "gfx/hud/sb_ring.tga", ring2_clip, ring2_color, ring_alpha, DRAWFLAG_ADDITIVE); - text_pos_x = ring_pos_x - stringwidth(text2_msg, FALSE, text_size) / 2; - text_pos_y = ring_pos_y + ring1_size / 2; - drawstring(text_pos, text2_msg, text_size, ring2_color, sbar_alpha_fg, DRAWFLAG_NORMAL); + switch(getstati(STAT_SBRING1_TYPE)) + { + case 0: + break; + case 1: + // ring shows vore system delay + ring1_color = '0.5 0.5 1'; + ring1_clip = getstatf(STAT_SBRING1_CLIP); + text1_msg = "vore delay"; + break; + default: + print(strcat("^1Error:^7 Unknown ring type: ", ftos(getstati(STAT_SBRING1_TYPE)), "\n")); + break; + } + + if(text1_msg != "") + { + DrawCircleClippedPic(ring_pos, ring1_size, "gfx/hud/sb_ring.tga", ring1_clip, ring1_color, ring_alpha, DRAWFLAG_ADDITIVE); + text_pos_x = ring_pos_x - stringwidth(text1_msg, FALSE, text_size) / 2; + text_pos_y = ring_pos_y - ring1_size / 2; + drawstring(text_pos, text1_msg, text_size, ring1_color, sbar_alpha_fg, DRAWFLAG_NORMAL); + } + if(text2_msg != "") + { + DrawCircleClippedPic(ring_pos, ring2_size, "gfx/hud/sb_ring.tga", ring2_clip, ring2_color, ring_alpha, DRAWFLAG_ADDITIVE); + text_pos_x = ring_pos_x - stringwidth(text2_msg, FALSE, text_size) / 2; + text_pos_y = ring_pos_y + ring1_size / 2; + drawstring(text_pos, text2_msg, text_size, ring2_color, sbar_alpha_fg, DRAWFLAG_NORMAL); + } } void CSQC_Strength_Timer() { diff --git a/data/qcsrc/server/vore.qc b/data/qcsrc/server/vore.qc index 32cfb261..4dfe4a3f 100644 --- a/data/qcsrc/server/vore.qc +++ b/data/qcsrc/server/vore.qc @@ -432,6 +432,22 @@ void Vore_AutoTaunt() } } +void Vore_SetSbarRings() +{ + float min_time; + if(self.swallow_delay > time) + { + self.stat_sbring1_type = 1; // ring shows vore system delay + min_time = self.swallow_delay - cvar("g_balance_vore_swallow_delay"); + self.stat_sbring1_clip = bound(0, (time / self.swallow_delay - 1) / (min_time / self.swallow_delay - 1), 1); + } + else + { + self.stat_sbring1_type = 0; + self.stat_sbring1_clip = 0; + } +} + void Vore() { // main vore code, this is where it all happens @@ -462,6 +478,7 @@ void Vore() } // set all vore stats + Vore_SetSbarRings(); if(self.fakepredator.classname == "player") self.stat_eaten = num_for_edict(self.fakepredator); else if(self.predator.classname == "player")