diff --git a/android/assets/jsons/Tutorials.json b/android/assets/jsons/Tutorials.json index cbfae353e2..036fcce423 100644 --- a/android/assets/jsons/Tutorials.json +++ b/android/assets/jsons/Tutorials.json @@ -10,7 +10,7 @@ // Civilopedia only, because players said this was too wall-of-text New_Game: [ "Your first mission is to found your capital city.\nThis is actually an important task because your capital city will probably be your most prosperous.\nMany game bonuses apply only to your capital city and it will probably be the center of your empire.", - "How do you know a spot is appropriate?\nThat’s not an easy question to answer, but looking for and building next to luxury resources is a good rule of thumb.\nLuxury resources are tiles that have things like gems, cotton, or silk (indicated by a smiley next to the resource icon)\nThese resources make your civilization happy. You should also keep an eye out for resources needed to build units, such as iron." , + "How do you know a spot is appropriate?\nThat’s not an easy question to answer, but looking for and building next to luxury resources is a good rule of thumb.\nLuxury resources are tiles that have things like gems, cotton, or silk (indicated by a smiley next to the resource icon)\nThese resources make your civilization happy. You should also keep an eye out for resources needed to build units, such as iron. Cities cannot be built within 3 tiles of existing cities, which is another thing to watch out for!", "However, cities don’t have a set area that they can work - more on that later!\nThis means you don’t have to settle cities right next to resources.\nLet’s say, for example, that you want access to some iron – but the resource is right next to a desert.\nYou don’t have to settle your city next to the desert. You can settle a few tiles away in more prosperous lands.\nYour city will grow and eventually gain access to the resource.\nYou only need to settle right next to resources if you need them immediately – \n which might be the case now and then, but you’ll usually have the luxury of time." , "The first thing coming out of your city should be either a Scout or Warrior.\nI generally prefer the Warrior because it can be used for defense and because it can be upgraded\n to the Swordsman unit later in the game for a relatively modest sum of gold.\nScouts can be effective, however, if you seem to be located in an area of dense forest and hills.\nScouts don’t suffer a movement penalty in this terrain.\nIf you’re a veteran of the 4x strategy genre your first Warrior or Scout will be followed by a Settler.\nFast expanding is absolutely critical in most games of this type." ], diff --git a/android/src/com/unciv/app/AndroidLauncher.kt b/android/src/com/unciv/app/AndroidLauncher.kt index 888455cc41..f6cedbdd0e 100644 --- a/android/src/com/unciv/app/AndroidLauncher.kt +++ b/android/src/com/unciv/app/AndroidLauncher.kt @@ -18,7 +18,8 @@ class AndroidLauncher : AndroidApplication() { // Only allow mods on KK+, to avoid READ_EXTERNAL_STORAGE permission earlier versions need if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { copyMods() - GameSaver.externalFilesDirForAndroid = getExternalFilesDir(null)!!.path + val externalfilesDir = getExternalFilesDir(null) + if(externalfilesDir!=null) GameSaver.externalFilesDirForAndroid = externalfilesDir.path } val config = AndroidApplicationConfiguration().apply { useImmersiveMode = true } diff --git a/core/src/com/unciv/logic/map/TileInfo.kt b/core/src/com/unciv/logic/map/TileInfo.kt index bf9e3dc1f6..02c1317317 100644 --- a/core/src/com/unciv/logic/map/TileInfo.kt +++ b/core/src/com/unciv/logic/map/TileInfo.kt @@ -343,6 +343,7 @@ open class TileInfo { /** The two tiles have a river between them */ fun isConnectedByRiver(otherTile:TileInfo): Boolean { + if(otherTile==this) throw Exception("Should not be called to compare to self!") val xDifference = this.position.x - otherTile.position.x val yDifference = this.position.y - otherTile.position.y diff --git a/core/src/com/unciv/logic/map/mapgenerator/MapGenerator.kt b/core/src/com/unciv/logic/map/mapgenerator/MapGenerator.kt index cdd67db1d7..aad8ed14aa 100644 --- a/core/src/com/unciv/logic/map/mapgenerator/MapGenerator.kt +++ b/core/src/com/unciv/logic/map/mapgenerator/MapGenerator.kt @@ -44,10 +44,10 @@ class MapGenerator(val ruleset: Ruleset) { spawnVegetation(map) spawnRareFeatures(map) spawnIce(map) + NaturalWonderGenerator(ruleset).spawnNaturalWonders(map, randomness) RiverGenerator(randomness).spawnRivers(map) spreadResources(map) spreadAncientRuins(map) - NaturalWonderGenerator(ruleset).spawnNaturalWonders(map, randomness) return map } diff --git a/core/src/com/unciv/logic/map/mapgenerator/RiverGenerator.kt b/core/src/com/unciv/logic/map/mapgenerator/RiverGenerator.kt index 97b2d17a81..05e43143ae 100644 --- a/core/src/com/unciv/logic/map/mapgenerator/RiverGenerator.kt +++ b/core/src/com/unciv/logic/map/mapgenerator/RiverGenerator.kt @@ -50,7 +50,7 @@ class RiverGenerator(val randomness: MapGenerationRandomness){ RiverCoordinate.BottomRightOrLeft.values().random(randomness.RNG)) - while(getAdjacentTiles(riverCoordinate,map).none { it.isWater }){ + while(getAdjacentTiles(riverCoordinate, map).none { it.isWater }){ val possibleCoordinates = riverCoordinate.getAdjacentPositions() .filter { map.contains(it.position) } if(possibleCoordinates.none()) return // end of the line diff --git a/core/src/com/unciv/models/Tutorial.kt b/core/src/com/unciv/models/Tutorial.kt index ce8aad9cb8..0eece7c901 100644 --- a/core/src/com/unciv/models/Tutorial.kt +++ b/core/src/com/unciv/models/Tutorial.kt @@ -32,6 +32,8 @@ enum class Tutorial(val value: String, val isCivilopedia: Boolean = !value.start CityStates("City-States"), NaturalWonders("Natural_Wonders"), CityExpansion("City_Expansion"), + GreatPeople("Great_People"), + RemovingTerrainFeatures("Removing_Terrain_Features") ; companion object { diff --git a/core/src/com/unciv/ui/worldscreen/unit/UnitActionsTable.kt b/core/src/com/unciv/ui/worldscreen/unit/UnitActionsTable.kt index a284d98ded..117a757bdf 100644 --- a/core/src/com/unciv/ui/worldscreen/unit/UnitActionsTable.kt +++ b/core/src/com/unciv/ui/worldscreen/unit/UnitActionsTable.kt @@ -32,7 +32,7 @@ class UnitActionsTable(val worldScreen: WorldScreen) : Table() { unitAction.startsWith("Create ") -> { // Regexplaination: start with a [, take as many non-] chars as you can, until you reach a ]. // What you find between the first [ and the first ] that comes after it, will be group no. 1 - val improvementName = Regex("""Create \[([^]]*)]""").find(unitAction)!!.groups[1]!!.value + val improvementName = Regex("""Create \[([^]]*)\]""").find(unitAction)!!.groups[1]!!.value return UnitIconAndKey(ImageGetter.getImprovementIcon(improvementName), 'i') } unitAction.startsWith("Sleep") -> return UnitIconAndKey(ImageGetter.getImage("OtherIcons/Sleep"), 'f')