Jelajahi Sumber

Update PriorityEvaluator.cpp

AI will be more aggressive when defending their territory. And more aggressive means more willing to take losses while fighting.
Xilmi 1 tahun lalu
induk
melakukan
eb94c9f0be
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      AI/Nullkiller/Engine/PriorityEvaluator.cpp

+ 1 - 1
AI/Nullkiller/Engine/PriorityEvaluator.cpp

@@ -1345,7 +1345,7 @@ float PriorityEvaluator::evaluate(Goals::TSubgoal task, int priorityTier)
 	else
 	{
 		float score = 0;
-		float maxWillingToLose = ai->cb->getTownsInfo().empty() ? 1 : 0.25;
+		float maxWillingToLose = ai->cb->getTownsInfo().empty() || (evaluationContext.isDefend && evaluationContext.threatTurns == 0) ? 1 : 0.25;
 
 		bool arriveNextWeek = false;
 		if (ai->cb->getDate(Date::DAY_OF_WEEK) + evaluationContext.turn > 7)