mirror of
https://github.com/JezuzLizard/t4sp_bot_warfare.git
synced 2025-09-08 01:27:26 +00:00
fmt
This commit is contained in:
@@ -7,49 +7,49 @@ Finder( eObj )
|
||||
{
|
||||
Players = get_players();
|
||||
Answer = [];
|
||||
|
||||
|
||||
if ( self inLastStand() )
|
||||
{
|
||||
return Answer;
|
||||
}
|
||||
|
||||
|
||||
for ( i = 0; i < Players.size; i++ )
|
||||
{
|
||||
Player = Players[ i ];
|
||||
|
||||
|
||||
if ( !isdefined( Player ) || !isdefined( Player.team ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if ( Player == self )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if ( Player.sessionstate != "playing" )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if ( !Player inLastStand() || Player.revivetrigger.beingrevived )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if ( GetPathIsInaccessible( self.origin, Player.origin ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if ( self GetBotsAmountForEntity( Player ) >= 1 )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Answer[ Answer.size ] = self CreateFinderObjectiveEZ( eObj, Player );
|
||||
}
|
||||
|
||||
|
||||
return Answer;
|
||||
}
|
||||
|
||||
@@ -57,12 +57,12 @@ Priority( eObj, eEnt )
|
||||
{
|
||||
base_priority = 3;
|
||||
base_priority += ClampLerp( get_path_dist( self.origin, eEnt.origin ), 500, 1200, 2, 0 );
|
||||
|
||||
|
||||
if ( self HasBotObjective() && self GetBotObjectiveEnt() != eEnt )
|
||||
{
|
||||
base_priority -= 1;
|
||||
}
|
||||
|
||||
|
||||
return base_priority;
|
||||
}
|
||||
|
||||
@@ -70,20 +70,20 @@ Executer( eObj )
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
self endon( "zombified" );
|
||||
|
||||
|
||||
revivee = eObj.eent;
|
||||
|
||||
|
||||
self thread IncrementBotsForEntity( revivee );
|
||||
self thread WatchForCancelRevive( revivee );
|
||||
|
||||
|
||||
self GoDoRevive( eObj );
|
||||
|
||||
|
||||
self WatchForCancelReviveCleanup();
|
||||
self DecrementBotsForEntity( revivee );
|
||||
self ClearScriptAimPos();
|
||||
self ClearScriptGoal();
|
||||
self ClearPriorityObjective();
|
||||
|
||||
|
||||
self CompletedObjective( eObj.bwassuccessful, eObj.sreason );
|
||||
}
|
||||
|
||||
@@ -97,31 +97,31 @@ WatchForCancelRevive( revivee )
|
||||
self endon( "disconnect" );
|
||||
self endon( "zombified" );
|
||||
self endon( "WatchForCancelRevive" );
|
||||
|
||||
|
||||
org = revivee.origin;
|
||||
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
wait 0.05;
|
||||
|
||||
|
||||
if ( self inLastStand() )
|
||||
{
|
||||
self CancelObjective( "self inLastStand()" );
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if ( !isdefined( revivee ) || !revivee inLastStand() )
|
||||
{
|
||||
self CancelObjective( "!isdefined( revivee ) || !revivee inLastStand()" );
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if ( revivee.revivetrigger.beingrevived && !self isReviving( revivee ) )
|
||||
{
|
||||
self CancelObjective( "revivee.revivetrigger.beingrevived && !self isReviving( revivee )" );
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if ( distance( revivee.origin, org ) > 16 )
|
||||
{
|
||||
self CancelObjective( "distance( revivee.origin, org ) > 16" );
|
||||
@@ -138,11 +138,11 @@ WatchToGoToGuy( revivee )
|
||||
self endon( "goal" );
|
||||
self endon( "bad_path" );
|
||||
self endon( "new_goal" );
|
||||
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
wait 1;
|
||||
|
||||
|
||||
if ( self istouching( revivee.revivetrigger ) )
|
||||
{
|
||||
self notify( "goal" );
|
||||
@@ -155,11 +155,11 @@ WatchForSuccessRevive( eObj )
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
self endon( "zombified" );
|
||||
|
||||
|
||||
revivee = eObj.eent;
|
||||
|
||||
|
||||
ret = self waittill_either_return( "cancel_bot_objective", "completed_bot_objective" );
|
||||
|
||||
|
||||
if ( ret == "cancel_bot_objective" && isdefined( revivee ) && !revivee inLastStand() )
|
||||
{
|
||||
eObj.bwassuccessful = true;
|
||||
@@ -170,40 +170,40 @@ WatchForSuccessRevive( eObj )
|
||||
GoDoRevive( eObj )
|
||||
{
|
||||
self endon( "cancel_bot_objective" );
|
||||
|
||||
|
||||
revivee = eObj.eent;
|
||||
|
||||
|
||||
// go to guy
|
||||
self thread WatchToGoToGuy( revivee );
|
||||
self SetPriorityObjective();
|
||||
self SetScriptGoal( revivee.origin, 32 );
|
||||
|
||||
|
||||
result = self waittill_any_return( "goal", "bad_path", "new_goal" );
|
||||
|
||||
|
||||
if ( result != "goal" )
|
||||
{
|
||||
eObj.sreason = "didn't go to guy";
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if ( !self istouching( revivee.revivetrigger ) )
|
||||
{
|
||||
eObj.sreason = "not touching guy";
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// ok we are touching guy, lets look at him
|
||||
self SetScriptAimPos( revivee.origin );
|
||||
|
||||
|
||||
// now lets hold use until he is up or otherwise
|
||||
self thread WatchForSuccessRevive( eObj );
|
||||
|
||||
|
||||
while ( self istouching( revivee.revivetrigger ) )
|
||||
{
|
||||
self thread BotPressUse( 0.15 );
|
||||
|
||||
|
||||
wait 0.1;
|
||||
}
|
||||
|
||||
|
||||
eObj.sreason = "not touching guy";
|
||||
}
|
||||
|
Reference in New Issue
Block a user