]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Fix how weight is calculated and applied
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 18 Jul 2011 11:10:05 +0000 (14:10 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 18 Jul 2011 11:10:05 +0000 (14:10 +0300)
data/qcsrc/server/bot/havocbot/vore_ai.qc
data/qcsrc/server/cl_physics.qc
data/qcsrc/server/vore.qc

index c3d1c1bdc93c037ea36b74cd19d920c50f236f12..7c35ff944e003894938f6318019af41659d696bf 100644 (file)
@@ -141,9 +141,9 @@ void Vore_AI()
                if(!cvar("g_vore_reversescoring")) // when reverse scoring is on, it's in the interest of the prey to get eaten, so the predator has nothing to fear
                {
                        if(skill >= 3) // make bots aware of this from skill 3 and up
-                               fear *= 1 + self.stomach_maxload / self.stomach_load; // the bigger our stomach, the less we want to put someone else in there
+                               fear *= 1 + self.stomach_load / self.stomach_maxload; // the bigger our stomach, the less we want to put someone else in there
                        if(skill >= 5) // make bots aware of this from skill 5 and up
-                               fear *= 1 + prey.stomach_maxload / prey.stomach_load; // predators fear prey that have a large stomach
+                               fear *= 1 + prey.stomach_load / prey.stomach_maxload; // predators fear prey that have a large stomach
 
                        if(cvar("g_healthsize"))
                                fear *= (prey.scale / self.scale); // predators fear larger prey and are courageous toward smaller prey
index e3dbb61ab99903c10448a153220ceff425a17e65..ba186cbb8471cc873be3d7139474da488625b44e 100644 (file)
@@ -508,7 +508,7 @@ void PM_Accelerate(vector wishdir, float wishspeed, float wishspeed0, float acce
                accelqw = -accelqw;\r
 \r
        if(cvar("g_balance_vore_load_pred_weight") > 0) // apply stomach weight\r
-               wishspeed *= 1 - bound(0, self.stomach_maxload / self.stomach_load * cvar("g_balance_vore_load_pred_speed"), 1);\r
+               wishspeed *= 1 - bound(0, self.stomach_load / self.stomach_maxload * cvar("g_balance_vore_load_pred_speed"), 1);\r
        if(cvar("g_healthsize")) // if we are smaller or larger, we run slower or faster\r
                wishspeed *= (1 - cvar("g_healthsize_movementfactor")) + cvar("g_healthsize_movementfactor") * self.scale; \r
        if(self.swallow_progress_prey) // cut speed based on swallow progress for prey\r
index a683fc659539230f30f258d5054e129360196b5c..b8c84850df758e17f55717ad4a47f0bc828e3719 100644 (file)
@@ -40,7 +40,7 @@ float Swallow_condition_check(entity prey)
        if(prey.classname == "player" && !prey.stat_eaten && prey.deadflag == DEAD_NO) // we can't swallow someone who's already in someone else's stomach\r
        if(self.classname == "player" && !self.stat_eaten && self.deadflag == DEAD_NO) // we can't swallow players while inside someone's stomach ourselves\r
        if(!self.BUTTON_REGURGITATE && time > self.action_delay)\r
-       if not(vlen(self.velocity) > cvar("g_balance_vore_load_pred_speedcap") / (1 + self.stomach_load))\r
+       if not(vlen(self.velocity) > cvar("g_balance_vore_load_pred_speedcap") / (self.stomach_maxload / self.stomach_load))\r
        {\r
                string swallow_complain;\r
                if(teams_matter && prey.team == self.team && !cvar("g_vore_teamvore"))\r
@@ -191,7 +191,7 @@ void Vore_WeightApply(entity e)
        // slowing the player is done in cl_physics.qc\r
 \r
        if(e.stomach_load != e.vore_oldstomachload)\r
-               e.gravity += 1 + (e.stomach_maxload / e.stomach_load * cvar("g_balance_vore_load_pred_weight") - e.vore_oldstomachload);\r
+               e.gravity += 1 + (e.stomach_load / e.stomach_maxload * cvar("g_balance_vore_load_pred_weight") - e.vore_oldstomachload);\r
        if(e.gravity == 0)\r
                e.gravity = 0.00001; // 0 becomes 1 for gravity, so do this to allow 0 gravity\r
        e.vore_oldstomachload = e.stomach_load;\r
@@ -883,7 +883,7 @@ void Vore()
 \r
        if(self.predator.deadflag != DEAD_NO)\r
                Vore_Regurgitate(self);\r
-       else if(vlen(self.predator.velocity) > cvar("g_balance_vore_load_pred_speedcap") / (1 + self.predator.stomach_load))\r
+       else if(vlen(self.predator.velocity) > cvar("g_balance_vore_load_pred_speedcap") / (self.stomach_maxload / self.stomach_load))\r
                Vore_Regurgitate(self);\r
 \r
        // apply delayed regurgitating if it was scheduled\r