Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/maps/random/flood.js
Show First 20 Lines • Show All 190 Lines • ▼ Show 20 Lines | |||||
g_Map.log("Creating fish"); | g_Map.log("Creating fish"); | ||||
createObjectGroupsDeprecated( | createObjectGroupsDeprecated( | ||||
new SimpleGroup([new SimpleObject(oFish, 2, 3, 0, 2)], true, clFood), | new SimpleGroup([new SimpleObject(oFish, 2, 3, 0, 2)], true, clFood), | ||||
0, | 0, | ||||
avoidClasses(clHill, 10, clFood, 20), | avoidClasses(clHill, 10, clFood, 20), | ||||
10 * numPlayers, | 10 * numPlayers, | ||||
60); | 60); | ||||
var [forestTrees, stragglerTrees] = getTreeCounts(...rBiomeTreeCount(0.7)); | const [forestTreesMainIsland, stragglerTreesMainIsland] = getTreeCounts(...rBiomeTreeCount(0.7)); | ||||
createForests( | createForests( | ||||
[tMainTerrain, tForestFloor1, tForestFloor2, pForest1, pForest2], | [tMainTerrain, tForestFloor1, tForestFloor2, pForest1, pForest2], | ||||
[avoidClasses(clPlayer, 25, clForest, 10, clBaseResource, 3, clMetal, 6, clRock, 6, clMountain, 2), stayClasses(clHill, 6)], | [avoidClasses(clPlayer, 25, clForest, 10, clBaseResource, 3, clMetal, 6, clRock, 6, clMountain, 2), stayClasses(clHill, 6)], | ||||
clForest, | clForest, | ||||
forestTrees); | forestTreesMainIsland); | ||||
const types = [oTree1, oTree2, oTree4, oTree3]; | const types = [oTree1, oTree2, oTree4, oTree3]; | ||||
createStragglerTrees( | createStragglerTrees( | ||||
types, | types, | ||||
[avoidClasses(clBaseResource, 2, clMetal, 6, clRock, 6, clMountain, 2, clPlayer, 25), stayClasses(clHill, 6)], | [avoidClasses(clBaseResource, 2, clMetal, 6, clRock, 6, clMountain, 2, clPlayer, 25), stayClasses(clHill, 6)], | ||||
clForest, | clForest, | ||||
stragglerTrees); | stragglerTreesMainIsland); | ||||
Engine.SetProgress(65); | Engine.SetProgress(65); | ||||
g_Map.log("Creating dirt patches"); | g_Map.log("Creating dirt patches"); | ||||
const numb = currentBiome() == "generic/savanna" ? 3 : 1; | const numb = currentBiome() == "generic/savanna" ? 3 : 1; | ||||
for (const size of [scaleByMapSize(3, 6), scaleByMapSize(5, 10), scaleByMapSize(8, 21)]) | for (const size of [scaleByMapSize(3, 6), scaleByMapSize(5, 10), scaleByMapSize(8, 21)]) | ||||
createAreas( | createAreas( | ||||
new ChainPlacer(1, Math.floor(scaleByMapSize(3, 5)), size, 0.5), | new ChainPlacer(1, Math.floor(scaleByMapSize(3, 5)), size, 0.5), | ||||
[ | [ | ||||
Show All 31 Lines | [ | ||||
[new SimpleObject(oFruitBush, 5, 7, 0, 4)] | [new SimpleObject(oFruitBush, 5, 7, 0, 4)] | ||||
], | ], | ||||
[3 * numPlayers], | [3 * numPlayers], | ||||
[avoidClasses(clForest, 0, clPlayer, 15, clMountain, 1, clFood, 4, clRock, 6, clMetal, 6), stayClasses(clHill, 6)], | [avoidClasses(clForest, 0, clPlayer, 15, clMountain, 1, clFood, 4, clRock, 6, clMetal, 6), stayClasses(clHill, 6)], | ||||
clFood); | clFood); | ||||
Engine.SetProgress(85); | Engine.SetProgress(85); | ||||
var planetm = currentBiome() == "generic/india" ? 8 : 1; | const planetm = currentBiome() == "generic/india" ? 8 : 1; | ||||
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, 2, 15, 0, 1)], | [new SimpleObject(aGrassShort, 2, 15, 0, 1)], | ||||
[new SimpleObject(aGrass, 2, 10, 0, 1.8), new SimpleObject(aGrassShort, 3, 10, 1.2, 2.5)], | [new SimpleObject(aGrass, 2, 10, 0, 1.8), new SimpleObject(aGrassShort, 3, 10, 1.2, 2.5)], | ||||
[new SimpleObject(aBushMedium, 1, 5, 0, 2), new SimpleObject(aBushSmall, 2, 4, 0, 2)] | [new SimpleObject(aBushMedium, 1, 5, 0, 2), new SimpleObject(aBushSmall, 2, 4, 0, 2)] | ||||
], | ], | ||||
[ | [ | ||||
scaleByMapAreaAbsolute(16), | scaleByMapAreaAbsolute(16), | ||||
scaleByMapAreaAbsolute(8), | scaleByMapAreaAbsolute(8), | ||||
planetm * scaleByMapAreaAbsolute(13), | planetm * scaleByMapAreaAbsolute(13), | ||||
planetm * scaleByMapAreaAbsolute(13), | planetm * scaleByMapAreaAbsolute(13), | ||||
planetm * scaleByMapAreaAbsolute(13) | planetm * scaleByMapAreaAbsolute(13) | ||||
], | ], | ||||
avoidClasses(clForest, 2, clPlayer, 20, clMountain, 5, clFood, 1, clBaseResource, 2)); | avoidClasses(clForest, 2, clPlayer, 20, clMountain, 5, clFood, 1, clBaseResource, 2)); | ||||
var [forestTrees, stragglerTrees] = getTreeCounts(...rBiomeTreeCount(0.1)); | const [forestTreesAround, stragglerTreesAround] = getTreeCounts(...rBiomeTreeCount(0.1)); | ||||
createForests( | createForests( | ||||
[tMainTerrain, tForestFloor1, tForestFloor2, pForest1, pForest2], | [tMainTerrain, tForestFloor1, tForestFloor2, pForest1, pForest2], | ||||
avoidClasses(clPlayer, 30, clHill, 10, clFood, 5), | avoidClasses(clPlayer, 30, clHill, 10, clFood, 5), | ||||
clForest, | clForest, | ||||
forestTrees); | forestTreesAround); | ||||
g_Map.log("Creating small grass tufts"); | g_Map.log("Creating small grass tufts"); | ||||
createObjectGroupsDeprecated( | createObjectGroupsDeprecated( | ||||
new SimpleGroup([new SimpleObject(aGrassShort, 1, 2, 0, 1)]), | new SimpleGroup([new SimpleObject(aGrassShort, 1, 2, 0, 1)]), | ||||
0, | 0, | ||||
[avoidClasses(clMountain, 2, clPlayer, 2, clDirt, 0), stayClasses(clHill, 8)], | [avoidClasses(clMountain, 2, clPlayer, 2, clDirt, 0), stayClasses(clHill, 8)], | ||||
planetm * scaleByMapSize(13, 200)); | planetm * scaleByMapSize(13, 200)); | ||||
Show All 10 Lines |
Wildfire Games · Phabricator