mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-28 22:37:02 -04:00
Fix construction cost.
This commit is contained in:
parent
7497ffd3b6
commit
c2f6637a91
@ -162,7 +162,8 @@ class Building : NamedStats(), IConstruction{
|
|||||||
// https://forums.civfanatics.com/threads/rush-buying-formula.393892/
|
// https://forums.civfanatics.com/threads/rush-buying-formula.393892/
|
||||||
var cost = Math.pow((30 * getProductionCost(adoptedPolicies)).toDouble(), 0.75) * (1 + hurryCostModifier / 100)
|
var cost = Math.pow((30 * getProductionCost(adoptedPolicies)).toDouble(), 0.75) * (1 + hurryCostModifier / 100)
|
||||||
if (adoptedPolicies.contains("Mercantilism")) cost *= 0.75
|
if (adoptedPolicies.contains("Mercantilism")) cost *= 0.75
|
||||||
if (adoptedPolicies.contains("Patronage")) cost *= 0.5
|
if (adoptedPolicies.contains("Patronage")
|
||||||
|
&& listOf("Monument", "Temple", "Opera House", "Museum").contains(name) ) cost *= 0.5
|
||||||
return (cost / 10).toInt() * 10
|
return (cost / 10).toInt() * 10
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -91,6 +91,7 @@ class BaseUnit : INamed, IConstruction, ICivilopedia {
|
|||||||
|
|
||||||
override fun getGoldCost(adoptedPolicies: HashSet<String>): Int {
|
override fun getGoldCost(adoptedPolicies: HashSet<String>): Int {
|
||||||
var cost = getBaseGoldCost()
|
var cost = getBaseGoldCost()
|
||||||
|
if(adoptedPolicies.contains("Mercantilism")) cost *= 0.75
|
||||||
if(adoptedPolicies.contains("Militarism")) cost *= 0.66f
|
if(adoptedPolicies.contains("Militarism")) cost *= 0.66f
|
||||||
return (cost / 10).toInt() * 10 // rounded down o nearest ten
|
return (cost / 10).toInt() * 10 // rounded down o nearest ten
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user