From: MirceaKitsune Date: Tue, 2 Aug 2011 13:05:53 +0000 (+0300) Subject: Make the shrink dead prey cvar part of g_healthsize_* and dependent on it X-Git-Url: http://git.xonotic.org/?a=commitdiff_plain;h=7a0d6e670b21c62f976702cc87a345baaf2b222e;p=voretournament%2Fvoretournament.git Make the shrink dead prey cvar part of g_healthsize_* and dependent on it --- diff --git a/data/balanceVT.cfg b/data/balanceVT.cfg index f8f5f927..e454f823 100644 --- a/data/balanceVT.cfg +++ b/data/balanceVT.cfg @@ -218,7 +218,6 @@ set g_balance_vore_digestion_vampire 0.2 "amount of health you gain from digesti set g_balance_vore_digestion_vampire_stable 150 "maximum amount of health you can gain from digestion (best kept equal or less than g_balance_health_rotstable)" set g_balance_vore_digestion_distribute 1 "if enabled, digestion is reduced by the amount of prey you have. eg: having 2 prey will reduce digestion strength by 2" set g_balance_vore_digestion_scalediff 0.5 "if enabled, digestion damage is affected by the size of the predator compared to the size of the prey by this amount" -set g_balance_vore_digestion_shrinkdeadprey 0.5 "dead prey will be shrunken by this amount, the closer it gets to the digestion limit" set g_balance_vore_teamheal 1 "when enabled, having a team mate in your stomach will keep healing them by this amount" set g_balance_vore_teamheal_stable 150 "maximum amount of health you can gain from a teamheal (best kept equal or less than g_balance_health_rotstable)" set g_balance_vore_kick_damage 30 "amount of damage you can do during stomach kick" diff --git a/data/defaultVT.cfg b/data/defaultVT.cfg index 6248ad48..18ca1536 100644 --- a/data/defaultVT.cfg +++ b/data/defaultVT.cfg @@ -1611,6 +1611,7 @@ set g_healthsize_soundfactor 0.5 "The sounds players make are amplified or reduc set g_healthsize_exteriorweapon_scalefactor 1 "Amount by which player size resizes the exterior weapon model" set g_healthsize_weapon_scalefactor 1 "Amount by which player size resizes the view weapon model" set g_healthsize_weapon_scalefactor_pos 10 "Amount by which the view model is moved vertically based on player size" +set g_healthsize_vore_shrinkdeadprey 0.5 "Dead prey will be shrunken by this amount, the closer it gets to the digestion limit" set g_healthsize_vore_pos 1 "Amount by which view height changes for prey, based on the size difference between them and their predator" set g_healthsize_min 50 "Player size may not drop below this amount of health" set g_healthsize_max 150 "Player size may not grow past this amount of health" diff --git a/data/qcsrc/server/cl_client.qc b/data/qcsrc/server/cl_client.qc index 674cce3c..dc48db11 100644 --- a/data/qcsrc/server/cl_client.qc +++ b/data/qcsrc/server/cl_client.qc @@ -2312,39 +2312,40 @@ float vercmp(string v1, string v2) void SetPlayerSize() { + if(!cvar("g_healthsize")) + { + self.scale = 0; + return; + } // don't scale dead players who aren't prey if(!self.stat_eaten && self.deadflag != DEAD_NO) 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"); + // 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"); - // 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; - } + // 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; } - if(cvar("g_balance_vore_digestion_shrinkdeadprey") && cvar("g_balance_vore_digestion_limit") < 0) + if(cvar("g_healthsize_vore_shrinkdeadprey") && cvar("g_balance_vore_digestion_limit") < 0) if(self.deadflag != DEAD_NO && self.stat_eaten) { // dead prey must shrink toward zero as they digest, until they reach digestion limit - self.scale *= 1 - bound(0, (self.health / cvar("g_balance_vore_digestion_limit")) * cvar("g_balance_vore_digestion_shrinkdeadprey"), 1); + self.scale *= 1 - bound(0, (self.health / cvar("g_balance_vore_digestion_limit")) * cvar("g_healthsize_vore_shrinkdeadprey"), 1); } if(self.scale < 0.1)