mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-21 21:17:49 +02:00
Swapped order of Defend and Far-Hunter-Gather
This commit is contained in:
parent
b0e87f01ed
commit
6b55401fde
@ -477,7 +477,7 @@ void ObjectClusterizer::clusterizeObject(
|
|||||||
|
|
||||||
heroesProcessed.insert(path.targetHero);
|
heroesProcessed.insert(path.targetHero);
|
||||||
|
|
||||||
for (int prio = PriorityEvaluator::PriorityTier::BUILDINGS; prio <= PriorityEvaluator::PriorityTier::DEFEND; ++prio)
|
for (int prio = PriorityEvaluator::PriorityTier::BUILDINGS; prio <= PriorityEvaluator::PriorityTier::MAX_PRIORITY_TIER; ++prio)
|
||||||
{
|
{
|
||||||
priority = std::max(priority, priorityEvaluator->evaluate(Goals::sptr(Goals::ExecuteHeroChain(path, obj)), prio));
|
priority = std::max(priority, priorityEvaluator->evaluate(Goals::sptr(Goals::ExecuteHeroChain(path, obj)), prio));
|
||||||
}
|
}
|
||||||
@ -503,7 +503,7 @@ void ObjectClusterizer::clusterizeObject(
|
|||||||
|
|
||||||
heroesProcessed.insert(path.targetHero);
|
heroesProcessed.insert(path.targetHero);
|
||||||
|
|
||||||
for (int prio = PriorityEvaluator::PriorityTier::BUILDINGS; prio <= PriorityEvaluator::PriorityTier::DEFEND; ++prio)
|
for (int prio = PriorityEvaluator::PriorityTier::BUILDINGS; prio <= PriorityEvaluator::PriorityTier::MAX_PRIORITY_TIER; ++prio)
|
||||||
{
|
{
|
||||||
priority = std::max(priority, priorityEvaluator->evaluate(Goals::sptr(Goals::ExecuteHeroChain(path, obj)), prio));
|
priority = std::max(priority, priorityEvaluator->evaluate(Goals::sptr(Goals::ExecuteHeroChain(path, obj)), prio));
|
||||||
}
|
}
|
||||||
|
@ -443,14 +443,10 @@ void Nullkiller::makeTurn()
|
|||||||
decompose(bestTasks, sptr(ExplorationBehavior()), MAX_DEPTH);
|
decompose(bestTasks, sptr(ExplorationBehavior()), MAX_DEPTH);
|
||||||
|
|
||||||
TTaskVec selectedTasks;
|
TTaskVec selectedTasks;
|
||||||
#if NKAI_TRACE_LEVEL >= 1
|
|
||||||
int prioOfTask = 0;
|
int prioOfTask = 0;
|
||||||
#endif
|
for (int prio = PriorityEvaluator::PriorityTier::INSTAKILL; prio <= PriorityEvaluator::PriorityTier::MAX_PRIORITY_TIER; ++prio)
|
||||||
for (int prio = PriorityEvaluator::PriorityTier::INSTAKILL; prio <= PriorityEvaluator::PriorityTier::DEFEND; ++prio)
|
|
||||||
{
|
{
|
||||||
#if NKAI_TRACE_LEVEL >= 1
|
|
||||||
prioOfTask = prio;
|
prioOfTask = prio;
|
||||||
#endif
|
|
||||||
selectedTasks = buildPlan(bestTasks, prio);
|
selectedTasks = buildPlan(bestTasks, prio);
|
||||||
if (!selectedTasks.empty() || settings->isUseFuzzy())
|
if (!selectedTasks.empty() || settings->isUseFuzzy())
|
||||||
break;
|
break;
|
||||||
@ -528,12 +524,6 @@ void Nullkiller::makeTurn()
|
|||||||
#if NKAI_TRACE_LEVEL >= 1
|
#if NKAI_TRACE_LEVEL >= 1
|
||||||
logAi->info("Pass %d: Performing prio %d task %s with prio: %d", i, prioOfTask, bestTask->toString(), bestTask->priority);
|
logAi->info("Pass %d: Performing prio %d task %s with prio: %d", i, prioOfTask, bestTask->toString(), bestTask->priority);
|
||||||
#endif
|
#endif
|
||||||
int totalMPBefore = 0;
|
|
||||||
int totalMPAfter = 0;
|
|
||||||
for (auto hero : cb->getHeroesInfo(true))
|
|
||||||
{
|
|
||||||
totalMPBefore += hero->movementPointsRemaining();
|
|
||||||
}
|
|
||||||
if(!executeTask(bestTask))
|
if(!executeTask(bestTask))
|
||||||
{
|
{
|
||||||
if(hasAnySuccess)
|
if(hasAnySuccess)
|
||||||
@ -541,12 +531,10 @@ void Nullkiller::makeTurn()
|
|||||||
else
|
else
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (auto hero : cb->getHeroesInfo(true))
|
else
|
||||||
{
|
{
|
||||||
totalMPAfter += hero->movementPointsRemaining();
|
|
||||||
}
|
|
||||||
if(totalMPBefore > totalMPAfter)
|
|
||||||
hasAnySuccess = true;
|
hasAnySuccess = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
hasAnySuccess |= handleTrading();
|
hasAnySuccess |= handleTrading();
|
||||||
|
@ -119,8 +119,9 @@ public:
|
|||||||
HUNTER_GATHER,
|
HUNTER_GATHER,
|
||||||
LOW_PRIO_EXPLORE,
|
LOW_PRIO_EXPLORE,
|
||||||
FAR_KILL,
|
FAR_KILL,
|
||||||
|
DEFEND,
|
||||||
FAR_HUNTER_GATHER,
|
FAR_HUNTER_GATHER,
|
||||||
DEFEND
|
MAX_PRIORITY_TIER = FAR_HUNTER_GATHER
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user