// 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_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
// 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