// execute the vore AI for bots
Vore_AI();
- if(self.predator.classname == "player")
+ if(self.stat_eaten)
return; // an eaten bot has nothing to do outside of the vore AI
if (bot_strategytoken == self)
if not(teams_matter && cvar("g_balance_vore_teamheal") && cvar("g_vore_teamvore"))
return;
- if(self.deadflag != DEAD_NO || self.predator.classname == "player" || self.flagcarried || self.digesting) // a flag carrier can't waste time on team healing
+ if(self.deadflag != DEAD_NO || self.stat_eaten || self.flagcarried || self.digesting) // a flag carrier can't waste time on team healing
{
self.status_teamhealing = 0;
return;
// Predator bot behavior:
// --------------------------------
- if(self.predator.classname != "player")
+ if(!self.stat_eaten)
{
// finding and swallowing a player
// Prey bot behavior:
// --------------------------------
- if(self.predator.classname == "player" && time > self.decide_prey)
+ if(self.stat_eaten && time > self.decide_prey)
{
// all we can do in the stomach is kick and do some damage / try to escape, or leave if the circumstances allow it and we should
}\r
\r
Client_setmodel(setmodel_state());\r
- if not(self.predator.classname == "player" || self.fakeprey)\r
+ if not(self.stat_eaten || self.fakeprey)\r
self.alpha = default_player_alpha;\r
else\r
self.alpha = -1; // hide all prey\r
RemoveGrabber(self); // Wazat's Grabber\r
\r
Vore_DeadPrey_Detach(self);\r
- self.fakeprey = 0; // completely clear the fakeprey status\r
+ self.fakeprey = FALSE; // clear the fakeprey status\r
\r
self.classname = "player";\r
self.wasplayer = TRUE;\r
remove(self);\r
return;\r
}\r
- if ((self.owner.BUTTON_CHAT && !self.owner.deadflag && self.owner.predator.classname != "player" && self.owner.fakepredator.classname != "player")\r
+ if ((self.owner.BUTTON_CHAT && !self.owner.deadflag && !self.owner.stat_eaten && self.owner.fakepredator.classname != "player")\r
#ifdef TETRIS\r
|| self.owner.tetris_on\r
#endif\r
return;\r
}\r
// setorigin(self, self.owner.origin + '0 0 15' + self.owner.maxs_z * '0 0 1'); // bandwidth hog. setattachment does this now\r
- if (self.owner.BUTTON_CHAT || self.owner.deadflag || self.owner.killindicator || self.owner.predator.classname == "player" || self.owner.fakepredator.classname == "player")\r
+ if (self.owner.BUTTON_CHAT || self.owner.deadflag || self.owner.killindicator || self.owner.stat_eaten)\r
self.model = "";\r
else\r
{\r
if(self.crouch)\r
{\r
//setsize (self, PL_CROUCH_MIN * self.scale, PL_CROUCH_MAX * self.scale);\r
- if not(self.predator.classname == "player" || self.fakeprey > 1)\r
+ if(!self.stat_eaten)\r
self.view_ofs = PL_CROUCH_VIEW_OFS * self.scale;\r
}\r
else\r
{\r
//setsize (self, PL_MIN * self.scale, PL_MAX * self.scale);\r
- if not(self.predator.classname == "player" || self.fakeprey > 1)\r
+ if(!self.stat_eaten)\r
self.view_ofs = PL_VIEW_OFS * self.scale;\r
}\r
}\r
}\r
}\r
\r
- if(self.predator.classname == "player" || self.fakepredator.classname == "player")\r
+ if(self.stat_eaten)\r
return;\r
\r
if (self.movetype == MOVETYPE_NONE)\r
PM_Accelerate(wishdir, wishspeed, wishspeed, sv_accelerate*maxspd_mod, 1, 0);\r
}\r
}\r
- else if ((self.items & IT_JETPACK) && self.BUTTON_JETPACK && (!cvar("g_jetpack_fuel") || self.ammo_fuel >= 0.01 || self.items & IT_UNLIMITED_WEAPON_AMMO) && self.predator.classname != "player")\r
+ else if ((self.items & IT_JETPACK) && self.BUTTON_JETPACK && (!cvar("g_jetpack_fuel") || self.ammo_fuel >= 0.01 || self.items & IT_UNLIMITED_WEAPON_AMMO) && !self.stat_eaten)\r
{\r
//makevectors(self.v_angle_y * '0 1 0');\r
makevectors(self.v_angle);\r
else if (self.flags & FL_ONGROUND)\r
{\r
// we get here if we ran out of ammo\r
- if((self.items & IT_JETPACK) && self.BUTTON_JETPACK && !(buttons_prev & 32) && self.predator.classname != "player")\r
+ if((self.items & IT_JETPACK) && self.BUTTON_JETPACK && !(buttons_prev & 32) && !self.stat_eaten)\r
sprint(self, "You don't have any fuel for the ^2Jetpack\n");\r
\r
// walking\r
{\r
float wishspeed0;\r
// we get here if we ran out of ammo\r
- if((self.items & IT_JETPACK) && self.BUTTON_JETPACK && !(buttons_prev & 32) && self.predator.classname != "player")\r
+ if((self.items & IT_JETPACK) && self.BUTTON_JETPACK && !(buttons_prev & 32) && !self.stat_eaten)\r
sprint(self, "You don't have any fuel for the ^2Jetpack\n");\r
\r
if(maxspd_mod < 1)\r
selected = world;\r
selected_score = 0.95; // 18 degrees\r
\r
- if(self.predator.classname == "player")\r
+ if(self.stat_eaten)\r
{\r
if(!self.dropweapon_check)\r
if(self.predator.team != self.team) // don't disarm team mates when swallowing them\r
{\r
if(msg_entity.cvar_cl_voice_directional == 1)\r
{\r
- if(self.predator.classname == "player")\r
+ if(self.stat_eaten)\r
soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE * bound(0, cvar("g_vore_soundocclusion"), 1), ATTN_MIN);\r
else\r
soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_MIN);\r
{\r
if(msg_entity.cvar_cl_voice_directional == 1)\r
{\r
- if(self.predator.classname == "player")\r
+ if(self.stat_eaten)\r
soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE * bound(0, cvar("g_vore_soundocclusion"), 1), ATTN_MIN);\r
else\r
soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_MIN);\r
{\r
if(msg_entity.cvar_cl_voice_directional == 1)\r
{\r
- if(self.predator.classname == "player")\r
+ if(self.stat_eaten)\r
soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE * bound(0, cvar("g_vore_soundocclusion"), 1), ATTN_MIN);\r
else\r
soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_MIN);\r
if (tauntrand < msg_entity.cvar_cl_autotaunt)\r
if (msg_entity.cvar_cl_voice_directional >= 1)\r
{\r
- if(self.predator.classname == "player")\r
+ if(self.stat_eaten)\r
soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE * bound(0, cvar("g_vore_soundocclusion"), 1), bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX));\r
else\r
soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX));\r
{\r
if (msg_entity.cvar_cl_voice_directional >= 1)\r
{\r
- if(self.predator.classname == "player")\r
+ if(self.stat_eaten)\r
soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE * bound(0, cvar("g_vore_soundocclusion"), 1), bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX));\r
else\r
soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX));\r
soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE);\r
}\r
case VOICETYPE_PLAYERSOUND:\r
- if(self.predator.classname == "player")\r
+ if(self.stat_eaten)\r
sound(self, chan, sample, VOL_BASE * bound(0, cvar("g_vore_soundocclusion"), 1), ATTN_NORM);\r
else\r
sound(self, chan, sample, VOL_BASE, ATTN_NORM);\r
w = self.weapon;\r
if (w == 0)\r
return; // just in case\r
- if(self.predator.classname == "player" && self.dropweapon_check)\r
+ if(self.stat_eaten && self.dropweapon_check)\r
return; // can't drop weapons from the stomach\r
if (g_lms)\r
return;\r
\r
if(self.owner.alpha == default_player_alpha)\r
self.alpha = default_weapon_alpha;\r
- else if(self.owner.alpha != 0 && self.owner.predator.classname != "player")\r
+ else if(self.owner.alpha != 0 && !self.owner.stat_eaten)\r
self.alpha = self.owner.alpha;\r
else\r
self.alpha = 1;\r
void W_ReloadedAndReady()\r
{\r
// if we are inside the stomach, don't allow reloading, and schedule the weapon to reload once when we're out\r
- if(self.predator.classname == "player")\r
+ if(self.stat_eaten)\r
{\r
self.clip_load = self.weapon_load[self.weapon] = -1;\r
w_ready(); // don't keep executing each frame\r
void W_Reload(float sent_ammo_min, float sent_ammo_amount, float sent_time, string sent_sound)\r
{\r
// if we are inside the stomach, don't allow reloading\r
- if(self.predator.classname == "player")\r
+ if(self.stat_eaten)\r
return;\r
\r
// set global values to work with\r
WarpZone_RefSys_AddIncrementally(self, self.aiment);\r
\r
// prevent the grabber from sticking to a player that has been swallowed\r
- if(self.aiment.predator.classname == "player")\r
+ if(self.aiment.stat_eaten)\r
{\r
// if the grabber is linked to a player that we swallowed, disconnect it (or the grabber will stick to us / the player inside us)\r
// otherwise, link the grabber to the player who ate our linked player\r
// TODO maybe convert this to a TE?\r
void Violence_GibSplash_At(vector org, vector dir, float type, float amount, entity gibowner, entity attacker)\r
{\r
- if(gibowner.predator.classname == "player" || gibowner.fakeprey > 1)\r
+ if(gibowner.stat_eaten)\r
return; // you can't bleed or gib outside of the stomach\r
\r
entity e;\r
WriteByte(MSG_BROADCAST, SVC_TEMPENTITY);\r
WriteByte(MSG_BROADCAST, TE_CSQC_OTHERPLREPORT);\r
WriteByte(MSG_BROADCAST, self.cnt);\r
- if(e.predator.classname == "player") // tempt hackers less by only sending the info of eaten players\r
+ if(e.stat_eaten) // tempt hackers less by only sending the info of eaten players\r
{\r
if(cvar("g_vore_showhealth"))\r
WriteByte(MSG_BROADCAST, e.health);\r
if not (e_target)\r
return -2;\r
\r
- if(e_target.predator.classname == "player") // don't shoot someone from the belly\r
+ if(e_target.stat_eaten) // don't shoot someone in the belly\r
return -3;\r
\r
if(g_onslaught)\r
// checks the necessary conditions for swallowing a player\r
\r
if(prey != self)\r
- if(prey.classname == "player" && prey.predator.classname != "player" && prey.deadflag == DEAD_NO) // we can't swallow someone who's already in someone else's stomach\r
- if(self.classname == "player" && self.predator.classname != "player" && self.deadflag == DEAD_NO) // we can't swallow players while inside someone's stomach ourselves\r
+ if(prey.classname == "player" && !prey.stat_eaten && prey.deadflag == DEAD_NO) // we can't swallow someone who's already in someone else's stomach\r
+ if(self.classname == "player" && !self.stat_eaten && self.deadflag == DEAD_NO) // we can't swallow players while inside someone's stomach ourselves\r
if(!self.BUTTON_REGURGITATE && self.swallow_delay < time)\r
if not(vlen(self.velocity) > cvar("g_balance_vore_regurgitate_speedcap"))\r
{\r
\r
float Vore_CanLeave()\r
{\r
- if(self.predator.classname == "player")\r
+ if(self.stat_eaten)\r
{\r
if(!cvar("g_vore_kick")) // you are defenseless in the stomach if you can't kick, so allow leaving\r
return TRUE;\r
// position the camera properly for prey\r
void Vore_SetCamera()\r
{\r
- if not(self.predator.classname == "player" || self.fakeprey > 1)\r
+ if not(self.stat_eaten)\r
return;\r
\r
self.view_ofs = PL_PREY_VIEW_OFS;\r
\r
float prey_height;\r
- if(self.fakeprey > 1)\r
+ if(self.fakeprey)\r
prey_height = (self.scale - self.fakepredator.scale) * cvar("g_healthsize_vore_pos");\r
else\r
prey_height = (self.scale - self.predator.scale) * cvar("g_healthsize_vore_pos");\r
{\r
// ran when the keepdeadprey feature is enabled and prey stays inside the stomach after dying\r
\r
- if(e.fakeprey || e.predator.classname != "player") // already configured\r
+ if(e.fakeprey || !e.stat_eaten) // we already configured everything\r
return;\r
\r
// this entity is like e.predator but for dead prey, to avoid conflicts\r
e.fakepredator = e.predator;\r
- e.fakeprey = 2; // is fakeprey in a stomach\r
+ e.fakeprey = TRUE;\r
\r
// first release the prey from the predator, as dead prey needs to be attached differently\r
// the predator's stomach load is also decreased, as dead prey doesn't count any more\r
return;\r
\r
e.fakepredator = world;\r
- e.fakeprey = 1; // was fakeprey but is now detached\r
+ e.fakeprey = TRUE; // keep fakeprey status\r
e.aiment = world;\r
e.movetype = MOVETYPE_TOSS;\r
}\r
{\r
if(pred_disconnect)\r
{\r
- if(e.fakeprey > 1)\r
+ if(e.fakeprey)\r
Vore_DeadPrey_Detach(e);\r
else\r
Vore_Regurgitate(e);\r
// frees prey from their predators when someone disconnects or goes spectating, or in other circumstances\r
\r
// prey disconnects or goes spectating while inside someone's belly\r
- if(self.predator.classname == "player")\r
+ if(self.stat_eaten)\r
Vore_PreyRelease(self, TRUE);\r
\r
// pred disconnects or goes spectating with players in their belly\r
}\r
\r
// prey taunts\r
- if(self.predator.classname == "player" && !(teams_matter && self.team == self.predator.team))\r
+ if(self.stat_eaten && !(teams_matter && self.team == self.predator.team))\r
{\r
if(!self.taunt_soundtime) // taunt_soundtime becomes 0 once the taunt has played\r
{\r
Vore_AutoTaunt();\r
\r
// wash the goo away from players once they leave the stomach\r
- if(self.predator.classname != "player")\r
+ if(!self.stat_eaten)\r
if(stov(cvar_string("g_vore_regurgitatecolor_release")))\r
if(self.colormod)\r
if(cvar("g_vore_regurgitatecolor_release_fade"))\r
}\r
\r
// set all vore stats\r
- if(self.fakeprey > 1)\r
+ if(self.fakepredator.classname == "player")\r
self.stat_eaten = num_for_edict(self.fakepredator);\r
else if(self.predator.classname == "player")\r
{\r
// don't allow a player inside a player inside another player :)\r
// prevent this by checking if such has happened, and taking the proper measures\r
// this code has a high priority and must not be stopped by any delay, so run it here\r
- if(self.predator.predator.classname == "player")\r
+ if(self.predator.stat_eaten)\r
{\r
entity target_predator, target_predator_predator, oldself;\r
target_predator = self.predator;\r
Vore_SetCamera();\r
\r
// keepdeadprey - detach dead prey if their predator died or got swallowed\r
- if(self.fakepredator.classname == "player")\r
- if(self.fakepredator.deadflag != DEAD_NO || self.fakepredator.predator.classname == "player")\r
+ if(self.fakeprey)\r
+ if(self.fakepredator.deadflag != DEAD_NO || self.fakepredator.stat_eaten)\r
Vore_DeadPrey_Detach(self);\r
\r
- if(self.predator.classname != "player")\r
+ if(!self.stat_eaten)\r
return;\r
\r
if(self.deadflag != DEAD_NO)\r
\r
float w_grabber(float req)\r
{\r
- if(self.predator.classname == "player") // we can't use weapons while in the stomach\r
+ if(self.stat_eaten) // we can't use weapons while in the stomach\r
{\r
self.grabber_state |= GRABBER_REMOVING;\r
return FALSE;\r