void CopyBody(float keepvelocity)\r
{\r
local entity oldself;\r
- if (self.effects & EF_NODRAW)\r
+ if (self.fakeprey)\r
+ return;\r
+ if (self.effects & EF_NODRAW || self.alpha < 0)\r
return;\r
oldself = self;\r
self = spawn();\r
self.solid = oldself.solid;\r
self.takedamage = oldself.takedamage;\r
self.think = oldself.think;\r
+ self.scale = oldself.scale;\r
self.customizeentityforclient = oldself.customizeentityforclient;\r
self.uncustomizeentityforclient = oldself.uncustomizeentityforclient;\r
self.uncustomizeentityforclient_set = oldself.uncustomizeentityforclient_set;\r
self.anim_backright = '21 1 1';\r
self.anim_backleft = '22 1 1';\r
animparseerror = FALSE;\r
- animfilename = strcat(self.model, ".animinfo");\r
+ animfilename = strcat(self.playermodel, ".animinfo"); // only the normal player model may contain animation info\r
animfile = fopen(animfilename, FILE_READ);\r
if (animfile >= 0)\r
{\r
else\r
dprint("File ", animfilename, " not found, assuming legacy .zym model animation timings\n");\r
\r
- // the line below is disabled due to issues with the stomach model, which cannot be animated.\r
- // customizeentityforclient cannot let this part of the code know whether it's the stomach model or normal\r
- // player model we're using. Attempting to animate the stomach model causes BIG issues, and must not be allowed.\r
-\r
// reset animstate now\r
- //setanim(self, self.anim_idle, TRUE, FALSE, TRUE);\r
+ setanim(self, self.anim_idle, TRUE, FALSE, TRUE);\r
};\r
\r
void player_anim (void)\r
\r
if (!self.animstate_override)\r
{\r
- if (!(self.flags & FL_ONGROUND))\r
+ if(self.stat_eaten)\r
+ {\r
+ if(self.BUTTON_ATCK)\r
+ setanim(self, self.anim_duckjump, FALSE, TRUE, FALSE); // looks good for players attempting to attack the stomach\r
+ else\r
+ setanim(self, self.anim_jump, FALSE, TRUE, FALSE); // looks good for players idling inside the stomach\r
+ }\r
+ else if (!(self.flags & FL_ONGROUND))\r
{\r
if (self.crouch)\r
setanim(self, self.anim_duckjump, FALSE, TRUE, self.restart_jump);\r
setanim(self.weaponentity, self.weaponentity.anim_idle, TRUE, FALSE, FALSE);\r
}\r
\r
-void SpawnThrownWeapon (vector org, float w)\r
+void SpawnThrownWeapon (vector org, float w, float doreduce)\r
{\r
- W_ThrowWeapon(randomvec() * 125 + '0 0 200', org - self.origin, FALSE);\r
+ W_ThrowWeapon(randomvec() * 125 + '0 0 200', org - self.origin, doreduce);\r
}\r
\r
void PlayerCorpseDamage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)\r
self.armorvalue = self.armorvalue - save;\r
self.health = self.health - take;\r
// pause regeneration for 5 seconds\r
- self.pauseregen_finished = max(self.pauseregen_finished, time + cvar("g_balance_pause_health_regen"));\r
+ self.pauseregenhealth_finished = max(self.pauseregenhealth_finished, time + cvar("g_balance_pause_health_regen"));\r
+ self.pauseregenarmor_finished = max(self.pauseregenarmor_finished, time + cvar("g_balance_pause_armor_regen"));\r
}\r
self.dmg_save = self.dmg_save + save;//max(save - 10, 0);\r
self.dmg_take = self.dmg_take + take;//max(take - 10, 0);\r
self.dmg_inflictor = inflictor;\r
\r
- if (self.health <= -75 && self.modelindex != 0)\r
+ if (self.health <= -cvar("sv_gibhealth") && self.modelindex != 0)\r
{\r
// don't use any animations as a gib\r
self.frame = 0;\r
self.armorvalue = self.armorvalue - save;\r
self.health = self.health - take;\r
// pause regeneration for 5 seconds\r
- self.pauseregen_finished = max(self.pauseregen_finished, time + cvar("g_balance_pause_health_regen"));\r
+ self.pauseregenhealth_finished = max(self.pauseregenhealth_finished, time + cvar("g_balance_pause_health_regen"));\r
+ self.pauseregenarmor_finished = max(self.pauseregenarmor_finished, time + cvar("g_balance_pause_armor_regen"));\r
\r
if (time > self.pain_finished) //Don't switch pain sequences like crazy\r
{\r
}\r
\r
if(sound_allowed(MSG_BROADCAST, attacker))\r
+ if(self.health > 1)\r
{\r
- if(self.health > 75) // TODO make a "gentle" version?\r
+ if(deathtype == DEATH_FALL)\r
+ PlayerSound(self, playersound_fall, CHAN_PAIN, VOICETYPE_PLAYERSOUND);\r
+ else if(self.health > 75) // TODO make a "gentle" version?\r
PlayerSound(self, playersound_pain100, CHAN_PAIN, VOICETYPE_PLAYERSOUND);\r
else if(self.health > 50)\r
PlayerSound(self, playersound_pain75, CHAN_PAIN, VOICETYPE_PLAYERSOUND);\r
else if(self.health > 25)\r
PlayerSound(self, playersound_pain50, CHAN_PAIN, VOICETYPE_PLAYERSOUND);\r
- else if(self.health > 1)\r
+ else\r
PlayerSound(self, playersound_pain25, CHAN_PAIN, VOICETYPE_PLAYERSOUND);\r
}\r
}\r
// clear selected player display\r
ClearSelectedPlayer();\r
// throw a weapon\r
- SpawnThrownWeapon (self.origin + (self.mins + self.maxs) * 0.5, self.switchweapon);\r
+ SpawnThrownWeapon (self.origin + (self.mins + self.maxs) * 0.5, self.switchweapon, FALSE);\r
// print an obituary message\r
Obituary (attacker, inflictor, self, deathtype);\r
race_PreDie();\r
}\r
}\r
\r
-.float dropweapon_check;\r
void UpdateSelectedPlayer()\r
{\r
entity selected;\r
selected = world;\r
selected_score = 0.95; // 18 degrees\r
\r
- if(self.eater.classname == "player")\r
+ if(self.stat_eaten)\r
{\r
if(!self.dropweapon_check)\r
- if(self.eater.team != self.team) // don't disarm team mates when swallowing them\r
- if(random() < cvar("g_vore_dropweapon"))\r
- SpawnThrownWeapon (self.origin + (self.mins + self.maxs) * 0.5, self.switchweapon);\r
+ if(self.predator.team != self.team) // don't disarm team mates when swallowing them\r
+ if(random() < cvar("g_balance_vore_swallow_dropweapon"))\r
+ SpawnThrownWeapon (self.origin + (self.mins + self.maxs) * 0.5, self.switchweapon, TRUE);\r
self.dropweapon_check = TRUE;\r
}\r
else\r
{\r
if(msg_entity.cvar_cl_voice_directional == 1)\r
{\r
- if(self.eater.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.eater.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.eater.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
tauntrand = random();\r
FOR_EACH_REALCLIENT(msg_entity)\r
if (tauntrand < msg_entity.cvar_cl_autotaunt)\r
+ if (msg_entity.cvar_cl_voice_directional >= 1)\r
{\r
- if (msg_entity.cvar_cl_voice_directional >= 1)\r
- {\r
- if(self.eater.classname == "player")\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(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, ATTN_NONE);\r
+ soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX));\r
}\r
+ else\r
+ soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE);\r
break;\r
case VOICETYPE_TAUNT:\r
if(self.classname == "player")\r
{\r
if (msg_entity.cvar_cl_voice_directional >= 1)\r
{\r
- if(self.eater.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.eater.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