mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-29 15:01:09 -04:00
Fixed "units from ruins block activating unit" bug and fixed colors for new city states
This commit is contained in:
parent
42e5f3b883
commit
b131372b13
@ -1056,8 +1056,8 @@
|
|||||||
attacked:"Very well, this shall not be forgotten.",
|
attacked:"Very well, this shall not be forgotten.",
|
||||||
afterPeace:"May peace forever bless our lands.",
|
afterPeace:"May peace forever bless our lands.",
|
||||||
|
|
||||||
mainColor:[0, 0, 0],
|
outerColor:[0, 0, 0],
|
||||||
secondaryColor:[102,0,51],
|
innerColor:[102,0,51],
|
||||||
cities:["Almaty"]
|
cities:["Almaty"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -1069,8 +1069,8 @@
|
|||||||
attacked:"Very well, this shall not be forgotten.",
|
attacked:"Very well, this shall not be forgotten.",
|
||||||
afterPeace:"May peace forever bless our lands.",
|
afterPeace:"May peace forever bless our lands.",
|
||||||
|
|
||||||
mainColor:[0, 0, 0],
|
outerColor:[0, 0, 0],
|
||||||
secondaryColor:[0,102,102],
|
innerColor:[0,102,102],
|
||||||
cities:["Edinburgh"]
|
cities:["Edinburgh"]
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -21,8 +21,8 @@ android {
|
|||||||
applicationId "com.unciv.app"
|
applicationId "com.unciv.app"
|
||||||
minSdkVersion 14
|
minSdkVersion 14
|
||||||
targetSdkVersion 28
|
targetSdkVersion 28
|
||||||
versionCode 278
|
versionCode 279
|
||||||
versionName "2.18.6-patch1"
|
versionName "2.18.6-patch2"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Had to add this crap for Travis to build, it wanted to sign the app
|
// Had to add this crap for Travis to build, it wanted to sign the app
|
||||||
|
@ -460,7 +460,8 @@ class UnitAutomation{
|
|||||||
|
|
||||||
fun tryGoToRuin(unit:MapUnit, unitDistanceToTiles: PathsToTilesWithinTurn): Boolean {
|
fun tryGoToRuin(unit:MapUnit, unitDistanceToTiles: PathsToTilesWithinTurn): Boolean {
|
||||||
if(!unit.civInfo.isMajorCiv()) return false // barbs don't have anything to do in ruins
|
if(!unit.civInfo.isMajorCiv()) return false // barbs don't have anything to do in ruins
|
||||||
val tileWithRuin = unitDistanceToTiles.keys.firstOrNull{unit.movement.canMoveTo(it) && it.improvement == Constants.ancientRuins}
|
val tileWithRuin = unitDistanceToTiles.keys
|
||||||
|
.firstOrNull{ it.improvement == Constants.ancientRuins && unit.movement.canMoveTo(it) }
|
||||||
if(tileWithRuin==null) return false
|
if(tileWithRuin==null) return false
|
||||||
unit.movement.moveToTile(tileWithRuin)
|
unit.movement.moveToTile(tileWithRuin)
|
||||||
return true
|
return true
|
||||||
|
@ -239,12 +239,18 @@ class UnitMovementAlgorithms(val unit:MapUnit) {
|
|||||||
// Move through all intermediate tiles to get ancient ruins, barb encampments
|
// Move through all intermediate tiles to get ancient ruins, barb encampments
|
||||||
// and to view tiles along the way
|
// and to view tiles along the way
|
||||||
val pathToFinalTile = distanceToTiles.getPathToTile(destination)
|
val pathToFinalTile = distanceToTiles.getPathToTile(destination)
|
||||||
|
|
||||||
unit.removeFromTile()
|
unit.removeFromTile()
|
||||||
|
unit.putInTile(destination)
|
||||||
|
|
||||||
|
// We only activate the moveThroughTile AFTER the putInTile because of a really weird bug -
|
||||||
|
// If you're going to (or past) a ruin, and you activate the ruin bonus, and A UNIT spawns.
|
||||||
|
// That unit could now be blocking your entrance to the destination, so the putInTile would fail! =0
|
||||||
|
// Instead, we move you to the destination directly, and only afterwards activate the various tileson the way.
|
||||||
|
|
||||||
for(tile in pathToFinalTile){
|
for(tile in pathToFinalTile){
|
||||||
unit.moveThroughTile(tile)
|
unit.moveThroughTile(tile)
|
||||||
}
|
}
|
||||||
unit.putInTile(destination)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -256,7 +262,8 @@ class UnitMovementAlgorithms(val unit:MapUnit) {
|
|||||||
if(unit.type.isAirUnit())
|
if(unit.type.isAirUnit())
|
||||||
return tile.airUnits.size<6 && tile.isCityCenter() && tile.getCity()?.civInfo==unit.civInfo
|
return tile.airUnits.size<6 && tile.isCityCenter() && tile.getCity()?.civInfo==unit.civInfo
|
||||||
|
|
||||||
if(!canPassThrough(tile)) return false
|
if(!canPassThrough(tile))
|
||||||
|
return false
|
||||||
|
|
||||||
if (unit.type.isCivilian())
|
if (unit.type.isCivilian())
|
||||||
return tile.civilianUnit==null && (tile.militaryUnit==null || tile.militaryUnit!!.owner==unit.owner)
|
return tile.civilianUnit==null && (tile.militaryUnit==null || tile.militaryUnit!!.owner==unit.owner)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user