Policy transformation
This commit is contained in:
parent
654a355666
commit
0444a28657
5 changed files with 26 additions and 24 deletions
|
@ -154,7 +154,7 @@
|
|||
"name": "Piety",
|
||||
"era": "Classical era",
|
||||
"effect": "Building time of culture buildings reduced by 15%",
|
||||
"uniques": ["Production cost of [Culture] buildings reduced by [15]%"],
|
||||
"uniques": ["+[15]% Production when constructing [Culture] buildings"],
|
||||
"policies": [
|
||||
{
|
||||
"name": "Organized Religion",
|
||||
|
@ -167,12 +167,14 @@
|
|||
{
|
||||
"name": "Mandate Of Heaven",
|
||||
"effect": "50% of excess happiness added to culture towards policies",
|
||||
"uniques": ["50% of excess happiness added to culture towards policies"],
|
||||
"row": 1,
|
||||
"column": 5
|
||||
},
|
||||
{
|
||||
"name": "Theocracy",
|
||||
"effect": "Temples give +10% gold",
|
||||
"uniques": ["Temples give +10% gold"],
|
||||
"requires": ["Organized Religion"],
|
||||
"row": 2,
|
||||
"column": 1
|
||||
|
@ -180,6 +182,7 @@
|
|||
{
|
||||
"name": "Reformation",
|
||||
"effect": "+33% culture in all cities with a world wonder, immediately enter a golden age",
|
||||
"uniques": ["+33% culture in all cities with a world wonder", "Empire enters golden age"]
|
||||
"requires": ["Organized Religion"],
|
||||
"row": 2,
|
||||
"column": 3
|
||||
|
@ -187,6 +190,8 @@
|
|||
{
|
||||
"name": "Free Religion",
|
||||
"effect": "+1 culture for each monument, temple and monastery. Gain a free policy.",
|
||||
"uniques": ["[+1 Culture] from every [Monument]", "[+1 Culture] from every [Temple]", "[+1 Culture] from every [Monastery]",
|
||||
"Free Social Policy"]
|
||||
"requires": ["Mandate Of Heaven","Reformation"],
|
||||
"row": 3,
|
||||
"column": 4
|
||||
|
|
|
@ -342,10 +342,21 @@ class CityStats {
|
|||
if (cityInfo.civInfo.hasUnique("+20% production when training melee units")
|
||||
&& currentConstruction is BaseUnit && currentConstruction.unitType.isMelee())
|
||||
stats.production += 20
|
||||
if (policies.contains("Piety")
|
||||
&& listOf("Monument", "Temple", "Opera House", "Museum", "Broadcast Tower").contains(currentConstruction.name))
|
||||
stats.production += 15f
|
||||
if (policies.contains("Reformation") && cityConstructions.getBuiltBuildings().any { it.isWonder })
|
||||
|
||||
if(currentConstruction is Building && !currentConstruction.isWonder)
|
||||
for(unique in cityInfo.civInfo.getMatchingUniques("+[]% Production when constructing [] buildings")){
|
||||
val placeholderParams = unique.getPlaceholderParameters()
|
||||
val stat = Stat.valueOf(placeholderParams[0])
|
||||
if(currentConstruction.isStatRelated(stat))
|
||||
stats.production += placeholderParams[1].toInt()
|
||||
}
|
||||
|
||||
if (currentConstruction is Building && currentConstruction.name == "Courthouse"
|
||||
&& cityInfo.civInfo.policies.hasEffect("+3 Happiness from every Courthouse. Build Courthouses in half the usual time."))
|
||||
stats.production += 100
|
||||
|
||||
if (cityConstructions.getBuiltBuildings().any { it.isWonder }
|
||||
&& cityInfo.civInfo.hasUnique("+33% culture in all cities with a world wonder"))
|
||||
stats.culture += 33f
|
||||
if (policies.contains("Commerce") && cityInfo.isCapital())
|
||||
stats.gold += 25f
|
||||
|
|
|
@ -91,7 +91,7 @@ class CivInfoStats(val civInfo: CivilizationInfo){
|
|||
statMap["Transportation upkeep"] = Stats().apply { gold=- getTransportationUpkeep().toFloat()}
|
||||
statMap["Unit upkeep"] = Stats().apply { gold=- getUnitUpkeep().toFloat()}
|
||||
|
||||
if (civInfo.policies.hasEffect("50% of excess happiness added to culture towards policies")) {
|
||||
if (civInfo.hasUnique("50% of excess happiness added to culture towards policies")) {
|
||||
val happiness = civInfo.getHappiness()
|
||||
if(happiness>0) statMap.add("Policies", Stats().apply { culture=happiness/2f })
|
||||
}
|
||||
|
|
|
@ -138,9 +138,8 @@ class PolicyManager {
|
|||
if (hasCapital && (unitName != Constants.settler || !civInfo.isOneCityChallenger()))
|
||||
civInfo.placeUnitNearTile(civInfo.getCapital().location, unitName)
|
||||
}
|
||||
"+1 culture for each monument, temple and monastery. Gain a free policy." -> freePolicies++
|
||||
"Empire enters golden age",
|
||||
"+33% culture in all cities with a world wonder, immediately enter a golden age" ->
|
||||
"Gain a free policy" -> freePolicies++
|
||||
"Empire enters golden age" ->
|
||||
civInfo.goldenAges.enterGoldenAge()
|
||||
"Free Great Person" -> {
|
||||
if (civInfo.isPlayerCivilization()) civInfo.greatPeople.freeGreatPeople++
|
||||
|
|
|
@ -143,9 +143,6 @@ class Building : NamedStats(), IConstruction{
|
|||
stats.add(Stats.parse(placeholderParams[0]))
|
||||
}
|
||||
|
||||
if (adoptedPolicies.contains("Free Religion") && cultureBuildings.contains(baseBuildingName ))
|
||||
stats.culture += 1f
|
||||
|
||||
if (adoptedPolicies.contains("Entrepreneurship") && hashSetOf("Mint", "Market", "Bank", "Stock Market").contains(baseBuildingName ))
|
||||
stats.science += 1f
|
||||
|
||||
|
@ -172,10 +169,10 @@ class Building : NamedStats(), IConstruction{
|
|||
val adoptedPolicies = civInfo.policies.adoptedPolicies
|
||||
val baseBuildingName = getBaseBuilding(civInfo.gameInfo.ruleSet).name
|
||||
|
||||
if (adoptedPolicies.contains("Theocracy") && baseBuildingName == "Temple")
|
||||
if (baseBuildingName == "Temple" && civInfo.hasUnique("Temples give +10% gold"))
|
||||
stats.gold = 10f
|
||||
|
||||
if (adoptedPolicies.contains("Free Thought") && baseBuildingName == "University")
|
||||
if (baseBuildingName == "University" && adoptedPolicies.contains("Free Thought"))
|
||||
stats.science = 50f
|
||||
|
||||
if(uniques.contains("+5% Production for every Trade Route with a City-State in the empire"))
|
||||
|
@ -192,16 +189,6 @@ class Building : NamedStats(), IConstruction{
|
|||
override fun getProductionCost(civInfo: CivilizationInfo): Int {
|
||||
var productionCost = cost.toFloat()
|
||||
|
||||
if(!isWonder)
|
||||
for(unique in civInfo.getMatchingUniques("Production cost of [] buildings reduced by []%")){
|
||||
val placeholderParams = unique.getPlaceholderParameters()
|
||||
val stat = Stat.valueOf(placeholderParams[0])
|
||||
if(this.isStatRelated(stat))
|
||||
productionCost *= (1f - placeholderParams[1].toFloat()/100)
|
||||
}
|
||||
|
||||
if (name == "Courthouse" && civInfo.policies.hasEffect("+3 Happiness from every Courthouse. Build Courthouses in half the usual time."))
|
||||
productionCost *= 0.5f
|
||||
|
||||
if (civInfo.isPlayerCivilization()) {
|
||||
if (!isWonder)
|
||||
|
|
Loading…
Reference in a new issue