diff --git a/android/build.gradle b/android/build.gradle index ebe22369..eb4c0389 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -21,7 +21,7 @@ android { applicationId "com.unciv.game" minSdkVersion 14 targetSdkVersion 26 - versionCode 148 + versionCode 149 versionName "2.9.2" } buildTypes { diff --git a/core/src/com/unciv/logic/GameInfo.kt b/core/src/com/unciv/logic/GameInfo.kt index 78d1c362..a5f12723 100644 --- a/core/src/com/unciv/logic/GameInfo.kt +++ b/core/src/com/unciv/logic/GameInfo.kt @@ -65,7 +65,8 @@ class GameInfo { && (it.getOwner()==player || it.neighbors.any { neighbor -> neighbor.getOwner()==player }) } for(enemyUnitTile in enemyUnitsCloseToTerritory) { val inOrNear = if(enemyUnitTile.getOwner()==player) "in" else "near" - player.addNotification("An enemy [${enemyUnitTile.militaryUnit!!.name}] was spotted $inOrNear our territory", enemyUnitTile.position, Color.RED) + val unitName = enemyUnitTile.militaryUnit!!.name + player.addNotification("An enemy [$unitName] was spotted $inOrNear our territory", enemyUnitTile.position, Color.RED) } turns++ @@ -98,5 +99,4 @@ class GameInfo { cityInfo.cityStats.update() } -} - +} \ No newline at end of file diff --git a/core/src/com/unciv/logic/map/MapUnit.kt b/core/src/com/unciv/logic/map/MapUnit.kt index be552ed7..54788107 100644 --- a/core/src/com/unciv/logic/map/MapUnit.kt +++ b/core/src/com/unciv/logic/map/MapUnit.kt @@ -107,8 +107,12 @@ class MapUnit { fun canPassThrough(tile: TileInfo):Boolean{ val tileOwner = tile.getOwner() - if(tile.getBaseTerrain().type==TerrainType.Water && baseUnit.unitType.isLandUnit()) - return false + if(tile.getBaseTerrain().type==TerrainType.Water && baseUnit.unitType.isLandUnit()){ + if(!civInfo.tech.isResearched("Optics")) + return false + if(tile.baseTerrain == "Ocean" && !civInfo.tech.isResearched("Astronomy")) + return false + } if(tile.getBaseTerrain().type==TerrainType.Land && baseUnit.unitType.isWaterUnit()) return false if(tile.baseTerrain=="Ocean" && baseUnit.uniques.contains("Cannot enter ocean tiles until Astronomy") @@ -158,6 +162,13 @@ class MapUnit { return currentTile.baseTerrain=="Ocean"||currentTile.baseTerrain=="Coast" } + fun getEmbarkedMovement(){ + var movement=2 + movement += civInfo.tech.techsResearched.map { GameBasics.Technologies[it]!! } + .count { it.baseDescription!=null && it.baseDescription!! == "Increases embarked movement" } + if(civInfo.tech.isResearched("Steam Power")) movement += 1 + } + //endregion //region state-changing functions diff --git a/core/src/com/unciv/logic/map/UnitMovementAlgorithms.kt b/core/src/com/unciv/logic/map/UnitMovementAlgorithms.kt index 75e9d5a0..54b54feb 100644 --- a/core/src/com/unciv/logic/map/UnitMovementAlgorithms.kt +++ b/core/src/com/unciv/logic/map/UnitMovementAlgorithms.kt @@ -1,11 +1,17 @@ package com.unciv.logic.map import com.badlogic.gdx.math.Vector2 +import com.unciv.models.gamebasics.tile.TerrainType class UnitMovementAlgorithms(val unit:MapUnit) { val tileMap = unit.getTile().tileMap private fun getMovementCostBetweenAdjacentTiles(from: TileInfo, to: TileInfo): Float { + + if(from.getBaseTerrain().type==TerrainType.Land && to.getBaseTerrain().type==TerrainType.Water + || from.getBaseTerrain().type==TerrainType.Water && to.getBaseTerrain().type==TerrainType.Land) + return 100f // this is embarkment or disembarkment, and will take the entire turn + if (from.roadStatus === RoadStatus.Railroad && to.roadStatus === RoadStatus.Railroad) return 1 / 10f