Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/maps/random/oasis.js
Show First 20 Lines • Show All 205 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
RMS.SetProgress(20); | RMS.SetProgress(20); | ||||
// create bumps | // create bumps | ||||
log("Creating bumps..."); | log("Creating bumps..."); | ||||
placer = new ClumpPlacer(scaleByMapSize(20, 50), 0.3, 0.06, 1); | placer = new ClumpPlacer(scaleByMapSize(20, 50), 0.3, 0.06, 1); | ||||
painter = new SmoothElevationPainter(ELEVATION_MODIFY, 4, 3); | painter = new SmoothElevationPainter(ELEVATION_MODIFY, 4, 3); | ||||
createAreas( placer, painter, | createAreasDeprecated( placer, painter, | ||||
avoidClasses(clPlayer, 10, clBaseResource, 6), | avoidClasses(clPlayer, 10, clBaseResource, 6), | ||||
scaleByMapSize(30, 70) | scaleByMapSize(30, 70) | ||||
); | ); | ||||
log("Creating dirt Patches..."); | log("Creating dirt Patches..."); | ||||
placer = new ClumpPlacer(80, 0.3, 0.06, 1); | placer = new ClumpPlacer(80, 0.3, 0.06, 1); | ||||
var terrainPainter = new TerrainPainter(tDirt); | var terrainPainter = new TerrainPainter(tDirt); | ||||
createAreas(placer, terrainPainter, avoidClasses(clPlayer, 10, clBaseResource, 6), scaleByMapSize(15, 50) ); | createAreasDeprecated(placer, terrainPainter, avoidClasses(clPlayer, 10, clBaseResource, 6), scaleByMapSize(15, 50) ); | ||||
log("Creating Dunes..."); | log("Creating Dunes..."); | ||||
placer = new ClumpPlacer(120, 0.3, 0.06, 1); | placer = new ClumpPlacer(120, 0.3, 0.06, 1); | ||||
var terrainPainter = new TerrainPainter(tDune); | var terrainPainter = new TerrainPainter(tDune); | ||||
painter = new SmoothElevationPainter(ELEVATION_MODIFY, 18, 30); | painter = new SmoothElevationPainter(ELEVATION_MODIFY, 18, 30); | ||||
createAreas( placer, [terrainPainter, painter], | createAreasDeprecated( placer, [terrainPainter, painter], | ||||
avoidClasses(clPlayer, 10, clBaseResource, 6), | avoidClasses(clPlayer, 10, clBaseResource, 6), | ||||
scaleByMapSize(15, 50) | scaleByMapSize(15, 50) | ||||
); | ); | ||||
log("Creating actual oasis..."); | log("Creating actual oasis..."); | ||||
var size = mapSize * 0.2; | var size = mapSize * 0.2; | ||||
size *= size; | size *= size; | ||||
Show All 17 Lines | if (mapSize > 150 && randBool()) | ||||
var pey = round(fz) + round(fractionToTiles(0.13 * sin(pAngle + PI))); | var pey = round(fz) + round(fractionToTiles(0.13 * sin(pAngle + PI))); | ||||
var path = new PathPlacer(px,py,pex,pey,scaleByMapSize(7,18), 0.4, 1, 0.2, 0); | var path = new PathPlacer(px,py,pex,pey,scaleByMapSize(7,18), 0.4, 1, 0.2, 0); | ||||
terrainPainter = new TerrainPainter(tSand); | terrainPainter = new TerrainPainter(tSand); | ||||
elevationPainter = new SmoothElevationPainter(ELEVATION_MODIFY, 4, 5 ); | elevationPainter = new SmoothElevationPainter(ELEVATION_MODIFY, 4, 5 ); | ||||
createArea(path, [terrainPainter, elevationPainter, paintClass(clPassage)], null); | createArea(path, [terrainPainter, elevationPainter, paintClass(clPassage)], null); | ||||
} | } | ||||
log("Creating some straggler trees around the Passage..."); | log("Creating some straggler trees around the Passage..."); | ||||
group = new SimpleGroup([new SimpleObject(ePalmTall, 1,1, 0,0),new SimpleObject(ePalmShort, 1,2, 1,2), new SimpleObject(aBushA, 0,2, 1,3)], true, clForest); | group = new SimpleGroup([new SimpleObject(ePalmTall, 1,1, 0,0),new SimpleObject(ePalmShort, 1,2, 1,2), new SimpleObject(aBushA, 0,2, 1,3)], true, clForest); | ||||
createObjectGroups(group, 0, stayClasses(clPassage,1), scaleByMapSize(60,250), 100 ); | createObjectGroupsDeprecated(group, 0, stayClasses(clPassage,1), scaleByMapSize(60,250), 100 ); | ||||
log("Creating stone mines..."); | log("Creating stone mines..."); | ||||
// create large stone quarries | // create large stone quarries | ||||
group = new SimpleGroup([new SimpleObject(eStoneMine, 1,1, 0,0),new SimpleObject(ePalmShort, 1,2, 3,3),new SimpleObject(ePalmTall, 0,1, 3,3) | group = new SimpleGroup([new SimpleObject(eStoneMine, 1,1, 0,0),new SimpleObject(ePalmShort, 1,2, 3,3),new SimpleObject(ePalmTall, 0,1, 3,3) | ||||
,new SimpleObject(aBushB, 1,1, 2,2), new SimpleObject(aBushA, 0,2, 1,3)], true, clRock); | ,new SimpleObject(aBushB, 1,1, 2,2), new SimpleObject(aBushA, 0,2, 1,3)], true, clRock); | ||||
createObjectGroups(group, 0, | createObjectGroupsDeprecated(group, 0, | ||||
avoidClasses(clWater, 10, clForest, 1, clPlayer, 30, clRock, 10,clBaseResource, 2, clHill, 1), | avoidClasses(clWater, 10, clForest, 1, clPlayer, 30, clRock, 10,clBaseResource, 2, clHill, 1), | ||||
scaleByMapSize(6,25), 100 | scaleByMapSize(6,25), 100 | ||||
); | ); | ||||
log("Creating metal mines..."); | log("Creating metal mines..."); | ||||
// create large metal quarries | // create large metal quarries | ||||
group = new SimpleGroup([new SimpleObject(eMetalMine, 1,1, 0,0),new SimpleObject(ePalmShort, 1,2, 2,3),new SimpleObject(ePalmTall, 0,1, 2,2) | group = new SimpleGroup([new SimpleObject(eMetalMine, 1,1, 0,0),new SimpleObject(ePalmShort, 1,2, 2,3),new SimpleObject(ePalmTall, 0,1, 2,2) | ||||
,new SimpleObject(aBushB, 1,1, 2,2), new SimpleObject(aBushA, 0,2, 1,3)], true, clMetal); | ,new SimpleObject(aBushB, 1,1, 2,2), new SimpleObject(aBushA, 0,2, 1,3)], true, clMetal); | ||||
createObjectGroups(group, 0, | createObjectGroupsDeprecated(group, 0, | ||||
avoidClasses(clWater, 10, clForest, 1, clPlayer, 30, clMetal, 10,clBaseResource, 2, clRock, 10, clHill, 1), | avoidClasses(clWater, 10, clForest, 1, clPlayer, 30, clMetal, 10,clBaseResource, 2, clRock, 10, clHill, 1), | ||||
scaleByMapSize(6,25), 100 | scaleByMapSize(6,25), 100 | ||||
); | ); | ||||
RMS.SetProgress(65); | RMS.SetProgress(65); | ||||
log("Creating small decorative rocks..."); | log("Creating small decorative rocks..."); | ||||
group = new SimpleGroup( [new SimpleObject(aRock, 2,4, 0,2)], true, undefined ); | group = new SimpleGroup( [new SimpleObject(aRock, 2,4, 0,2)], true, undefined ); | ||||
createObjectGroups(group, 0, avoidClasses(clWater, 3, clForest, 0, clPlayer, 10, clHill, 1, clFood, 20), 30, scaleByMapSize(10,50) ); | createObjectGroupsDeprecated(group, 0, avoidClasses(clWater, 3, clForest, 0, clPlayer, 10, clHill, 1, clFood, 20), 30, scaleByMapSize(10,50) ); | ||||
RMS.SetProgress(70); | RMS.SetProgress(70); | ||||
// create deer | // create deer | ||||
log("Creating Camels..."); | log("Creating Camels..."); | ||||
group = new SimpleGroup( | group = new SimpleGroup( | ||||
[new SimpleObject(eCamel, 1,2, 0,4)], | [new SimpleObject(eCamel, 1,2, 0,4)], | ||||
true, clFood | true, clFood | ||||
); | ); | ||||
createObjectGroups(group, 0, | createObjectGroupsDeprecated(group, 0, | ||||
avoidClasses(clWater, 3, clForest, 0, clPlayer, 10, clHill, 1, clFood, 20), | avoidClasses(clWater, 3, clForest, 0, clPlayer, 10, clHill, 1, clFood, 20), | ||||
1 * numPlayers, 50 | 1 * numPlayers, 50 | ||||
); | ); | ||||
RMS.SetProgress(75); | RMS.SetProgress(75); | ||||
// create sheep | // create sheep | ||||
log("Creating Gazelles..."); | log("Creating Gazelles..."); | ||||
group = new SimpleGroup( | group = new SimpleGroup( | ||||
[new SimpleObject(eGazelle, 2,4, 0,2)], | [new SimpleObject(eGazelle, 2,4, 0,2)], | ||||
true, clFood | true, clFood | ||||
); | ); | ||||
createObjectGroups(group, 0, | createObjectGroupsDeprecated(group, 0, | ||||
avoidClasses(clWater, 3, clForest, 0, clPlayer, 10, clHill, 1, clFood, 20), | avoidClasses(clWater, 3, clForest, 0, clPlayer, 10, clHill, 1, clFood, 20), | ||||
1 * numPlayers, 50 | 1 * numPlayers, 50 | ||||
); | ); | ||||
RMS.SetProgress(85); | RMS.SetProgress(85); | ||||
// create lions | // create lions | ||||
log("Creating Oasis Animals..."); | log("Creating Oasis Animals..."); | ||||
for (var p = 0; p < scaleByMapSize(5,30); p++) | for (var p = 0; p < scaleByMapSize(5,30); p++) | ||||
Show All 10 Lines | |||||
} | } | ||||
/* | /* | ||||
var planetm = 8; | var planetm = 8; | ||||
//create small grass tufts | //create small grass tufts | ||||
log("Creating small grass tufts..."); | log("Creating small grass tufts..."); | ||||
group = new SimpleGroup( | group = new SimpleGroup( | ||||
[new SimpleObject(rba1, 1,2, 0,1, -PI/8,PI/8)] | [new SimpleObject(rba1, 1,2, 0,1, -PI/8,PI/8)] | ||||
); | ); | ||||
createObjectGroups(group, 0, | createObjectGroupsDeprecated(group, 0, | ||||
avoidClasses(clWater, 2, clHill, 2, clPlayer, 2, clDirt, 0), | avoidClasses(clWater, 2, clHill, 2, clPlayer, 2, clDirt, 0), | ||||
planetm * scaleByMapSize(13, 200) | planetm * scaleByMapSize(13, 200) | ||||
); | ); | ||||
*/ | */ | ||||
RMS.SetProgress(90); | RMS.SetProgress(90); | ||||
RMS.SetProgress(95); | RMS.SetProgress(95); | ||||
// create bushes | // create bushes | ||||
log("Creating bushes..."); | log("Creating bushes..."); | ||||
group = new SimpleGroup( | group = new SimpleGroup( | ||||
[new SimpleObject(aBushB, 1,2, 0,2), new SimpleObject(aBushA, 2,4, 0,2)] | [new SimpleObject(aBushB, 1,2, 0,2), new SimpleObject(aBushA, 2,4, 0,2)] | ||||
); | ); | ||||
createObjectGroups(group, 0, | createObjectGroupsDeprecated(group, 0, | ||||
avoidClasses(clWater, 2, clHill, 1, clPlayer, 1, clPassage, 1), | avoidClasses(clWater, 2, clHill, 1, clPlayer, 1, clPassage, 1), | ||||
scaleByMapSize(10, 40), 20 | scaleByMapSize(10, 40), 20 | ||||
); | ); | ||||
log ("Creating Sand blows and beautifications"); | log ("Creating Sand blows and beautifications"); | ||||
for (var sandx = 0; sandx < mapSize; sandx += 4) | for (var sandx = 0; sandx < mapSize; sandx += 4) | ||||
{ | { | ||||
for (var sandz = 0; sandz < mapSize; sandz += 4) | for (var sandz = 0; sandz < mapSize; sandz += 4) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 50 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator