]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/client/sbar.qc
Ring for stomach kicking
[voretournament/voretournament.git] / data / qcsrc / client / sbar.qc
index b6881b45e2eb791d2bc8bc6be538cf0c92b9237e..18b16428bbc9725598cebaaa5ea7648b516fe4a3 100644 (file)
@@ -1978,6 +1978,72 @@ void Sbar_Timer()
        drawstring(pos, finaltime, 18 * scale * '1 1 0', timer_color, sbar_alpha_fg, DRAWFLAG_NORMAL);\r
 }\r
 \r
+void Sbar_Ring()\r
+{\r
+       vector ring_pos, ring1_color, ring2_color;\r
+       vector text_pos, text_size;\r
+       float ring_alpha, ring1_size, ring1_clip, ring2_size, ring2_clip;\r
+       string text1_msg, text2_msg;\r
+\r
+       ring_pos_x = vid_conwidth / 2;\r
+       ring_pos_y = vid_conheight / 1.375;\r
+       ring1_size = 100;\r
+       ring2_size = 60;\r
+       ring_alpha = sbar_alpha_fg * 1;\r
+       text_size = '10 10 0';\r
+\r
+       switch(getstati(STAT_SBRING1_TYPE))\r
+       {\r
+               case 0:\r
+                       // ring disabled\r
+                       break;\r
+               case 1:\r
+                       // ring shows vore system delay, empties with progress\r
+                       ring1_color = '0.5 0.5 1';\r
+                       text1_msg = "Vore delay";\r
+                       break;\r
+               case 2:\r
+                       // ring shows stomach kick delay, empties with progress\r
+                       ring1_color = '1 1 0.5';\r
+                       text1_msg = "Kick delay";\r
+                       break;\r
+               default:\r
+                       print(strcat("^1Error:^7 Unknown ring type: ", ftos(getstati(STAT_SBRING1_TYPE)), "\n"));\r
+                       break;\r
+       }\r
+       switch(getstati(STAT_SBRING2_TYPE))\r
+       {\r
+               case 0:\r
+                       // ring disabled\r
+                       break;\r
+               case 1:\r
+                       // ring shows regurgitation preparing, fills with progress\r
+                       ring2_color = '1 0.5 1';\r
+                       text2_msg = "Regurgitating...";\r
+                       break;\r
+               default:\r
+                       print(strcat("^1Error:^7 Unknown ring type: ", ftos(getstati(STAT_SBRING1_TYPE)), "\n"));\r
+                       break;\r
+       }\r
+       ring1_clip = getstatf(STAT_SBRING1_CLIP);\r
+       ring2_clip = getstatf(STAT_SBRING2_CLIP);\r
+\r
+       if(text1_msg != "")\r
+       {\r
+               DrawCircleClippedPic(ring_pos, ring1_size, "gfx/hud/sb_ring.tga", ring1_clip, ring1_color, ring_alpha, DRAWFLAG_ADDITIVE);\r
+               text_pos_x = ring_pos_x - stringwidth(text1_msg, FALSE, text_size) / 2;\r
+               text_pos_y = ring_pos_y - ring1_size / 2;\r
+               drawstring(text_pos, text1_msg, text_size, ring1_color, sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+       }\r
+       if(text2_msg != "")\r
+       {\r
+               DrawCircleClippedPic(ring_pos, ring2_size, "gfx/hud/sb_ring.tga", ring2_clip, ring2_color, ring_alpha, DRAWFLAG_ADDITIVE);\r
+               text_pos_x = ring_pos_x - stringwidth(text2_msg, FALSE, text_size) / 2;\r
+               text_pos_y = ring_pos_y + ring1_size / 2;\r
+               drawstring(text_pos, text2_msg, text_size, ring2_color, sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+       }\r
+}\r
+\r
 void CSQC_Strength_Timer() {\r
        vector pos;\r
        vector bottomright;\r
@@ -3085,9 +3151,10 @@ void Sbar_Draw (void)
                if (e && e.netname != "" && e.netname != "N/A")\r
                        drawpic(bottom - '96 96 0', strcat("gfx/hud/bg_status_activeweapon_", e.netname), '192 96 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
 \r
-               // draw scores and timer\r
+               // draw scores, timer, and ring\r
                Sbar_Score();\r
                Sbar_Timer();\r
+               Sbar_Ring();\r
 \r
                // draw strength/invincibility icon and timer\r
                CSQC_Strength_Timer();\r