Stats per Stat unique (#10591)

* Added Stats per Stat unique

* Applied the suggestions of @yairm210
This commit is contained in:
PLynx 2023-11-30 18:12:39 +01:00 committed by GitHub
parent 199b3ada93
commit 6617504c05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 1 deletions

View File

@ -311,6 +311,11 @@ class CivInfoStatsForNextTurn(val civInfo: Civilization) {
if (unique.sourceObjectType != UniqueTarget.Building && unique.sourceObjectType != UniqueTarget.Wonder)
statMap.add(unique.sourceObjectType!!.name, unique.stats)
for (unique in civInfo.getMatchingUniques(UniqueType.StatsPerStat)) {
val amount = civInfo.getStatReserve(Stat.valueOf(unique.params[2])) / unique.params[1].toInt()
statMap.add("Stats", unique.stats.times(amount))
}
val statsPerNaturalWonder = Stats(happiness = 1f)
for (unique in civInfo.getMatchingUniques(UniqueType.StatsFromNaturalWonders))

View File

@ -28,7 +28,7 @@ enum class UniqueType(
StatsFromSpecialist("[stats] from every specialist [cityFilter]", UniqueTarget.Global, UniqueTarget.FollowerBelief),
StatsPerPopulation("[stats] per [amount] population [cityFilter]", UniqueTarget.Global, UniqueTarget.FollowerBelief),
StatsPerPolicies("[stats] per [amount] social policies adopted", UniqueTarget.Global),
StatsPerStat("[stats] per every [amount] [civWideStat]", UniqueTarget.Global),
StatsFromCitiesOnSpecificTiles("[stats] in cities on [terrainFilter] tiles", UniqueTarget.Global, UniqueTarget.FollowerBelief),
StatsFromBuildings("[stats] from all [buildingFilter] buildings", UniqueTarget.Global, UniqueTarget.FollowerBelief),

View File

@ -210,6 +210,11 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
Applicable to: Global
??? example "[stats] per every [amount] [civWideStat]"
Example: "[+1 Gold, +2 Production] per every [3] [Gold]"
Applicable to: Global
??? example "[stats] in cities on [terrainFilter] tiles"
Example: "[+1 Gold, +2 Production] in cities on [Fresh Water] tiles"