mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-23 22:30:18 +07:00
Free policies no longer increase future policy cost
This commit is contained in:
@ -158,6 +158,9 @@ class CivilizationInfo {
|
|||||||
fun setTransients() {
|
fun setTransients() {
|
||||||
goldenAges.civInfo = this
|
goldenAges.civInfo = this
|
||||||
policies.civInfo = this
|
policies.civInfo = this
|
||||||
|
if(policies.adoptedPolicies.size>0 && policies.numberOfAdoptedPolicies == 0)
|
||||||
|
policies.numberOfAdoptedPolicies = policies.adoptedPolicies.count { !it.endsWith("Complete") }
|
||||||
|
|
||||||
tech.civInfo = this
|
tech.civInfo = this
|
||||||
diplomacy.values.forEach { it.civInfo=this}
|
diplomacy.values.forEach { it.civInfo=this}
|
||||||
|
|
||||||
|
@ -13,13 +13,13 @@ class PolicyManager {
|
|||||||
var freePolicies = 0
|
var freePolicies = 0
|
||||||
var storedCulture = 0
|
var storedCulture = 0
|
||||||
internal val adoptedPolicies = HashSet<String>()
|
internal val adoptedPolicies = HashSet<String>()
|
||||||
|
var numberOfAdoptedPolicies = 0
|
||||||
var shouldOpenPolicyPicker = false
|
var shouldOpenPolicyPicker = false
|
||||||
|
|
||||||
// from https://forums.civfanatics.com/threads/the-number-crunching-thread.389702/
|
// from https://forums.civfanatics.com/threads/the-number-crunching-thread.389702/
|
||||||
// round down to nearest 5
|
// round down to nearest 5
|
||||||
fun getCultureNeededForNextPolicy(): Int {
|
fun getCultureNeededForNextPolicy(): Int {
|
||||||
val basicPolicies = adoptedPolicies.count { !it.endsWith("Complete") }
|
var baseCost = 25 + Math.pow((numberOfAdoptedPolicies * 6).toDouble(), 1.7)
|
||||||
var baseCost = 25 + Math.pow((basicPolicies * 6).toDouble(), 1.7)
|
|
||||||
var cityModifier = 0.3 * (civInfo.cities.size - 1)
|
var cityModifier = 0.3 * (civInfo.cities.size - 1)
|
||||||
if (isAdopted("Representation")) cityModifier *= (2 / 3f).toDouble()
|
if (isAdopted("Representation")) cityModifier *= (2 / 3f).toDouble()
|
||||||
if (isAdopted("Piety Complete")) baseCost *= 0.9
|
if (isAdopted("Piety Complete")) baseCost *= 0.9
|
||||||
@ -43,7 +43,10 @@ class PolicyManager {
|
|||||||
|
|
||||||
if(!branchCompletion) {
|
if(!branchCompletion) {
|
||||||
if (freePolicies > 0) freePolicies--
|
if (freePolicies > 0) freePolicies--
|
||||||
else storedCulture -= getCultureNeededForNextPolicy()
|
else {
|
||||||
|
storedCulture -= getCultureNeededForNextPolicy()
|
||||||
|
numberOfAdoptedPolicies++
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
adoptedPolicies.add(policy.name)
|
adoptedPolicies.add(policy.name)
|
||||||
|
Reference in New Issue
Block a user