Index: binaries/data/mods/public/maps/random/archipelago.js =================================================================== --- binaries/data/mods/public/maps/random/archipelago.js +++ binaries/data/mods/public/maps/random/archipelago.js @@ -2,7 +2,7 @@ TILE_CENTERED_HEIGHT_MAP = true; -var random_terrain = randomizeBiome(); +setSelectedBiome(); const tMainTerrain = rBiomeT1(); const tForestFloor1 = rBiomeT2(); @@ -224,7 +224,7 @@ [avoidClasses(clPlayer, 20, clForest, 17, clHill, 0), stayClasses(clLand, 4)], clForest, 1.0, - random_terrain + currentBiome() ); RMS.SetProgress(50); @@ -264,7 +264,7 @@ RMS.SetProgress(65); log("Creating decoration..."); -var planetm = random_terrain == g_BiomeTropic ? 8 : 1; +var planetm = currentBiome() == g_BiomeTropic ? 8 : 1; createDecoration ( [[new SimpleObject(aRockMedium, 1,3, 0,1)], Index: binaries/data/mods/public/maps/random/archipelago.json =================================================================== --- binaries/data/mods/public/maps/random/archipelago.json +++ binaries/data/mods/public/maps/random/archipelago.json @@ -7,6 +7,7 @@ "BaseHeight" : -5, "Keywords": ["naval"], "Preview" : "archipelago.png", + "SupportedBiomes": true, "CircularMap" : true } } Index: binaries/data/mods/public/maps/random/canyon.js =================================================================== --- binaries/data/mods/public/maps/random/canyon.js +++ binaries/data/mods/public/maps/random/canyon.js @@ -1,7 +1,7 @@ RMS.LoadLibrary("rmgen"); //random terrain textures -var random_terrain = randomizeBiome(); +setSelectedBiome(); const tMainTerrain = rBiomeT1(); const tForestFloor1 = rBiomeT2(); @@ -383,7 +383,7 @@ [avoidClasses(clPlayer, 1, clForest, 15, clHill, 1, clHill2, 0), stayClasses(clLand, 4)], clForest, 1.0, - random_terrain + currentBiome() ); RMS.SetProgress(50); @@ -430,7 +430,7 @@ // create decoration var planetm = 1; -if (random_terrain == g_BiomeTropic) +if (currentBiome() == g_BiomeTropic) planetm = 8; createDecoration Index: binaries/data/mods/public/maps/random/canyon.json =================================================================== --- binaries/data/mods/public/maps/random/canyon.json +++ binaries/data/mods/public/maps/random/canyon.json @@ -6,6 +6,7 @@ "BaseTerrain" : ["medit_sea_depths"], "BaseHeight" : 30, "Preview" : "canyon.png", + "SupportedBiomes": true, "CircularMap" : true } } \ No newline at end of file Index: binaries/data/mods/public/maps/random/continent.js =================================================================== --- binaries/data/mods/public/maps/random/continent.js +++ binaries/data/mods/public/maps/random/continent.js @@ -1,7 +1,7 @@ RMS.LoadLibrary("rmgen"); //random terrain textures -var random_terrain = randomizeBiome(); +setSelectedBiome(); const tMainTerrain = rBiomeT1(); const tForestFloor1 = rBiomeT2(); @@ -237,7 +237,7 @@ [avoidClasses(clPlayer, 20, clForest, 17, clHill, 0, clBaseResource,2), stayClasses(clLand, 4)], clForest, 1.0, - random_terrain + currentBiome() ); RMS.SetProgress(50); @@ -286,7 +286,7 @@ // create decoration var planetm = 1; -if (random_terrain == g_BiomeTropic) +if (currentBiome() == g_BiomeTropic) planetm = 8; createDecoration Index: binaries/data/mods/public/maps/random/continent.json =================================================================== --- binaries/data/mods/public/maps/random/continent.json +++ binaries/data/mods/public/maps/random/continent.json @@ -6,6 +6,7 @@ "BaseTerrain" : ["medit_sea_depths"], "BaseHeight" : -5, "Preview" : "continent.png", + "SupportedBiomes": true, "CircularMap" : true } } Index: binaries/data/mods/public/maps/random/empire.js =================================================================== --- binaries/data/mods/public/maps/random/empire.js +++ binaries/data/mods/public/maps/random/empire.js @@ -3,7 +3,7 @@ InitMap(); -randomizeBiome(); +setSelectedBiome(); initMapSettings(); initTileClasses(); Index: binaries/data/mods/public/maps/random/empire.json =================================================================== --- binaries/data/mods/public/maps/random/empire.json +++ binaries/data/mods/public/maps/random/empire.json @@ -7,6 +7,7 @@ "BaseHeight" : 2, "Keywords": [], "Preview" : "empire.png", + "SupportedBiomes": true, "CircularMap" : true } } Index: binaries/data/mods/public/maps/random/frontier.js =================================================================== --- binaries/data/mods/public/maps/random/frontier.js +++ binaries/data/mods/public/maps/random/frontier.js @@ -3,7 +3,7 @@ InitMap(); -randomizeBiome(); +setSelectedBiome(); initMapSettings(); initTileClasses(); Index: binaries/data/mods/public/maps/random/frontier.json =================================================================== --- binaries/data/mods/public/maps/random/frontier.json +++ binaries/data/mods/public/maps/random/frontier.json @@ -6,6 +6,7 @@ "BaseTerrain" : ["medit_sea_depths"], "Preview" : "frontier.png", "BaseHeight" : 2, + "SupportedBiomes": true, "CircularMap" : true } } Index: binaries/data/mods/public/maps/random/gear.js =================================================================== --- binaries/data/mods/public/maps/random/gear.js +++ binaries/data/mods/public/maps/random/gear.js @@ -3,7 +3,7 @@ TILE_CENTERED_HEIGHT_MAP = true; //random terrain textures -var random_terrain = randomizeBiome(); +setSelectedBiome(); const tMainTerrain = rBiomeT1(); const tForestFloor1 = rBiomeT2(); @@ -364,7 +364,7 @@ avoidClasses(clPlayer, 20, clForest, 17, clHill, 0, clWater, 2), clForest, 1.0, - random_terrain + currentBiome() ); RMS.SetProgress(50); @@ -417,7 +417,7 @@ // create decoration var planetm = 1; -if (random_terrain == g_BiomeTropic) +if (currentBiome() == g_BiomeTropic) planetm = 8; createDecoration Index: binaries/data/mods/public/maps/random/gear.json =================================================================== --- binaries/data/mods/public/maps/random/gear.json +++ binaries/data/mods/public/maps/random/gear.json @@ -6,6 +6,7 @@ "BaseTerrain" : ["medit_sea_depths"], "BaseHeight" : 4, "CircularMap" : true, + "SupportedBiomes": true, "Preview" : "gear.png" } } \ No newline at end of file Index: binaries/data/mods/public/maps/random/harbor.js =================================================================== --- binaries/data/mods/public/maps/random/harbor.js +++ binaries/data/mods/public/maps/random/harbor.js @@ -3,7 +3,7 @@ InitMap(); -randomizeBiome(); +setSelectedBiome(); initMapSettings(); initTileClasses(); @@ -346,13 +346,13 @@ let spineTile = g_Terrains.dirt; let elevation = 35; - if (g_MapInfo.biome == 2) + if (currentBiome() == g_BiomeSnowy) spineTile = g_Terrains.tier1Terrain; - if (g_MapInfo.biome == 4 || g_MapInfo.biome == 6) + if (currentBiome() == g_BiomeAlpine || currentBiome() == g_BiomeSavanna) spineTile = g_Terrains.tier2Terrain; - if (g_MapInfo.biome == 8) + if (currentBiome() == g_BiomeAutumn) spineTile = g_Terrains.tier4Terrain; let split = 1; Index: binaries/data/mods/public/maps/random/harbor.json =================================================================== --- binaries/data/mods/public/maps/random/harbor.json +++ binaries/data/mods/public/maps/random/harbor.json @@ -7,6 +7,7 @@ "BaseHeight" : 2, "Keywords": [], "Preview" : "harbor.png", + "SupportedBiomes": true, "CircularMap" : true } } Index: binaries/data/mods/public/maps/random/hells_pass.js =================================================================== --- binaries/data/mods/public/maps/random/hells_pass.js +++ binaries/data/mods/public/maps/random/hells_pass.js @@ -3,7 +3,7 @@ InitMap(); -randomizeBiome(); +setSelectedBiome(); initMapSettings(); initTileClasses(); @@ -226,13 +226,13 @@ { var spineTerrain = g_Terrains.dirt; - if (g_MapInfo.biome == g_BiomeSnowy) + if (currentBiome() == g_BiomeSnowy) spineTerrain = g_Terrains.tier1Terrain; - if (g_MapInfo.biome == g_BiomeAlpine || g_MapInfo.biome == g_BiomeSavanna) + if (currentBiome() == g_BiomeAlpine || currentBiome() == g_BiomeSavanna) spineTerrain = g_Terrains.tier2Terrain; - if (g_MapInfo.biome == g_BiomeAutumn) + if (currentBiome() == g_BiomeAutumn) spineTerrain = g_Terrains.tier4Terrain; // create mountain ranges Index: binaries/data/mods/public/maps/random/hells_pass.json =================================================================== --- binaries/data/mods/public/maps/random/hells_pass.json +++ binaries/data/mods/public/maps/random/hells_pass.json @@ -6,6 +6,7 @@ "BaseTerrain" : ["medit_sea_depths"], "BaseHeight" : 1, "Preview" : "hells_pass.png", + "SupportedBiomes": true, "CircularMap" : true } } Index: binaries/data/mods/public/maps/random/island_stronghold.js =================================================================== --- binaries/data/mods/public/maps/random/island_stronghold.js +++ binaries/data/mods/public/maps/random/island_stronghold.js @@ -528,7 +528,7 @@ placeDefaultDecoratives(fx, fz, aGrassShort, clBaseResource, radius, [stayClasses(clLand, 5)]); log("Creating small grass tufts..."); -let planetm = currentBiome() == 7 ? 8 : 1; +let planetm = currentBiome() == g_BiomeTropic ? 8 : 1; group = new SimpleGroup( [new SimpleObject(aGrassShort, 1, 2, 0, 1, -PI / 8, PI / 8)] ); Index: binaries/data/mods/public/maps/random/islands.js =================================================================== --- binaries/data/mods/public/maps/random/islands.js +++ binaries/data/mods/public/maps/random/islands.js @@ -2,7 +2,7 @@ TILE_CENTERED_HEIGHT_MAP = true; //random terrain textures -var random_terrain = randomizeBiome(); +setSelectedBiome(); const tMainTerrain = rBiomeT1(); const tForestFloor1 = rBiomeT2(); @@ -320,13 +320,13 @@ // calculate desired number of trees for map (based on size) -if (random_terrain == g_BiomeSavanna) +if (currentBiome() == g_BiomeSavanna) { var MIN_TREES = 200; var MAX_TREES = 1250; var P_FOREST = 0; } -else if (random_terrain == g_BiomeTropic) +else if (currentBiome() == g_BiomeTropic) { var MIN_TREES = 1000; var MAX_TREES = 6000; @@ -349,7 +349,7 @@ [[tForestFloor1, tMainTerrain, pForest2], [tForestFloor1, pForest2]] ]; // some variation -if (random_terrain != g_BiomeSavanna) +if (currentBiome() != g_BiomeSavanna) { var size = numForest / (scaleByMapSize(3,6) * numPlayers); var num = floor(size / types.length); @@ -374,7 +374,7 @@ log("Creating dirt patches..."); var sizes = [scaleByMapSize(3, 6), scaleByMapSize(5, 10), scaleByMapSize(8, 21)]; var numb = 1; -if (random_terrain == g_BiomeSavanna) +if (currentBiome() == g_BiomeSavanna) numb = 3; for (var i = 0; i < sizes.length; i++) { @@ -526,7 +526,7 @@ } var planetm = 1; -if (random_terrain == g_BiomeTropic) +if (currentBiome() == g_BiomeTropic) planetm = 8; //create small grass tufts Index: binaries/data/mods/public/maps/random/islands.json =================================================================== --- binaries/data/mods/public/maps/random/islands.json +++ binaries/data/mods/public/maps/random/islands.json @@ -7,6 +7,7 @@ "BaseHeight" : -5, "Keywords": ["naval"], "Preview" : "islands.png", + "SupportedBiomes": true, "CircularMap" : true } } Index: binaries/data/mods/public/maps/random/lake.js =================================================================== --- binaries/data/mods/public/maps/random/lake.js +++ binaries/data/mods/public/maps/random/lake.js @@ -1,7 +1,7 @@ RMS.LoadLibrary("rmgen"); //random terrain textures -var random_terrain = randomizeBiome(); +setSelectedBiome(); const tMainTerrain = rBiomeT1(); const tForestFloor1 = rBiomeT2(); @@ -250,7 +250,7 @@ avoidClasses(clPlayer, 20, clForest, 17, clHill, 0, clWater, 2), clForest, 1.0, - random_terrain + currentBiome() ); RMS.SetProgress(50); @@ -299,7 +299,7 @@ // create decoration var planetm = 1; -if (random_terrain == g_BiomeTropic) +if (currentBiome() == g_BiomeTropic) planetm = 8; createDecoration Index: binaries/data/mods/public/maps/random/lake.json =================================================================== --- binaries/data/mods/public/maps/random/lake.json +++ binaries/data/mods/public/maps/random/lake.json @@ -6,6 +6,7 @@ "BaseTerrain" : ["medit_sea_depths"], "BaseHeight" : 3, "Preview" : "lake.png", + "SupportedBiomes": true, "CircularMap" : true } } \ No newline at end of file Index: binaries/data/mods/public/maps/random/lions_den.js =================================================================== --- binaries/data/mods/public/maps/random/lions_den.js +++ binaries/data/mods/public/maps/random/lions_den.js @@ -3,7 +3,7 @@ InitMap(); -randomizeBiome(); +setSelectedBiome(); initMapSettings(); initTileClasses(["step"]); @@ -382,34 +382,34 @@ var lower = g_Terrains.tier2Terrain; var road = g_Terrains.road; - if (g_MapInfo.biome == g_BiomeSnowy) + if (currentBiome() == g_BiomeSnowy) { middle = g_Terrains.tier2Terrain; lower = g_Terrains.tier1Terrain; } - if (g_MapInfo.biome == g_BiomeAlpine) + if (currentBiome() == g_BiomeAlpine) { middle = g_Terrains.shore; lower = g_Terrains.tier4Terrain; } - if (g_MapInfo.biome == g_BiomeMediterranean) + if (currentBiome() == g_BiomeMediterranean) { middle = g_Terrains.tier1Terrain; lower = g_Terrains.forestFloor1; } - if (g_MapInfo.biome == g_BiomeSavanna) + if (currentBiome() == g_BiomeSavanna) { middle = g_Terrains.tier2Terrain; lower = g_Terrains.tier4Terrain; } - if (g_MapInfo.biome == g_BiomeTropic || g_MapInfo.biome == g_BiomeAutumn) + if (currentBiome() == g_BiomeTropic || currentBiome() == g_BiomeAutumn) road = g_Terrains.roadWild; - if (g_MapInfo.biome == g_BiomeAutumn) + if (currentBiome() == g_BiomeAutumn) middle = g_Terrains.shore; var expSize = g_MapInfo.mapArea * 0.015 / (g_MapInfo.numPlayers / 4); Index: binaries/data/mods/public/maps/random/lions_den.json =================================================================== --- binaries/data/mods/public/maps/random/lions_den.json +++ binaries/data/mods/public/maps/random/lions_den.json @@ -7,6 +7,7 @@ "BaseHeight" : 50, "Preview" : "lions_den.png", "Keywords": [], + "SupportedBiomes": true, "CircularMap" : true } } Index: binaries/data/mods/public/maps/random/mainland.js =================================================================== --- binaries/data/mods/public/maps/random/mainland.js +++ binaries/data/mods/public/maps/random/mainland.js @@ -1,7 +1,7 @@ RMS.LoadLibrary("rmgen"); //random terrain textures -var random_terrain = randomizeBiome(); +setSelectedBiome(); const tMainTerrain = rBiomeT1(); const tForestFloor1 = rBiomeT2(); @@ -198,7 +198,7 @@ avoidClasses(clPlayer, 20, clForest, 18, clHill, 0), clForest, 1.0, - random_terrain + currentBiome() ); RMS.SetProgress(50); @@ -245,7 +245,7 @@ // create decoration var planetm = 1; -if (random_terrain == g_BiomeTropic) +if (currentBiome() == g_BiomeTropic) planetm = 8; createDecoration Index: binaries/data/mods/public/maps/random/mainland.json =================================================================== --- binaries/data/mods/public/maps/random/mainland.json +++ binaries/data/mods/public/maps/random/mainland.json @@ -6,6 +6,7 @@ "BaseTerrain" : ["medit_sea_depths"], "BaseHeight" : 3, "Preview" : "mainland.png", + "SupportedBiomes": true, "CircularMap" : true } } Index: binaries/data/mods/public/maps/random/migration.js =================================================================== --- binaries/data/mods/public/maps/random/migration.js +++ binaries/data/mods/public/maps/random/migration.js @@ -1,7 +1,7 @@ RMS.LoadLibrary("rmgen"); //random terrain textures -var random_terrain = randomizeBiome(); +setSelectedBiome(); const tMainTerrain = rBiomeT1(); const tForestFloor1 = rBiomeT2(); @@ -258,13 +258,13 @@ RMS.SetProgress(34); // calculate desired number of trees for map (based on size) -if (random_terrain == g_BiomeSavanna) +if (currentBiome() == g_BiomeSavanna) { var MIN_TREES = 200; var MAX_TREES = 1250; var P_FOREST = 0.02; } -else if (random_terrain == g_BiomeTropic) +else if (currentBiome() == g_BiomeTropic) { var MIN_TREES = 1000; var MAX_TREES = 6000; @@ -288,7 +288,7 @@ ]; // some variation var size = numForest / (scaleByMapSize(2,8) * numPlayers) * - (random_terrain == g_BiomeSavanna ? 2 : 1); + (currentBiome() == g_BiomeSavanna ? 2 : 1); var num = floor(size / types.length); for (var i = 0; i < types.length; ++i) @@ -449,7 +449,7 @@ } RMS.SetProgress(86); -var planetm = random_terrain == g_BiomeTropic ? 8 : 1; +var planetm = currentBiome() == g_BiomeTropic ? 8 : 1; log("Creating small grass tufts..."); group = new SimpleGroup( Index: binaries/data/mods/public/maps/random/migration.json =================================================================== --- binaries/data/mods/public/maps/random/migration.json +++ binaries/data/mods/public/maps/random/migration.json @@ -7,6 +7,7 @@ "BaseHeight" : -5, "Keywords": ["naval"], "Preview" : "migration.png", + "SupportedBiomes": true, "CircularMap" : true } } Index: binaries/data/mods/public/maps/random/rivers.js =================================================================== --- binaries/data/mods/public/maps/random/rivers.js +++ binaries/data/mods/public/maps/random/rivers.js @@ -1,7 +1,7 @@ RMS.LoadLibrary("rmgen"); //random terrain textures -var random_terrain = randomizeBiome(); +setSelectedBiome(); const tMainTerrain = rBiomeT1(); const tForestFloor1 = rBiomeT2(); @@ -18,7 +18,7 @@ const tShoreBlend = rBiomeT13(); var tShore = rBiomeT14(); var tWater = rBiomeT15(); -if (random_terrain == g_BiomeTropic) +if (currentBiome() == g_BiomeTropic) { tShore = "tropic_dirt_b_plants"; tWater = "tropic_dirt_b"; @@ -380,7 +380,7 @@ avoidClasses(clPlayer, 20, clForest, 17, clHill, 0, clWater, 2), clForest, 1.0, - random_terrain + currentBiome() ); RMS.SetProgress(50); @@ -429,7 +429,7 @@ // create decoration var planetm = 1; -if (random_terrain == g_BiomeTropic) +if (currentBiome() == g_BiomeTropic) planetm = 8; createDecoration Index: binaries/data/mods/public/maps/random/rivers.json =================================================================== --- binaries/data/mods/public/maps/random/rivers.json +++ binaries/data/mods/public/maps/random/rivers.json @@ -6,6 +6,7 @@ "BaseTerrain" : ["temp_grass", "temp_grass_c"], "BaseHeight" : 1, "Preview" : "rivers.png", + "SupportedBiomes": true, "CircularMap" : true } } \ No newline at end of file Index: binaries/data/mods/public/maps/random/snowflake_searocks.js =================================================================== --- binaries/data/mods/public/maps/random/snowflake_searocks.js +++ binaries/data/mods/public/maps/random/snowflake_searocks.js @@ -1,7 +1,7 @@ RMS.LoadLibrary("rmgen"); //random terrain textures -var random_terrain = randomizeBiome(); +setSelectedBiome(); const tMainTerrain = rBiomeT1(); const tForestFloor1 = rBiomeT2(); @@ -1656,13 +1656,13 @@ } // calculate desired number of trees for map (based on size) -if (random_terrain == g_BiomeSavanna) +if (currentBiome() == g_BiomeSavanna) { var MIN_TREES = 200; var MAX_TREES = 1250; var P_FOREST = 0.02; } -else if (random_terrain == g_BiomeTropic) +else if (currentBiome() == g_BiomeTropic) { var MIN_TREES = 1000; var MAX_TREES = 6000; @@ -1685,7 +1685,7 @@ [[tForestFloor1, tMainTerrain, pForest2], [tForestFloor1, pForest2]] ]; // some variation -if (random_terrain == g_BiomeSavanna) +if (currentBiome() == g_BiomeSavanna) var size = numForest / (0.5 * scaleByMapSize(2,8) * numPlayers); else var size = numForest / (scaleByMapSize(2,8) * numPlayers); @@ -1848,7 +1848,7 @@ } var planetm = 1; -if (random_terrain == g_BiomeTropic) +if (currentBiome() == g_BiomeTropic) planetm = 8; //create small grass tufts Index: binaries/data/mods/public/maps/random/snowflake_searocks.json =================================================================== --- binaries/data/mods/public/maps/random/snowflake_searocks.json +++ binaries/data/mods/public/maps/random/snowflake_searocks.json @@ -6,6 +6,7 @@ "BaseTerrain" : ["medit_sea_depths"], "BaseHeight" : -5, "Preview" : "snowflake_searocks.png", + "SupportedBiomes": true, "CircularMap" : true } } Index: binaries/data/mods/public/maps/random/stronghold.js =================================================================== --- binaries/data/mods/public/maps/random/stronghold.js +++ binaries/data/mods/public/maps/random/stronghold.js @@ -3,7 +3,7 @@ InitMap(); -randomizeBiome(); +setSelectedBiome(); initMapSettings(); initTileClasses(); Index: binaries/data/mods/public/maps/random/stronghold.json =================================================================== --- binaries/data/mods/public/maps/random/stronghold.json +++ binaries/data/mods/public/maps/random/stronghold.json @@ -6,6 +6,7 @@ "BaseTerrain" : ["medit_sea_depths"], "BaseHeight" : 30, "Preview" : "stronghold.png", + "SupportedBiomes": true, "CircularMap" : true } } Index: binaries/data/mods/public/maps/random/survivalofthefittest.js =================================================================== --- binaries/data/mods/public/maps/random/survivalofthefittest.js +++ binaries/data/mods/public/maps/random/survivalofthefittest.js @@ -1,6 +1,6 @@ RMS.LoadLibrary("rmgen"); -var random_terrain = randomizeBiome(); +setSelectedBiome(); const tMainTerrain = rBiomeT1(); const tForestFloor1 = rBiomeT2(); @@ -185,7 +185,7 @@ [avoidClasses(clPlayer, 20, clForest, 5, clHill, 0, clBaseResource,2, clWomen, 5), stayClasses(clLand, 4)], clForest, 1, - random_terrain + currentBiome() ); if (randBool()) @@ -230,7 +230,7 @@ ); var planetm = 1; -if (random_terrain == g_BiomeTropic) +if (currentBiome() == g_BiomeTropic) planetm = 8; createDecoration( Index: binaries/data/mods/public/maps/random/survivalofthefittest.json =================================================================== --- binaries/data/mods/public/maps/random/survivalofthefittest.json +++ binaries/data/mods/public/maps/random/survivalofthefittest.json @@ -7,6 +7,7 @@ "BaseHeight" : 30, "Keywords": ["trigger"], "Preview" : "survivalofthefittest.png", + "SupportedBiomes": true, "CircularMap" : true, "TriggerScripts": [ "scripts/TriggerHelper.js", Index: binaries/data/mods/public/maps/random/unknown.js =================================================================== --- binaries/data/mods/public/maps/random/unknown.js +++ binaries/data/mods/public/maps/random/unknown.js @@ -2,7 +2,7 @@ TILE_CENTERED_HEIGHT_MAP = true; //random terrain textures -var random_terrain = randomizeBiome(); +setSelectedBiome(); const tMainTerrain = rBiomeT1(); const tForestFloor1 = rBiomeT2(); @@ -1765,13 +1765,13 @@ var multiplier = sqrt(randFloat(0.5,1.2)*randFloat(0.5,1.2)); // calculate desired number of trees for map (based on size) -if (random_terrain == g_BiomeSavanna) +if (currentBiome() == g_BiomeSavanna) { var MIN_TREES = floor(200*multiplier); var MAX_TREES = floor(1250*multiplier); var P_FOREST = randFloat(0.02, 0.05); } -else if (random_terrain == g_BiomeTropic) +else if (currentBiome() == g_BiomeTropic) { var MIN_TREES = floor(1000*multiplier); var MAX_TREES = floor(6000*multiplier); @@ -1794,7 +1794,7 @@ [[tForestFloor1, tMainTerrain, pForest2], [tForestFloor1, pForest2]] ]; // some variation -if (random_terrain == g_BiomeSavanna) +if (currentBiome() == g_BiomeSavanna) var size = numForest / (0.5 * scaleByMapSize(2,8) * numPlayers); else var size = numForest / (scaleByMapSize(2,8) * numPlayers); @@ -1820,7 +1820,7 @@ log("Creating dirt patches..."); var sizes = [scaleByMapSize(3, 48), scaleByMapSize(5, 84), scaleByMapSize(8, 128)]; var numb = 1; -if (random_terrain == g_BiomeSavanna) +if (currentBiome() == g_BiomeSavanna) numb = 3; for (var i = 0; i < sizes.length; i++) { @@ -1972,7 +1972,7 @@ } var planetm = 1; -if (random_terrain == g_BiomeTropic) +if (currentBiome() == g_BiomeTropic) planetm = 8; //create small grass tufts Index: binaries/data/mods/public/maps/random/unknown.json =================================================================== --- binaries/data/mods/public/maps/random/unknown.json +++ binaries/data/mods/public/maps/random/unknown.json @@ -6,6 +6,7 @@ "BaseTerrain" : ["medit_sand_wet"], "BaseHeight" : -5, "Preview" : "unknown.png", + "SupportedBiomes": true, "CircularMap" : true } } Index: binaries/data/mods/public/maps/random/unknown_land.js =================================================================== --- binaries/data/mods/public/maps/random/unknown_land.js +++ binaries/data/mods/public/maps/random/unknown_land.js @@ -2,7 +2,7 @@ TILE_CENTERED_HEIGHT_MAP = true; //random terrain textures -var random_terrain = randomizeBiome(); +setSelectedBiome(); const tMainTerrain = rBiomeT1(); const tForestFloor1 = rBiomeT2(); @@ -1534,13 +1534,13 @@ var multiplier = sqrt(randFloat(0.5,1.2)*randFloat(0.5,1.2)); // calculate desired number of trees for map (based on size) -if (random_terrain == g_BiomeSavanna) +if (currentBiome() == g_BiomeSavanna) { var MIN_TREES = floor(200*multiplier); var MAX_TREES = floor(1250*multiplier); var P_FOREST = 0; } -else if (random_terrain == g_BiomeTropic) +else if (currentBiome() == g_BiomeTropic) { var MIN_TREES = floor(1000*multiplier); var MAX_TREES = floor(6000*multiplier); @@ -1563,7 +1563,7 @@ [[tForestFloor1, tMainTerrain, pForest2], [tForestFloor1, pForest2]] ]; // some variation -if (random_terrain != g_BiomeSavanna) +if (currentBiome() != g_BiomeSavanna) { var size = numForest / (scaleByMapSize(3,6) * numPlayers); var num = floor(size / types.length); @@ -1588,7 +1588,7 @@ log("Creating dirt patches..."); var sizes = [scaleByMapSize(3, 6), scaleByMapSize(5, 10), scaleByMapSize(8, 21)]; var numb = 1; -if (random_terrain == 6) +if (currentBiome() == g_BiomeSavanna) numb = 3; for (var i = 0; i < sizes.length; i++) { @@ -1740,7 +1740,7 @@ } var planetm = 1; -if (random_terrain == g_BiomeTropic) +if (currentBiome() == g_BiomeTropic) planetm = 8; //create small grass tufts Index: binaries/data/mods/public/maps/random/unknown_land.json =================================================================== --- binaries/data/mods/public/maps/random/unknown_land.json +++ binaries/data/mods/public/maps/random/unknown_land.json @@ -6,6 +6,7 @@ "BaseTerrain" : ["medit_sand_wet"], "BaseHeight" : -5, "Preview" : "unknown.png", + "SupportedBiomes": true, "CircularMap" : true } } Index: binaries/data/mods/public/maps/random/unknown_nomad.js =================================================================== --- binaries/data/mods/public/maps/random/unknown_nomad.js +++ binaries/data/mods/public/maps/random/unknown_nomad.js @@ -2,7 +2,7 @@ TILE_CENTERED_HEIGHT_MAP = true; //random terrain textures -var rt = randomizeBiome(); +setSelectedBiome(); var tGrass = rBiomeT1(); var tGrassPForest = rBiomeT2(); @@ -1401,13 +1401,13 @@ var multiplier = sqrt(randFloat(0.5,1.2)*randFloat(0.5,1.2)); // calculate desired number of trees for map (based on size) -if (rt == 6) +if (currentBiome() == g_BiomeSavanna) { var MIN_TREES = floor(200*multiplier); var MAX_TREES = floor(1250*multiplier); var P_FOREST = randFloat(0.02, 0.05); } -else if (rt == 7) +else if (currentBiome() == g_BiomeTropic) { var MIN_TREES = floor(1000*multiplier); var MAX_TREES = floor(6000*multiplier); @@ -1430,7 +1430,7 @@ [[tGrassPForest, tGrass, pForestP], [tGrassPForest, pForestP]] ]; // some variation -if (rt == 6) +if (currentBiome() == g_BiomeSavanna) { var size = numForest / (0.5 * scaleByMapSize(2,8) * numPlayers); } @@ -1459,7 +1459,7 @@ log("Creating dirt patches..."); var sizes = [scaleByMapSize(3, 48), scaleByMapSize(5, 84), scaleByMapSize(8, 128)]; var numb = 1; -if (rt == 6) +if (currentBiome() == g_BiomeSavanna) numb = 3; for (var i = 0; i < sizes.length; i++) { Index: binaries/data/mods/public/maps/random/unknown_nomad.json =================================================================== --- binaries/data/mods/public/maps/random/unknown_nomad.json +++ binaries/data/mods/public/maps/random/unknown_nomad.json @@ -6,6 +6,7 @@ "BaseTerrain" : ["medit_sand_wet"], "BaseHeight" : -5, "Preview" : "unknown.png", + "SupportedBiomes": true, "CircularMap" : true } } Index: binaries/data/mods/public/maps/random/wild_lake.js =================================================================== --- binaries/data/mods/public/maps/random/wild_lake.js +++ binaries/data/mods/public/maps/random/wild_lake.js @@ -15,7 +15,9 @@ return stringOrArrayOfStrings; } -randomizeBiome() +setSelectedBiome(); + +let biomeIndex = g_Biomes.indexOf(currentBiome()); // Terrain, entities and actors let wildLakeBiome = [ @@ -287,10 +289,10 @@ // Autumn 8 gaul { "building" : "structures/gaul_farmstead", "animal" : "gaia/fauna_horse" } ]; -wallStyles.other.sheepIn = new WallElement("sheepIn", farmEntities[g_BiomeID - 1].animal, PI / 4, -1.5, 0.75, PI/2); +wallStyles.other.sheepIn = new WallElement("sheepIn", farmEntities[biomeIndex - 1].animal, PI / 4, -1.5, 0.75, PI/2); wallStyles.other.foodBin = new WallElement("foodBin", "gaia/special_treasure_food_bin", PI/2, 1.5); -wallStyles.other.sheep = new WallElement("sheep", farmEntities[g_BiomeID - 1].animal, 0, 0, 0.75); -wallStyles.other.farm = new WallElement("farm", farmEntities[g_BiomeID - 1].building, PI, 0, -3); +wallStyles.other.sheep = new WallElement("sheep", farmEntities[biomeIndex - 1].animal, 0, 0, 0.75); +wallStyles.other.farm = new WallElement("farm", farmEntities[biomeIndex - 1].building, PI, 0, -3); let fences = [ new Fortress("fence", ["foodBin", "farm", "bench", "sheepIn", "fence", "sheepIn", "fence", "sheepIn", "fence"]), new Fortress("fence", ["foodBin", "farm", "fence", "sheepIn", "fence", "sheepIn", "bench", "sheep", "fence", "sheepIn", "fence"]), @@ -347,7 +349,7 @@ { function getRandDist() { - return averageDistToCC + randFloat(-dAverageDistToCC, dAverageDistToCC) + return averageDistToCC + randFloat(-dAverageDistToCC, dAverageDistToCC); } let currentAngle = randFloat(0, TWO_PI); @@ -696,7 +698,7 @@ { if (mercenaryCamps) { - createStartingPlayerEntities(resourceSpots[i].x, resourceSpots[i].y, 0, mercenaryCampGuards[g_BiomeID - 1]); + createStartingPlayerEntities(resourceSpots[i].x, resourceSpots[i].y, 0, mercenaryCampGuards[biomeIndex - 1]); rectangularSmoothToHeight(resourceSpots[i], 15, 15, g_Map.height[resourceSpots[i].x][resourceSpots[i].y], 0.5); --mercenaryCamps; } Index: binaries/data/mods/public/maps/random/wild_lake.json =================================================================== --- binaries/data/mods/public/maps/random/wild_lake.json +++ binaries/data/mods/public/maps/random/wild_lake.json @@ -4,9 +4,10 @@ "Script" : "wild_lake.js", "Preview" : "wild_lake.png", "Description" : "A lake surrounded by hills.", - "CircularMap" : true, "BaseTerrain" : "whiteness", "Keywords": [], - "BaseHeight" : 0 + "BaseHeight" : 0, + "SupportedBiomes": true, + "CircularMap" : true } }