X-Git-Url: http://de.git.xonotic.org/?p=voretournament%2Fvoretournament.git;a=blobdiff_plain;f=data%2Fqcsrc%2Fserver%2Fcl_client.qc;h=94f5936c99f66a1725cb1aa3769629630b232322;hp=ae99b3632a577d3b55be5aa328c120c9a9566dae;hb=748ddc43b328660e11fb54634f3d4141074e6c1b;hpb=a84e64941a7e765f09aee5604bd7d50f0064545a diff --git a/data/qcsrc/server/cl_client.qc b/data/qcsrc/server/cl_client.qc index ae99b363..94f5936c 100644 --- a/data/qcsrc/server/cl_client.qc +++ b/data/qcsrc/server/cl_client.qc @@ -435,8 +435,16 @@ string setmodel_state() newmodel_name = substring(self.playermodel, 0, strlen(self.playermodel) - 4); newmodel_extension = substring(self.playermodel, strlen(self.playermodel) - 4, 4); - if(self.stomach_load) - applymodel = strcat(newmodel_name, "_state", ftos(floor(self.stomach_load)), newmodel_extension); + float vore_state; + if(self.stomach_load > ceil(g_balance_vore_swallow_limit * 0.6)) + vore_state = 3; + else if(self.stomach_load > ceil(g_balance_vore_swallow_limit * 0.3)) + vore_state = 2; + else if(self.stomach_load) + vore_state = 1; + + if(vore_state) + applymodel = strcat(newmodel_name, "_state", ftos(vore_state), newmodel_extension); else applymodel = self.playermodel; @@ -515,7 +523,7 @@ float Client_customizeentityforclient() // this is only visible to the prey however, otherwise players would appear as a floating stomach to everyone (ewww) stomachmodel = strcat(substring(self.playermodel, 0, strlen(self.playermodel) - 4), "_stomach.md3"); // 4 is the extension length - if(other.spectatee_status) + if(other.spectatee_status && other.spectatee_status == num_for_edict(other.enemy)) other = other.enemy; // also do this for the player we are spectating // don't do this if we have chase_active enabled, as we'd be seeing a floating stomach from third person view @@ -530,7 +538,7 @@ float Client_customizeentityforclient() Client_setmodel(setmodel_state()); if not(self.stat_eaten || self.fakeprey) self.alpha = default_player_alpha; - else if(cvar("g_vore_preydistance") && self.predator == other.predator && self != other && !(other.cvar_chase_active || other.classname == "observer")) + else if(cvar("g_vore_neighborprey_distance") && !self.fakeprey && (self.predator == other.predator || self.predator == other.fakepredator) && !(other.cvar_chase_active || other.classname == "observer")) self.alpha = default_player_alpha; // allow seeing neighboring prey else self.alpha = -1; // hide prey @@ -1035,7 +1043,15 @@ float ClientInit_SendEntity(entity to, float sf) WriteByte(MSG_ENTITY, cvar("g_balance_weaponswitchdelay") * 255.0); WriteCoord(MSG_ENTITY, cvar("g_vore")); - WriteCoord(MSG_ENTITY, cvar("g_balance_vore_swallow_limit")); + WriteCoord(MSG_ENTITY, g_balance_vore_swallow_limit); + WriteCoord(MSG_ENTITY, cvar("g_healthsize")); + + // tell the client if this server uses armor + float armor_max; + if(cvar("g_balance_armor_start") || (cvar("g_lms") && cvar("g_lms_start_armor")) /*|| (inWarmupStage && cvar("g_warmup_start_armor"))*/ || cvar("g_balance_armor_regen") || cvar("g_balance_armor_regenlinear")) + armor_max = cvar("g_balance_armor_limit"); + WriteCoord(MSG_ENTITY, armor_max); + return TRUE; } @@ -2277,30 +2293,36 @@ float vercmp(string v1, string v2) return vercmp_recursive(v1, v2); } -void ApplyHealthSize() +void SetPlayerSize() { - // change player scale based on the amount of health we have - - if not(cvar("g_healthsize")) - return; + if(cvar("g_healthsize")) + { + // change player scale based on the amount of health we have - self.scale = bound(cvar("g_healthsize_min"), self.health, cvar("g_healthsize_max")) / cvar("g_healthsize"); + self.scale = bound(cvar("g_healthsize_min"), self.health, cvar("g_healthsize_max")) / cvar("g_healthsize"); - // The following code sets the bounding box to match the player's size. - // It is currently disabled because of issues with engine movement prediction (cl_movement). - // The engine expects the bounding box to be default size, and changing it will cause glitches. - // This code may be enabled once the engine has the ability to use different bbox sizes for movement prediction. - if(self.crouch) - { - //setsize (self, PL_CROUCH_MIN * self.scale, PL_CROUCH_MAX * self.scale); - if(!self.stat_eaten) - self.view_ofs = PL_CROUCH_VIEW_OFS * self.scale; + // The following code sets the bounding box to match the player's size. + // It is currently disabled because of issues with engine movement prediction (cl_movement). + // The engine expects the bounding box to be default size, and changing it will cause glitches. + // This code may be enabled once the engine has the ability to use different bbox sizes for movement prediction. + if(self.crouch) + { + //setsize (self, PL_CROUCH_MIN * self.scale, PL_CROUCH_MAX * self.scale); + if(!self.stat_eaten) + self.view_ofs = PL_CROUCH_VIEW_OFS * self.scale; + } + else + { + //setsize (self, PL_MIN * self.scale, PL_MAX * self.scale); + if(!self.stat_eaten) + self.view_ofs = PL_VIEW_OFS * self.scale; + } } - else + + if(self.stat_eaten && cvar("g_vore_neighborprey_distance")) { - //setsize (self, PL_MIN * self.scale, PL_MAX * self.scale); - if(!self.stat_eaten) - self.view_ofs = PL_VIEW_OFS * self.scale; + // resize prey if neighborprey is enabled + self.scale *= cvar("g_vore_neighborprey_scale"); } } @@ -2492,6 +2514,29 @@ void PlayerPreThink (void) if(frametime) { + + if(self.health <= 0 && cvar("g_deathglow")) + { + if(self.glowmod_x > 0) + self.glowmod_x -= cvar("g_deathglow") * frametime; + else + self.glowmod_x = -1; + if(self.glowmod_y > 0) + self.glowmod_y -= cvar("g_deathglow") * frametime; + else + self.glowmod_y = -1; + if(self.glowmod_z > 0) + self.glowmod_z -= cvar("g_deathglow") * frametime; + else + self.glowmod_z = -1; + } + else + { + // set weapon and player glowmod + self.glowmod = colormapPaletteColor(self.clientcolors & 0x0F, TRUE) * 2; + self.weaponentity_glowmod = self.glowmod; + } + player_powerups(); } @@ -2626,7 +2671,7 @@ void PlayerPreThink (void) } } - ApplyHealthSize(); + SetPlayerSize(); FixPlayermodel();