1
0
mirror of https://github.com/vcmi/vcmi.git synced 2026-05-22 09:55:17 +02:00

Nullkiller AI: further stabilisation, implement staged hero chain (first with limit 0 turns then 1 turn)

This commit is contained in:
Andrii Danylchenko
2021-05-16 14:13:56 +03:00
committed by Andrii Danylchenko
parent 6bebb766a6
commit eea5cb7f0b
14 changed files with 118 additions and 45 deletions
@@ -99,7 +99,7 @@ Goals::TGoalVec CaptureObjectsBehavior::getTasks()
auto hero = path.targetHero;
auto danger = path.getTotalDanger();
if(danger == 0 && path.exchangeCount > 1)
if(ai->ah->getHeroRole(hero) == HeroRole::SCOUT && danger == 0 && path.exchangeCount > 1)
continue;
auto isSafe = isSafeToVisit(hero, path.heroArmy, danger);
@@ -131,13 +131,13 @@ Goals::TGoalVec CaptureObjectsBehavior::getTasks()
for(auto way : waysToVisitObj)
{
if(ai->nullkiller->arePathHeroesLocked(way->getPath()))
continue;
way->evaluationContext.closestWayRatio
= way->evaluationContext.movementCost / closestWay->evaluationContext.movementCost;
if(way->hero && ai->nullkiller->canMove(way->hero.h))
{
tasks.push_back(sptr(*way));
}
tasks.push_back(sptr(*way));
}
}
};