mirror of
https://github.com/yairm210/Unciv.git
synced 2025-03-09 20:29:50 +07:00
Add new game option: No City Razing. (#8203)
This commit is contained in:
parent
7427932985
commit
9f6aa4b90f
@ -358,6 +358,7 @@ Archipelago =
|
||||
Inner Sea =
|
||||
Number of City-States =
|
||||
One City Challenge =
|
||||
No City Razing =
|
||||
No Barbarians =
|
||||
Disable starting bias =
|
||||
Raging Barbarians =
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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
|
||||
|
@ -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 }
|
||||
|
Loading…
Reference in New Issue
Block a user