From bb41789b54177ebf9e1ae78d4518eb63e6c1716d Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Thu, 30 Sep 2010 03:39:05 +0300 Subject: [PATCH] Vore AI: Correct fearing system, and teach bots to avoid eating someone else the fuller their stomach gets (since the more players you keep inside, the harder you make things for yourself) --- data/qcsrc/server/bot/havocbot/vore_ai.qc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/data/qcsrc/server/bot/havocbot/vore_ai.qc b/data/qcsrc/server/bot/havocbot/vore_ai.qc index dc033ba1..1b58e187 100644 --- a/data/qcsrc/server/bot/havocbot/vore_ai.qc +++ b/data/qcsrc/server/bot/havocbot/vore_ai.qc @@ -102,10 +102,11 @@ void Vore_AI() // now do the actual checking and swallowing entity prey; - float randomtry_pred, randomtry_prey; + float randomtry_pred, randomtry_prey, fear_pred; float decide_pred_time, decide_prey_time; prey = Swallow_player_check(); + fear_pred = 1; // check if we should run the Teamhealing AI rather than continuing with the normal vore AI Vore_AI_Teamheal(prey); @@ -114,9 +115,10 @@ void Vore_AI() randomtry_pred = randomtry_prey = random() * 10; // there are 10 bot skill steps if(prey.items & IT_STRENGTH) // avoid eating bots that have the Strenght powerup - randomtry_pred /= cvar("bot_ai_vore_fear") * self.bot_vorefear; + fear_pred += cvar("bot_ai_vore_fear") * self.bot_vorefear; if(prey.items & IT_INVINCIBLE) // avoid eating bots that have the Invincible powerup - randomtry_pred /= cvar("bot_ai_vore_fear") * self.bot_vorefear; + 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 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; @@ -124,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 >= randomtry_pred) + if(skill / fear_pred >= randomtry_pred) if not(teams_matter && prey.team == self.team) { self.BUTTON_ATCK = TRUE; // swallow -- 2.39.2