]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
We only need one randomtry float now
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 30 Sep 2010 00:42:00 +0000 (03:42 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 30 Sep 2010 00:42:00 +0000 (03:42 +0300)
data/qcsrc/server/bot/havocbot/vore_ai.qc

index 1b58e1870fac96a48e29bb18a287e72726e70621..ef251a3dd71e45701fd73069d93e64de6239c202 100644 (file)
@@ -102,23 +102,23 @@ void Vore_AI()
 
        // now do the actual checking and swallowing
        entity prey;
-       float randomtry_pred, randomtry_prey, fear_pred;
+       float randomtry, fear;
        float decide_pred_time, decide_prey_time;
 
        prey = Swallow_player_check();
-       fear_pred = 1;
+       fear = 1;
 
        // check if we should run the Teamhealing AI rather than continuing with the normal vore AI
        Vore_AI_Teamheal(prey);
        if(self.status_teamhealing > 1) // if we are teamhealing, there's nothing to do from here on
                return;
 
-       randomtry_pred = randomtry_prey = random() * 10; // there are 10 bot skill steps
+       randomtry = random() * 10; // there are 10 bot skill steps
        if(prey.items & IT_STRENGTH) // avoid eating bots that have the Strenght powerup
-               fear_pred += cvar("bot_ai_vore_fear") * self.bot_vorefear;
+               fear += cvar("bot_ai_vore_fear") * self.bot_vorefear;
        if(prey.items & IT_INVINCIBLE) // avoid eating bots that have the Invincible powerup
-               fear_pred += cvar("bot_ai_vore_fear") * self.bot_vorefear;
-       fear_pred += self.stomach_load; // the bigger our stomach, the less we want to put someone else in there
+               fear += cvar("bot_ai_vore_fear") * self.bot_vorefear;
+       fear += self.stomach_load; // the bigger our stomach, the less we want to put someone else in there
        decide_pred_time = cvar("bot_ai_vore_decide_pred") / skill / self.bot_vorethinkpred;
        decide_prey_time = cvar("bot_ai_vore_decide_prey") / skill / self.bot_vorethinkprey;
 
@@ -126,7 +126,7 @@ void Vore_AI()
        if(Swallow_condition_check_bot(prey))
        {
                // the greater the skill, the higher the chance bots will swallow someone each attempt
-               if(skill / fear_pred >= randomtry_pred)
+               if(skill / fear >= randomtry)
                if not(teams_matter && prey.team == self.team)
                {
                        self.BUTTON_ATCK = TRUE; // swallow
@@ -148,7 +148,7 @@ void Vore_AI()
                {
                        // the higher the skill, the faster bots will start to digest you
                        if not(g_rpg && cvar("g_rpg_botattack") < 2)
-                       if(skill >= randomtry_pred)
+                       if(skill >= randomtry)
                                self.BUTTON_DIGEST = TRUE; // digest
 
                        self.decide_pred = time + decide_pred_time; // time before the bot decides what to do with their prey
@@ -167,7 +167,7 @@ void Vore_AI()
                if not(teams_matter && self.team == self.predator.team)
                {
                        // the higher the skill, the more the bot will kick in your stomack
-                       if(skill >= randomtry_prey)
+                       if(skill >= randomtry)
                        if not(teams_matter && self.team == self.predator.team) // if someone from the same team is in the belly, don't kick the predator
                                self.BUTTON_ATCK = TRUE; // kick
                }