// pred is the predator and head is the prey\r
\r
local entity head;\r
- local vector origin_apply;\r
\r
// In order to allow prey to see each other in the stomach, we must position each occupant differently,\r
// else all players overlap in the center. To do this, we use a random origin on all players in the same stomach.\r
{\r
if(head.predator == pred)\r
{\r
- origin_apply_x = PL_PREY_VIEW_OFS_x + crandom() * cvar("g_vore_neighborprey_distance");\r
- origin_apply_y = PL_PREY_VIEW_OFS_y + crandom() * cvar("g_vore_neighborprey_distance");\r
- origin_apply_z = PL_PREY_VIEW_OFS_z;\r
-\r
// since prey have their predators set as an aiment, view_ofs will specify the real origin of prey, not just the view offset\r
- head.view_ofs = origin_apply;\r
- head.view_ofs_z *= pred.scale; // stomach center depends on predator scale\r
-\r
- // change prey height based on scale\r
- float prey_height;\r
- prey_height = (head.scale - pred.scale) * cvar("g_healthsize_vore_pos");\r
- head.view_ofs_z += prey_height;\r
+ head.view_ofs_x = PL_PREY_VIEW_OFS_x + crandom() * cvar("g_vore_neighborprey_distance");\r
+ head.view_ofs_y = PL_PREY_VIEW_OFS_y + crandom() * cvar("g_vore_neighborprey_distance");\r
+ head.view_ofs_z = PL_PREY_VIEW_OFS_z;\r
}\r
}\r
}\r
{\r
// apply stomach weight that makes you heavier and larger the more you eat\r
// slowing the player is done in cl_physics.qc\r
+ if(self.classname != "player")\r
+ return;\r
\r
entity e;\r
float prey_mass;\r
self.stomach_load += floor(prey_mass);\r
}\r
}\r
+ for(e = world; (e = find(e, classname, "consumable")); )\r
+ {\r
+ if(e.predator == self)\r
+ self.stomach_load += floor(self.dmg);\r
+ }\r
\r
// apply weight\r
self.gravity = 1 + (self.stomach_load / self.stomach_maxload) * cvar("g_balance_vore_load_pred_weight");\r
\r
e.vore_oldmovetype = e.movetype;\r
e.vore_oldsolid = e.solid;\r
+ e.punchvector_z = cvar("g_balance_vore_swallow_prey_punchvector");\r
\r
e.predator = self;\r
setorigin(e, e.predator.origin);\r
\r
PlayerSound(e.predator, playersound_swallow, CHAN_VOICE, VOICETYPE_PLAYERSOUND);\r
setanim(e.predator, e.predator.anim_pain1, FALSE, TRUE, TRUE); // looks good for swallowing / regurgitating\r
- e.predator.punchangle_x -= cvar("g_balance_vore_swallow_punchangle");\r
+ e.predator.punchangle_x -= cvar("g_balance_vore_swallow_predator_punchangle");\r
e.predator.regurgitate_prepare = 0;\r
e.predator.spawnshieldtime = 0; // lose spawn shield when we vore\r
e.predator.hitsound += 1; // play this for team mates too, as we could be swallowing them to heal them\r
if(e.health > 0) // leave SOLID_NOT for dead bodies\r
e.solid = e.vore_oldsolid;\r
e.view_ofs_z = PL_VIEW_OFS_z;\r
+ e.punchvector_z = -cvar("g_balance_vore_regurgitate_prey_punchvector");\r
+\r
+ // if the prey has been fully digested, silently detach them\r
+ if(e.deadflag != DEAD_NO && e.health <= cvar("g_balance_vore_digestion_limit"))\r
+ {\r
+ e.predator = world;\r
+ e.modelindex = 0; // hide the dead body\r
+ return;\r
+ }\r
\r
// apply velocities\r
local vector oldforward, oldright, oldup;\r
regurgitate_dmg = cvar("g_balance_vore_regurgitate_damage");\r
if(cvar("g_healthsize"))\r
regurgitate_dmg *= e.scale / e.predator.scale;\r
- Damage(e.predator, e.predator, e.predator, regurgitate_dmg, DEATH_REGURGITATION, e.predator.origin, '0 0 0');\r
+ Damage(e.predator, e, e, regurgitate_dmg, DEATH_REGURGITATION, e.predator.origin, '0 0 0');\r
}\r
\r
PlayerSound(e.predator, playersound_regurgitate, CHAN_VOICE, VOICETYPE_PLAYERSOUND);\r
setanim(e.predator, e.predator.anim_pain1, FALSE, TRUE, TRUE); // looks good for swallowing / regurgitating\r
pointparticles(particleeffectnum("vore_regurgitate"), e.predator.origin, '0 0 0', 1);\r
- e.predator.punchangle_x += cvar("g_balance_vore_regurgitate_punchangle");\r
+ e.predator.punchangle_x += cvar("g_balance_vore_regurgitate_predator_punchangle");\r
e.predator.regurgitate_prepare = 0;\r
e.predator.action_delay = time + cvar("g_balance_vore_action_delay");\r
Vore_SetPreyPositions(e.predator);\r
// apply digestion to prey\r
\r
if(self.predator.deadflag != DEAD_NO) // dead predators don't digest\r
+ {\r
+ self.predator.digesting = FALSE;\r
return;\r
+ }\r
if(self.health <= cvar("g_balance_vore_digestion_limit")) // don't digest below this amount of health\r
return;\r
\r
float taunt_time;\r
\r
// predator taunts\r
- if(self.stomach_load && !Stomach_TeamMates_check(self) && Stomach_HasLivePrey(self))\r
+ if((self.swallow_progress_pred || (self.stomach_load && Stomach_HasLivePrey(self))) && !Stomach_TeamMates_check(self))\r
{\r
if(!self.taunt_soundtime) // taunt_soundtime becomes 0 once the taunt has played\r
{\r
}\r
\r
// prey taunts\r
- if(self.stat_eaten && !(teams_matter && self.team == self.predator.team) && self.deadflag == DEAD_NO)\r
+ if((self.swallow_progress_prey || (self.stat_eaten && !(teams_matter && self.team == self.predator.team))) && self.deadflag == DEAD_NO)\r
{\r
if(!self.taunt_soundtime) // taunt_soundtime becomes 0 once the taunt has played\r
{\r
\r
// do we stick around inside dead furries? x_x\r
if(self.predator.deadflag != DEAD_NO)\r
- if(!cvar("g_balance_vore_deadpredator") || !self.predator.modelindex) // if the predator is gibbed, we are out\r
{\r
- Vore_Regurgitate(self);\r
- return;\r
+ if(!cvar("g_balance_vore_deadpredator") || !self.predator.modelindex) // if the predator is gibbed, we are out\r
+ {\r
+ Vore_Regurgitate(self);\r
+ return;\r
+ }\r
+ if(self.predator.regurgitate_prepare) // abort scheduled regurgitation\r
+ self.predator.regurgitate_prepare = 0;\r
}\r
\r
if(self.predator.stomach_load > self.predator.stomach_maxload) // the predator got beyond his capacity after eating, so some prey must pop out\r
// Ugly workaround for a Keyhunt issue. Your team's key can still be given to you while in the stomach\r
// (at round start), which is pretty ugly and wrong. So attempt to drop keys each frame for prey\r
kh_Key_DropAll(self, FALSE);\r
+\r
+ // always position camera at the center of the stomach, to reduce probability of the view poking out\r
+ self.view_ofs_z = PL_PREY_VIEW_OFS_z * self.predator.scale;\r
}
\ No newline at end of file