From: MirceaKitsune Date: Sun, 12 Sep 2010 01:27:39 +0000 (+0300) Subject: Add a cvar that allows disabling the vore system. Yes, it's the core part Vore Tourna... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=cf3ba5b1d3e30d29e0b8ac5c16957b42689a8a3a;p=voretournament%2Fvoretournament.git Add a cvar that allows disabling the vore system. Yes, it's the core part Vore Tournament, but there may be circumstances (like a story map) where you may wish to disable it temporarily, and fight only with the Grabber. --- diff --git a/data/defaultVoretournament.cfg b/data/defaultVoretournament.cfg index 2ee750b3..a6d6c5cc 100644 --- a/data/defaultVoretournament.cfg +++ b/data/defaultVoretournament.cfg @@ -1498,6 +1498,7 @@ seta g_ghost_items_color "-1 -1 -1" "color of ghosted items, 0 0 0 leaves the co set cl_vore_stomachmodel 1 "when enabled, we see the stomach model around us when eaten. -1 = disabled, 1 = enabled, anything between 0 and 1 = alpha" set cl_vore_cameraspeed 1.5 "speed at which you see yourself sliding down when swallowed, 0 disables" set cl_vore_punchangle 10 "your view gets tilted by this amount when swallowing or regurgitating someone" +set g_vore 1 "enables the vore system, you want this on!" set g_vore_reversescoring 0 "reverses vore scoring, and gives digested prey a frag rather than the predator (offer yourself gameplay), does not affect suicides, weapon kills and team kills" set g_vore_teamvore 1 "allow players to swallow their team mates" set g_vore_biggergut 1 "when enabled, a player can't swallow someone with more players in their stomach than them" diff --git a/data/qcsrc/client/Main.qc b/data/qcsrc/client/Main.qc index 54f11ec1..d5444248 100644 --- a/data/qcsrc/client/Main.qc +++ b/data/qcsrc/client/Main.qc @@ -1013,6 +1013,7 @@ void Ent_Init() g_weaponswitchdelay = ReadByte() / 255.0; + g_vore = ReadCoord(); g_balance_vore_swallow_limit = ReadCoord(); if(!postinit) diff --git a/data/qcsrc/client/main.qh b/data/qcsrc/client/main.qh index 949ff1bf..10d1fd66 100644 --- a/data/qcsrc/client/main.qh +++ b/data/qcsrc/client/main.qh @@ -164,7 +164,7 @@ void centerprint(string strMessage); float armorblockpercent; float g_weaponswitchdelay; -float g_balance_vore_swallow_limit; +float g_vore, g_balance_vore_swallow_limit; //hooks float calledhooks; diff --git a/data/qcsrc/client/sbar.qc b/data/qcsrc/client/sbar.qc index b09e2bf6..9db2566f 100644 --- a/data/qcsrc/client/sbar.qc +++ b/data/qcsrc/client/sbar.qc @@ -2943,76 +2943,79 @@ void Sbar_Draw (void) fade = 3.2 - 2 * (time - weapontime); fade = bound(0.7, fade, 1); - // draw the stomach board - if (cvar("viewsize") <= 100) { - 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(getstati(STAT_VORE_EATEN)) + if(g_vore) // only when the vore system is enabled { - drawpic(bottomleft - '0 256 0', "gfx/hud/bg_stomach_status", '256 256 0', StomachStatus_ColorFade(stov(cvar_string("sbar_stomachboard_color2"))), cvar("sbar_stomachboard_status_alpha") * sbar_alpha_fg, DRAWFLAG_NORMAL); - drawstring(bottomleft - '-80 172 0', "predator:", '10 10 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); - } - else - { - drawpic(bottomleft - '0 256 0', "gfx/hud/bg_stomach_status", '256 256 0', StomachStatus_ColorFade(stov(cvar_string("sbar_stomachboard_color1"))), cvar("sbar_stomachboard_status_alpha") * sbar_alpha_fg, DRAWFLAG_NORMAL); - drawstring(bottomleft - '-80 172 0', "self:", '10 10 0', ' 1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); - } + // draw the stomach board + if (cvar("viewsize") <= 100) { + 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); + } + } - float stomach_load; - stomach_load = getstati(STAT_VORE_LOAD); // shows the predator's stomach load when we are eaten, and ours otherwise + if(getstati(STAT_VORE_EATEN)) + { + drawpic(bottomleft - '0 256 0', "gfx/hud/bg_stomach_status", '256 256 0', StomachStatus_ColorFade(stov(cvar_string("sbar_stomachboard_color2"))), cvar("sbar_stomachboard_status_alpha") * sbar_alpha_fg, DRAWFLAG_NORMAL); + drawstring(bottomleft - '-80 172 0', "predator:", '10 10 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); + } + else + { + drawpic(bottomleft - '0 256 0', "gfx/hud/bg_stomach_status", '256 256 0', StomachStatus_ColorFade(stov(cvar_string("sbar_stomachboard_color1"))), cvar("sbar_stomachboard_status_alpha") * sbar_alpha_fg, DRAWFLAG_NORMAL); + drawstring(bottomleft - '-80 172 0', "self:", '10 10 0', ' 1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); + } - Sbar_DrawXNum(bottomleft - '-18 170 0', bound(0, stomach_load, 9), 1, 0, 22, '1 1 1', 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL); - drawstring(bottomleft - '-40 170 0', "/", '22 22 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); - Sbar_DrawXNum(bottomleft - '-50 170 0', bound(0, g_balance_vore_swallow_limit, 9), 1, 0, 22, '1 1 1', 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL); + float stomach_load; + stomach_load = getstati(STAT_VORE_LOAD); // shows the predator's stomach load when we are eaten, and ours otherwise - if(getstati(STAT_VORE_DIGESTING)) - drawstring(bottomleft - '-76 142 0', "stomach digesting", '12 12 0', '1 0.5 0.5', sbar_alpha_fg, DRAWFLAG_NORMAL); - else if(stomach_load == g_balance_vore_swallow_limit) - drawstring(bottomleft - '-76 142 0', "stomach full", '12 12 0', '0.5 1 0.5', sbar_alpha_fg, DRAWFLAG_NORMAL); - else if(!stomach_load) - drawstring(bottomleft - '-76 142 0', "stomach empty", '12 12 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); - else - drawstring(bottomleft - '-76 142 0', "stomach has prey", '12 12 0', '0.75 1 0.75', sbar_alpha_fg, DRAWFLAG_NORMAL); + Sbar_DrawXNum(bottomleft - '-18 170 0', bound(0, stomach_load, 9), 1, 0, 22, '1 1 1', 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL); + drawstring(bottomleft - '-40 170 0', "/", '22 22 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); + Sbar_DrawXNum(bottomleft - '-50 170 0', bound(0, g_balance_vore_swallow_limit, 9), 1, 0, 22, '1 1 1', 0, 0, sbar_alpha_fg, DRAWFLAG_NORMAL); - // draw the stomach board player list - entity pl; - float f; + if(getstati(STAT_VORE_DIGESTING)) + drawstring(bottomleft - '-76 142 0', "stomach digesting", '12 12 0', '1 0.5 0.5', sbar_alpha_fg, DRAWFLAG_NORMAL); + else if(stomach_load == g_balance_vore_swallow_limit) + drawstring(bottomleft - '-76 142 0', "stomach full", '12 12 0', '0.5 1 0.5', sbar_alpha_fg, DRAWFLAG_NORMAL); + else if(!stomach_load) + drawstring(bottomleft - '-76 142 0', "stomach empty", '12 12 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); + else + drawstring(bottomleft - '-76 142 0', "stomach has prey", '12 12 0', '0.75 1 0.75', sbar_alpha_fg, DRAWFLAG_NORMAL); - pos = bottomleft; - for(pl = players.sort_next; pl; pl = pl.sort_next) - { - if(pl.team == COLOR_SPECTATOR) - continue; + // draw the stomach board player list + entity pl; + float f; - if(getstati(STAT_VORE_EATEN)) - f = pl.plpredator == getstati(STAT_VORE_EATEN); - else + pos = bottomleft; + for(pl = players.sort_next; pl; pl = pl.sort_next) { - if(spectatee_status) - f = pl.plpredator == spectatee_status; + if(pl.team == COLOR_SPECTATOR) + continue; + + if(getstati(STAT_VORE_EATEN)) + f = pl.plpredator == getstati(STAT_VORE_EATEN); else - f = pl.plpredator == player_localentnum; - } + { + if(spectatee_status) + f = pl.plpredator == spectatee_status; + else + f = pl.plpredator == player_localentnum; + } - if(f) - { - Sbar_PrintStomachboardItem(pos - '-16 124 0', pl); - pos_y += 1.25 * sbar_fontsize_y; - } + if(f) + { + Sbar_PrintStomachboardItem(pos - '-16 124 0', pl); + pos_y += 1.25 * sbar_fontsize_y; + } - if(getstati(STAT_VORE_EATEN)) - if(pl.sv_entnum == getstati(STAT_VORE_EATEN) - 1) - Sbar_PrintStomachboardItemPred(bottomleft - '-76 156 0', pl); + if(getstati(STAT_VORE_EATEN)) + if(pl.sv_entnum == getstati(STAT_VORE_EATEN) - 1) + Sbar_PrintStomachboardItemPred(bottomleft - '-76 156 0', pl); + } } if (cvar("viewsize") <= 100) { diff --git a/data/qcsrc/server/bot/havocbot/vore_ai.qc b/data/qcsrc/server/bot/havocbot/vore_ai.qc index 6e95c6fe..0b356c1a 100644 --- a/data/qcsrc/server/bot/havocbot/vore_ai.qc +++ b/data/qcsrc/server/bot/havocbot/vore_ai.qc @@ -77,6 +77,8 @@ void Vore_AI() { // main vore AI code + if(!cvar("g_vore")) + return; if(cvar("bot_nofire") || !skill || (g_rpg && cvar("g_rpg_botattack") < 1)) return; diff --git a/data/qcsrc/server/cl_client.qc b/data/qcsrc/server/cl_client.qc index 393463cc..c8109a7b 100644 --- a/data/qcsrc/server/cl_client.qc +++ b/data/qcsrc/server/cl_client.qc @@ -1013,6 +1013,7 @@ float ClientInit_SendEntity(entity to, float sf) WriteByte(MSG_ENTITY, cvar("g_balance_armor_blockpercent") * 255.0); WriteByte(MSG_ENTITY, cvar("g_balance_weaponswitchdelay") * 255.0); + WriteCoord(MSG_ENTITY, cvar("g_vore")); WriteCoord(MSG_ENTITY, cvar("g_balance_vore_swallow_limit")); return TRUE; } diff --git a/data/qcsrc/server/vore.qc b/data/qcsrc/server/vore.qc index e0ef601f..97136610 100644 --- a/data/qcsrc/server/vore.qc +++ b/data/qcsrc/server/vore.qc @@ -318,6 +318,12 @@ void Vore() { // main vore code, this is where it all happens + if(!cvar("g_vore")) // vore system is disabled + { + Vore_Disconnect(); + return; + } + // set all vore related stats if(self.predator.classname == "player") {