mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-15 02:09:21 +07:00
Ancient Ruins are now spread out instead of randomized
This commit is contained in:
@ -49,7 +49,10 @@ class MapGenerator {
|
|||||||
|
|
||||||
for (tile in map.values) randomizeTile(tile, mapParameters, ruleset)
|
for (tile in map.values) randomizeTile(tile, mapParameters, ruleset)
|
||||||
|
|
||||||
randomizeResources(map, mapRadius, ruleset)
|
spreadResources(map, mapRadius, ruleset)
|
||||||
|
|
||||||
|
if(!mapParameters.noRuins)
|
||||||
|
spreadAncientRuins(map)
|
||||||
|
|
||||||
if (!mapParameters.noNaturalWonders)
|
if (!mapParameters.noNaturalWonders)
|
||||||
spawnNaturalWonders(map, mapRadius, ruleset)
|
spawnNaturalWonders(map, mapRadius, ruleset)
|
||||||
@ -105,8 +108,6 @@ class MapGenerator {
|
|||||||
tileInfo.setTransients()
|
tileInfo.setTransients()
|
||||||
}
|
}
|
||||||
addRandomTerrainFeature(tileInfo, ruleset)
|
addRandomTerrainFeature(tileInfo, ruleset)
|
||||||
if(!mapParameters.noRuins)
|
|
||||||
maybeAddAncientRuins(tileInfo)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getLatitude(vector: Vector2): Float {
|
fun getLatitude(vector: Vector2): Float {
|
||||||
@ -200,14 +201,16 @@ class MapGenerator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fun maybeAddAncientRuins(tile: TileInfo) {
|
fun spreadAncientRuins(map: TileMap) {
|
||||||
val baseTerrain = tile.getBaseTerrain()
|
val suitableTiles = map.values.filter { it.isLand && !it.getBaseTerrain().impassable }
|
||||||
if (baseTerrain.type != TerrainType.Water && !baseTerrain.impassable && Random().nextDouble() < 1f / 100)
|
val locations = chooseSpreadOutLocations(suitableTiles.size/100,
|
||||||
tile.improvement = Constants.ancientRuins
|
suitableTiles, 10)
|
||||||
|
for(tile in locations)
|
||||||
|
tile.improvement =Constants.ancientRuins
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fun randomizeResources(mapToReturn: TileMap, distance: Int, ruleset: Ruleset) {
|
fun spreadResources(mapToReturn: TileMap, distance: Int, ruleset: Ruleset) {
|
||||||
for (tile in mapToReturn.values)
|
for (tile in mapToReturn.values)
|
||||||
if (tile.resource != null)
|
if (tile.resource != null)
|
||||||
tile.resource = null
|
tile.resource = null
|
||||||
|
Reference in New Issue
Block a user