From c327b54b1bb116dfc2354ba89ff0de2cd8c56e0f Mon Sep 17 00:00:00 2001 From: Xander Lenstra <71121390+xlenstra@users.noreply.github.com> Date: Fri, 9 Jul 2021 11:13:45 +0200 Subject: [PATCH] City Centers can no longer be removed by nukes (#4423) * City Centers can no longer be removed by nukes * Implemented requested changes * Implemented more requested changes --- .../assets/jsons/Civ V - Vanilla/TileImprovements.json | 2 +- core/src/com/unciv/logic/battle/Battle.kt | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/android/assets/jsons/Civ V - Vanilla/TileImprovements.json b/android/assets/jsons/Civ V - Vanilla/TileImprovements.json index 346c40f5d6..aad3f03325 100644 --- a/android/assets/jsons/Civ V - Vanilla/TileImprovements.json +++ b/android/assets/jsons/Civ V - Vanilla/TileImprovements.json @@ -237,7 +237,7 @@ "civilopediaText": [{text:"Ancient ruins provide a one-time random bonus when explored"}] }, { "name": "City ruins", "uniques": ["Unpillagable"], "civilopediaText": [{text:"A bleak reminder of the destruction wreaked by War"}] }, - { "name": "City center", "uniques": ["Unpillagable"], + { "name": "City center", "uniques": ["Unpillagable", "Indestructible"], "civilopediaText": [{text:"Marks the center of a city"},{text:"Appearance changes with the technological era of the owning civilization"}] }, { "name": "Barbarian encampment", "uniques": ["Unpillagable"], "civilopediaText": [{text:"Home to uncivilized barbarians, will spawn a hostile unit from time to time"}] } diff --git a/core/src/com/unciv/logic/battle/Battle.kt b/core/src/com/unciv/logic/battle/Battle.kt index 5f43548455..f6339a9fd0 100644 --- a/core/src/com/unciv/logic/battle/Battle.kt +++ b/core/src/com/unciv/logic/battle/Battle.kt @@ -558,7 +558,9 @@ object Battle { } // Remove improvements, add fallout - tile.improvement = null + if (tile.improvement != null && !attacker.getTile().getTileImprovement()!!.hasUnique("Indestructible")) { + tile.improvement = null + } tile.improvementInProgress = null tile.turnsToImprovement = 0 tile.roadStatus = RoadStatus.None @@ -618,7 +620,9 @@ object Battle { } // Remove improvements - tile.improvement = null + if (tile.improvement != null && !attacker.getTile().getTileImprovement()!!.hasUnique("Indestructible")) { + tile.improvement = null + } tile.improvementInProgress = null tile.turnsToImprovement = 0 tile.roadStatus = RoadStatus.None