diff --git a/android/assets/Atlases.json b/android/assets/Atlases.json index 8cf6e0eb27..206636a653 100644 --- a/android/assets/Atlases.json +++ b/android/assets/Atlases.json @@ -1 +1 @@ -[Tech,Flags,Skin,Construction] \ No newline at end of file +[Construction,Flags,Skin,Tech] \ No newline at end of file diff --git a/android/assets/jsons/Civ V - Vanilla/Eras.json b/android/assets/jsons/Civ V - Vanilla/Eras.json index 39bd3e9488..07cb0302e3 100644 --- a/android/assets/jsons/Civ V - Vanilla/Eras.json +++ b/android/assets/jsons/Civ V - Vanilla/Eras.json @@ -16,12 +16,14 @@ "Cultured": ["Provides [3] [Culture] per turn"], "Maritime": ["Provides [2] [Food] [in capital]"], "Mercantile": ["Provides [2] Happiness"], + "Religious": ["Provides [3] [Faith] per turn"], "Militaristic": ["Provides military units every ≈[20] turns"] }, "allyBonus": { "Cultured": ["Provides [6] [Culture] per turn"], "Maritime": ["Provides [2] [Food] [in capital]", "Provides [1] [Food] [in all cities]"], "Mercantile": ["Provides [2] Happiness", "Provides a unique luxury"], + "Religious": ["Provides [6] [Faith] per turn"], "Militaristic": ["Provides military units every ≈[17] turns"] }, "iconRGB": [255, 87, 35] @@ -42,12 +44,14 @@ "Cultured": ["Provides [3] [Culture] per turn"], "Maritime": ["Provides [2] [Food] [in capital]"], "Mercantile": ["Provides [2] Happiness"], + "Religious": ["Provides [3] [Faith] per turn"], "Militaristic": ["Provides military units every ≈[20] turns"] }, "allyBonus": { "Cultured": ["Provides [6] [Culture] per turn"], "Maritime": ["Provides [2] [Food] [in capital]", "Provides [1] [Food] [in all cities]"], "Mercantile": ["Provides [2] Happiness", "Provides a unique luxury"], + "Religious": ["Provides [6] [Faith] per turn"], "Militaristic": ["Provides military units every ≈[17] turns"] }, "iconRGB": [233, 31, 99] @@ -70,12 +74,14 @@ "Cultured": ["Provides [6] [Culture] per turn"], "Maritime": ["Provides [2] [Food] [in capital]"], "Mercantile": ["Provides [3] Happiness"], + "Religious": ["Provides [6] [Faith] per turn"], "Militaristic": ["Provides military units every ≈[20] turns"] }, "allyBonus": { "Cultured": ["Provides [12] [Culture] per turn"], "Maritime": ["Provides [2] [Food] [in capital]", "Provides [1] [Food] [in all cities]"], "Mercantile": ["Provides [3] Happiness", "Provides a unique luxury"], + "Religious": ["Provides [12] [Faith] per turn"], "Militaristic": ["Provides military units every ≈[17] turns"] }, "iconRGB": [157, 39, 176] @@ -99,12 +105,14 @@ "Cultured": ["Provides [6] [Culture] per turn"], "Maritime": ["Provides [2] [Food] [in capital]"], "Mercantile": ["Provides [3] Happiness"], + "Religious": ["Provides [6] [Faith] per turn"], "Militaristic": ["Provides military units every ≈[20] turns"] }, "allyBonus": { "Cultured": ["Provides [12] [Culture] per turn"], "Maritime": ["Provides [2] [Food] [in capital]", "Provides [1] [Food] [in all cities]"], "Mercantile": ["Provides [3] Happiness", "Provides a unique luxury"], + "Religious": ["Provides [12] [Faith] per turn"], "Militaristic": ["Provides military units every ≈[17] turns"] }, "iconRGB": [104, 58, 183] @@ -129,12 +137,14 @@ "Cultured": ["Provides [13] [Culture] per turn"], "Maritime": ["Provides [2] [Food] [in capital]"], "Mercantile": ["Provides [3] Happiness"], + "Religious": ["Provides [13] [Faith] per turn"], "Militaristic": ["Provides military units every ≈[20] turns"] }, "allyBonus": { "Cultured": ["Provides [26] [Culture] per turn"], "Maritime": ["Provides [2] [Food] [in capital]", "Provides [1] [Food] [in all cities]"], "Mercantile": ["Provides [3] Happiness", "Provides a unique luxury"], + "Religious": ["Provides [26] [Faith] per turn"], "Militaristic": ["Provides military units every ≈[17] turns"] }, "iconRGB": [63, 81, 182], @@ -164,12 +174,15 @@ "Cultured": ["Provides [13] [Culture] per turn"], "Maritime": ["Provides [2] [Food] [in capital]"], "Mercantile": ["Provides [3] Happiness"], + + "Religious": ["Provides [13] [Faith] per turn"], "Militaristic": ["Provides military units every ≈[20] turns"] }, "allyBonus": { "Cultured": ["Provides [26] [Culture] per turn"], "Maritime": ["Provides [2] [Food] [in capital]", "Provides [1] [Food] [in all cities]"], "Mercantile": ["Provides [3] Happiness", "Provides a unique luxury"], + "Religious": ["Provides [26] [Faith] per turn"], "Militaristic": ["Provides military units every ≈[17] turns"] }, "iconRGB": [33, 150, 243], @@ -200,12 +213,14 @@ "Cultured": ["Provides [13] [Culture] per turn"], "Maritime": ["Provides [2] [Food] [in capital]"], "Mercantile": ["Provides [3] Happiness"], + "Religious": ["Provides [13] [Faith] per turn"], "Militaristic": ["Provides military units every ≈[20] turns"] }, "allyBonus": { "Cultured": ["Provides [26] [Culture] per turn"], "Maritime": ["Provides [2] [Food] [in capital]", "Provides [1] [Food] [in all cities]"], "Mercantile": ["Provides [3] Happiness", "Provides a unique luxury"], + "Religious": ["Provides [26] [Faith] per turn"], "Militaristic": ["Provides military units every ≈[17] turns"] }, "iconRGB": [0, 150, 136], @@ -240,13 +255,16 @@ "Cultured": ["Provides [13] [Culture] per turn"], "Maritime": ["Provides [2] [Food] [in capital]"], "Mercantile": ["Provides [3] Happiness"], + "Religious": ["Provides [13] [Faith] per turn"], "Militaristic": ["Provides military units every ≈[20] turns"] }, "allyBonus": { "Cultured": ["Provides [26] [Culture] per turn"], "Maritime": ["Provides [2] [Food] [in capital]", "Provides [1] [Food] [in all cities]"], "Mercantile": ["Provides [3] Happiness", "Provides a unique luxury"], + "Religious": ["Provides [26] [Faith] per turn"], "Militaristic": ["Provides military units every ≈[17] turns"] + }, "iconRGB": [76, 176, 81], "uniques": ["May not generate great prophet equivalents naturally", @@ -279,13 +297,17 @@ "Cultured": ["Provides [13] [Culture] per turn"], "Maritime": ["Provides [2] [Food] [in capital]"], "Mercantile": ["Provides [3] Happiness"], + "Religious": ["Provides [13] [Faith] per turn"], "Militaristic": ["Provides military units every ≈[20] turns"] + }, "allyBonus": { "Cultured": ["Provides [26] [Culture] per turn"], "Maritime": ["Provides [2] [Food] [in capital]", "Provides [1] [Food] [in all cities]"], "Mercantile": ["Provides [3] Happiness", "Provides a unique luxury"], + "Religious": ["Provides [26] [Faith] per turn"], "Militaristic": ["Provides military units every ≈[17] turns"] + }, "iconRGB": [76, 176, 81], "uniques": ["May not generate great prophet equivalents naturally", diff --git a/android/assets/jsons/Civ V - Vanilla/Nations.json b/android/assets/jsons/Civ V - Vanilla/Nations.json index 969ef5b63e..57d6baa962 100644 --- a/android/assets/jsons/Civ V - Vanilla/Nations.json +++ b/android/assets/jsons/Civ V - Vanilla/Nations.json @@ -1121,6 +1121,42 @@ "innerColor": [224,224,224], "cities": ["Mogadishu"] }, + { + "name": "Bratislava", + "adjective": ["Bratislava"], + "cityStateType": "Religious", + + "declaringWar": "I didn't want to do this. We declare war.", + "attacked": "I will fear no evil. For god is with me!", + "defeated": "Why have you forsaken us my lord?", + "outerColor": [0, 0, 0], + "innerColor": [255,255,255], + "cities": ["Bratislava"] + }, + { + "name": "Cahokia", + "adjective": ["Cahokia"], + "cityStateType": "Religious", + + "declaringWar": "We have wanted this for a LONG time. War it shall be.", + "attacked": "Very well, we will kick you back to the ancient era!", + "defeated": "This isn't how it is supposed to be!", + "outerColor": [0, 0, 0], + "innerColor": [203, 253, 232], + "cities": ["Cahokia"] + }, + { + "name": "Jerusalem", + "adjective": ["Jerusalem"], + "cityStateType": "Religious", + + "declaringWar": "By god's grace we will not allow these atrocities to occur any longer. We declare war!", + "attacked": "May god have mercy on your evil soul.", + "defeated": "I for one welcome our new conquer overlord!", + "outerColor": [0, 0, 0], + "innerColor": [198,255,192], + "cities": ["Jerusalem"] + }, diff --git a/android/assets/jsons/translations/template.properties b/android/assets/jsons/translations/template.properties index 57ae9a5d48..e522759bca 100644 --- a/android/assets/jsons/translations/template.properties +++ b/android/assets/jsons/translations/template.properties @@ -499,6 +499,7 @@ A [greatPerson] has been born in [cityName]! = We have encountered [civName]! = [cityStateName] has given us [stats] as a token of goodwill for meeting us = [cityStateName] has given us [stats] as we are the first major civ to meet them = +[cityStateName] has also given us [stats] = Cannot provide unit upkeep for [unitName] - unit has been disbanded! = [cityName] has grown! = [cityName] is starving! = diff --git a/core/src/com/unciv/logic/GameStarter.kt b/core/src/com/unciv/logic/GameStarter.kt index 061983c4c6..4596d3725d 100644 --- a/core/src/com/unciv/logic/GameStarter.kt +++ b/core/src/com/unciv/logic/GameStarter.kt @@ -191,16 +191,26 @@ object GameStarter { val availableCityStatesNames = Stack() // since we shuffle and then order by, we end up with all the City-States with starting tiles first in a random order, // and then all the other City-States in a random order! Because the sortedBy function is stable! - availableCityStatesNames.addAll(ruleset.nations.filter { it.value.isCityState() }.keys - .shuffled().sortedByDescending { it in civNamesWithStartingLocations }) + availableCityStatesNames.addAll( ruleset.nations + .filter { it.value.isCityState() && (it.value.cityStateType != CityStateType.Religious || newGameParameters.religionEnabled) } + .keys + .shuffled() + .sortedByDescending { it in civNamesWithStartingLocations } ) + + + val allMercantileResources = ruleset.tileResources.values.filter { it.unique == "Can only be created by Mercantile City-States" }.map { it.name } + val unusedMercantileResources = Stack() + unusedMercantileResources.addAll(allMercantileResources.shuffled()) + var addedCityStates = 0 // Keep trying to add city states until we reach the target number. while (addedCityStates < newGameParameters.numberOfCityStates) { if (availableCityStatesNames.isEmpty()) // We ran out of city-states somehow break + val cityStateName = availableCityStatesNames.pop() val civ = CivilizationInfo(cityStateName) - if (civ.initCityState(ruleset, newGameParameters.startingEra, availableCivNames)) { // true if successful init + if (civ.initCityState(ruleset, newGameParameters.startingEra, availableCivNames)) { gameInfo.civilizations.add(civ) addedCityStates++ } diff --git a/core/src/com/unciv/logic/civilization/CityStateFunctions.kt b/core/src/com/unciv/logic/civilization/CityStateFunctions.kt index f720633040..d151ff89bf 100644 --- a/core/src/com/unciv/logic/civilization/CityStateFunctions.kt +++ b/core/src/com/unciv/logic/civilization/CityStateFunctions.kt @@ -425,6 +425,7 @@ class CityStateFunctions(val civInfo: CivilizationInfo) { civInfo.cityStateType == CityStateType.Mercantile && statType == Stat.Happiness -> true civInfo.cityStateType == CityStateType.Cultured && statType == Stat.Culture -> true civInfo.cityStateType == CityStateType.Maritime && statType == Stat.Food -> true + civInfo.cityStateType == CityStateType.Religious && statType == Stat.Faith ->true else -> false } } diff --git a/core/src/com/unciv/logic/civilization/CityStateType.kt b/core/src/com/unciv/logic/civilization/CityStateType.kt index 9c30e1a35a..fca8759506 100644 --- a/core/src/com/unciv/logic/civilization/CityStateType.kt +++ b/core/src/com/unciv/logic/civilization/CityStateType.kt @@ -5,7 +5,7 @@ enum class CityStateType(val color: String = "", val icon: String) { Maritime("#38ff70", "OtherIcons/Maritime"), Mercantile("#ffd800", "OtherIcons/Mercantile"), Militaristic("#ff0000", "OtherIcons/Militaristic"), - //Religious("#FFFFFF", "OtherIcons/Religious") + Religious("#FFFFFF", "OtherIcons/Religious") } enum class CityStatePersonality { diff --git a/core/src/com/unciv/logic/civilization/CivilizationInfo.kt b/core/src/com/unciv/logic/civilization/CivilizationInfo.kt index 43b8277a56..4ee3df527e 100644 --- a/core/src/com/unciv/logic/civilization/CivilizationInfo.kt +++ b/core/src/com/unciv/logic/civilization/CivilizationInfo.kt @@ -406,9 +406,11 @@ class CivilizationInfo { val cityStateLocation = if (cities.isEmpty()) null else getCapital().location val giftAmount = Stats(gold = 15f) + val faithAmount = Stats(faith = 4f) // Later, religious city-states will also gift gold, making this the better implementation // For now, it might be overkill though. var meetString = "[${civName}] has given us [${giftAmount}] as a token of goodwill for meeting us" + val religionMeetString = "[${civName}] has also given us [${faithAmount}]" if (diplomacy.filter { it.value.otherCiv().isMajorCiv() }.count() == 1) { giftAmount.timesInPlace(2f) meetString = "[${civName}] has given us [${giftAmount}] as we are the first major civ to meet them" @@ -418,6 +420,12 @@ class CivilizationInfo { else otherCiv.addNotification(meetString, NotificationIcon.Gold) + if (otherCiv.isCityState() && otherCiv.canGiveStat(Stat.Faith)){ + otherCiv.addNotification(religionMeetString, NotificationIcon.Faith) + + for ((key, value) in faithAmount) + otherCiv.addStat(key, value.toInt()) + } for ((key, value) in giftAmount) otherCiv.addStat(key, value.toInt()) } diff --git a/core/src/com/unciv/logic/civilization/ReligionManager.kt b/core/src/com/unciv/logic/civilization/ReligionManager.kt index 70bf161cdc..ac977999eb 100644 --- a/core/src/com/unciv/logic/civilization/ReligionManager.kt +++ b/core/src/com/unciv/logic/civilization/ReligionManager.kt @@ -1,9 +1,11 @@ package com.unciv.logic.civilization +import com.unciv.logic.civilization.diplomacy.RelationshipLevel import com.unciv.logic.map.MapUnit import com.unciv.models.Religion import com.unciv.models.ruleset.Belief import com.unciv.models.ruleset.BeliefType +import com.unciv.models.ruleset.Era import com.unciv.ui.pickerscreens.BeliefContainer import com.unciv.ui.utils.toPercent import kotlin.random.Random