mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-18 08:47:05 -04:00
AI: Don't choose one-time-action promotions
This commit is contained in:
parent
900d81f48b
commit
a9b8596e87
@ -183,9 +183,10 @@ object UnitAutomation {
|
||||
// Restrict Human automated units from promotions via setting
|
||||
(UncivGame.Current.settings.automatedUnitsChoosePromotions || unit.civ.isAI())) {
|
||||
val availablePromotions = unit.promotions.getAvailablePromotions()
|
||||
if (unit.health < 60 && !(unit.baseUnit.isAirUnit() || unit.baseUnit.hasUnique(UniqueType.CanMoveAfterAttacking)) && availablePromotions.any { it.hasUnique(UniqueType.OneTimeUnitHeal) })
|
||||
availablePromotions.filter { it.hasUnique(UniqueType.OneTimeUnitHeal) } //choose healing promotions only when beneficial
|
||||
else availablePromotions.filterNot { it.hasUnique(UniqueType.SkipPromotion) }
|
||||
// It can be assumed that "heal + skip promotion" is a bad choice - the cases where we WOULD want it are slim
|
||||
.filterNot { it.hasUnique(UniqueType.SkipPromotion) }
|
||||
|
||||
|
||||
if (availablePromotions.none()) break
|
||||
val freePromotions = availablePromotions.filter { it.hasUnique(UniqueType.FreePromotion) }.toList()
|
||||
val stateForConditionals = unit.cache.state
|
||||
|
Loading…
x
Reference in New Issue
Block a user