mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-25 21:38:59 +02:00
Small adjustments to defensive behavior
AI will no longer leave the defense of a threatened town in order to bring the army to another hero. AI will no longer send heroes to die outside of towns that already have a garrisioning hero inside, if there's a stronger enemy hero lurking around the town.
This commit is contained in:
parent
1b041fe09d
commit
c7b875f671
@ -1460,7 +1460,7 @@ float PriorityEvaluator::evaluate(Goals::TSubgoal task, int priorityTier)
|
||||
{
|
||||
case PriorityTier::INSTAKILL: //Take towns / kill heroes in immediate reach
|
||||
{
|
||||
if (evaluationContext.turn > 0)
|
||||
if (evaluationContext.turn > 0 || evaluationContext.isExchange)
|
||||
return 0;
|
||||
if (evaluationContext.movementCost >= 1)
|
||||
return 0;
|
||||
@ -1594,7 +1594,7 @@ float PriorityEvaluator::evaluate(Goals::TSubgoal task, int priorityTier)
|
||||
}
|
||||
case PriorityTier::DEFEND: //Defend whatever if nothing else is to do
|
||||
{
|
||||
if (evaluationContext.enemyHeroDangerRatio > dangerThreshold && evaluationContext.isExchange)
|
||||
if (evaluationContext.enemyHeroDangerRatio > dangerThreshold)
|
||||
return 0;
|
||||
if (evaluationContext.isDefend || evaluationContext.isArmyUpgrade)
|
||||
score = evaluationContext.armyInvolvement;
|
||||
|
Loading…
x
Reference in New Issue
Block a user