76 lines
7.1 KiB
Plaintext
76 lines
7.1 KiB
Plaintext
#using scripts\shared\array_shared;
|
|
#using scripts\shared\callbacks_shared;
|
|
#using scripts\shared\math_shared;
|
|
#using scripts\shared\system_shared;
|
|
#using scripts\shared\util_shared;
|
|
|
|
|
|
|
|
|
|
|
|
#using scripts\mp\bots\_bot;
|
|
#using scripts\shared\bots\_bot;
|
|
#using scripts\shared\bots\_bot_combat;
|
|
#using scripts\shared\bots\bot_traversals;
|
|
#using scripts\shared\bots\bot_buttons;
|
|
|
|
|
|
#using scripts\mp\teams\_teams;
|
|
#using scripts\mp\_util;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#namespace bot_escort;
|
|
|
|
function init()
|
|
{
|
|
level.botIdle = &bot_idle;
|
|
}
|
|
|
|
function bot_idle()
|
|
{
|
|
if ( self.team == game["attackers"] )
|
|
{
|
|
self attackers_idle();
|
|
}
|
|
else
|
|
{
|
|
self defenders_idle();
|
|
}
|
|
}
|
|
|
|
function attackers_idle()
|
|
{
|
|
if ( isdefined( level.moveObject ) && ( level.robot.active || level.rebootPlayers > 0 ) )
|
|
{
|
|
if ( !level.robot.moving || math::cointoss() )
|
|
{
|
|
self bot::path_to_point_in_trigger( level.moveObject.trigger );
|
|
}
|
|
else
|
|
{
|
|
self bot::approach_point( level.moveObject.trigger.origin, 160, 400 );
|
|
}
|
|
|
|
self bot::sprint_to_goal();
|
|
return;
|
|
}
|
|
|
|
self bot::bot_idle();
|
|
}
|
|
|
|
function defenders_idle()
|
|
{
|
|
if ( isdefined( level.moveObject ) && level.robot.active )
|
|
{
|
|
self bot::approach_point( level.moveObject.trigger.origin, 160, 400 );
|
|
self bot::sprint_to_goal();
|
|
return;
|
|
}
|
|
|
|
self bot::bot_idle();
|
|
} |