mirror of
https://github.com/ineedbots/t5_bot_warfare.git
synced 2025-03-14 19:36:56 +00:00
improved cap capflag
This commit is contained in:
parent
a0380ed024
commit
7bb3b35887
@ -4511,6 +4511,18 @@ bot_cap()
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Gets the carriers ent num
|
||||
*/
|
||||
getCarrierEntNum()
|
||||
{
|
||||
carrierNum = -1;
|
||||
if (isDefined(self.carrier))
|
||||
carrierNum = self.carrier getEntityNumber();
|
||||
|
||||
return carrierNum;
|
||||
}
|
||||
|
||||
/*
|
||||
Bots go and get the flag
|
||||
*/
|
||||
@ -4527,12 +4539,30 @@ bot_cap_get_flag( flag )
|
||||
|
||||
evt = self waittill_any_return( "goal", "bad_path", "new_goal" );
|
||||
|
||||
wait 1;
|
||||
if ( evt != "new_goal" )
|
||||
self ClearScriptGoal();
|
||||
|
||||
if ( evt != "goal" )
|
||||
{
|
||||
self.bot_lock_goal = false;
|
||||
return;
|
||||
}
|
||||
|
||||
self SetScriptGoal( self.origin, 64 );
|
||||
curCarrier = flag getCarrierEntNum();
|
||||
|
||||
while ( curCarrier == flag getCarrierEntNum() && self isTouching( flag.trigger ) )
|
||||
{
|
||||
cur = flag.curProgress;
|
||||
wait 0.5;
|
||||
|
||||
if ( flag.curProgress == cur )
|
||||
break;//some enemy is near us, kill him
|
||||
}
|
||||
|
||||
self ClearScriptGoal();
|
||||
|
||||
self.bot_lock_goal = false;
|
||||
|
||||
if ( evt != "new_goal" )
|
||||
self ClearBotGoal();
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user