Implemented Cultural Diplomacy policy

This commit is contained in:
Yair Morgenstern 2021-01-29 12:06:16 +02:00
parent 2f121983cf
commit 1a576539e0
2 changed files with 12 additions and 7 deletions

View File

@ -193,13 +193,14 @@
},
{
"name": "Scholasticism",
"requires": ["Philantropy"],
"uniques":["Allied City-States provide Science equal to [25]% of what they produce for themselves"],
"requires": ["Philantropy"],
"row": 2,
"column": 2
},
{
"name": "Cultural Diplomacy",
"uniques": ["Quantity of Resources gifted by City-States increased by [100]%"],
"requires": ["Scholasticism"],
"row": 3,
"column": 2

View File

@ -144,10 +144,14 @@ class CivInfoTransientUpdater(val civInfo: CivilizationInfo) {
for (city in civInfo.cities) newDetailedCivResources.add(city.getCityResources())
if (!civInfo.isCityState()) {
var resourceBonusPercentage = 1f
for (unique in civInfo.getMatchingUniques("Quantity of Resources gifted by City-States increased by []%"))
resourceBonusPercentage += unique.params[0].toFloat() / 100
for (otherCiv in civInfo.getKnownCivs().filter { it.getAllyCiv() == civInfo.civName }) {
for (city in otherCiv.cities) {
for (resourceSupply in city.getCityResources())
newDetailedCivResources.add(resourceSupply.resource,resourceSupply.amount,"City-States")
newDetailedCivResources.add(resourceSupply.resource,
(resourceSupply.amount * resourceBonusPercentage).toInt(), "City-States")
}
}
}