Better crude maps - zero uncovered tiles impossible (#4685)

This commit is contained in:
SomeTroglodyte 2021-07-31 22:50:20 +02:00 committed by GitHub
parent e68bc128ab
commit bb25f1fdb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -841,21 +841,24 @@ class MapUnit {
}
// Map of the surrounding area
actions.add {
val revealCenter = tile.getTilesAtDistance(ANCIENT_RUIN_MAP_REVEAL_OFFSET).toList()
.random(tileBasedRandom)
val tilesToReveal = revealCenter
.getTilesInDistance(ANCIENT_RUIN_MAP_REVEAL_RANGE)
.filter { Random.nextFloat() < ANCIENT_RUIN_MAP_REVEAL_CHANCE }
.map { it.position }
civInfo.exploredTiles.addAll(tilesToReveal)
civInfo.updateViewableTiles()
civInfo.addNotification(
"We have found a crudely-drawn map in the ruins!",
tile.position,
"ImprovementIcons/Ancient ruins"
)
}
val revealCenter = tile.getTilesAtDistance(ANCIENT_RUIN_MAP_REVEAL_OFFSET)
.filter { it.position !in civInfo.exploredTiles }
.toList()
.randomOrNull(tileBasedRandom)
if (revealCenter != null)
actions.add {
val tilesToReveal = revealCenter
.getTilesInDistance(ANCIENT_RUIN_MAP_REVEAL_RANGE)
.filter { Random.nextFloat() < ANCIENT_RUIN_MAP_REVEAL_CHANCE }
.map { it.position }
civInfo.exploredTiles.addAll(tilesToReveal)
civInfo.updateViewableTiles()
civInfo.addNotification(
"We have found a crudely-drawn map in the ruins!",
tile.position,
"ImprovementIcons/Ancient ruins"
)
}
(actions.random(tileBasedRandom))()
}