From c8cba55ffdc0eb549c69784115957c25b554ed79 Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Wed, 8 Sep 2010 02:31:04 +0300 Subject: [PATCH] Vore AI: Team heal abandoning. When the probability returns true, a bot will abandon healing a team mate in order to attack an enemy --- data/defaultVoretournament.cfg | 1 + data/qcsrc/server/bot/havocbot/vore_ai.qc | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/data/defaultVoretournament.cfg b/data/defaultVoretournament.cfg index f600a44e..cb81b7d9 100644 --- a/data/defaultVoretournament.cfg +++ b/data/defaultVoretournament.cfg @@ -351,6 +351,7 @@ set bot_ai_bunnyhop_firstjumpdelay 0.5 "Start running to the goal only if it was set bot_ai_vore_decide_pred 4 "How fast bots decide what to do with their prey, at lowest skill" set bot_ai_vore_decide_prey 4 "How fast bots decide what to do with their predator, at lowest skill" set bot_ai_vore_decide_fear 2 "How much bots will fear players more powerful than them, and therefore avoid them in some situations" +set bot_ai_vore_decide_teamhealabandon 0.5 "Probability (from 0 to 1) of bot stopping a team heal when seeing a foe that they can vore" set bot_god 0 "god mode for bots" set bot_ai_navigation_jetpack 0 "Enable bots to navigat maps using the jetpack" set bot_ai_navigation_jetpack_mindistance 3500 "Bots will try fly to objects located farther than this distance" diff --git a/data/qcsrc/server/bot/havocbot/vore_ai.qc b/data/qcsrc/server/bot/havocbot/vore_ai.qc index e37942af..e4138c50 100644 --- a/data/qcsrc/server/bot/havocbot/vore_ai.qc +++ b/data/qcsrc/server/bot/havocbot/vore_ai.qc @@ -28,6 +28,15 @@ float Swallow_condition_check_bot(entity prey) void Vore_AI_Teamheal(entity prey) { // allows bots to take advantage of the teamheal feature, and use it to heal damaged team mates + // the prey entity is only used when it's available (a player is detected in-range), otherwise the rest of the code executes as expected + + // if a teamheal is ongoing, decide whether or not to abandon it when seeing a foe that we can attack instead + // this only causes the bot to regurgitate their team mate when seeing an enemy, with the hope that this enemy will still be there once we can swallow again + if(self.status_teamhealing > 1) + if(Swallow_condition_check_bot(prey)) + if(prey.team != self.team) + if(random() < cvar("bot_ai_vore_decide_teamhealabandon")) + self.BUTTON_REGURGITATE = TRUE; // release the team mate entity head; -- 2.39.2