diff --git a/android/assets/jsons/translations/template.properties b/android/assets/jsons/translations/template.properties index d31fa15ce6..862dbed59d 100644 --- a/android/assets/jsons/translations/template.properties +++ b/android/assets/jsons/translations/template.properties @@ -358,6 +358,7 @@ Archipelago = Inner Sea = Number of City-States = One City Challenge = +No City Razing = No Barbarians = Disable starting bias = Raging Barbarians = diff --git a/core/src/com/unciv/logic/city/CityInfo.kt b/core/src/com/unciv/logic/city/CityInfo.kt index ffdfa5bccc..9126549046 100644 --- a/core/src/com/unciv/logic/city/CityInfo.kt +++ b/core/src/com/unciv/logic/city/CityInfo.kt @@ -591,6 +591,8 @@ class CityInfo : IsPartOfGameInfoSerialization { fun isHolyCityOf(religionName: String?) = isHolyCity() && religion.religionThisIsTheHolyCityOf == religionName fun canBeDestroyed(justCaptured: Boolean = false): Boolean { + if (civInfo.gameInfo.gameParameters.noCityRazing) return false; + val allowRazeCapital = civInfo.gameInfo.ruleSet.modOptions.uniques.contains(ModOptionsConstants.allowRazeCapital) val allowRazeHolyCity = civInfo.gameInfo.ruleSet.modOptions.uniques.contains(ModOptionsConstants.allowRazeHolyCity) diff --git a/core/src/com/unciv/models/metadata/GameParameters.kt b/core/src/com/unciv/models/metadata/GameParameters.kt index 3cedfbe150..f945335e59 100644 --- a/core/src/com/unciv/models/metadata/GameParameters.kt +++ b/core/src/com/unciv/models/metadata/GameParameters.kt @@ -21,6 +21,7 @@ class GameParameters : IsPartOfGameInfoSerialization { // Default values are the } var numberOfCityStates = 6 + var noCityRazing = false var noBarbarians = false var ragingBarbarians = false var oneCityChallenge = false diff --git a/core/src/com/unciv/ui/newgamescreen/GameOptionsTable.kt b/core/src/com/unciv/ui/newgamescreen/GameOptionsTable.kt index e2e40abe45..c9d4bdd86d 100644 --- a/core/src/com/unciv/ui/newgamescreen/GameOptionsTable.kt +++ b/core/src/com/unciv/ui/newgamescreen/GameOptionsTable.kt @@ -65,6 +65,7 @@ class GameOptionsTable( val checkboxTable = Table().apply { defaults().left().pad(2.5f) } + checkboxTable.addNoCityRazingCheckbox() checkboxTable.addNoBarbariansCheckbox() checkboxTable.addRagingBarbariansCheckbox() checkboxTable.addOneCityChallengeCheckbox() @@ -89,6 +90,10 @@ class GameOptionsTable( add(checkbox).colspan(2).row() } + private fun Table.addNoCityRazingCheckbox() = + addCheckbox("No City Razing", gameParameters.noCityRazing) + { gameParameters.noCityRazing = it } + private fun Table.addNoBarbariansCheckbox() = addCheckbox("No Barbarians", gameParameters.noBarbarians) { gameParameters.noBarbarians = it }