Updated Rationalism branch to G&K (#4136)

This commit is contained in:
Xander Lenstra 2021-06-14 14:10:49 +02:00 committed by GitHub
parent 1c21573a42
commit fbebcdcd21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 28 additions and 16 deletions

View File

@ -52,7 +52,7 @@
"name": "Library",
"hurryCostModifier": 25,
"maintenance": 1,
"uniques": ["[+1 Science] Per [2] Population [in this city]"],
"uniques": ["[+1 Science] per [2] population [in this city]"],
"requiredTech": "Writing"
},
{
@ -72,7 +72,7 @@
"uniqueTo": "China",
"hurryCostModifier": 25,
"gold": 2,
"uniques": ["[+1 Science] Per [2] Population [in this city]"],
"uniques": ["[+1 Science] per [2] population [in this city]"],
"requiredTech": "Writing"
},
{
@ -729,7 +729,7 @@
"culture": 1,
"greatPersonPoints": {"science": 2},
"isWonder": true,
"uniques": ["Free [Great Scientist] appears","Science gained from research agreements +50%"],
"uniques": ["Free [Great Scientist] appears","Science gained from research agreements +[50]%"],
"requiredTech": "Architecture",
"quote": "'Things always seem fairer when we look back at them, and it is out of that inaccessible tower of the past that Longing leans and beckons.' - James Russell Lowell"
},
@ -752,7 +752,7 @@
"requiredBuilding": "University",
"maintenance": 3,
"hurryCostModifier": 0,
"uniques": ["[+1 Science] Per [2] Population [in this city]"],
"uniques": ["[+1 Science] per [2] population [in this city]"],
"requiredTech": "Scientific Theory"
},
{

View File

@ -267,7 +267,7 @@
{
"name": "Rationalism",
"era": "Renaissance era",
"uniques": ["Production to science conversion in cities increased by 33%"],
"uniques": ["+[15]% [Science] while the empire is happy"],
"policies": [
{
"name": "Secularism",
@ -291,21 +291,21 @@
},
{
"name": "Sovereignty",
"uniques": ["+15% science while empire is happy"],
"uniques": ["[+1 Gold] from all [Science] buildings"],
"requires": ["Humanism"],
"row": 2,
"column": 5
},
{
"name": "Scientific Revolution",
"uniques": ["Science gained from research agreements +50%"],
"uniques": ["Science gained from research agreements +[50]%"],
"requires": ["Free Thought"],
"row": 3,
"column": 1
},
{
"name": "Rationalism Complete",
"uniques": ["[+1 Gold] from all [Science] buildings"]
"uniques": ["[2] Free Technologies"]
}
]
},

View File

@ -317,9 +317,15 @@ class CityStats {
stats.production += unique.params[0].toInt()
}
if (cityInfo.civInfo.getHappiness() >= 0 && uniques.any { it.text == "+15% science while empire is happy" })
stats.science += 15f
if (cityInfo.civInfo.getHappiness() >= 0) {
for (unique in uniques.filter { it.placeholderText == "+[]% [] while the empire is happy"})
stats.add(Stat.valueOf(unique.params[1]), unique.params[0].toFloat())
// Deprecated since 3.15.0
for (unique in uniques.filter { it.placeholderText == "+15% science while the empire is happy"})
stats.science += 15f
//
}
return stats
}

View File

@ -182,8 +182,13 @@ class TechManager {
private fun scienceFromResearchAgreements(): Int {
// https://forums.civfanatics.com/resources/research-agreements-bnw.25568/
var researchAgreementModifier = 0.5f
for (unique in civInfo.getMatchingUniques("Science gained from research agreements +50%"))
researchAgreementModifier += 0.25f
// Deprecated since 3.15.0
for (unique in civInfo.getMatchingUniques("Science gained from research agreements +50%"))
researchAgreementModifier += 0.25f
//
for (unique in civInfo.getMatchingUniques("Science gained from research agreements +[]%")) {
researchAgreementModifier += unique.params[0].toFloat() / 200f
}
return (scienceFromResearchAgreements / 3 * researchAgreementModifier).toInt()
}

View File

@ -53,8 +53,8 @@ object UniqueTriggerActivation {
}
// spectators get all techs at start of game, and if (in a mod) a tech gives a free policy, the game stucks on the policy picker screen
"Free Social Policy" -> if (!civInfo.isSpectator()) civInfo.policies.freePolicies++
"Empire enters golden age" ->
civInfo.goldenAges.enterGoldenAge()
"[] Free Social Policies" -> if (!civInfo.isSpectator()) civInfo.policies.freePolicies += unique.params[0].toInt()
"Empire enters golden age" -> civInfo.goldenAges.enterGoldenAge()
"Free Great Person" -> {
if (civInfo.isSpectator()) return
if (civInfo.isPlayerCivilization()) civInfo.greatPeople.freeGreatPeople++
@ -81,7 +81,8 @@ object UniqueTriggerActivation {
city.population.population += 1
city.population.autoAssignPopulation()
}
"Free Technology" -> civInfo.tech.freeTechs += 1
"Free Technology" -> if (!civInfo.isSpectator()) civInfo.tech.freeTechs += 1
"[] Free Technologies" -> if (!civInfo.isSpectator()) civInfo.tech.freeTechs += unique.params[0].toInt()
"Quantity of strategic resources produced by the empire increased by 100%" -> civInfo.updateDetailedCivResources()
"+20% attack bonus to all Military Units for 30 turns" -> civInfo.policies.autocracyCompletedTurns = 30