diff --git a/android/assets/jsons/Civ V - Vanilla/Units.json b/android/assets/jsons/Civ V - Vanilla/Units.json index 839ead70d3..ae69a81196 100644 --- a/android/assets/jsons/Civ V - Vanilla/Units.json +++ b/android/assets/jsons/Civ V - Vanilla/Units.json @@ -1289,46 +1289,42 @@ { "name": "Great Artist", - "unbuildable": true, "unitType": "Civilian", - "uniques": ["Can start an 8-turn golden age","Can build improvement: Landmark"], + "uniques": ["Can start an 8-turn golden age","Can build improvement: Landmark", "Unbuildable"], "movement": 2 }, { "name": "Great Scientist", - "unbuildable": true, "unitType": "Civilian", - "uniques": ["Can hurry technology research","Can build improvement: Academy"], + "uniques": ["Can hurry technology research","Can build improvement: Academy", "Unbuildable"], "movement": 2 }, { "name": "Great Merchant", - "unbuildable": true, "unitType": "Civilian", - "uniques": ["Can undertake a trade mission with City-State, giving a large sum of gold and [30] Influence","Can build improvement: Customs house"], + "uniques": ["Can undertake a trade mission with City-State, giving a large sum of gold and [30] Influence", + "Can build improvement: Customs house", "Unbuildable"], "movement": 2 }, { "name": "Great Engineer", - "unbuildable": true, "unitType": "Civilian", - "uniques": ["Can speed up construction of a wonder","Can build improvement: Manufactory"], + "uniques": ["Can speed up construction of a wonder","Can build improvement: Manufactory", "Unbuildable"], "movement": 2 }, { "name": "Great General", - "unbuildable": true, "unitType": "Civilian", - "uniques": ["Can start an 8-turn golden age","Bonus for units in 2 tile radius 15%", "Can build improvement: Citadel"], + "uniques": ["Can start an 8-turn golden age","Bonus for units in 2 tile radius 15%", "Can build improvement: Citadel", "Unbuildable"], "movement": 2 }, { "name": "Khan", - "unbuildable": true, "unitType": "Civilian", "uniqueTo": "Mongolia", "replaces": "Great General", - "uniques": ["Can start an 8-turn golden age","Bonus for units in 2 tile radius 15%", "Heal adjacent units for an additional 15 HP per turn", "Can build improvement: Citadel"], + "uniques": ["Can start an 8-turn golden age","Bonus for units in 2 tile radius 15%", "Unbuildable", + "Heal adjacent units for an additional 15 HP per turn", "Can build improvement: Citadel"], "movement": 5 } ] diff --git a/core/src/com/unciv/models/ruleset/unit/BaseUnit.kt b/core/src/com/unciv/models/ruleset/unit/BaseUnit.kt index 1332e1214e..0ca799120c 100644 --- a/core/src/com/unciv/models/ruleset/unit/BaseUnit.kt +++ b/core/src/com/unciv/models/ruleset/unit/BaseUnit.kt @@ -25,7 +25,6 @@ class BaseUnit : INamed, IConstruction { var range:Int = 2 var interceptRange = 0 lateinit var unitType: UnitType - internal var unbuildable: Boolean = false // for special units like great people var requiredTech:String? = null var requiredResource:String? = null var uniques =HashSet() @@ -54,7 +53,6 @@ class BaseUnit : INamed, IConstruction { if(requiredResource!=null) sb.appendln("{Requires} {$requiredResource}".tr()) if(!forPickerScreen) { if(uniqueTo!=null) sb.appendln("Unique to [$uniqueTo], replaces [$replaces]".tr()) - if (unbuildable) sb.appendln("Unbuildable".tr()) else sb.appendln("{Cost}: $cost".tr()) if(requiredTech!=null) sb.appendln("Required tech: [$requiredTech]".tr()) if(upgradesTo!=null) sb.appendln("Upgrades to [$upgradesTo]".tr()) @@ -122,15 +120,15 @@ class BaseUnit : INamed, IConstruction { } fun getRejectionReason(construction: CityConstructions): String { - if(unitType.isWaterUnit() && !construction.cityInfo.getCenterTile().isCoastalTile()) + if (unitType.isWaterUnit() && !construction.cityInfo.getCenterTile().isCoastalTile()) return "Can only build water units in coastal cities" val civRejectionReason = getRejectionReason(construction.cityInfo.civInfo) - if(civRejectionReason!="") return civRejectionReason + if (civRejectionReason != "") return civRejectionReason return "" } fun getRejectionReason(civInfo: CivilizationInfo): String { - if (unbuildable) return "Unbuildable" + if (uniques.contains("Unbuildable")) return "Unbuildable" if (requiredTech!=null && !civInfo.tech.isResearched(requiredTech!!)) return "$requiredTech not researched" if (obsoleteTech!=null && civInfo.tech.isResearched(obsoleteTech!!)) return "Obsolete by $obsoleteTech" if (uniqueTo!=null && uniqueTo!=civInfo.civName) return "Unique to $uniqueTo"