X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=data%2Fqcsrc%2Fserver%2Fcl_player.qc;h=829a6501b777bf234d15110d7ad8a240b123fef3;hb=80e531b34bc8354b0eb9c55a94dbc41643dea27f;hp=401c8082e9fbb19e574b84697765d97b5aca64dd;hpb=e3809e5f58cb6427a43cbd18d8f5e415248e3e7c;p=voretournament%2Fvoretournament.git diff --git a/data/qcsrc/server/cl_player.qc b/data/qcsrc/server/cl_player.qc index 401c8082..829a6501 100644 --- a/data/qcsrc/server/cl_player.qc +++ b/data/qcsrc/server/cl_player.qc @@ -114,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; @@ -143,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; @@ -245,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) { @@ -282,20 +284,12 @@ 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) { - // if this is the stomach model (or any model that can't be animated), don't attempt to animate - if(substring(self.model, strlen(self.model) - 3, 3) == "md3") // check model extension - return; - updateanim(self); if (self.weaponentity) updateanim(self.weaponentity); @@ -316,7 +310,18 @@ void player_anim (void) if (!self.animstate_override) { - if (!(self.flags & FL_ONGROUND)) + if(self.swallow_progress_pred) + setanim(self, self.anim_duckjump, TRUE, FALSE, FALSE); // looks good for predators who are swallowing + else if(self.swallow_progress_prey) + setanim(self, self.anim_die2, FALSE, FALSE, FALSE); // looks good for prey who's getting swallowed + else 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); @@ -358,7 +363,16 @@ void player_anim (void) if (self.weaponentity) if (!self.weaponentity.animstate_override) - setanim(self.weaponentity, self.weaponentity.anim_idle, TRUE, FALSE, FALSE); + { + if(self.swallow_progress_pred) + setanim(self.weaponentity, self.weaponentity.anim_fire2, TRUE, FALSE, FALSE); // looks good for predators who are swallowing + else if(self.swallow_progress_prey) + setanim(self.weaponentity, self.weaponentity.anim_reload, TRUE, FALSE, FALSE); // looks good for prey who's getting swallowed + else if(self.stat_eaten && self.BUTTON_ATCK) + setanim(self.weaponentity, self.weaponentity.anim_fire1, TRUE, FALSE, FALSE); // looks good for prey attacking the stomach + else + setanim(self.weaponentity, self.weaponentity.anim_idle, TRUE, FALSE, FALSE); + } } void SpawnThrownWeapon (vector org, float w, float doreduce) @@ -749,7 +763,6 @@ void ClearSelectedPlayer() } } -.float dropweapon_check; void UpdateSelectedPlayer() { entity selected; @@ -757,7 +770,7 @@ 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 @@ -1219,6 +1232,7 @@ void GlobalSound(string sample, float chan, float voicetype) { float n; float tauntrand; + float vol; if(sample == "") return; @@ -1230,6 +1244,14 @@ void GlobalSound(string sample, float chan, float voicetype) else sample = strcat(argv(0), ".wav"); // randomization + // modified volume, used for attenuated (non-radio) voices + vol = VOL_BASEVOICE; + if(self.stat_eaten && cvar("g_vore_soundocclusion")) // reduce sound volume for prey, to simulate stomach culling + vol *= cvar("g_vore_soundocclusion"); + if(cvar("g_healthsize") && cvar("g_healthsize_soundfactor")) // amplify or reduce sound volume based on the size of the player + vol *= pow(self.scale, cvar("g_healthsize_soundfactor")); + vol = bound(0, vol, 1); + switch(voicetype) { case VOICETYPE_LASTATTACKER_ONLY: @@ -1240,12 +1262,7 @@ void GlobalSound(string sample, float chan, float voicetype) if(clienttype(msg_entity) == CLIENTTYPE_REAL) { 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), ATTN_MIN); - else - soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_MIN); - } + soundto(MSG_ONE, self, chan, sample, vol, ATTN_MIN); else soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE); } @@ -1259,12 +1276,7 @@ void GlobalSound(string sample, float chan, float voicetype) if(clienttype(msg_entity) == CLIENTTYPE_REAL) { 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), ATTN_MIN); - else - soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_MIN); - } + soundto(MSG_ONE, self, chan, sample, vol, ATTN_MIN); else soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE); } @@ -1278,12 +1290,7 @@ void GlobalSound(string sample, float chan, float voicetype) if(!teams_matter || msg_entity.team == self.team) { 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), ATTN_MIN); - else - soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_MIN); - } + soundto(MSG_ONE, self, chan, sample, vol, ATTN_MIN); else soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE); } @@ -1298,15 +1305,12 @@ 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(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)); + if (msg_entity.cvar_cl_voice_directional >= 1) + soundto(MSG_ONE, self, chan, sample, vol, 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)); + soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE); } - else - soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE); break; case VOICETYPE_TAUNT: if(self.classname == "player") @@ -1319,24 +1323,16 @@ void GlobalSound(string sample, float chan, float voicetype) FOR_EACH_REALCLIENT(msg_entity) { 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)); - } + soundto(MSG_ONE, self, chan, sample, vol, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX)); else soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE); } case VOICETYPE_PLAYERSOUND: - if(self.predator.classname == "player") - sound(self, chan, sample, VOL_BASE * bound(0, cvar("g_vore_soundocclusion"), 1), ATTN_NORM); - else - sound(self, chan, sample, VOL_BASE, ATTN_NORM); + sound(self, chan, sample, vol, 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 * self.stomach_load / g_balance_vore_swallow_limit, ATTN_NORM); else stopsound(self, chan); break;