mirror of
https://github.com/ineedbots/iw2_bot_warfare.git
synced 2025-04-21 23:15:43 +00:00
added prio goal
This commit is contained in:
parent
a1ed7c2cc6
commit
8e604c25aa
@ -141,6 +141,8 @@ resetBotVars()
|
||||
self.bot.cur_weap_dist_multi = 1;
|
||||
self.bot.is_cur_sniper = false;
|
||||
|
||||
self.bot.prio_objective = false;
|
||||
|
||||
self.bot.rand = randomInt( 100 );
|
||||
|
||||
self BotBuiltinBotStop();
|
||||
@ -1036,7 +1038,7 @@ aim_loop()
|
||||
aimspeed *= 1 + adsAimSpeedFact * adsAmount;
|
||||
}
|
||||
|
||||
if ( isDefined( self.bot.target ) && isDefined( self.bot.target.entity ) )
|
||||
if ( isDefined( self.bot.target ) && isDefined( self.bot.target.entity ) && !( self.bot.prio_objective && isDefined( self.bot.script_aimpos ) ) )
|
||||
{
|
||||
no_trace_time = self.bot.target.no_trace_time;
|
||||
no_trace_look_time = self.pers["bots"]["skill"]["no_trace_look_time"];
|
||||
@ -1385,7 +1387,7 @@ killWalkCauseNoWaypoints()
|
||||
*/
|
||||
walk_loop()
|
||||
{
|
||||
hasTarget = isDefined( self.bot.target ) && isDefined( self.bot.target.entity );
|
||||
hasTarget = isDefined( self.bot.target ) && isDefined( self.bot.target.entity ) && !self.bot.prio_objective;
|
||||
|
||||
if ( hasTarget )
|
||||
{
|
||||
|
@ -408,6 +408,32 @@ HasThreat()
|
||||
return ( isDefined( self GetThreat() ) );
|
||||
}
|
||||
|
||||
/*
|
||||
Returns whether the bot has a priority objective
|
||||
*/
|
||||
HasPriorityObjective()
|
||||
{
|
||||
return self.bot.prio_objective;
|
||||
}
|
||||
|
||||
/*
|
||||
Sets the bot to prioritize the objective over targeting enemies
|
||||
*/
|
||||
SetPriorityObjective()
|
||||
{
|
||||
self.bot.prio_objective = true;
|
||||
self notify( "kill_goal" );
|
||||
}
|
||||
|
||||
/*
|
||||
Clears the bot's priority objective to allow the bot to target enemies automatically again
|
||||
*/
|
||||
ClearPriorityObjective()
|
||||
{
|
||||
self.bot.prio_objective = false;
|
||||
self notify( "kill_goal" );
|
||||
}
|
||||
|
||||
/*
|
||||
If the site is in use
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user