1
0
mirror of https://github.com/ineedbots/iw5_bot_warfare.git synced 2026-03-22 10:43:01 +00:00

More bot enable stuff

This commit is contained in:
ineedbots
2021-05-16 22:51:20 -06:00
parent 176440a65a
commit 3bf5cf12ea
4 changed files with 103 additions and 148 deletions

View File

@@ -154,6 +154,7 @@ init()
level thread onPlayerConnect();
level thread addNotifyOnAirdrops();
level thread watchScrabler();
level thread handleBots();
@@ -303,6 +304,53 @@ fixKoth()
}
}
/*
Watches scrambler
*/
watchScrabler()
{
for (;;)
{
wait 1;
for ( i = level.players.size - 1; i >= 0; i-- )
{
player = level.players[i];
player.bot_isScrambled = false;
}
for (i = level.scramblers.size - 1; i >= 0; i--)
{
scrambler = level.scramblers[i];
if ( !isDefined( scrambler ) )
continue;
for ( h = level.players.size - 1; h >= 0; h-- )
{
player = level.players[h];
if (!isReallyAlive(player))
continue;
if (isDefined(scrambler.owner) && scrambler.owner == player)
continue;
if(level.teamBased && scrambler.team == player.team)
continue;
if (player _hasPerk("specialty_coldblooded"))
continue;
if (DistanceSquared(player.origin, scrambler.origin) > 256*256)
continue;
player.bot_isScrambled = true;
}
}
}
}
/*
Adds a notify when the airdrop is dropped
*/