mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-10 23:37:31 +07:00
Fixed Great Barrier Reef spawn rules
This commit is contained in:
parent
9eaf4f4826
commit
01877fee7c
@ -173,7 +173,7 @@
|
||||
"production": 1,
|
||||
"gold": 1,
|
||||
"science": 2,
|
||||
"occursOn": ["Coast"],
|
||||
"occursOn": ["Ocean"],
|
||||
"turnsInto": "Coast",
|
||||
"impassable": true,
|
||||
"unbuildable": true,
|
||||
|
@ -255,7 +255,7 @@ class MapGenerator(val ruleset: Ruleset) {
|
||||
private fun spawnVegetation(tileMap: TileMap) {
|
||||
val vegetationSeed = randomness.RNG.nextInt().toDouble()
|
||||
val candidateTerrains = Constants.vegetation.flatMap{ ruleset.terrains[it]!!.occursOn }
|
||||
for (tile in tileMap.values.asSequence().filter { it.baseTerrain in candidateTerrains && it.terrainFeature == null
|
||||
for (tile in tileMap.values.asSequence().filter { it.baseTerrain in candidateTerrains && it.terrainFeatures.isEmpty()
|
||||
&& (!it.isHill() || Constants.hill in candidateTerrains) }) {
|
||||
val vegetation = (randomness.getPerlinNoise(tile, vegetationSeed, scale = 3.0, nOctaves = 1) + 1.0) / 2.0
|
||||
|
||||
|
@ -127,7 +127,7 @@ class NaturalWonderGenerator(val ruleset: Ruleset) {
|
||||
|
||||
/*
|
||||
Great Barrier Reef: Specifics currently unknown;
|
||||
Assumption: at least 1 neighbour not water; no tundra; at least 1 neighbour coast; becomes coast
|
||||
Assumption: at least 1 neighbour coast; no tundra; at least 1 neighbour coast; becomes coast
|
||||
*/
|
||||
private fun spawnGreatBarrierReef(tileMap: TileMap) {
|
||||
val wonder = ruleset.terrains[Constants.greatBarrierReef]!!
|
||||
@ -136,6 +136,7 @@ class NaturalWonderGenerator(val ruleset: Ruleset) {
|
||||
&& wonder.occursOn.contains(it.getLastTerrain().name)
|
||||
&& abs(it.latitude) > tileMap.maxLatitude * 0.1
|
||||
&& abs(it.latitude) < tileMap.maxLatitude * 0.7
|
||||
&& it.neighbors.any { it.baseTerrain == Constants.coast }
|
||||
&& it.neighbors.all { neighbor -> neighbor.isWater }
|
||||
&& it.neighbors.any { neighbor ->
|
||||
neighbor.resource == null && neighbor.improvement == null
|
||||
|
Loading…
Reference in New Issue
Block a user