From: MirceaKitsune Date: Mon, 4 Oct 2010 23:28:05 +0000 (+0300) Subject: Vore AI: Team heal swallowing should be done the same way normal swallowing is, based... X-Git-Url: http://git.xonotic.org/?a=commitdiff_plain;h=15555c36f8cc792003e272ef000f155d09026120;p=voretournament%2Fvoretournament.git Vore AI: Team heal swallowing should be done the same way normal swallowing is, based on skill. 0.4 has been delayed, so this is a pre-0.4 change. --- diff --git a/data/bots.cfg b/data/bots.cfg index 42daf44b..d5d9b5d9 100644 --- a/data/bots.cfg +++ b/data/bots.cfg @@ -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" set bot_ai_vore_decide_pred 1.35 "How fast bots decide what to do with their prey, at lowest skill" set bot_ai_vore_decide_prey 1.35 "How fast bots decide what to do with their predator, at lowest skill" -set bot_ai_vore_decide_swallow 0.2 "How often bots decide if to swallow someone or not" +set bot_ai_vore_decide_swallow 0.2 "How often bots decide if to swallow someone" set bot_ai_vore_fear 2 "How much bots will fear players more powerful than them and avoid them in some situations" 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" 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" diff --git a/data/qcsrc/server/bot/havocbot/vore_ai.qc b/data/qcsrc/server/bot/havocbot/vore_ai.qc index 7d99813c..dea9787c 100644 --- a/data/qcsrc/server/bot/havocbot/vore_ai.qc +++ b/data/qcsrc/server/bot/havocbot/vore_ai.qc @@ -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: