modding: Double Happiness from Natural Wonders -> [stats] from every known Natural Wonder

This commit is contained in:
Yair Morgenstern
2022-12-02 11:50:11 +02:00
parent 94605911a2
commit c9ed9d5d74
5 changed files with 17 additions and 11 deletions

View File

@ -563,7 +563,7 @@
"favoredReligion": "Christianity", "favoredReligion": "Christianity",
"uniqueName": "Seven Cities of Gold", "uniqueName": "Seven Cities of Gold",
"uniques": ["100 Gold for discovering a Natural Wonder (bonus enhanced to 500 Gold if first to discover it)", "uniques": ["100 Gold for discovering a Natural Wonder (bonus enhanced to 500 Gold if first to discover it)",
"Double Happiness from Natural Wonders", "[+100]% Yield from every [Natural Wonder]"], "[+1 Happiness] for every known Natural Wonder", "[+100]% Yield from every [Natural Wonder]"],
"cities": ["Madrid","Barcelona","Seville","Cordoba","Toledo","Santiago","Salamanca","Murcia","Valencia","Zaragoza","Pamplona", "cities": ["Madrid","Barcelona","Seville","Cordoba","Toledo","Santiago","Salamanca","Murcia","Valencia","Zaragoza","Pamplona",
"Vitoria","Santander","Oviedo","Jaen","Logroño","Valladolid","Palma","Teruel","Almeria","Leon","Zamora","Mida", "Vitoria","Santander","Oviedo","Jaen","Logroño","Valladolid","Palma","Teruel","Almeria","Leon","Zamora","Mida",
"Lugo","Alicante","Càdiz","Eiche","Alcorcon","Burgos","Vigo","Badajoz","La Coruña","Guadalquivir","Bilbao", "Lugo","Alicante","Càdiz","Eiche","Alcorcon","Burgos","Vigo","Badajoz","La Coruña","Guadalquivir","Bilbao",

View File

@ -520,7 +520,7 @@
"innerColor": [255,102,102], "innerColor": [255,102,102],
"uniqueName": "Seven Cities of Gold", "uniqueName": "Seven Cities of Gold",
"uniques": ["100 Gold for discovering a Natural Wonder (bonus enhanced to 500 Gold if first to discover it)", "uniques": ["100 Gold for discovering a Natural Wonder (bonus enhanced to 500 Gold if first to discover it)",
"Double Happiness from Natural Wonders", "[+100]% Yield from every [Natural Wonder]"], "[+1 Happiness] for every known Natural Wonder", "[+100]% Yield from every [Natural Wonder]"],
"cities": ["Madrid","Barcelona","Seville","Cordoba","Toledo","Santiago","Salamanca","Murcia","Valencia","Zaragoza","Pamplona", "cities": ["Madrid","Barcelona","Seville","Cordoba","Toledo","Santiago","Salamanca","Murcia","Valencia","Zaragoza","Pamplona",
"Vitoria","Santander","Oviedo","Jaen","Logroño","Valladolid","Palma","Teruel","Almeria","Leon","Zamora","Mida", "Vitoria","Santander","Oviedo","Jaen","Logroño","Valladolid","Palma","Teruel","Almeria","Leon","Zamora","Mida",
"Lugo","Alicante","Càdiz","Eiche","Alcorcon","Burgos","Vigo","Badajoz","La Coruña","Guadalquivir","Bilbao", "Lugo","Alicante","Càdiz","Eiche","Alcorcon","Burgos","Vigo","Badajoz","La Coruña","Guadalquivir","Bilbao",

View File

@ -250,12 +250,6 @@ class CivInfoStats(val civInfo: CivilizationInfo) {
statMap.add("Policies", civInfo.policies.getAdoptedPolicies().count { !Policy.isBranchCompleteByName(it) } / 2) statMap.add("Policies", civInfo.policies.getAdoptedPolicies().count { !Policy.isBranchCompleteByName(it) } / 2)
} }
var happinessPerNaturalWonder = 1f
if (civInfo.hasUnique(UniqueType.DoubleHappinessFromNaturalWonders))
happinessPerNaturalWonder *= 2
statMap["Natural Wonders"] = happinessPerNaturalWonder * civInfo.naturalWonders.size
for ((key, value) in getGlobalStatsFromUniques()) for ((key, value) in getGlobalStatsFromUniques())
statMap.add(key,value.happiness) statMap.add(key,value.happiness)
@ -289,6 +283,15 @@ class CivInfoStats(val civInfo: CivilizationInfo) {
if (unique.sourceObjectType != UniqueTarget.Building && unique.sourceObjectType != UniqueTarget.Wonder) if (unique.sourceObjectType != UniqueTarget.Building && unique.sourceObjectType != UniqueTarget.Wonder)
statMap.add(unique.sourceObjectType!!.name, unique.stats) statMap.add(unique.sourceObjectType!!.name, unique.stats)
val statsPerNaturalWonder = Stats(happiness = 1f)
if (civInfo.hasUnique(UniqueType.DoubleHappinessFromNaturalWonders))
statsPerNaturalWonder.happiness *= 2
for (unique in civInfo.getMatchingUniques(UniqueType.StatsFromNaturalWonders))
statsPerNaturalWonder.add(unique.stats)
statMap.add("Natural Wonders", statsPerNaturalWonder.times(civInfo.naturalWonders.size))
return statMap return statMap
} }

View File

@ -205,7 +205,9 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags:
// Todo: Sign should not be part of the unique placeholder // Todo: Sign should not be part of the unique placeholder
StrategicResourcesIncrease("Quantity of strategic resources produced by the empire +[relativeAmount]%", UniqueTarget.Global), // used in Policy StrategicResourcesIncrease("Quantity of strategic resources produced by the empire +[relativeAmount]%", UniqueTarget.Global), // used in Policy
DoubleResourceProduced("Double quantity of [resource] produced", UniqueTarget.Global), DoubleResourceProduced("Double quantity of [resource] produced", UniqueTarget.Global),
// Todo: should probably be changed to "[stats] from every known Natural Wonder", and that'll give us the global unique as well
StatsFromNaturalWonders("[stats] for every known Natural Wonder", UniqueTarget.Global),
@Deprecated("as of 4.3.6", ReplaceWith("[+1 Happiness] for every known Natural Wonder"))
DoubleHappinessFromNaturalWonders("Double Happiness from Natural Wonders", UniqueTarget.Global), DoubleHappinessFromNaturalWonders("Double Happiness from Natural Wonders", UniqueTarget.Global),
EnablesConstructionOfSpaceshipParts("Enables construction of Spaceship parts", UniqueTarget.Global), EnablesConstructionOfSpaceshipParts("Enables construction of Spaceship parts", UniqueTarget.Global),
@ -778,7 +780,6 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags:
GreatPersonPointPercentageDeprecated("[relativeAmount]% great person generation [cityFilter]", UniqueTarget.Global, UniqueTarget.FollowerBelief), GreatPersonPointPercentageDeprecated("[relativeAmount]% great person generation [cityFilter]", UniqueTarget.Global, UniqueTarget.FollowerBelief),
@Deprecated("as of 3.19.19", ReplaceWith("[+25]% [Gold] from Trade Routes"), DeprecationLevel.ERROR) @Deprecated("as of 3.19.19", ReplaceWith("[+25]% [Gold] from Trade Routes"), DeprecationLevel.ERROR)
GoldBonusFromTradeRoutesDeprecated("Gold from all trade routes +25%", UniqueTarget.Global), GoldBonusFromTradeRoutesDeprecated("Gold from all trade routes +25%", UniqueTarget.Global),
// ToDo: Reword to `[stats] <in cities with [amount] or more population>` for consistency with other conditionals
@Deprecated("as of 3.19.19", ReplaceWith("[stats] <in cities with at least [amount] [Population]>"), DeprecationLevel.ERROR) @Deprecated("as of 3.19.19", ReplaceWith("[stats] <in cities with at least [amount] [Population]>"), DeprecationLevel.ERROR)
StatsFromXPopulation("[stats] in cities with [amount] or more population", UniqueTarget.Global, UniqueTarget.FollowerBelief), StatsFromXPopulation("[stats] in cities with [amount] or more population", UniqueTarget.Global, UniqueTarget.FollowerBelief),
@Deprecated("as of 3.19.8", ReplaceWith("Only available <before adopting [policy/tech/promotion]>" + @Deprecated("as of 3.19.8", ReplaceWith("Only available <before adopting [policy/tech/promotion]>" +

View File

@ -436,7 +436,9 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
Applicable to: Global Applicable to: Global
??? example "Double Happiness from Natural Wonders" ??? example "[stats] for every known Natural Wonder"
Example: "[+1 Gold, +2 Production] for every known Natural Wonder"
Applicable to: Global Applicable to: Global
??? example "Enables construction of Spaceship parts" ??? example "Enables construction of Spaceship parts"