X-Git-Url: http://de.git.xonotic.org/?p=voretournament%2Fvoretournament.git;a=blobdiff_plain;f=data%2Fqcsrc%2Fserver%2Fcl_client.qc;h=1ccdea5c979a0f7f2168529e268f87062dd8851e;hp=e954308e523c636d7ef7e5437c5c73130e720f5e;hb=a6f57a21ea80fc05fca7cc7052892a2477fa80c8;hpb=41fe018e5301b2fa1886224ef84ec3a9e2062ed7 diff --git a/data/qcsrc/server/cl_client.qc b/data/qcsrc/server/cl_client.qc index e954308e..1ccdea5c 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_neighborprey_distance") && 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 @@ -832,6 +840,7 @@ void PutClientInServer (void) Vore_DeadPrey_Detach(self); self.fakeprey = FALSE; // clear the fakeprey status + self.swallow_progress_pred = self.swallow_progress_prey = 0; self.classname = "player"; self.wasplayer = TRUE; @@ -1030,12 +1039,27 @@ float ClientInit_SendEntity(entity to, float sf) WriteString(MSG_ENTITY, world.fog); else WriteString(MSG_ENTITY, ""); - WriteCoord(MSG_ENTITY, cvar("g_campaign")); + WriteShort(MSG_ENTITY, cvar("g_campaign")); WriteByte(MSG_ENTITY, cvar("g_balance_armor_blockpercent") * 255.0); WriteByte(MSG_ENTITY, cvar("g_balance_weaponswitchdelay") * 255.0); - WriteCoord(MSG_ENTITY, cvar("g_vore")); - WriteCoord(MSG_ENTITY, cvar("g_balance_vore_swallow_limit")); + WriteShort(MSG_ENTITY, cvar("g_vore")); + WriteShort(MSG_ENTITY, g_balance_vore_swallow_limit); + WriteShort(MSG_ENTITY, cvar("g_healthsize")); + WriteShort(MSG_ENTITY, cvar("g_healthsize_min")); + WriteShort(MSG_ENTITY, cvar("g_healthsize_max")); + + // 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); + + float teamheal_max; + if(cvar("g_vore") && cvar("g_vore_teamvore") && cvar("g_balance_vore_teamheal")) + teamheal_max = cvar("g_balance_vore_teamheal_stable"); + WriteCoord(MSG_ENTITY, teamheal_max); + return TRUE; } @@ -1437,8 +1461,7 @@ void ClientConnect (void) ctf_clientconnect(); }*/ - if(teams_matter || radar_showennemies) - attach_entcs(); + attach_entcs(); bot_relinkplayerlist(); @@ -1519,7 +1542,6 @@ Called when a client disconnects from the server ============= */ .entity chatbubbleentity; -.entity teambubbleentity; void ReadyCount(); void ClientDisconnect (void) { @@ -1567,9 +1589,6 @@ void ClientDisconnect (void) if (self.chatbubbleentity) remove (self.chatbubbleentity); - if (self.teambubbleentity) - remove (self.teambubbleentity); - if (self.killindicator) remove (self.killindicator); @@ -1646,57 +1665,6 @@ void UpdateChatBubble() } } -void TeamBubbleThink() -{ - self.nextthink = time; - if (!self.owner.modelindex || self.owner.teambubbleentity != self) - { - if(self.owner) // but why can that ever be world? - self.owner.teambubbleentity = world; - remove(self); - return; - } -// setorigin(self, self.owner.origin + '0 0 15' + self.owner.maxs_z * '0 0 1'); // bandwidth hog. setattachment does this now - if (self.owner.BUTTON_CHAT || self.owner.deadflag || self.owner.killindicator || self.owner.stat_eaten) - self.model = ""; - else - { - if(cvar("g_balance_vore_teamheal") && cvar("g_vore_teamvore")) - if(self.owner.health < cvar("g_balance_vore_teamheal_stable")) - setmodel(self, "models/misc/teambubbleheal.spr"); // indicate that this player can be teamhealed - else - setmodel(self, "models/misc/teambubble.spr"); - } -}; - -float TeamBubble_customizeentityforclient() -{ - return (self.owner != other && self.owner.team == other.team && other.killcount > -666); -} - -void UpdateTeamBubble() -{ - if (!self.modelindex || !teams_matter) - return; - // spawn a teambubble entity if needed - if (!self.teambubbleentity && teams_matter) - { - self.teambubbleentity = spawn(); - self.teambubbleentity.owner = self; - self.teambubbleentity.exteriormodeltoclient = self; - self.teambubbleentity.think = TeamBubbleThink; - self.teambubbleentity.nextthink = time; - setmodel(self.teambubbleentity, "models/misc/teambubble.spr"); // precision set below -// setorigin(self.teambubbleentity, self.origin + '0 0 15' + self.maxs_z * '0 0 1'); - setorigin(self.teambubbleentity, '0 0 15' + self.maxs_z * '0 0 1'); - setattachment(self.teambubbleentity, self, ""); // sticks to moving player better, also conserves bandwidth -// self.teambubbleentity.mdl = self.teambubbleentity.model; -// self.teambubbleentity.model = self.teambubbleentity.mdl; - self.teambubbleentity.customizeentityforclient = TeamBubble_customizeentityforclient; - self.teambubbleentity.effects = EF_LOWPRECISION; - } -} - // LordHavoc: this hack will be removed when proper _pants/_shirt layers are // added to the model skins /*void UpdateColorModHack() @@ -2277,30 +2245,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 +2466,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 +2623,7 @@ void PlayerPreThink (void) } } - ApplyHealthSize(); + SetPlayerSize(); FixPlayermodel(); @@ -2831,7 +2828,6 @@ void PlayerPostThink (void) if(self.classname == "player") { CheckRules_Player(); UpdateChatBubble(); - UpdateTeamBubble(); if (self.impulse) ImpulseCommands(); if (intermission_running)