This commit is contained in:
INeedBots 2020-11-22 00:53:02 -06:00
parent b5a535842b
commit a98840b94e

View File

@ -4929,6 +4929,8 @@ bot_sd_attackers()
if(myTeam != game["attackers"]) if(myTeam != game["attackers"])
return; return;
rand = self BotGetRandom();
first = true; first = true;
for ( ;; ) for ( ;; )
@ -5017,7 +5019,7 @@ bot_sd_attackers()
if(!isDefined(bomb.bots)) if(!isDefined(bomb.bots))
bomb.bots = 0; bomb.bots = 0;
origin = ( bomb.curorigin[0], bomb.curorigin[1], bomb.curorigin[2]+32 ); origin = ( bomb.curorigin[0], bomb.curorigin[1], bomb.curorigin[2]+5 );
//hang around the bomb if other is going to go get it //hang around the bomb if other is going to go get it
if(bomb.bots > 1) if(bomb.bots > 1)
@ -5028,45 +5030,29 @@ bot_sd_attackers()
if(DistanceSquared(origin, self.origin) <= 1024*1024) if(DistanceSquared(origin, self.origin) <= 1024*1024)
continue; continue;
self.did = "bot_sd_attackers(bomb_hang)";
self SetScriptGoal( origin, 256 ); self SetScriptGoal( origin, 256 );
if(DistanceSquared(origin, self.origin) > 256*256)
{
self thread bot_get_obj(bomb); self thread bot_get_obj(bomb);
self waittill_any( "goal", "bad_path" ); if (self waittill_any_return( "goal", "bad_path", "new_goal" ) != "new_goal")
}
self ClearScriptGoal(); self ClearScriptGoal();
continue; continue;
} }
// go get the bomb
self.bot_lock_goal = true; self.bot_lock_goal = true;
self notify("bot_check_unreachable");
self notify("bad_path");
self thread bot_inc_bots(bomb);
wait 0.05;
self.did = "bot_sd_attackers(bomb_get)";
self SetScriptGoal( origin, 64 ); self SetScriptGoal( origin, 64 );
self thread bot_inc_bots(bomb);
if(!self isTouching(bomb.trigger))
{
self thread bot_get_obj(bomb); self thread bot_get_obj(bomb);
self waittill_any( "goal", "bad_path" ); if (self waittill_any_return( "goal", "bad_path", "new_goal" ) != "new_goal")
}
self notify("bot_inc_bots");
self ClearScriptGoal(); self ClearScriptGoal();
self.bot_lock_goal = false; self.bot_lock_goal = false;
continue; continue;
} }
// check if to plant
if(timepassed < 120 && timeleft >= 90 && randomInt(100) < 98) if(timepassed < 120 && timeleft >= 90 && randomInt(100) < 98)
continue; continue;
@ -5082,7 +5068,7 @@ bot_sd_attackers()
if(!sites.size) if(!sites.size)
continue; continue;
if(randomint(2)) if(rand > 50)
plant = self bot_array_nearest_curorigin(sites); plant = self bot_array_nearest_curorigin(sites);
else else
plant = random(sites); plant = random(sites);
@ -5090,46 +5076,29 @@ bot_sd_attackers()
if(!isDefined(plant)) if(!isDefined(plant))
continue; continue;
origin = ( plant.curorigin[0]+50, plant.curorigin[1]+50, plant.curorigin[2]+32 ); origin = ( plant.curorigin[0]+50, plant.curorigin[1]+50, plant.curorigin[2]+5 );
self.bot_lock_goal = true; self.bot_lock_goal = true;
self SetScriptGoal( origin, 1 );
self notify("bot_check_unreachable");
self notify("bad_path");
wait 0.05;
if(!self isTouching(plant.trigger))
{
self.did = "bot_sd_attackers";
self SetScriptGoal( origin, 64 );
self thread bot_go_plant(plant); self thread bot_go_plant(plant);
event = self waittill_any_return( "goal", "bad_path" ); event = self waittill_any_return( "goal", "bad_path", "new_goal" );
if (event != "new_goal")
self ClearScriptGoal(); self ClearScriptGoal();
if (event == "bad_path") if(event != "goal" || level.bombPlanted || plant.visibleTeam == "none" || !self isTouching(plant.trigger) || self InLastStand() || self HasThreat() || plant IsInUse())
{
self.bot_lock_goal = false;
continue;
}
}
if(level.bombPlanted || plant.visibleTeam == "none" || !self isTouching(plant.trigger) || (isDefined(self.laststand) && self.laststand) || isDefined(self getThreat()))
{ {
self.bot_lock_goal = false; self.bot_lock_goal = false;
continue; continue;
} }
self.did = "bot_sd_attackers(2)";
self SetScriptGoal( self.origin, 64 ); self SetScriptGoal( self.origin, 64 );
self bot_use_bomb_thread(plant); self bot_use_bomb_thread(plant);
wait 1; wait 1;
self ClearScriptGoal(); self ClearScriptGoal();
self.bot_lock_goal = false; self.bot_lock_goal = false;
} }
} }