From: MirceaKitsune Date: Tue, 19 Jul 2011 13:07:17 +0000 (+0300) Subject: Teach bots to use the new firing button X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e41f4855e3d54c2b390199abd67195f6c22fd505;p=voretournament%2Fvoretournament.git Teach bots to use the new firing button --- diff --git a/data/qcsrc/server/bot/havocbot/vore_ai.qc b/data/qcsrc/server/bot/havocbot/vore_ai.qc index 7c35ff94..9d293878 100644 --- a/data/qcsrc/server/bot/havocbot/vore_ai.qc +++ b/data/qcsrc/server/bot/havocbot/vore_ai.qc @@ -1,5 +1,5 @@ .float status_teamhealing; // 0 = can't team heal, 1 = can team heal, 2 = team healing right now -.float hold_BUTTON_ATCK; // marks the bot holding the fire button after having decided on his prey +.float hold_BUTTON_ATCK2; // marks the bot holding the fire button after having decided on his prey float Swallow_condition_check_bot(entity prey) { @@ -81,18 +81,18 @@ void Vore_AI_Teamheal(entity prey) if(prey.health < cvar("g_balance_vore_teamheal_stable")) 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 + if not(prey.BUTTON_ATCK || prey.BUTTON_ATCK2) // our team mate wouldn't want us eating him while he's attacking { if(time > self.decide_swallow) { // base the decision around HOW damaged the team mate is, centered around 100 health if(skill * (100 / prey.health) >= random() * 10) // there are 10 bot skill steps - self.hold_BUTTON_ATCK = TRUE; // swallow the team mate + self.hold_BUTTON_ATCK2 = 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 quickly } } else - self.hold_BUTTON_ATCK = FALSE; + self.hold_BUTTON_ATCK2 = FALSE; } void Vore_AI() @@ -169,18 +169,18 @@ void Vore_AI() if(skill / fear >= randomtry) if not(teams_matter && prey.team == self.team) { - self.hold_BUTTON_ATCK = TRUE; // swallow + self.hold_BUTTON_ATCK2 = TRUE; // swallow self.decide_pred = time + decide_pred_time; // time before the bot decides what to do with his prey } 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 quickly } } else - self.hold_BUTTON_ATCK = FALSE; + self.hold_BUTTON_ATCK2 = FALSE; // if the bot is holding the firing button, apply that to the actual fire key - if(self.hold_BUTTON_ATCK) - self.BUTTON_ATCK = TRUE; + if(self.hold_BUTTON_ATCK2) + self.BUTTON_ATCK2 = TRUE; // deciding what to do with a victim: @@ -245,7 +245,7 @@ void Vore_AI() // the higher the skill, the more the bot will kick in your stomack if(skill >= randomtry) if not(teams_matter && self.team == self.predator.team) // if someone from the same team is in the belly, don't kick the predator - self.BUTTON_ATCK = TRUE; // kick + self.BUTTON_ATCK2 = TRUE; // kick } // if a bot can willingly leave the predator, do so unless there's a reason not to