X-Git-Url: http://de.git.xonotic.org/?p=voretournament%2Fvoretournament.git;a=blobdiff_plain;f=data%2Fqcsrc%2Fserver%2Fcl_player.qc;h=430d6655b9c7f692343153dfcae2031ea690c0a2;hp=740cc6a9ee6a6b5042843fcf20e1e63c19af77a5;hb=e79a9bac1c149bc0f0488f33508007586a8cb9af;hpb=4cc6f1abbe551cfb21566994f05de77ee154f1ec diff --git a/data/qcsrc/server/cl_player.qc b/data/qcsrc/server/cl_player.qc index 740cc6a9..430d6655 100644 --- a/data/qcsrc/server/cl_player.qc +++ b/data/qcsrc/server/cl_player.qc @@ -104,7 +104,9 @@ void WeaponStats_LogKill(float awep, float vwep) void CopyBody(float keepvelocity) { local entity oldself; - if (self.effects & EF_NODRAW) + if (self.fakeprey) + return; + if (self.effects & EF_NODRAW || self.alpha < 0) return; oldself = self; self = spawn(); @@ -112,6 +114,7 @@ void CopyBody(float keepvelocity) self.lip = oldself.lip; self.colormap = oldself.colormap; self.colormod = oldself.colormod; + self.glowmod = oldself.glowmod; self.iscreature = oldself.iscreature; self.angles = oldself.angles; self.avelocity = oldself.avelocity; @@ -141,6 +144,7 @@ void CopyBody(float keepvelocity) self.solid = oldself.solid; self.takedamage = oldself.takedamage; self.think = oldself.think; + self.scale = oldself.scale; self.customizeentityforclient = oldself.customizeentityforclient; self.uncustomizeentityforclient = oldself.uncustomizeentityforclient; self.uncustomizeentityforclient_set = oldself.uncustomizeentityforclient_set; @@ -243,7 +247,7 @@ void player_setupanimsformodel() self.anim_backright = '21 1 1'; self.anim_backleft = '22 1 1'; animparseerror = FALSE; - animfilename = strcat(self.model, ".animinfo"); + animfilename = strcat(self.playermodel, ".animinfo"); // only the normal player model may contain animation info animfile = fopen(animfilename, FILE_READ); if (animfile >= 0) { @@ -280,12 +284,8 @@ void player_setupanimsformodel() else dprint("File ", animfilename, " not found, assuming legacy .zym model animation timings\n"); - // the line below is disabled due to issues with the stomach model, which cannot be animated. - // customizeentityforclient cannot let this part of the code know whether it's the stomach model or normal - // player model we're using. Attempting to animate the stomach model causes BIG issues, and must not be allowed. - // reset animstate now - //setanim(self, self.anim_idle, TRUE, FALSE, TRUE); + setanim(self, self.anim_idle, TRUE, FALSE, TRUE); }; void player_anim (void) @@ -310,7 +310,14 @@ void player_anim (void) if (!self.animstate_override) { - if (!(self.flags & FL_ONGROUND)) + if(self.stat_eaten) + { + if(self.BUTTON_ATCK || self.predator.digesting) + setanim(self, self.anim_pain2, FALSE, TRUE, FALSE); // looks good for prey attacking the stomach or being digested + else + setanim(self, self.anim_jump, FALSE, TRUE, FALSE); // looks good for prey idling inside the stomach + } + else if (!(self.flags & FL_ONGROUND)) { if (self.crouch) setanim(self, self.anim_duckjump, FALSE, TRUE, self.restart_jump); @@ -355,9 +362,9 @@ void player_anim (void) setanim(self.weaponentity, self.weaponentity.anim_idle, TRUE, FALSE, FALSE); } -void SpawnThrownWeapon (vector org, float w) +void SpawnThrownWeapon (vector org, float w, float doreduce) { - W_ThrowWeapon(randomvec() * 125 + '0 0 200', org - self.origin, FALSE); + W_ThrowWeapon(randomvec() * 125 + '0 0 200', org - self.origin, doreduce); } void PlayerCorpseDamage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force) @@ -393,13 +400,14 @@ void PlayerCorpseDamage (entity inflictor, entity attacker, float damage, float self.armorvalue = self.armorvalue - save; self.health = self.health - take; // pause regeneration for 5 seconds - self.pauseregen_finished = max(self.pauseregen_finished, time + cvar("g_balance_pause_health_regen")); + self.pauseregenhealth_finished = max(self.pauseregenhealth_finished, time + cvar("g_balance_pause_health_regen")); + self.pauseregenarmor_finished = max(self.pauseregenarmor_finished, time + cvar("g_balance_pause_armor_regen")); } self.dmg_save = self.dmg_save + save;//max(save - 10, 0); self.dmg_take = self.dmg_take + take;//max(take - 10, 0); self.dmg_inflictor = inflictor; - if (self.health <= -75 && self.modelindex != 0) + if (self.health <= -cvar("sv_gibhealth") && self.modelindex != 0) { // don't use any animations as a gib self.frame = 0; @@ -470,7 +478,8 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht self.armorvalue = self.armorvalue - save; self.health = self.health - take; // pause regeneration for 5 seconds - self.pauseregen_finished = max(self.pauseregen_finished, time + cvar("g_balance_pause_health_regen")); + self.pauseregenhealth_finished = max(self.pauseregenhealth_finished, time + cvar("g_balance_pause_health_regen")); + self.pauseregenarmor_finished = max(self.pauseregenarmor_finished, time + cvar("g_balance_pause_armor_regen")); if (time > self.pain_finished) //Don't switch pain sequences like crazy { @@ -486,14 +495,17 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht } if(sound_allowed(MSG_BROADCAST, attacker)) + if(self.health > 1) { - if(self.health > 75) // TODO make a "gentle" version? + if(deathtype == DEATH_FALL) + PlayerSound(self, playersound_fall, CHAN_PAIN, VOICETYPE_PLAYERSOUND); + else if(self.health > 75) // TODO make a "gentle" version? PlayerSound(self, playersound_pain100, CHAN_PAIN, VOICETYPE_PLAYERSOUND); else if(self.health > 50) PlayerSound(self, playersound_pain75, CHAN_PAIN, VOICETYPE_PLAYERSOUND); else if(self.health > 25) PlayerSound(self, playersound_pain50, CHAN_PAIN, VOICETYPE_PLAYERSOUND); - else if(self.health > 1) + else PlayerSound(self, playersound_pain25, CHAN_PAIN, VOICETYPE_PLAYERSOUND); } } @@ -586,7 +598,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht // clear selected player display ClearSelectedPlayer(); // throw a weapon - SpawnThrownWeapon (self.origin + (self.mins + self.maxs) * 0.5, self.switchweapon); + SpawnThrownWeapon (self.origin + (self.mins + self.maxs) * 0.5, self.switchweapon, FALSE); // print an obituary message Obituary (attacker, inflictor, self, deathtype); race_PreDie(); @@ -738,7 +750,6 @@ void ClearSelectedPlayer() } } -.float dropweapon_check; void UpdateSelectedPlayer() { entity selected; @@ -746,12 +757,12 @@ void UpdateSelectedPlayer() selected = world; selected_score = 0.95; // 18 degrees - if(self.predator.classname == "player") + if(self.stat_eaten) { if(!self.dropweapon_check) if(self.predator.team != self.team) // don't disarm team mates when swallowing them if(random() < cvar("g_balance_vore_swallow_dropweapon")) - SpawnThrownWeapon (self.origin + (self.mins + self.maxs) * 0.5, self.switchweapon); + SpawnThrownWeapon (self.origin + (self.mins + self.maxs) * 0.5, self.switchweapon, TRUE); self.dropweapon_check = TRUE; } else @@ -1230,7 +1241,7 @@ void GlobalSound(string sample, float chan, float voicetype) { if(msg_entity.cvar_cl_voice_directional == 1) { - if(self.predator.classname == "player") + if(self.stat_eaten) soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE * bound(0, cvar("g_vore_soundocclusion"), 1), ATTN_MIN); else soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_MIN); @@ -1249,7 +1260,7 @@ void GlobalSound(string sample, float chan, float voicetype) { if(msg_entity.cvar_cl_voice_directional == 1) { - if(self.predator.classname == "player") + if(self.stat_eaten) soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE * bound(0, cvar("g_vore_soundocclusion"), 1), ATTN_MIN); else soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_MIN); @@ -1268,7 +1279,7 @@ void GlobalSound(string sample, float chan, float voicetype) { if(msg_entity.cvar_cl_voice_directional == 1) { - if(self.predator.classname == "player") + if(self.stat_eaten) soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE * bound(0, cvar("g_vore_soundocclusion"), 1), ATTN_MIN); else soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_MIN); @@ -1287,17 +1298,15 @@ void GlobalSound(string sample, float chan, float voicetype) tauntrand = random(); FOR_EACH_REALCLIENT(msg_entity) if (tauntrand < msg_entity.cvar_cl_autotaunt) + if (msg_entity.cvar_cl_voice_directional >= 1) { - if (msg_entity.cvar_cl_voice_directional >= 1) - { - if(self.predator.classname == "player") - 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)); - else - soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX)); - } + if(self.stat_eaten) + 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)); else - soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE); + soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX)); } + else + soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE); break; case VOICETYPE_TAUNT: if(self.classname == "player") @@ -1311,7 +1320,7 @@ void GlobalSound(string sample, float chan, float voicetype) { if (msg_entity.cvar_cl_voice_directional >= 1) { - if(self.predator.classname == "player") + if(self.stat_eaten) 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)); else soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX)); @@ -1320,14 +1329,14 @@ void GlobalSound(string sample, float chan, float voicetype) soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE); } case VOICETYPE_PLAYERSOUND: - if(self.predator.classname == "player") + if(self.stat_eaten) sound(self, chan, sample, VOL_BASE * bound(0, cvar("g_vore_soundocclusion"), 1), ATTN_NORM); else sound(self, chan, sample, VOL_BASE, ATTN_NORM); break; case VOICETYPE_GURGLE: if(self.stomach_load) - sound(self, chan, sample, VOL_BASE * self.stomach_load / cvar("g_balance_vore_swallow_limit"), ATTN_NORM); + sound(self, chan, sample, VOL_BASE * self.stomach_load / g_balance_vore_swallow_limit, ATTN_NORM); else stopsound(self, chan); break;