mirror of
https://github.com/yairm210/Unciv.git
synced 2025-02-08 01:54:02 +07:00
Added Shrine, option for enabling religion (#4291)
* Added option in-game to enable faith (highly discouraged) * Added shrine for generating Faith * Made Shrine hidden in games without religion
This commit is contained in:
parent
4add686bcd
commit
168f984a65
BIN
android/ImagesToPackSeparately/BuildingIcons/Shrine.png
Normal file
BIN
android/ImagesToPackSeparately/BuildingIcons/Shrine.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
@ -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
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 255 KiB After Width: | Height: | Size: 256 KiB |
@ -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,
|
||||
|
@ -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
|
||||
|
@ -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())
|
||||
|
@ -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<VictoryType> = arrayListOf(VictoryType.Cultural, VictoryType.Domination, VictoryType.Scientific) // By default, all victory types
|
||||
var startingEra = Constants.ancientEra
|
||||
|
@ -41,6 +41,7 @@ class GameSettings {
|
||||
var visualMods = HashSet<String>()
|
||||
|
||||
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"
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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}: "
|
||||
@ -91,6 +92,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
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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()
|
||||
|
||||
@ -84,6 +86,10 @@ class GameOptionsTable(val previousScreen: IPreviousScreen, val updatePlayerPick
|
||||
updatePlayerPickerTable("")
|
||||
}
|
||||
|
||||
private fun Table.addReligionCheckbox() =
|
||||
addCheckbox("Enable Religion", gameParameters.religionEnabled)
|
||||
{ gameParameters.religionEnabled = it }
|
||||
|
||||
private fun addCityStatesSelectBox() {
|
||||
add("{Number of City-States}:".toLabel())
|
||||
val cityStatesSelectBox = SelectBox<Int>(CameraStageBaseScreen.skin)
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user