better twar

This commit is contained in:
INeedBots 2020-11-30 02:08:52 -06:00
parent 14bebeab0e
commit c1091994f8

View File

@ -4055,6 +4055,19 @@ bot_war()
if(!isDefined(level.twarFlags)) if(!isDefined(level.twarFlags))
continue; continue;
ourFlags = 0;
theirFlags = 0;
neuFlags = 0;
for (i = 0; i < level.flags.size; i++)
{
if ( level.flags[i] maps\mp\gametypes\twar::getFlagTeam() == myTeam )
ourFlags++;
else if (level.flags[i] maps\mp\gametypes\twar::getFlagTeam() == otherTeam)
theirFlags++;
else
neuFlags++;
}
flag = maps\mp\gametypes\twar::locate_contested_twar_flag(); flag = maps\mp\gametypes\twar::locate_contested_twar_flag();
if (!isDefined(flag)) if (!isDefined(flag))
@ -4063,7 +4076,7 @@ bot_war()
// check if should cap // check if should cap
if (game["war_momentum"][myTeam + "_multiplier"] == getDvarInt("twar_momentumMaxMultiplier") || if (game["war_momentum"][myTeam + "_multiplier"] == getDvarInt("twar_momentumMaxMultiplier") ||
flag.useObj.numTouching[otherTeam] > flag.useObj.numTouching[myTeam] || flag.useObj.numTouching[otherTeam] > flag.useObj.numTouching[myTeam] ||
rand > 90) rand > 90 || ourFlags < theirFlags)
{ {
self.bot_lock_goal = true; self.bot_lock_goal = true;
self SetScriptGoal(flag.origin, 1); self SetScriptGoal(flag.origin, 1);