mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-29 06:51:30 -04:00
Tile resource uniques now work to provide stat bonuses
This commit is contained in:
parent
103f1daf36
commit
7e05a56e37
@ -227,7 +227,7 @@
|
|||||||
"gold": 2,
|
"gold": 2,
|
||||||
"improvement": "Quarry",
|
"improvement": "Quarry",
|
||||||
"improvementStats": {"production": 1},
|
"improvementStats": {"production": 1},
|
||||||
"uniques": ["+15% production towards Wonder construction"]
|
"uniques": ["+[15]% Production when constructing [Wonders]"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Whales",
|
"name": "Whales",
|
||||||
|
@ -744,9 +744,7 @@ class CityInfo {
|
|||||||
// Note that we don't query religion here, as those only have local effects (for now at least)
|
// Note that we don't query religion here, as those only have local effects (for now at least)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun isHolyCity(): Boolean {
|
fun isHolyCity(): Boolean = religion.religionThisIsTheHolyCityOf != null
|
||||||
return religion.religionThisIsTheHolyCityOf != null
|
|
||||||
}
|
|
||||||
|
|
||||||
fun canBeDestroyed(justCaptured: Boolean = false): Boolean {
|
fun canBeDestroyed(justCaptured: Boolean = false): Boolean {
|
||||||
return !isOriginalCapital && !isHolyCity() && (!isCapital() || justCaptured)
|
return !isOriginalCapital && !isHolyCity() && (!isCapital() || justCaptured)
|
||||||
|
@ -93,6 +93,7 @@ class CityStats(val cityInfo: CityInfo) {
|
|||||||
return stats
|
return stats
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Deprecated("As of 3.16.16 - replaced by regular getStatPercentBonusesFromUniques()")
|
||||||
private fun getStatPercentBonusesFromResources(construction: IConstruction): Stats {
|
private fun getStatPercentBonusesFromResources(construction: IConstruction): Stats {
|
||||||
val stats = Stats()
|
val stats = Stats()
|
||||||
|
|
||||||
@ -473,6 +474,9 @@ class CityStats(val cityInfo: CityInfo) {
|
|||||||
.plus(cityInfo.cityConstructions.getStatPercentBonuses()) // This function is to be deprecated but it'll take a while.
|
.plus(cityInfo.cityConstructions.getStatPercentBonuses()) // This function is to be deprecated but it'll take a while.
|
||||||
newStatPercentBonusList["Wonders"] = getStatPercentBonusesFromUniques(currentConstruction, cityInfo.civInfo.getCivWideBuildingUniques(cityInfo))
|
newStatPercentBonusList["Wonders"] = getStatPercentBonusesFromUniques(currentConstruction, cityInfo.civInfo.getCivWideBuildingUniques(cityInfo))
|
||||||
newStatPercentBonusList["Railroads"] = getStatPercentBonusesFromRailroad() // Name chosen same as tech, for translation, but theoretically independent
|
newStatPercentBonusList["Railroads"] = getStatPercentBonusesFromRailroad() // Name chosen same as tech, for translation, but theoretically independent
|
||||||
|
val resourceUniques = cityInfo.civInfo.getCivResources().asSequence().flatMap { it.resource.uniqueObjects }
|
||||||
|
newStatPercentBonusList["Resources"] = getStatPercentBonusesFromUniques(currentConstruction, resourceUniques)
|
||||||
|
// Deprecated as of 3.16.16
|
||||||
newStatPercentBonusList["Resources"] = getStatPercentBonusesFromResources(currentConstruction)
|
newStatPercentBonusList["Resources"] = getStatPercentBonusesFromResources(currentConstruction)
|
||||||
newStatPercentBonusList["National ability"] = getStatPercentBonusesFromNationUnique(currentConstruction)
|
newStatPercentBonusList["National ability"] = getStatPercentBonusesFromNationUnique(currentConstruction)
|
||||||
newStatPercentBonusList["Puppet City"] = getStatPercentBonusesFromPuppetCity()
|
newStatPercentBonusList["Puppet City"] = getStatPercentBonusesFromPuppetCity()
|
||||||
|
@ -132,11 +132,10 @@ class CivilizationInfo {
|
|||||||
*/
|
*/
|
||||||
val temporaryUniques = ArrayList<Pair<Unique, Int>>()
|
val temporaryUniques = ArrayList<Pair<Unique, Int>>()
|
||||||
|
|
||||||
// Deprecated since 3.16.15
|
/** Maps the name of the construction to the amount of times bought */
|
||||||
/** Maps the name of the construction to the amount of times bought */
|
@Deprecated("Deprecated since 3.16.15", replaceWith = ReplaceWith("civWideConstructions.boughtItemsWithIncreasingPrice"))
|
||||||
@Deprecated("Deprecated since 3.16.15", replaceWith = ReplaceWith("civWideConstructions.boughtItemsWithIncreasingPrice"))
|
val boughtConstructionsWithGloballyIncreasingPrice = HashMap<String, Int>()
|
||||||
val boughtConstructionsWithGloballyIncreasingPrice = HashMap<String, Int>()
|
|
||||||
//
|
|
||||||
|
|
||||||
// if we only use lists, and change the list each time the cities are changed,
|
// if we only use lists, and change the list each time the cities are changed,
|
||||||
// we won't get concurrent modification exceptions.
|
// we won't get concurrent modification exceptions.
|
||||||
|
@ -3,12 +3,20 @@ package com.unciv.models.ruleset
|
|||||||
import com.unciv.models.translations.getPlaceholderParameters
|
import com.unciv.models.translations.getPlaceholderParameters
|
||||||
import com.unciv.models.translations.getPlaceholderText
|
import com.unciv.models.translations.getPlaceholderText
|
||||||
|
|
||||||
|
enum class UniqueTarget{
|
||||||
|
/** Buildings, units, nations, policies, religions, techs etc. */
|
||||||
|
Global,
|
||||||
|
Building,
|
||||||
|
Unit,
|
||||||
|
Improvement,
|
||||||
|
}
|
||||||
|
|
||||||
enum class UniqueType(val text:String, val replacedBy: UniqueType? = null) {
|
enum class UniqueType(val text:String, val replacedBy: UniqueType? = null) {
|
||||||
|
|
||||||
ConsumesResources("Consumes [amount] [resource]"),
|
ConsumesResources("Consumes [amount] [resource]"),
|
||||||
FreeUnits("[amount] units cost no maintenance"),
|
FreeUnits("[amount] units cost no maintenance"),
|
||||||
UnitMaintenanceDiscount("[amount]% maintenance costs for [mapUnitFilter] units"),
|
UnitMaintenanceDiscount("[amount]% maintenance costs for [mapUnitFilter] units"),
|
||||||
@Deprecated("As of 3.16.16")
|
@Deprecated("As of 3.16.16", ReplaceWith("UnitMaintenanceDiscount"))
|
||||||
DecreasedUnitMaintenanceCostsByFilter("-[amount]% [mapUnitFilter] unit maintenance costs", UnitMaintenanceDiscount),
|
DecreasedUnitMaintenanceCostsByFilter("-[amount]% [mapUnitFilter] unit maintenance costs", UnitMaintenanceDiscount),
|
||||||
@Deprecated("As of 3.16.16")
|
@Deprecated("As of 3.16.16")
|
||||||
DecreasedUnitMaintenanceCostsGlobally("-[amount]% unit upkeep costs", UnitMaintenanceDiscount),
|
DecreasedUnitMaintenanceCostsGlobally("-[amount]% unit upkeep costs", UnitMaintenanceDiscount),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user