const float steptime = 0.1;\r
const float system_delay_time = 0.1;\r
\r
-.float vore_oldmovetype, vore_oldsolid, vore_oldstomachload;\r
+.float vore_oldmovetype, vore_oldsolid, vore_oldstomachload, vore_oldview_ofs_z;\r
\r
entity Swallow_distance_check()\r
{\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
+void Vore_CameraEffect_Set(entity e)\r
+{\r
+ e.cameraeffect_current = 1;\r
+ e.cameraeffect_target = 2;\r
+}\r
+void Vore_CameraEffect_Apply()\r
+{\r
+ if(self.eater.classname != "player")\r
+ return;\r
+\r
+ local float step;\r
+ step = 2 * frametime; // CVAR!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r
+\r
+ if(self.cameraeffect_current >= self.cameraeffect_target + step)\r
+ self.cameraeffect_current -= step;\r
+ else if(self.cameraeffect_current <= self.cameraeffect_target - step)\r
+ self.cameraeffect_current += step;\r
+\r
+bprint(strcat(ftos(self.cameraeffect_current), "<<-----------\n"));\r
+ self.view_ofs_z = self.vore_oldview_ofs_z / self.cameraeffect_current;\r
+}\r
+\r
void Vore_Weight_apply(entity e)\r
{\r
// apply stomach weight that makes you heavier the more you eat\r
// this player is beening swallowed by another player, apply the proper changes\r
e.vore_oldmovetype = e.movetype;\r
e.vore_oldsolid = e.solid;\r
+ e.vore_oldview_ofs_z = e.view_ofs_z;\r
\r
setorigin(e, e.eater.origin);\r
e.velocity = '0 0 0';\r
e.solid = SOLID_NOT;\r
e.alpha = -1; // best way of hiding / showing the eaten player\r
e.aiment = e.eater; // follow the predator. Is automatically unset\r
- e.view_ofs_z /= 2; // best positioning for the stomach model\r
+\r
+ /*e.cameraeffect_current = e.view_ofs_z * 2;\r
+ e.cameraeffect_target = e.view_ofs_z / 2; // best positioning for the stomach model*/\r
+\r
+ Vore_CameraEffect_Set(e);\r
\r
// drop keys (KH) and flags (CTF) when we get swallowed\r
kh_Key_DropAll(e, FALSE);\r
e.movetype = e.vore_oldmovetype;\r
if(e.health > 0) // leave SOLID_NOT for dead bodies\r
e.solid = e.vore_oldsolid;\r
+ e.view_ofs_z = e.vore_oldview_ofs_z;\r
e.alpha = default_player_alpha; // best way of hiding / showing the eaten player\r
- e.view_ofs_z *= 2; // best positioning for the stomach model\r
+\r
+ //e.view_ofs_z *= 2; // best positioning for the stomach model\r
\r
// velocities\r
local vector oldforward, oldright, oldup;\r
Vore_Teamheal();\r
\r
Vore_StomachKick();\r
+\r
+ Vore_CameraEffect_Apply();\r
}
\ No newline at end of file