CSQC_ctf_hud();\r
else if(gametype == GAME_CTS || gametype == GAME_RACE)\r
CSQC_race_hud();\r
+\r
+ // draw canleave message\r
+ if(getstati(STAT_VORE_CANLEAVE))\r
+ {\r
+ s = strcat("^7Press ^3", getcommandkey("secondary fire", "+attack2"), " ^7to exit");\r
+ pos_x = bottom_x - stringwidth(s, TRUE, '0 0 0') * 16 / 2;\r
+ pos_y = bottom_y - 120;\r
+ drawcolorcodedstring(pos, s, '16 16 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+ }\r
}\r
return;\r
}\r
const float STAT_VORE_LOAD = 48;\r
const float STAT_VORE_DIGESTING = 49;\r
const float STAT_VORE_EATEN = 50;\r
+const float STAT_VORE_CANLEAVE = 51;\r
const float CTF_STATE_ATTACK = 1;\r
const float CTF_STATE_DEFEND = 2;\r
const float CTF_STATE_COMMANDER = 3;\r
self.stat_eaten = spectatee.stat_eaten;\r
self.stat_stomachload = spectatee.stat_stomachload;\r
self.stat_digesting = spectatee.stat_digesting;\r
+ // self.stat_canleave = spectatee.stat_canleave; // don't enable this one, since the notification it's used for does not address spectated players\r
setorigin(self, spectatee.origin);\r
setsize(self, spectatee.mins, spectatee.maxs);\r
SetZoomState(spectatee.zoomstate);\r
.float digesting;\r
.float stomach_load;\r
.float weapon_delay;\r
-.float stat_eaten, stat_stomachload, stat_digesting;\r
+.float stat_eaten, stat_stomachload, stat_digesting, stat_canleave;\r
\r
// Fields\r
\r
addstat(STAT_VORE_LOAD, AS_INT, stat_stomachload);\r
addstat(STAT_VORE_DIGESTING, AS_INT, stat_digesting);\r
addstat(STAT_VORE_EATEN, AS_INT, stat_eaten);\r
+ addstat(STAT_VORE_CANLEAVE, AS_INT, stat_canleave);\r
\r
next_pingtime = time + 5;\r
InitializeEntity(self, cvar_changes_init, INITPRIO_CVARS);\r
return FALSE;\r
}\r
\r
+float Vore_PreyCanLeave()\r
+{\r
+ if(teams_matter && self.team == self.eater.team)\r
+ return TRUE;\r
+ return FALSE;\r
+}\r
+\r
// make the camera smoothly lower itself when we get swallowed\r
// 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)\r
.float cameraeffect_current, cameraeffect_target;\r
{\r
// allows players to get out of their predator at will in some circumstances, such as team mates\r
\r
- float canleave;\r
- canleave = (teams_matter && self.team == self.eater.team); // currently, the only circumstance where you can use this if for team mates\r
-\r
- if(canleave)\r
+ if(Vore_PreyCanLeave())\r
Vore_Regurgitate(self);\r
else if(time > self.complain_swallow)\r
{\r
else if(self.BUTTON_ATCK2)\r
Vore_StomachLeave();\r
\r
+ self.stat_canleave = Vore_PreyCanLeave();\r
+\r
Vore_CameraEffect_Apply();\r
}
\ No newline at end of file