mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-11 13:19:39 -04:00
Update MotivationToAttackAutomation.kt (#13724)
This commit is contained in:
parent
648b0998c0
commit
5e89e60442
@ -58,8 +58,6 @@ object MotivationToAttackAutomation {
|
|||||||
val scoreRatioModifier = getScoreRatioModifier(targetCiv, civInfo)
|
val scoreRatioModifier = getScoreRatioModifier(targetCiv, civInfo)
|
||||||
modifiers.add(Pair("Relative score", scoreRatioModifier))
|
modifiers.add(Pair("Relative score", scoreRatioModifier))
|
||||||
|
|
||||||
modifiers.add(Pair("Relative technologies", getRelativeTechModifier(civInfo, targetCiv)))
|
|
||||||
|
|
||||||
if (civInfo.stats.getUnitSupplyDeficit() != 0) {
|
if (civInfo.stats.getUnitSupplyDeficit() != 0) {
|
||||||
modifiers.add(Pair("Over unit supply", (civInfo.stats.getUnitSupplyDeficit() * 2f).coerceAtMost(20f)))
|
modifiers.add(Pair("Over unit supply", (civInfo.stats.getUnitSupplyDeficit() * 2f).coerceAtMost(20f)))
|
||||||
} else if (targetCiv.stats.getUnitSupplyDeficit() == 0 && !targetCiv.isCityState) {
|
} else if (targetCiv.stats.getUnitSupplyDeficit() == 0 && !targetCiv.isCityState) {
|
||||||
@ -205,19 +203,6 @@ object MotivationToAttackAutomation {
|
|||||||
return relationshipModifier * diplomacyManager.civInfo.getPersonality().modifierFocus(PersonalityValue.Loyal, .3f)
|
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 {
|
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
|
// 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
|
// There is no easy way to check the raw production if a civ has a supply deficit
|
||||||
|
Loading…
x
Reference in New Issue
Block a user