mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-10 15:59:33 +07:00
Exploring units now take several turns to reach a ruin (but only if it is in vision, not behind fog of war) (#7285)
Re-did this because the last pull request was a mess and so was everything else I was doing
This commit is contained in:
@ -48,16 +48,16 @@ object UnitAutomation {
|
||||
|
||||
private fun tryGoToRuinAndEncampment(unit: MapUnit): Boolean {
|
||||
if (!unit.civInfo.isMajorCiv()) return false // barbs don't have anything to do in ruins
|
||||
val unitDistanceToTiles = unit.movement.getDistanceToTiles()
|
||||
val tileWithRuinOrEncampment = unitDistanceToTiles.keys
|
||||
|
||||
val tileWithRuinOrEncampment = unit.viewableTiles
|
||||
.firstOrNull {
|
||||
(
|
||||
(it.improvement != null && it.getTileImprovement()!!.isAncientRuinsEquivalent())
|
||||
|| it.improvement == Constants.barbarianEncampment
|
||||
)
|
||||
&& unit.movement.canMoveTo(it)
|
||||
(it.improvement != null && it.getTileImprovement()!!.isAncientRuinsEquivalent())
|
||||
|| it.improvement == Constants.barbarianEncampment
|
||||
)
|
||||
&& unit.movement.canMoveTo(it)
|
||||
} ?: return false
|
||||
unit.movement.moveToTile(tileWithRuinOrEncampment)
|
||||
unit.movement.headTowards(tileWithRuinOrEncampment)
|
||||
return true
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user