|
@@ -58,6 +58,7 @@ Goals::TGoalVec RecruitHeroBehavior::decompose(const Nullkiller * ai) const
|
|
|
|
|
|
ai->dangerHitMap->updateHitMap();
|
|
|
int treasureSourcesCount = 0;
|
|
|
+ int bestClosestThreat = UINT8_MAX;
|
|
|
|
|
|
for(auto town : towns)
|
|
|
{
|
|
@@ -118,6 +119,7 @@ Goals::TGoalVec RecruitHeroBehavior::decompose(const Nullkiller * ai) const
|
|
|
bestScore = score;
|
|
|
bestHeroToHire = hero;
|
|
|
bestTownToHireFrom = town;
|
|
|
+ bestClosestThreat = closestThreat;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -128,7 +130,7 @@ Goals::TGoalVec RecruitHeroBehavior::decompose(const Nullkiller * ai) const
|
|
|
{
|
|
|
if (ai->cb->getHeroesInfo().size() == 0
|
|
|
|| treasureSourcesCount > ai->cb->getHeroesInfo().size() * 5
|
|
|
- || bestHeroToHire->getArmyCost() > GameConstants::HERO_GOLD_COST / 2.0
|
|
|
+ || (bestHeroToHire->getArmyCost() > GameConstants::HERO_GOLD_COST / 2.0 && (bestClosestThreat < 1 || !ai->buildAnalyzer->isGoldPressureHigh()))
|
|
|
|| (ai->getFreeResources()[EGameResID::GOLD] > 10000 && !ai->buildAnalyzer->isGoldPressureHigh() && haveCapitol)
|
|
|
|| (ai->getFreeResources()[EGameResID::GOLD] > 30000 && !ai->buildAnalyzer->isGoldPressureHigh()))
|
|
|
{
|