From: MirceaKitsune Date: Tue, 7 Sep 2010 21:31:32 +0000 (+0300) Subject: Teach bots to use the "willingly leave" feature when available X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=cd953b330d321ee603d0c2bb2117b56ef5a845a4;p=voretournament%2Fvoretournament.git Teach bots to use the "willingly leave" feature when available --- diff --git a/data/qcsrc/server/bot/havocbot/vore_ai.qc b/data/qcsrc/server/bot/havocbot/vore_ai.qc index 28c3ec1e..e37942af 100644 --- a/data/qcsrc/server/bot/havocbot/vore_ai.qc +++ b/data/qcsrc/server/bot/havocbot/vore_ai.qc @@ -150,14 +150,21 @@ void Vore_AI() // Prey bot behavior: // -------------------------------- - // all we can do in the stomach is kick and do some damage / try to escape + // 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 if(self.eater.classname == "player" && time > self.decide_delay2) - if not(teams_matter && self.team == self.eater.team) { - // the higher the skill, the more the bot will kick in your stomack - if(skill >= random_try) - if not(teams_matter && prey.team == self.team) // if someone from the same team somehow made it in the belly, don't kick the eater - self.BUTTON_ATCK = TRUE; // kick + if not(teams_matter && self.team == self.eater.team) + { + // the higher the skill, the more the bot will kick in your stomack + if(skill >= random_try) + if not(teams_matter && prey.team == self.team) // if someone from the same team somehow made it in the belly, don't kick the eater + self.BUTTON_ATCK = TRUE; // kick + } + + // if a bot can willingly leave the predator, do so unless there's a reason not to + if(self.stat_canleave) + if not(teams_matter && self.team == self.eater.team && cvar("g_balance_vore_teamheal") && self.health < cvar("g_balance_vore_teamheal_stable")) // we are being team healed, don't leave + self.BUTTON_JUMP = TRUE; self.decide_delay2 = time + decide_prey; // time before the bot decides what to do with their predator }