Update MotivationToAttackAutomation.kt (#13724)

This commit is contained in:
EmperorPinguin 2025-07-29 15:17:13 +02:00 committed by GitHub
parent 648b0998c0
commit 5e89e60442
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -58,8 +58,6 @@ object MotivationToAttackAutomation {
val scoreRatioModifier = getScoreRatioModifier(targetCiv, civInfo)
modifiers.add(Pair("Relative score", scoreRatioModifier))
modifiers.add(Pair("Relative technologies", getRelativeTechModifier(civInfo, targetCiv)))
if (civInfo.stats.getUnitSupplyDeficit() != 0) {
modifiers.add(Pair("Over unit supply", (civInfo.stats.getUnitSupplyDeficit() * 2f).coerceAtMost(20f)))
} else if (targetCiv.stats.getUnitSupplyDeficit() == 0 && !targetCiv.isCityState) {
@ -205,19 +203,6 @@ object MotivationToAttackAutomation {
return relationshipModifier * diplomacyManager.civInfo.getPersonality().modifierFocus(PersonalityValue.Loyal, .3f)
}
private fun getRelativeTechModifier(civInfo: Civilization, otherCiv: Civilization): Float {
val relativeTech = civInfo.getStatForRanking(RankingType.Technologies) - otherCiv.getStatForRanking(RankingType.Technologies)
val relativeTechModifier = when {
relativeTech > 6 -> 10f
relativeTech > 3 -> 5f
relativeTech > -3 -> 0f
relativeTech > -6 -> -2f
relativeTech > -9 -> -5f
else -> -10f
}
return relativeTechModifier
}
private fun getProductionRatioModifier(civInfo: Civilization, otherCiv: Civilization): Float {
// If either of our Civs are suffering from a supply deficit, our army must be too large
// There is no easy way to check the raw production if a civ has a supply deficit