mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-13 17:28:57 +07:00
modding: Double Happiness from Natural Wonders -> [stats] from every known Natural Wonder
This commit is contained in:
@ -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",
|
||||||
|
@ -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",
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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]>" +
|
||||||
|
@ -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"
|
||||||
|
Reference in New Issue
Block a user