From: MirceaKitsune Date: Tue, 7 Sep 2010 18:30:14 +0000 (+0300) Subject: Add a message that lets us know we can leave the belly, when it's the case X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=bd239fe8d0f5a071e8d7e0f1cde8c0544687debb;p=voretournament%2Fvoretournament.git Add a message that lets us know we can leave the belly, when it's the case --- diff --git a/data/qcsrc/client/sbar.qc b/data/qcsrc/client/sbar.qc index d9223079..fe6e09ec 100644 --- a/data/qcsrc/client/sbar.qc +++ b/data/qcsrc/client/sbar.qc @@ -3075,6 +3075,15 @@ void Sbar_Draw (void) CSQC_ctf_hud(); else if(gametype == GAME_CTS || gametype == GAME_RACE) CSQC_race_hud(); + + // draw canleave message + if(getstati(STAT_VORE_CANLEAVE)) + { + s = strcat("^7Press ^3", getcommandkey("secondary fire", "+attack2"), " ^7to exit"); + pos_x = bottom_x - stringwidth(s, TRUE, '0 0 0') * 16 / 2; + pos_y = bottom_y - 120; + drawcolorcodedstring(pos, s, '16 16 0', sbar_alpha_fg, DRAWFLAG_NORMAL); + } } return; } diff --git a/data/qcsrc/common/constants.qh b/data/qcsrc/common/constants.qh index a6031ba9..ff54fb86 100644 --- a/data/qcsrc/common/constants.qh +++ b/data/qcsrc/common/constants.qh @@ -279,6 +279,7 @@ const float STAT_LEADLIMIT = 47; const float STAT_VORE_LOAD = 48; const float STAT_VORE_DIGESTING = 49; const float STAT_VORE_EATEN = 50; +const float STAT_VORE_CANLEAVE = 51; const float CTF_STATE_ATTACK = 1; const float CTF_STATE_DEFEND = 2; const float CTF_STATE_COMMANDER = 3; diff --git a/data/qcsrc/server/cl_client.qc b/data/qcsrc/server/cl_client.qc index 9f5eb15f..52a9a412 100644 --- a/data/qcsrc/server/cl_client.qc +++ b/data/qcsrc/server/cl_client.qc @@ -2016,6 +2016,7 @@ void SpectateCopy(entity spectatee) { self.stat_eaten = spectatee.stat_eaten; self.stat_stomachload = spectatee.stat_stomachload; self.stat_digesting = spectatee.stat_digesting; + // self.stat_canleave = spectatee.stat_canleave; // don't enable this one, since the notification it's used for does not address spectated players setorigin(self, spectatee.origin); setsize(self, spectatee.mins, spectatee.maxs); SetZoomState(spectatee.zoomstate); diff --git a/data/qcsrc/server/defs.qh b/data/qcsrc/server/defs.qh index 569236ed..9e6a63fb 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, stat_stomachload, stat_digesting; +.float stat_eaten, stat_stomachload, stat_digesting, stat_canleave; // Fields diff --git a/data/qcsrc/server/g_world.qc b/data/qcsrc/server/g_world.qc index d06624c2..3c1fb34d 100644 --- a/data/qcsrc/server/g_world.qc +++ b/data/qcsrc/server/g_world.qc @@ -657,6 +657,7 @@ void spawnfunc_worldspawn (void) addstat(STAT_VORE_LOAD, AS_INT, stat_stomachload); addstat(STAT_VORE_DIGESTING, AS_INT, stat_digesting); addstat(STAT_VORE_EATEN, AS_INT, stat_eaten); + addstat(STAT_VORE_CANLEAVE, AS_INT, stat_canleave); next_pingtime = time + 5; InitializeEntity(self, cvar_changes_init, INITPRIO_CVARS); diff --git a/data/qcsrc/server/vore.qc b/data/qcsrc/server/vore.qc index 48ea0c6e..f6f4165d 100644 --- a/data/qcsrc/server/vore.qc +++ b/data/qcsrc/server/vore.qc @@ -56,6 +56,13 @@ float Swallow_condition_check(entity prey) return FALSE; } +float Vore_PreyCanLeave() +{ + if(teams_matter && self.team == self.eater.team) + return TRUE; + return FALSE; +} + // make the camera smoothly lower itself when we get swallowed // the target we are going for is from normal view offset to half of the view offset (because half is the best positioning of the view for the stomach model) .float cameraeffect_current, cameraeffect_target; @@ -266,10 +273,7 @@ void Vore_StomachLeave() { // allows players to get out of their predator at will in some circumstances, such as team mates - float canleave; - canleave = (teams_matter && self.team == self.eater.team); // currently, the only circumstance where you can use this if for team mates - - if(canleave) + if(Vore_PreyCanLeave()) Vore_Regurgitate(self); else if(time > self.complain_swallow) { @@ -419,5 +423,7 @@ void Vore() else if(self.BUTTON_ATCK2) Vore_StomachLeave(); + self.stat_canleave = Vore_PreyCanLeave(); + Vore_CameraEffect_Apply(); } \ No newline at end of file