First part of the predator stomach board; Send the stomach load stat of the predator...
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 3 Sep 2010 23:05:19 +0000 (02:05 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 3 Sep 2010 23:05:19 +0000 (02:05 +0300)
data/qcsrc/client/sbar.qc
data/qcsrc/server/defs.qh
data/qcsrc/server/g_world.qc
data/qcsrc/server/vore.qc

index d71abb52d552f6ed397537aa082e108cea29f334..60d5139f29797ecc8d7095c244e96fbe07b5833c 100644 (file)
@@ -2872,20 +2872,20 @@ void Sbar_Draw (void)
                fade = 3.2 - 2 * (time - weapontime);\r
                fade = bound(0.7, fade, 1);\r
 \r
-               if not(getstati(STAT_STOMACH_EATEN)) // useless if we're inside someone\r
-               {\r
-                       if (cvar("viewsize") <= 100 && vid_conwidth <= 1600) {\r
-                               if (teamplay)\r
-                                       drawpic(bottomleft- '0 256 0', "gfx/hud/bg_stomach", '256 256 0', GetTeamRGB(myteam) * sbar_color_bg_team, sbar_alpha_bg, DRAWFLAG_NORMAL); // hud color = myteam color\r
-                               else {\r
-                                       // allow for custom HUD colors in non-teamgames\r
-                                       color_x = cvar("sbar_color_bg_r");\r
-                                       color_y = cvar("sbar_color_bg_g");\r
-                                       color_z = cvar("sbar_color_bg_b");\r
-\r
-                                       drawpic(bottomleft - '0 256 0', "gfx/hud/bg_stomach", '256 256 0', color, sbar_alpha_bg, DRAWFLAG_NORMAL);\r
-                               }\r
+               if (cvar("viewsize") <= 100 && vid_conwidth <= 1600) {\r
+                       if (teamplay)\r
+                               drawpic(bottomleft- '0 256 0', "gfx/hud/bg_stomach", '256 256 0', GetTeamRGB(myteam) * sbar_color_bg_team, sbar_alpha_bg, DRAWFLAG_NORMAL); // hud color = myteam color\r
+                       else {\r
+                               // allow for custom HUD colors in non-teamgames\r
+                               color_x = cvar("sbar_color_bg_r");\r
+                               color_y = cvar("sbar_color_bg_g");\r
+                               color_z = cvar("sbar_color_bg_b");\r
+\r
+                               drawpic(bottomleft - '0 256 0', "gfx/hud/bg_stomach", '256 256 0', color, sbar_alpha_bg, DRAWFLAG_NORMAL);\r
                        }\r
+               }\r
+               //if not(getstati(STAT_STOMACH_EATEN)) // useless if we're inside someone\r
+               //{\r
                        float stomach_load;\r
                        stomach_load = getstati(STAT_STOMACH_LOAD);\r
 \r
@@ -2900,11 +2900,11 @@ void Sbar_Draw (void)
                                drawstring(bottomleft - '-76 150 0', "stomach empty", '14 14 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
                        else\r
                                drawstring(bottomleft - '-76 150 0', "stomach has prey", '14 14 0', '0.75 1 0.75', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
-               }\r
+               //}\r
 \r
                // draw the stomach board\r
-               if not(getstati(STAT_STOMACH_EATEN)) // useless if we're inside someone\r
-               {\r
+               //if not(getstati(STAT_STOMACH_EATEN)) // useless if we're inside someone\r
+               //{\r
                        entity pl;\r
                        float f;\r
 \r
@@ -2924,7 +2924,7 @@ void Sbar_Draw (void)
                                        pos_y += 1.25 * sbar_fontsize_y;\r
                                }\r
                        }\r
-               }\r
+               //}\r
 \r
                if (cvar("viewsize") <= 100 && vid_conwidth <= 1600) {\r
                        if (teamplay)\r
index 7953f82281dc82f6e993e6082b2dc21c0980e167..0ef4fb36bb8509dc5bae2946aa39b4dd20a67926 100644 (file)
@@ -69,7 +69,7 @@ float maxclients;
 .float digesting;\r
 .float stomach_load;\r
 .float weapon_delay;\r
-.float stat_eaten;\r
+.float stat_eaten, stat_stomachload;\r
 \r
 // Fields\r
 \r
index 12b021afd3180f9667ede6a1208ca59cef42bc4d..aae78b32a5abc6a05521073bb538097bf4c0407b 100644 (file)
@@ -655,7 +655,7 @@ void spawnfunc_worldspawn (void)
        addstat(STAT_SHOTORG, AS_INT, stat_shotorg);\r
        addstat(STAT_LEADLIMIT, AS_FLOAT, stat_leadlimit);\r
        addstat(STAT_BULLETS_LOADED, AS_INT, campingrifle_bulletcounter);\r
-       addstat(STAT_STOMACH_LOAD, AS_INT, stomach_load);\r
+       addstat(STAT_STOMACH_LOAD, AS_INT, stat_stomachload);\r
        addstat(STAT_STOMACH_DIGESTING, AS_INT, digesting);\r
        addstat(STAT_STOMACH_EATEN, AS_INT, stat_eaten);\r
 \r
index 836c0912e07628a837f83a3629a6367978a77592..0e853a417f46ef2aec4b4e04cdd7fb3aada750ec 100644 (file)
@@ -237,6 +237,12 @@ void Vore_Gurglesound()
 \r
 void Vore()\r
 {\r
+       // if we are free, show our stomach load on the HUD. Otherwise, show the predator's\r
+       if(self.eater.classname == "player")\r
+               self.stat_stomachload = self.eater.stomach_load;\r
+       else\r
+               self.stat_stomachload = self.stomach_load;\r
+\r
        // skip the vore system under some circumstances\r
        if(time < game_starttime)\r
        {\r