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", "name": "Library",
"hurryCostModifier": 25, "hurryCostModifier": 25,
"maintenance": 1, "maintenance": 1,
"uniques": ["[+1 Science] Per [2] Population [in this city]"], "uniques": ["[+1 Science] per [2] population [in this city]"],
"requiredTech": "Writing" "requiredTech": "Writing"
}, },
{ {
@ -72,7 +72,7 @@
"uniqueTo": "China", "uniqueTo": "China",
"hurryCostModifier": 25, "hurryCostModifier": 25,
"gold": 2, "gold": 2,
"uniques": ["[+1 Science] Per [2] Population [in this city]"], "uniques": ["[+1 Science] per [2] population [in this city]"],
"requiredTech": "Writing" "requiredTech": "Writing"
}, },
{ {
@ -729,7 +729,7 @@
"culture": 1, "culture": 1,
"greatPersonPoints": {"science": 2}, "greatPersonPoints": {"science": 2},
"isWonder": true, "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", "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" "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", "requiredBuilding": "University",
"maintenance": 3, "maintenance": 3,
"hurryCostModifier": 0, "hurryCostModifier": 0,
"uniques": ["[+1 Science] Per [2] Population [in this city]"], "uniques": ["[+1 Science] per [2] population [in this city]"],
"requiredTech": "Scientific Theory" "requiredTech": "Scientific Theory"
}, },
{ {

View File

@ -267,7 +267,7 @@
{ {
"name": "Rationalism", "name": "Rationalism",
"era": "Renaissance era", "era": "Renaissance era",
"uniques": ["Production to science conversion in cities increased by 33%"], "uniques": ["+[15]% [Science] while the empire is happy"],
"policies": [ "policies": [
{ {
"name": "Secularism", "name": "Secularism",
@ -291,21 +291,21 @@
}, },
{ {
"name": "Sovereignty", "name": "Sovereignty",
"uniques": ["+15% science while empire is happy"], "uniques": ["[+1 Gold] from all [Science] buildings"],
"requires": ["Humanism"], "requires": ["Humanism"],
"row": 2, "row": 2,
"column": 5 "column": 5
}, },
{ {
"name": "Scientific Revolution", "name": "Scientific Revolution",
"uniques": ["Science gained from research agreements +50%"], "uniques": ["Science gained from research agreements +[50]%"],
"requires": ["Free Thought"], "requires": ["Free Thought"],
"row": 3, "row": 3,
"column": 1 "column": 1
}, },
{ {
"name": "Rationalism Complete", "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() stats.production += unique.params[0].toInt()
} }
if (cityInfo.civInfo.getHappiness() >= 0) {
if (cityInfo.civInfo.getHappiness() >= 0 && uniques.any { it.text == "+15% science while empire is happy" }) for (unique in uniques.filter { it.placeholderText == "+[]% [] while the empire is happy"})
stats.science += 15f 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 return stats
} }

View File

@ -182,8 +182,13 @@ class TechManager {
private fun scienceFromResearchAgreements(): Int { private fun scienceFromResearchAgreements(): Int {
// https://forums.civfanatics.com/resources/research-agreements-bnw.25568/ // https://forums.civfanatics.com/resources/research-agreements-bnw.25568/
var researchAgreementModifier = 0.5f var researchAgreementModifier = 0.5f
for (unique in civInfo.getMatchingUniques("Science gained from research agreements +50%")) // Deprecated since 3.15.0
researchAgreementModifier += 0.25f 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() 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 // 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++ "Free Social Policy" -> if (!civInfo.isSpectator()) civInfo.policies.freePolicies++
"Empire enters golden age" -> "[] Free Social Policies" -> if (!civInfo.isSpectator()) civInfo.policies.freePolicies += unique.params[0].toInt()
civInfo.goldenAges.enterGoldenAge() "Empire enters golden age" -> civInfo.goldenAges.enterGoldenAge()
"Free Great Person" -> { "Free Great Person" -> {
if (civInfo.isSpectator()) return if (civInfo.isSpectator()) return
if (civInfo.isPlayerCivilization()) civInfo.greatPeople.freeGreatPeople++ if (civInfo.isPlayerCivilization()) civInfo.greatPeople.freeGreatPeople++
@ -81,7 +81,8 @@ object UniqueTriggerActivation {
city.population.population += 1 city.population.population += 1
city.population.autoAssignPopulation() 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() "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 "+20% attack bonus to all Military Units for 30 turns" -> civInfo.policies.autocracyCompletedTurns = 30