Make pantheon cost respect game speed modifer (#12635)

* Make pantheon cost respect game speed modifer

* Inplement suggestion
This commit is contained in:
SeventhM 2024-12-16 00:53:01 -08:00 committed by GitHub
parent f07444e030
commit b55e02fd4d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -15,6 +15,7 @@ import com.unciv.models.ruleset.unit.BaseUnit
import com.unciv.ui.components.extensions.toPercent
import com.unciv.ui.screens.worldscreen.unit.actions.UnitActionModifiers
import java.lang.Integer.min
import kotlin.math.roundToInt
import kotlin.random.Random
class ReligionManager : IsPartOfGameInfoSerialization {
@ -106,8 +107,12 @@ class ReligionManager : IsPartOfGameInfoSerialization {
|| religionState == ReligionState.Pantheon // any subsequent pantheons before founding a religion
|| (religionState == ReligionState.Religion || religionState == ReligionState.EnhancedReligion) // any belief adding outside of great prophet use
fun faithForPantheon(additionalCivs: Int = 0) =
civInfo.gameInfo.ruleset.modOptions.constants.pantheonBase + (civInfo.gameInfo.civilizations.count { it.isMajorCiv() && it.religionManager.religion != null } + additionalCivs) * civInfo.gameInfo.ruleset.modOptions.constants.pantheonGrowth
fun faithForPantheon(additionalCivs: Int = 0): Int {
val gameInfo = civInfo.gameInfo
val numCivs = additionalCivs + gameInfo.civilizations.count { it.isMajorCiv() && it.religionManager.religion != null }
val cost = gameInfo.ruleset.modOptions.constants.pantheonBase + numCivs * gameInfo.ruleset.modOptions.constants.pantheonGrowth
return (cost * gameInfo.speed.faithCostModifier).roundToInt()
}
/** Used for founding the pantheon and for each time the player gets additional pantheon beliefs
* before forming a religion */