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

View File

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