mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-30 07:21:34 -04:00
parameterized few uniques, fixed "Mass Media" tech in mods (#3184)
* parameterized "Culture cost of adopting new Policies reduced by [10]%" and "Each city founded increases culture cost of policies [33]% less than normal" * removed old fix for abcense of "Mass Media" tech so mods can have this tech
This commit is contained in:
parent
33270baea2
commit
0f97c5eb59
@ -896,7 +896,7 @@
|
|||||||
"culture": 5,
|
"culture": 5,
|
||||||
"isWonder": true,
|
"isWonder": true,
|
||||||
"greatPersonPoints": {"culture": 2},
|
"greatPersonPoints": {"culture": 2},
|
||||||
"uniques": ["Culture cost of adopting new Policies reduced by 10%"],
|
"uniques": ["Culture cost of adopting new Policies reduced by [10]%"],
|
||||||
"requiredTech": "Flight",
|
"requiredTech": "Flight",
|
||||||
"quote": "'Come to me, all who labor and are heavy burdened, and I will give you rest.' - New Testament, Matthew 11:28"
|
"quote": "'Come to me, all who labor and are heavy burdened, and I will give you rest.' - New Testament, Matthew 11:28"
|
||||||
},
|
},
|
||||||
|
@ -80,7 +80,7 @@
|
|||||||
{
|
{
|
||||||
"name": "Representation",
|
"name": "Representation",
|
||||||
"effect": "Each city founded increases culture cost of policies 33% less than normal. Starts a golden age.",
|
"effect": "Each city founded increases culture cost of policies 33% less than normal. Starts a golden age.",
|
||||||
"uniques": ["Each city founded increases culture cost of policies 33% less than normal", "Empire enters golden age"],
|
"uniques": ["Each city founded increases culture cost of policies [33]% less than normal", "Empire enters golden age"],
|
||||||
"requires": ["Citizenship"],
|
"requires": ["Citizenship"],
|
||||||
"row": 2,
|
"row": 2,
|
||||||
"column": 3
|
"column": 3
|
||||||
@ -199,7 +199,7 @@
|
|||||||
{
|
{
|
||||||
"name": "Piety Complete",
|
"name": "Piety Complete",
|
||||||
"effect": "Reduce culture cost of future policies by 10%",
|
"effect": "Reduce culture cost of future policies by 10%",
|
||||||
"uniques": ["Culture cost of adopting new Policies reduced by 10%"]
|
"uniques": ["Culture cost of adopting new Policies reduced by [10]%"]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},/*{
|
},/*{
|
||||||
|
@ -76,10 +76,17 @@ class PolicyManager {
|
|||||||
var policyCultureCost = 25 + (numberOfAdoptedPolicies * 6).toDouble().pow(1.7)
|
var policyCultureCost = 25 + (numberOfAdoptedPolicies * 6).toDouble().pow(1.7)
|
||||||
var cityModifier = 0.3f * (civInfo.cities.count { !it.isPuppet } - 1)
|
var cityModifier = 0.3f * (civInfo.cities.count { !it.isPuppet } - 1)
|
||||||
|
|
||||||
|
// As of 3.10.11 These are to be deprecated. Keeping it here so that mods with this can still work for now.
|
||||||
|
// Use "Culture cost of adopting new Policies reduced by [10]%" and "Each city founded increases culture cost of policies [33]% less than normal" instead
|
||||||
if (civInfo.hasUnique("Each city founded increases culture cost of policies 33% less than normal"))
|
if (civInfo.hasUnique("Each city founded increases culture cost of policies 33% less than normal"))
|
||||||
cityModifier *= (2 / 3f)
|
cityModifier *= (2 / 3f)
|
||||||
for(unique in civInfo.getMatchingUniques("Culture cost of adopting new Policies reduced by 10%"))
|
for(unique in civInfo.getMatchingUniques("Culture cost of adopting new Policies reduced by 10%"))
|
||||||
policyCultureCost *= 0.9
|
policyCultureCost *= 0.9
|
||||||
|
|
||||||
|
for (unique in civInfo.getMatchingUniques("Each city founded increases culture cost of policies []% less than normal"))
|
||||||
|
cityModifier *= 1 - unique.params[0].toFloat() / 100
|
||||||
|
for (unique in civInfo.getMatchingUniques("Culture cost of adopting new Policies reduced by []%"))
|
||||||
|
policyCultureCost *= 1 - unique.params[0].toFloat() / 100
|
||||||
if (civInfo.isPlayerCivilization())
|
if (civInfo.isPlayerCivilization())
|
||||||
policyCultureCost *= civInfo.getDifficulty().policyCostModifier
|
policyCultureCost *= civInfo.getDifficulty().policyCostModifier
|
||||||
policyCultureCost *= civInfo.gameInfo.gameParameters.gameSpeed.modifier
|
policyCultureCost *= civInfo.gameInfo.gameParameters.gameSpeed.modifier
|
||||||
|
@ -290,29 +290,6 @@ class TechManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun setTransients() {
|
fun setTransients() {
|
||||||
// As of 2.10.16, removed mass media, since our tech tree is like G&K
|
|
||||||
techsResearched.remove("Mass Media")
|
|
||||||
techsToResearch.remove("Mass Media")
|
|
||||||
techsInProgress.remove("Mass Media")
|
|
||||||
|
|
||||||
// As of 2.13.15, "Replacable parts" is renamed to "Replaceable Parts"
|
|
||||||
val badTechName = "Replacable Parts"
|
|
||||||
val goodTechName = "Replaceable Parts"
|
|
||||||
if (techsResearched.contains(badTechName)) {
|
|
||||||
techsResearched.remove(badTechName)
|
|
||||||
techsResearched.add(goodTechName)
|
|
||||||
}
|
|
||||||
if (techsInProgress.containsKey(badTechName)) {
|
|
||||||
techsInProgress[goodTechName] = techsInProgress[badTechName]!!
|
|
||||||
techsInProgress.remove(badTechName)
|
|
||||||
}
|
|
||||||
if (techsToResearch.contains(badTechName)) {
|
|
||||||
val newTechToReseach = ArrayList<String>()
|
|
||||||
for (tech in techsToResearch)
|
|
||||||
newTechToReseach.add(if (tech != badTechName) tech else goodTechName)
|
|
||||||
techsToResearch = newTechToReseach
|
|
||||||
}
|
|
||||||
|
|
||||||
researchedTechnologies.addAll(techsResearched.map { getRuleset().technologies[it]!! })
|
researchedTechnologies.addAll(techsResearched.map { getRuleset().technologies[it]!! })
|
||||||
researchedTechUniques.addAll(researchedTechnologies.flatMap { it.uniques })
|
researchedTechUniques.addAll(researchedTechnologies.flatMap { it.uniques })
|
||||||
updateTransientBooleans()
|
updateTransientBooleans()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user