diff --git a/android/ImagesToPackSeparately/BuildingIcons/Shrine.png b/android/ImagesToPackSeparately/BuildingIcons/Shrine.png new file mode 100644 index 0000000000..da80454c77 Binary files /dev/null and b/android/ImagesToPackSeparately/BuildingIcons/Shrine.png differ diff --git a/android/assets/BuildingIcons.atlas b/android/assets/BuildingIcons.atlas index 2e3a5d286d..3759cfa340 100644 --- a/android/assets/BuildingIcons.atlas +++ b/android/assets/BuildingIcons.atlas @@ -592,206 +592,213 @@ Seaport orig: 100, 100 offset: 0, 0 index: -1 -Sistine Chapel +Shrine rotate: false xy: 868, 328 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Solar Plant +Sistine Chapel rotate: false xy: 976, 436 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Spaceship Factory +Solar Plant rotate: false xy: 1084, 544 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Stable +Spaceship Factory rotate: false xy: 1192, 652 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Stadium +Stable rotate: false xy: 1300, 760 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Statue of Liberty +Stadium rotate: false xy: 1408, 868 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Statue of Zeus +Statue of Liberty rotate: false xy: 652, 4 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Stock Exchange +Statue of Zeus rotate: false xy: 760, 112 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Stone Works +Stock Exchange rotate: false xy: 868, 220 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Stonehenge +Stone Works rotate: false xy: 976, 328 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Sydney Opera House +Stonehenge rotate: false xy: 1084, 436 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Taj Mahal +Sydney Opera House rotate: false xy: 1192, 544 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Temple +Taj Mahal rotate: false xy: 1300, 652 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Temple of Artemis +Temple rotate: false xy: 1408, 760 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Terracotta Army +Temple of Artemis rotate: false xy: 1516, 868 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -The Great Library +Terracotta Army rotate: false xy: 760, 4 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -The Great Lighthouse +The Great Library rotate: false xy: 868, 112 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -The Louvre +The Great Lighthouse rotate: false xy: 976, 220 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -The Oracle +The Louvre rotate: false xy: 1084, 328 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -The Pyramids +The Oracle rotate: false xy: 1192, 436 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Theatre +The Pyramids rotate: false xy: 1300, 544 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -University +Theatre rotate: false xy: 1408, 652 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Utopia Project +University rotate: false xy: 1516, 760 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Walls +Utopia Project rotate: false xy: 1624, 868 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Walls of Babylon +Walls rotate: false xy: 868, 4 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Wat +Walls of Babylon rotate: false xy: 976, 112 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Water Mill +Wat rotate: false xy: 1084, 220 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Windmill +Water Mill rotate: false xy: 1192, 328 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Workshop +Windmill rotate: false xy: 1300, 436 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 +Workshop + rotate: false + xy: 1408, 544 + size: 100, 100 + orig: 100, 100 + offset: 0, 0 + index: -1 diff --git a/android/assets/BuildingIcons.png b/android/assets/BuildingIcons.png index d67b548b0e..ce53469ed9 100644 Binary files a/android/assets/BuildingIcons.png and b/android/assets/BuildingIcons.png differ diff --git a/android/assets/jsons/Civ V - Vanilla/Buildings.json b/android/assets/jsons/Civ V - Vanilla/Buildings.json index dd097dc069..fbaa3737d6 100644 --- a/android/assets/jsons/Civ V - Vanilla/Buildings.json +++ b/android/assets/jsons/Civ V - Vanilla/Buildings.json @@ -31,6 +31,14 @@ "[+1 Food] from [Wheat] tiles in this city"], "requiredTech": "Pottery" }, + { + "name": "Shrine", + "faith": 1, + "cost": 40, + "maintenance": 1, + "requiredTech": "Pottery", + "uniques": ["Hidden when religion is disabled"] + }, { "name": "Temple of Artemis", "culture": 1, diff --git a/core/src/com/unciv/logic/GameInfo.kt b/core/src/com/unciv/logic/GameInfo.kt index 6e2e7cd42e..f82d9aee87 100644 --- a/core/src/com/unciv/logic/GameInfo.kt +++ b/core/src/com/unciv/logic/GameInfo.kt @@ -411,6 +411,8 @@ class GameInfo { cityConstructions.inProgressConstructions.remove(oldBuildingName) } } + + fun hasRelgionEnabled() = gameParameters.religionEnabled || ruleSet.hasReligion() // Temporary function to check whether religion should be used for this game } // reduced variant only for load preview diff --git a/core/src/com/unciv/logic/city/CityInfo.kt b/core/src/com/unciv/logic/city/CityInfo.kt index 746c2e454a..9648cf19f1 100644 --- a/core/src/com/unciv/logic/city/CityInfo.kt +++ b/core/src/com/unciv/logic/city/CityInfo.kt @@ -372,7 +372,7 @@ class CityInfo { } } else population.nextTurn(foodForNextTurn()) - if (getRuleset().hasReligion()) religion.getAffectedBySurroundingCities() + if (civInfo.gameInfo.hasRelgionEnabled()) religion.getAffectedBySurroundingCities() if (this in civInfo.cities) { // city was not destroyed health = min(health + 20, getMaxHealth()) diff --git a/core/src/com/unciv/models/metadata/GameParameters.kt b/core/src/com/unciv/models/metadata/GameParameters.kt index 8fd133f945..a913db7678 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 { // Default values are the default new game var oneCityChallenge = false var godMode = false var nuclearWeaponsEnabled = true + var religionEnabled = false var victoryTypes: ArrayList = arrayListOf(VictoryType.Cultural, VictoryType.Domination, VictoryType.Scientific) // By default, all victory types var startingEra = Constants.ancientEra diff --git a/core/src/com/unciv/models/metadata/GameSettings.kt b/core/src/com/unciv/models/metadata/GameSettings.kt index 3bb07b65f1..92e2930821 100644 --- a/core/src/com/unciv/models/metadata/GameSettings.kt +++ b/core/src/com/unciv/models/metadata/GameSettings.kt @@ -41,6 +41,7 @@ class GameSettings { var visualMods = HashSet() var showExperimentalWorldWrap = false // We're keeping this as a config due to ANR problems on Android phones for people who don't know what they're doing :/ + var showExperimentalRelgion = false var lastOverviewPage: String = "Cities" diff --git a/core/src/com/unciv/models/ruleset/Building.kt b/core/src/com/unciv/models/ruleset/Building.kt index cd0ee4d0ff..c99378c8e2 100644 --- a/core/src/com/unciv/models/ruleset/Building.kt +++ b/core/src/com/unciv/models/ruleset/Building.kt @@ -283,6 +283,7 @@ class Building : NamedStats(), IConstruction { "Can only be built in annexed cities" -> if (construction.cityInfo.isPuppet || construction.cityInfo.foundingCiv == "" || construction.cityInfo.civInfo.civName == construction.cityInfo.foundingCiv) return unique.text "Obsolete with []" -> if (civInfo.tech.isResearched(unique.params[0])) return unique.text + "Hidden when religion is disabled" -> if (!civInfo.gameInfo.hasRelgionEnabled()) return unique.text } if (uniqueTo != null && uniqueTo != civInfo.civName) return "Unique to $uniqueTo" diff --git a/core/src/com/unciv/models/ruleset/Ruleset.kt b/core/src/com/unciv/models/ruleset/Ruleset.kt index 341ac2be1b..fb8b0a1471 100644 --- a/core/src/com/unciv/models/ruleset/Ruleset.kt +++ b/core/src/com/unciv/models/ruleset/Ruleset.kt @@ -211,7 +211,7 @@ class Ruleset { } fun getEras(): List = technologies.values.map { it.column!!.era }.distinct() - fun hasReligion() = beliefs.any() + fun hasReligion() = beliefs.any() fun getEraNumber(era: String) = getEras().indexOf(era) fun getSummary(): String { diff --git a/core/src/com/unciv/models/ruleset/tech/Technology.kt b/core/src/com/unciv/models/ruleset/tech/Technology.kt index d9b10b513b..ece5e6ddcc 100644 --- a/core/src/com/unciv/models/ruleset/tech/Technology.kt +++ b/core/src/com/unciv/models/ruleset/tech/Technology.kt @@ -47,6 +47,7 @@ class Technology { val regularBuildings = enabledBuildings.filter { !it.isWonder && !it.isNationalWonder && "Will not be displayed in Civilopedia" !in it.uniques + && !(!viewingCiv.gameInfo.hasRelgionEnabled() && it.uniques.contains("Hidden when religion is disabled")) } if (regularBuildings.isNotEmpty()) { lineList += "{Buildings enabled}: " @@ -90,6 +91,9 @@ class Technology { if (!civInfo.gameInfo.gameParameters.nuclearWeaponsEnabled) enabledBuildings = enabledBuildings.filterNot { it.name == "Manhattan Project" } + + if (!civInfo.gameInfo.hasRelgionEnabled()) + enabledBuildings = enabledBuildings.filterNot { it.uniques.contains("Hidden when religion is disabled") } return enabledBuildings } diff --git a/core/src/com/unciv/ui/cityscreen/CityStatsTable.kt b/core/src/com/unciv/ui/cityscreen/CityStatsTable.kt index 414922c133..9f24f22b7e 100644 --- a/core/src/com/unciv/ui/cityscreen/CityStatsTable.kt +++ b/core/src/com/unciv/ui/cityscreen/CityStatsTable.kt @@ -31,7 +31,7 @@ class CityStatsTable(val cityScreen: CityScreen): Table() { val ministatsTable = Table() for ((stat, amount) in cityInfo.cityStats.currentCityStats.toHashMap()) { - if (stat == Stat.Faith && !cityInfo.getRuleset().hasReligion()) continue + if (stat == Stat.Faith && !cityInfo.civInfo.gameInfo.hasRelgionEnabled()) continue ministatsTable.add(ImageGetter.getStatIcon(stat.name)).size(20f).padRight(5f) val valueToDisplay = if (stat == Stat.Happiness) cityInfo.cityStats.happinessList.values.sum() else amount ministatsTable.add(round(valueToDisplay).toInt().toString().toLabel()).padRight(10f) diff --git a/core/src/com/unciv/ui/newgamescreen/GameOptionsTable.kt b/core/src/com/unciv/ui/newgamescreen/GameOptionsTable.kt index 7e9edaa3ce..3784e88808 100644 --- a/core/src/com/unciv/ui/newgamescreen/GameOptionsTable.kt +++ b/core/src/com/unciv/ui/newgamescreen/GameOptionsTable.kt @@ -50,6 +50,8 @@ class GameOptionsTable(val previousScreen: IPreviousScreen, val updatePlayerPick checkboxTable.addOneCityChallengeCheckbox() checkboxTable.addNuclearWeaponsCheckbox() checkboxTable.addIsOnlineMultiplayerCheckbox() + if (UncivGame.Current.settings.showExperimentalRelgion) + checkboxTable.addReligionCheckbox() checkboxTable.addModCheckboxes() add(checkboxTable).colspan(2).row() @@ -83,6 +85,10 @@ class GameOptionsTable(val previousScreen: IPreviousScreen, val updatePlayerPick gameParameters.isOnlineMultiplayer = it updatePlayerPickerTable("") } + + private fun Table.addReligionCheckbox() = + addCheckbox("Enable Religion", gameParameters.religionEnabled) + { gameParameters.religionEnabled = it } private fun addCityStatesSelectBox() { add("{Number of City-States}:".toLabel()) diff --git a/core/src/com/unciv/ui/overviewscreen/CityOverviewTable.kt b/core/src/com/unciv/ui/overviewscreen/CityOverviewTable.kt index edb07ea914..0919bd710f 100644 --- a/core/src/com/unciv/ui/overviewscreen/CityOverviewTable.kt +++ b/core/src/com/unciv/ui/overviewscreen/CityOverviewTable.kt @@ -24,7 +24,7 @@ class CityOverviewTable(private val viewingPlayer: CivilizationInfo, private val } private val columnsNames = arrayListOf("Population", "Food", "Gold", "Science", "Production", "Culture", "Happiness") - .apply { if (viewingPlayer.gameInfo.ruleSet.hasReligion()) add("Faith") } + .apply { if (viewingPlayer.gameInfo.hasRelgionEnabled()) add("Faith") } init { val numHeaderCells = columnsNames.size + 2 // +1 City +1 Filler diff --git a/core/src/com/unciv/ui/worldscreen/WorldScreenTopBar.kt b/core/src/com/unciv/ui/worldscreen/WorldScreenTopBar.kt index bcbd33c942..e66430bc53 100644 --- a/core/src/com/unciv/ui/worldscreen/WorldScreenTopBar.kt +++ b/core/src/com/unciv/ui/worldscreen/WorldScreenTopBar.kt @@ -124,7 +124,7 @@ class WorldScreenTopBar(val worldScreen: WorldScreen) : Table() { cultureLabel.onClick(invokePoliciesPage) cultureImage.onClick(invokePoliciesPage) - if(worldScreen.gameInfo.ruleSet.hasReligion()) { + if(worldScreen.gameInfo.hasRelgionEnabled()) { statsTable.add(faithLabel).padLeft(20f) statsTable.add(ImageGetter.getStatIcon("Faith")).padBottom(6f).size(20f) } diff --git a/core/src/com/unciv/ui/worldscreen/mainmenu/OptionsPopup.kt b/core/src/com/unciv/ui/worldscreen/mainmenu/OptionsPopup.kt index 6810221145..be4465df11 100644 --- a/core/src/com/unciv/ui/worldscreen/mainmenu/OptionsPopup.kt +++ b/core/src/com/unciv/ui/worldscreen/mainmenu/OptionsPopup.kt @@ -134,10 +134,16 @@ class OptionsPopup(val previousScreen:CameraStageBaseScreen) : Popup(previousScr addHeader("Other options") + addYesNoRow("{Show experimental world wrap for maps}\n{HIGHLY EXPERIMENTAL - YOU HAVE BEEN WARNED!}".tr(), settings.showExperimentalWorldWrap) { settings.showExperimentalWorldWrap = it } + addYesNoRow("{Enable experimental religion in start games}\n{HIHGLY EXPERIMENTAL - UPDATES WILL BREAK SAVES!}".tr(), + settings.showExperimentalRelgion) { + settings.showExperimentalRelgion = it + } + if (previousScreen.game.limitOrientationsHelper != null) { addYesNoRow("Enable portrait orientation", settings.allowAndroidPortrait) {