mirror of
https://github.com/yairm210/Unciv.git
synced 2025-02-10 02:47:24 +07:00
AI peace evaluation no longer hardocded - resolves first point of #5490
This commit is contained in:
parent
66fa8db51c
commit
f3b4c2fa6f
@ -663,7 +663,7 @@ class CivilizationInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun calculateMilitaryMight(): Int {
|
private fun calculateMilitaryMight(): Int {
|
||||||
var sum = 0
|
var sum = 1 // minimum value, so we never end up with 0
|
||||||
for (unit in units) {
|
for (unit in units) {
|
||||||
sum += if (unit.baseUnit.isWaterUnit())
|
sum += if (unit.baseUnit.isWaterUnit())
|
||||||
unit.getForceEvaluation() / 2 // Really don't value water units highly
|
unit.getForceEvaluation() / 2 // Really don't value water units highly
|
||||||
|
@ -266,8 +266,6 @@ class TradeEvaluation {
|
|||||||
val theirCombatStrength = otherCivilization.getStatForRanking(RankingType.Force)
|
val theirCombatStrength = otherCivilization.getStatForRanking(RankingType.Force)
|
||||||
if (ourCombatStrength * 1.5f >= theirCombatStrength && theirCombatStrength * 1.5f >= ourCombatStrength)
|
if (ourCombatStrength * 1.5f >= theirCombatStrength && theirCombatStrength * 1.5f >= ourCombatStrength)
|
||||||
return 0 // we're roughly equal, there's no huge power imbalance
|
return 0 // we're roughly equal, there's no huge power imbalance
|
||||||
if (ourCombatStrength == 0) return -1000
|
|
||||||
if (theirCombatStrength == 0) return 1000 // Chumps got no combat units
|
|
||||||
if (ourCombatStrength > theirCombatStrength) {
|
if (ourCombatStrength > theirCombatStrength) {
|
||||||
val absoluteAdvantage = ourCombatStrength - theirCombatStrength
|
val absoluteAdvantage = ourCombatStrength - theirCombatStrength
|
||||||
val percentageAdvantage = absoluteAdvantage / theirCombatStrength.toFloat()
|
val percentageAdvantage = absoluteAdvantage / theirCombatStrength.toFloat()
|
||||||
|
Loading…
Reference in New Issue
Block a user