Fix a major forgotten issue in the vore AI. 0.4 has been delayed, so this is a pre...
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 5 Oct 2010 01:26:18 +0000 (04:26 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 5 Oct 2010 01:26:18 +0000 (04:26 +0300)
data/qcsrc/server/bot/havocbot/vore_ai.qc

index 30a5d1960cc3bd7168215b5de4b77810cddb312c..fed7218ba0aaaa074f4c463d0a0e6e06e9aa738d 100644 (file)
@@ -90,6 +90,9 @@ void Vore_AI()
        if(cvar("bot_nofire") || !skill || (g_rpg && cvar("g_rpg_botattack") < 1))
                return;
 
+       float randomtry;
+       randomtry = random() * 10; // there are 10 bot skill steps
+
 // --------------------------------
 // Predator bot behavior:
 // --------------------------------
@@ -111,8 +114,7 @@ void Vore_AI()
 
                // now do the actual checking and swallowing
                entity prey;
-               float randomtry, fear;
-               float decide_pred_time, decide_prey_time;
+               float decide_pred_time, fear;
 
                prey = Swallow_player_check();
                fear = 1;
@@ -122,14 +124,12 @@ void Vore_AI()
                if(self.status_teamhealing > 1) // if we are teamhealing, there's nothing to do from here on
                        return;
 
-               randomtry = random() * 10; // there are 10 bot skill steps
                if(prey.items & IT_STRENGTH) // avoid eating bots that have the Strenght powerup
                        fear += cvar("bot_ai_vore_fear") * self.bot_vorefear;
                if(prey.items & IT_INVINCIBLE) // avoid eating bots that have the Invincible powerup
                        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;
 
                if(time > self.decide_swallow && cvar("g_vore_digestion"))
                if(Swallow_condition_check_bot(prey))
@@ -173,6 +173,9 @@ void Vore_AI()
        {
                // all we can do in the stomach is kick and do some damage / try to escape, or leave if the circumstances allow it and we should
 
+               float decide_prey_time;
+               decide_prey_time = cvar("bot_ai_vore_decide_prey") / skill / self.bot_vorethinkprey;
+
                if(cvar("g_vore_kick"))
                if not(g_rpg && cvar("g_rpg_botattack") < 2)
                if not(teams_matter && self.team == self.predator.team)