From: MirceaKitsune Date: Fri, 3 Sep 2010 23:05:19 +0000 (+0300) Subject: First part of the predator stomach board; Send the stomach load stat of the predator... X-Git-Url: http://de.git.xonotic.org/?p=voretournament%2Fvoretournament.git;a=commitdiff_plain;h=1d1f1251b5e836aa2d3bed03200d24ec4bb926d3 First part of the predator stomach board; Send the stomach load stat of the predator when we are eaten. --- diff --git a/data/qcsrc/client/sbar.qc b/data/qcsrc/client/sbar.qc index d71abb52..60d5139f 100644 --- a/data/qcsrc/client/sbar.qc +++ b/data/qcsrc/client/sbar.qc @@ -2872,20 +2872,20 @@ void Sbar_Draw (void) fade = 3.2 - 2 * (time - weapontime); fade = bound(0.7, fade, 1); - if not(getstati(STAT_STOMACH_EATEN)) // useless if we're inside someone - { - if (cvar("viewsize") <= 100 && vid_conwidth <= 1600) { - if (teamplay) - 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 - else { - // allow for custom HUD colors in non-teamgames - color_x = cvar("sbar_color_bg_r"); - color_y = cvar("sbar_color_bg_g"); - color_z = cvar("sbar_color_bg_b"); - - drawpic(bottomleft - '0 256 0', "gfx/hud/bg_stomach", '256 256 0', color, sbar_alpha_bg, DRAWFLAG_NORMAL); - } + if (cvar("viewsize") <= 100 && vid_conwidth <= 1600) { + if (teamplay) + 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 + else { + // allow for custom HUD colors in non-teamgames + color_x = cvar("sbar_color_bg_r"); + color_y = cvar("sbar_color_bg_g"); + color_z = cvar("sbar_color_bg_b"); + + drawpic(bottomleft - '0 256 0', "gfx/hud/bg_stomach", '256 256 0', color, sbar_alpha_bg, DRAWFLAG_NORMAL); } + } + //if not(getstati(STAT_STOMACH_EATEN)) // useless if we're inside someone + //{ float stomach_load; stomach_load = getstati(STAT_STOMACH_LOAD); @@ -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); else drawstring(bottomleft - '-76 150 0', "stomach has prey", '14 14 0', '0.75 1 0.75', sbar_alpha_fg, DRAWFLAG_NORMAL); - } + //} // draw the stomach board - if not(getstati(STAT_STOMACH_EATEN)) // useless if we're inside someone - { + //if not(getstati(STAT_STOMACH_EATEN)) // useless if we're inside someone + //{ entity pl; float f; @@ -2924,7 +2924,7 @@ void Sbar_Draw (void) pos_y += 1.25 * sbar_fontsize_y; } } - } + //} if (cvar("viewsize") <= 100 && vid_conwidth <= 1600) { if (teamplay) diff --git a/data/qcsrc/server/defs.qh b/data/qcsrc/server/defs.qh index 7953f822..0ef4fb36 100644 --- a/data/qcsrc/server/defs.qh +++ b/data/qcsrc/server/defs.qh @@ -69,7 +69,7 @@ float maxclients; .float digesting; .float stomach_load; .float weapon_delay; -.float stat_eaten; +.float stat_eaten, stat_stomachload; // Fields diff --git a/data/qcsrc/server/g_world.qc b/data/qcsrc/server/g_world.qc index 12b021af..aae78b32 100644 --- a/data/qcsrc/server/g_world.qc +++ b/data/qcsrc/server/g_world.qc @@ -655,7 +655,7 @@ void spawnfunc_worldspawn (void) addstat(STAT_SHOTORG, AS_INT, stat_shotorg); addstat(STAT_LEADLIMIT, AS_FLOAT, stat_leadlimit); addstat(STAT_BULLETS_LOADED, AS_INT, campingrifle_bulletcounter); - addstat(STAT_STOMACH_LOAD, AS_INT, stomach_load); + addstat(STAT_STOMACH_LOAD, AS_INT, stat_stomachload); addstat(STAT_STOMACH_DIGESTING, AS_INT, digesting); addstat(STAT_STOMACH_EATEN, AS_INT, stat_eaten); diff --git a/data/qcsrc/server/vore.qc b/data/qcsrc/server/vore.qc index 836c0912..0e853a41 100644 --- a/data/qcsrc/server/vore.qc +++ b/data/qcsrc/server/vore.qc @@ -237,6 +237,12 @@ void Vore_Gurglesound() void Vore() { + // if we are free, show our stomach load on the HUD. Otherwise, show the predator's + if(self.eater.classname == "player") + self.stat_stomachload = self.eater.stomach_load; + else + self.stat_stomachload = self.stomach_load; + // skip the vore system under some circumstances if(time < game_starttime) {