Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/maps/random/rivers.js
RMS.LoadLibrary("rmgen"); | RMS.LoadLibrary("rmgen"); | ||||
//random terrain textures | setSelectedBiome(); | ||||
var random_terrain = randomizeBiome(); | |||||
const tMainTerrain = rBiomeT1(); | const tMainTerrain = rBiomeT1(); | ||||
const tForestFloor1 = rBiomeT2(); | const tForestFloor1 = rBiomeT2(); | ||||
const tForestFloor2 = rBiomeT3(); | const tForestFloor2 = rBiomeT3(); | ||||
const tCliff = rBiomeT4(); | const tCliff = rBiomeT4(); | ||||
const tTier1Terrain = rBiomeT5(); | const tTier1Terrain = rBiomeT5(); | ||||
const tTier2Terrain = rBiomeT6(); | const tTier2Terrain = rBiomeT6(); | ||||
const tTier3Terrain = rBiomeT7(); | const tTier3Terrain = rBiomeT7(); | ||||
const tHill = rBiomeT8(); | const tHill = rBiomeT8(); | ||||
const tDirt = rBiomeT9(); | const tDirt = rBiomeT9(); | ||||
const tRoad = rBiomeT10(); | const tRoad = rBiomeT10(); | ||||
const tRoadWild = rBiomeT11(); | const tRoadWild = rBiomeT11(); | ||||
const tTier4Terrain = rBiomeT12(); | const tTier4Terrain = rBiomeT12(); | ||||
const tShoreBlend = rBiomeT13(); | const tShoreBlend = rBiomeT13(); | ||||
var tShore = rBiomeT14(); | var tShore = rBiomeT14(); | ||||
var tWater = rBiomeT15(); | var tWater = rBiomeT15(); | ||||
if (random_terrain == g_BiomeTropic) | if (currentBiome() == g_BiomeTropic) | ||||
{ | { | ||||
tShore = "tropic_dirt_b_plants"; | tShore = "tropic_dirt_b_plants"; | ||||
tWater = "tropic_dirt_b"; | tWater = "tropic_dirt_b"; | ||||
} | } | ||||
// gaia entities | // gaia entities | ||||
const oTree1 = rBiomeE1(); | const oTree1 = rBiomeE1(); | ||||
const oTree2 = rBiomeE2(); | const oTree2 = rBiomeE2(); | ||||
const oTree3 = rBiomeE3(); | const oTree3 = rBiomeE3(); | ||||
▲ Show 20 Lines • Show All 345 Lines • ▼ Show 20 Lines | else | ||||
createMountains(tCliff, avoidClasses(clPlayer, 20, clHill, 15, clWater, 2), clHill, scaleByMapSize(3, 15)); | createMountains(tCliff, avoidClasses(clPlayer, 20, clHill, 15, clWater, 2), clHill, scaleByMapSize(3, 15)); | ||||
// create forests | // create forests | ||||
createForests( | createForests( | ||||
[tMainTerrain, tForestFloor1, tForestFloor2, pForest1, pForest2], | [tMainTerrain, tForestFloor1, tForestFloor2, pForest1, pForest2], | ||||
avoidClasses(clPlayer, 20, clForest, 17, clHill, 0, clWater, 2), | avoidClasses(clPlayer, 20, clForest, 17, clHill, 0, clWater, 2), | ||||
clForest, | clForest, | ||||
1.0, | 1.0, | ||||
random_terrain | currentBiome() | ||||
); | ); | ||||
RMS.SetProgress(50); | RMS.SetProgress(50); | ||||
// create dirt patches | // create dirt patches | ||||
log("Creating dirt patches..."); | log("Creating dirt patches..."); | ||||
createLayeredPatches( | createLayeredPatches( | ||||
[scaleByMapSize(3, 6), scaleByMapSize(5, 10), scaleByMapSize(8, 21)], | [scaleByMapSize(3, 6), scaleByMapSize(5, 10), scaleByMapSize(8, 21)], | ||||
Show All 32 Lines | |||||
clMetal | clMetal | ||||
); | ); | ||||
RMS.SetProgress(65); | RMS.SetProgress(65); | ||||
// create decoration | // create decoration | ||||
var planetm = 1; | var planetm = 1; | ||||
if (random_terrain == g_BiomeTropic) | if (currentBiome() == g_BiomeTropic) | ||||
planetm = 8; | planetm = 8; | ||||
createDecoration | createDecoration | ||||
( | ( | ||||
[[new SimpleObject(aRockMedium, 1,3, 0,1)], | [[new SimpleObject(aRockMedium, 1,3, 0,1)], | ||||
[new SimpleObject(aRockLarge, 1,2, 0,1), new SimpleObject(aRockMedium, 1,3, 0,2)], | [new SimpleObject(aRockLarge, 1,2, 0,1), new SimpleObject(aRockMedium, 1,3, 0,2)], | ||||
[new SimpleObject(aGrassShort, 1,2, 0,1, -PI/8,PI/8)], | [new SimpleObject(aGrassShort, 1,2, 0,1, -PI/8,PI/8)], | ||||
[new SimpleObject(aGrass, 2,4, 0,1.8, -PI/8,PI/8), new SimpleObject(aGrassShort, 3,6, 1.2,2.5, -PI/8,PI/8)], | [new SimpleObject(aGrass, 2,4, 0,1.8, -PI/8,PI/8), new SimpleObject(aGrassShort, 3,6, 1.2,2.5, -PI/8,PI/8)], | ||||
▲ Show 20 Lines • Show All 76 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator