.entity swallow_model;\r
void Vore_SwallowModel_Think()\r
{\r
- //update the necessary angles to match our view\r
- //self.angles_x = self.owner.angles_x;\r
- //self.view_ofs = self.owner.view_ofs;\r
-\r
- self.view_ofs = '-1 0 0' * (0.5 - self.owner.swallow_progress_prey) * cvar("g_vore_swallowmodel_range"); // the model is centered at 0.5 progress\r
-\r
- // if our swallow progress is gone, the swallow model must also go\r
+ //update the position of the swallow model to match our swallow progress\r
+ float dist;\r
+ dist = (-0.5 + self.owner.swallow_progress_prey) * cvar("g_vore_swallowmodel_range"); // the model is centered at 0.5 progress\r
+ if(cvar("g_healthsize"))\r
+ dist *= self.scale;\r
+ self.view_ofs = '1 0 0' * dist;\r
+\r
+ // if our swallow progress is gone, the swallow model also goes\r
if(!self.owner.swallow_progress_prey)\r
{\r
remove(self.owner.swallow_model);\r
return;\r
}\r
\r
+ // properties that should update whenever possible, but when the predator is not available\r
+ self.alpha = self.owner.cvar_cl_vore_stomachmodel;\r
self.nextthink = time;\r
}\r
\r
if(!prey.swallow_model)\r
{\r
prey.swallow_model = spawn();\r
- \r
+\r
prey.swallow_model.movetype = MOVETYPE_FOLLOW;\r
prey.swallow_model.solid = SOLID_NOT;\r
\r
- prey.swallow_model.skin = self.skin;\r
- //prey.swallow_model.scale = self.scale; // FIX LATER\r
-\r
// apply the properties of the prey\r
- prey.swallow_model.viewmodelforclient = prey;\r
- prey.swallow_model.effects |= EF_NOGUNBOB;\r
- prey.swallow_model.alpha = prey.cvar_cl_vore_stomachmodel;\r
- prey.swallow_model.colormap = prey.colormap;\r
- prey.swallow_model.glowmod = prey.glowmod;\r
+ prey.swallow_model.viewmodelforclient = prey; // use the same system as the weapon model\r
+ //prey.swallow_model.effects |= EF_NOGUNBOB; // let it bob\r
+ prey.swallow_model.colormap = prey.colormap; // pants and shirt color\r
+ prey.swallow_model.glowmod = prey.glowmod; // glow color\r
\r
prey.swallow_model.owner = prey; // owned by the prey\r
prey.swallow_model.think = Vore_SwallowModel_Think;\r
prey.swallow_model.nextthink = time;\r
}\r
\r
- // if predator has changed, update the swallow model\r
- if(prey.swallow_model.enemy != self)\r
- {\r
- setmodel(prey.swallow_model, strcat(substring(self.playermodel, 0, strlen(self.playermodel) - 4), "_swallow.md3")); // 4 is the extension length\r
+ // properties that should update whenever possible, but when the predator is available\r
+ string player_swallowmodel;\r
+ player_swallowmodel = strcat(substring(self.playermodel, 0, strlen(self.playermodel) - 4), "_swallow.md3"); // 4 is the extension length\r
+ if(prey.swallow_model.model != player_swallowmodel) // player model can be changed while the predator is active\r
+ setmodel(prey.swallow_model, player_swallowmodel);\r
+ if(prey.swallow_model.skin != self.skin) // player skin can be changed while the predator is active\r
prey.swallow_model.skin = self.skin;\r
+ if(cvar("g_healthsize"))\r
+ prey.swallow_model.scale = self.scale / prey.scale; // player size difference\r
+ if(prey.swallow_model.enemy != self)\r
prey.swallow_model.enemy = self; // enemy is the predator\r
- }\r
}\r
\r
.entity pusher;\r