Scale CS military rank tribute points such that last place gives 0.

This commit is contained in:
Loof 2025-09-18 19:11:31 +02:00
parent d51ef24c20
commit fde448ec2c

View File

@ -28,6 +28,7 @@ import com.unciv.models.stats.Stat
import com.unciv.ui.screens.victoryscreen.RankingType import com.unciv.ui.screens.victoryscreen.RankingType
import com.unciv.utils.randomWeighted import com.unciv.utils.randomWeighted
import yairm210.purity.annotations.Readonly import yairm210.purity.annotations.Readonly
import kotlin.math.max
import kotlin.math.min import kotlin.math.min
import kotlin.math.pow import kotlin.math.pow
import kotlin.random.Random import kotlin.random.Random
@ -465,7 +466,7 @@ class CityStateFunctions(val civInfo: Civilization) {
val forceRank = civInfo.gameInfo.getAliveMajorCivs().sortedByDescending { it.getStatForRanking( val forceRank = civInfo.gameInfo.getAliveMajorCivs().sortedByDescending { it.getStatForRanking(
RankingType.Force) }.indexOf(demandingCiv) RankingType.Force) }.indexOf(demandingCiv)
val globalModifier = civInfo.gameInfo.ruleset.modOptions.constants.tributeGlobalModifier val globalModifier = civInfo.gameInfo.ruleset.modOptions.constants.tributeGlobalModifier
modifiers["Military Rank"] = globalModifier - ((globalModifier / civInfo.gameInfo.gameParameters.players.size) * forceRank) modifiers["Military Rank"] = globalModifier - forceRank * globalModifier / max(civInfo.gameInfo.gameParameters.players.size-1, 1)
if (!requireWholeList && modifiers.values.sum() < -100) if (!requireWholeList && modifiers.values.sum() < -100)
return modifiers return modifiers