.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 Swallow_condition_check_bot(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
- 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 quickly
+ if(time > self.decide_swallow)
+ {
+ if(skill >= random() * 10) // there are 10 bot skill steps
+ self.hold_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 quickly
+ }
}
+ else
+ self.hold_BUTTON_ATCK = FALSE;
}
void Vore_AI()
fear += 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;
- if(time > self.decide_swallow)
if(Swallow_condition_check_bot(prey))
{
- // the greater the skill, the higher the chance bots will swallow someone each attempt
- if(skill / fear >= randomtry)
- if not(teams_matter && prey.team == self.team)
+ if(time > self.decide_swallow)
{
- self.BUTTON_ATCK = TRUE; // swallow
- self.decide_pred = time + decide_pred_time; // time before the bot decides what to do with his prey
+ // the greater the skill, the higher the chance bots will swallow someone each attempt
+ if(skill / fear >= randomtry)
+ if not(teams_matter && prey.team == self.team)
+ {
+ self.hold_BUTTON_ATCK = 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
}
- 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;
+
+ // if the bot is holding the firing button, apply that to the actual fire key
+ if(self.hold_BUTTON_ATCK)
+ self.BUTTON_ATCK = TRUE;
// deciding what to do with a victim: