]> de.git.xonotic.org Git - voretournament/voretournament.git/commitdiff
Vore AI: Team heal swallowing should be done the same way normal swallowing is, based...
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 4 Oct 2010 23:28:05 +0000 (02:28 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 4 Oct 2010 23:28:05 +0000 (02:28 +0300)
data/bots.cfg
data/qcsrc/server/bot/havocbot/vore_ai.qc

index 42daf44b03f0d15067ad3110bb667502ce436bb4..d5d9b5d935399793ae5f7ea3d312f22d9d10f3a3 100644 (file)
@@ -47,7 +47,7 @@ set bot_ai_bunnyhop_stopdistance 220 "Stop jumping after reaching this distance
 set bot_ai_bunnyhop_firstjumpdelay 0.5 "Start running to the goal only if it was seen for more than N seconds"\r
 set bot_ai_vore_decide_pred 1.35 "How fast bots decide what to do with their prey, at lowest skill"\r
 set bot_ai_vore_decide_prey 1.35 "How fast bots decide what to do with their predator, at lowest skill"\r
-set bot_ai_vore_decide_swallow 0.2 "How often bots decide if to swallow someone or not"\r
+set bot_ai_vore_decide_swallow 0.2 "How often bots decide if to swallow someone"\r
 set bot_ai_vore_fear 2 "How much bots will fear players more powerful than them and avoid them in some situations"\r
 set bot_ai_vore_teamhealabandon 0.75 "Probability (from 0 to 1) of the bot abandoning a team heal when seeing an enemy they can vore, at highest skill"\r
 set bot_ai_vore_stayinstomach 0 "When enabled, a bot will stay in a team mate's stomach even if he has no reason to and could willingly leave"\r
index 7d99813ca98ed0996e7665ce502d30fb810a82c4..dea9787c4fa43a7b9dbc3ec9b817b459608e635f 100644 (file)
@@ -12,6 +12,7 @@ float Swallow_condition_check_bot(entity prey)
        return FALSE;
 }
 
+.float decide_swallow, decide_pred, decide_prey;
 void Vore_AI_Teamheal(entity prey)
 {
        // allows bots to use the teamheal feature and heal damaged team mates
@@ -72,10 +73,14 @@ void Vore_AI_Teamheal(entity prey)
        if not(prey.digesting) // if our team mate is digesting someone, he likely wouldn't want us ruining his frag
        if not(prey.flagcarried) // don't eat the flag carrier and ruin his job
        if not(prey.BUTTON_ATCK || prey.BUTTON_ATCK2) // our team mate wouldn't want us eating him while he's firing
-               self.BUTTON_ATCK = TRUE; // swallow the team mate
+       if(time > self.decide_swallow)
+       {
+               if(skill >= random() * 10) // there are 10 bot skill steps
+                       self.BUTTON_ATCK = TRUE; // swallow the team mate
+               self.decide_swallow = time + cvar("bot_ai_vore_decide_swallow") / self.bot_vorethinkpred; // this is needed to take a proper decision, otherwise the code would execute each frame and return TRUE soon
+       }
 }
 
-.float decide_swallow, decide_pred, decide_prey;
 void Vore_AI()
 {
        // main vore AI code
@@ -136,7 +141,7 @@ void Vore_AI()
                                self.BUTTON_ATCK = TRUE; // swallow
                                self.decide_pred = time + decide_pred_time; // time before the bot decides what to do with their prey
                        }
-                       self.decide_swallow = time + cvar("bot_ai_vore_decide_swallow"); // this is needed to take a proper decision, otherwise the code would execute each frame and return TRUE pretty soon
+                       self.decide_swallow = time + cvar("bot_ai_vore_decide_swallow") / self.bot_vorethinkpred; // this is needed to take a proper decision, otherwise the code would execute each frame and return TRUE soon
                }
 
                // deciding what to do with a victim: