mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-29 06:51:30 -04:00
Deprecate Building.cannotBeBuiltWith (Solar/Nuclear Plant exclusion now as unique, auto-displays in Civilopedia) (#4732)
This commit is contained in:
parent
4a434b3689
commit
a248a1178c
@ -1007,9 +1007,8 @@
|
|||||||
"percentStatBonus": {"production": 15},
|
"percentStatBonus": {"production": 15},
|
||||||
"requiredBuilding": "Factory",
|
"requiredBuilding": "Factory",
|
||||||
"maintenance": 3,
|
"maintenance": 3,
|
||||||
"cannotBeBuiltWith": "Nuclear Plant",
|
|
||||||
"requiredTech": "Ecology",
|
"requiredTech": "Ecology",
|
||||||
"uniques": ["Must be next to [Desert]"]
|
"uniques": ["Must be next to [Desert]", "Cannot be built with [Nuclear Plant]"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Sydney Opera House",
|
"name": "Sydney Opera House",
|
||||||
@ -1026,9 +1025,9 @@
|
|||||||
"percentStatBonus": {"production": 15},
|
"percentStatBonus": {"production": 15},
|
||||||
"requiredBuilding": "Factory",
|
"requiredBuilding": "Factory",
|
||||||
"maintenance": 3,
|
"maintenance": 3,
|
||||||
"cannotBeBuiltWith": "Solar Plant",
|
|
||||||
"requiredResource": "Uranium",
|
"requiredResource": "Uranium",
|
||||||
"requiredTech": "Nuclear Fission"
|
"requiredTech": "Nuclear Fission",
|
||||||
|
"uniques": ["Cannot be built with [Solar Plant]"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Apollo Program",
|
"name": "Apollo Program",
|
||||||
|
@ -42,6 +42,7 @@ Wonder is being built elsewhere =
|
|||||||
National Wonder is being built elsewhere =
|
National Wonder is being built elsewhere =
|
||||||
Requires a [buildingName] in all cities =
|
Requires a [buildingName] in all cities =
|
||||||
Requires a [buildingName] in this city =
|
Requires a [buildingName] in this city =
|
||||||
|
Cannot be built with [buildingName] =
|
||||||
Consumes 1 [resource] =
|
Consumes 1 [resource] =
|
||||||
Consumes [amount] [resource] =
|
Consumes [amount] [resource] =
|
||||||
Required tech: [requiredTech] =
|
Required tech: [requiredTech] =
|
||||||
|
@ -56,6 +56,7 @@ class Building : NamedStats(), IConstruction, ICivilopediaText {
|
|||||||
|
|
||||||
/** City can only be built if one of these resources is nearby - it must be improved! */
|
/** City can only be built if one of these resources is nearby - it must be improved! */
|
||||||
var requiredNearbyImprovedResources: List<String>? = null
|
var requiredNearbyImprovedResources: List<String>? = null
|
||||||
|
@Deprecated("As of 3.15.19, replace with 'Cannot be built with []' unique")
|
||||||
private var cannotBeBuiltWith: String? = null
|
private var cannotBeBuiltWith: String? = null
|
||||||
var cityStrength = 0
|
var cityStrength = 0
|
||||||
var cityHealth = 0
|
var cityHealth = 0
|
||||||
@ -501,8 +502,13 @@ class Building : NamedStats(), IConstruction, ICivilopediaText {
|
|||||||
return "Requires a [${requiredBuilding}] in this city, which doesn't seem to exist in this ruleset!"
|
return "Requires a [${requiredBuilding}] in this city, which doesn't seem to exist in this ruleset!"
|
||||||
return "Requires a [${civInfo.getEquivalentBuilding(requiredBuilding!!)}] in this city"
|
return "Requires a [${civInfo.getEquivalentBuilding(requiredBuilding!!)}] in this city"
|
||||||
}
|
}
|
||||||
if (cannotBeBuiltWith != null && construction.isBuilt(cannotBeBuiltWith!!))
|
// cannotBeBuiltWith is Deprecated as of 3.15.19
|
||||||
return "Cannot be built with $cannotBeBuiltWith"
|
val cannotBeBuiltWith = uniqueObjects
|
||||||
|
.firstOrNull { it.placeholderText == "Cannot be built with []" }
|
||||||
|
?.params?.get(0)
|
||||||
|
?: this.cannotBeBuiltWith
|
||||||
|
if (cannotBeBuiltWith != null && construction.isBuilt(cannotBeBuiltWith))
|
||||||
|
return "Cannot be built with [$cannotBeBuiltWith]"
|
||||||
|
|
||||||
for ((resource, amount) in getResourceRequirements())
|
for ((resource, amount) in getResourceRequirements())
|
||||||
if (civInfo.getCivResourcesByName()[resource]!! < amount) {
|
if (civInfo.getCivResourcesByName()[resource]!! < amount) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user