Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/maps/random/botswanan_haven.js
Show First 20 Lines • Show All 161 Lines • ▼ Show 20 Lines | createObjectGroup( | ||||
Math.round(fx + gDist * Math.cos(gAngle)), | Math.round(fx + gDist * Math.cos(gAngle)), | ||||
Math.round(fz + gDist * Math.sin(gAngle))), | Math.round(fz + gDist * Math.sin(gAngle))), | ||||
0); | 0); | ||||
} | } | ||||
} | } | ||||
RMS.SetProgress(15); | RMS.SetProgress(15); | ||||
log("Creating bumps..."); | log("Creating bumps..."); | ||||
createAreas( | createAreasDeprecated( | ||||
new ClumpPlacer(scaleByMapSize(20, 50), 0.6, 0.1, 1), | new ClumpPlacer(scaleByMapSize(20, 50), 0.6, 0.1, 1), | ||||
new SmoothElevationPainter(ELEVATION_MODIFY, 2, 2), | new SmoothElevationPainter(ELEVATION_MODIFY, 2, 2), | ||||
avoidClasses(clPlayer, 13), | avoidClasses(clPlayer, 13), | ||||
scaleByMapSize(300, 800)); | scaleByMapSize(300, 800)); | ||||
log("Creating hills..."); | log("Creating hills..."); | ||||
createAreas( | createAreasDeprecated( | ||||
new ChainPlacer(1, Math.floor(scaleByMapSize(4, 6)), Math.floor(scaleByMapSize(16, 40)), 0.5), | new ChainPlacer(1, Math.floor(scaleByMapSize(4, 6)), Math.floor(scaleByMapSize(16, 40)), 0.5), | ||||
[ | [ | ||||
new LayeredPainter([tCliff, tHill], [2]), | new LayeredPainter([tCliff, tHill], [2]), | ||||
new SmoothElevationPainter(ELEVATION_SET, 15, 2), | new SmoothElevationPainter(ELEVATION_SET, 15, 2), | ||||
paintClass(clHill) | paintClass(clHill) | ||||
], | ], | ||||
avoidClasses(clPlayer, 20, clHill, 15, clWater, 0), | avoidClasses(clPlayer, 20, clHill, 15, clWater, 0), | ||||
scaleByMapSize(1, 4) * numPlayers * 3); | scaleByMapSize(1, 4) * numPlayers * 3); | ||||
log("Creating marshes..."); | log("Creating marshes..."); | ||||
for (let i = 0; i < 2; ++i) | for (let i = 0; i < 2; ++i) | ||||
createAreas( | createAreasDeprecated( | ||||
new ChainPlacer(1, Math.floor(scaleByMapSize(6, 12)), Math.floor(scaleByMapSize(15, 60)), 0.8), | new ChainPlacer(1, Math.floor(scaleByMapSize(6, 12)), Math.floor(scaleByMapSize(15, 60)), 0.8), | ||||
[ | [ | ||||
new LayeredPainter([tShoreBlend, tShore, tWater], [1, 1]), | new LayeredPainter([tShoreBlend, tShore, tWater], [1, 1]), | ||||
new SmoothElevationPainter(ELEVATION_SET, -2, 3), | new SmoothElevationPainter(ELEVATION_SET, -2, 3), | ||||
paintClass(clWater) | paintClass(clWater) | ||||
], | ], | ||||
avoidClasses(clPlayer, 25, clWater, Math.round(scaleByMapSize(7, 16) * randFloat(0.8, 1.35))), | avoidClasses(clPlayer, 25, clWater, Math.round(scaleByMapSize(7, 16) * randFloat(0.8, 1.35))), | ||||
scaleByMapSize(4, 20)); | scaleByMapSize(4, 20)); | ||||
log("Creating reeds..."); | log("Creating reeds..."); | ||||
createObjectGroups( | createObjectGroupsDeprecated( | ||||
new SimpleGroup( | new SimpleGroup( | ||||
[ | [ | ||||
new SimpleObject(aReeds, 20, 40, 0, 4), | new SimpleObject(aReeds, 20, 40, 0, 4), | ||||
new SimpleObject(aReeds2, 20, 40, 0, 4), | new SimpleObject(aReeds2, 20, 40, 0, 4), | ||||
new SimpleObject(aLillies, 10, 30, 0, 4) | new SimpleObject(aLillies, 10, 30, 0, 4) | ||||
], | ], | ||||
true), | true), | ||||
0, | 0, | ||||
stayClasses(clWater, 1), | stayClasses(clWater, 1), | ||||
scaleByMapSize(400, 1000), | scaleByMapSize(400, 1000), | ||||
100); | 100); | ||||
RMS.SetProgress(40); | RMS.SetProgress(40); | ||||
log("Creating bumps..."); | log("Creating bumps..."); | ||||
createAreas( | createAreasDeprecated( | ||||
new ClumpPlacer(scaleByMapSize(20, 50), 0.3, 0.06, 1), | new ClumpPlacer(scaleByMapSize(20, 50), 0.3, 0.06, 1), | ||||
new SmoothElevationPainter(ELEVATION_MODIFY, 1, 2), | new SmoothElevationPainter(ELEVATION_MODIFY, 1, 2), | ||||
stayClasses(clWater, 2), | stayClasses(clWater, 2), | ||||
scaleByMapSize(50, 100)); | scaleByMapSize(50, 100)); | ||||
log("Creating mud patches..."); | log("Creating mud patches..."); | ||||
for (let size of [scaleByMapSize(3, 6), scaleByMapSize(5, 10), scaleByMapSize(8, 21)]) | for (let size of [scaleByMapSize(3, 6), scaleByMapSize(5, 10), scaleByMapSize(8, 21)]) | ||||
createAreas( | createAreasDeprecated( | ||||
new ChainPlacer(2, Math.floor(scaleByMapSize(3, 6)), size, 1), | new ChainPlacer(2, Math.floor(scaleByMapSize(3, 6)), size, 1), | ||||
[ | [ | ||||
new LayeredPainter([tGrassA, tGrassB, tMud], [1, 1]), | new LayeredPainter([tGrassA, tGrassB, tMud], [1, 1]), | ||||
paintClass(clDirt) | paintClass(clDirt) | ||||
], | ], | ||||
avoidClasses(clWater, 1, clHill, 0, clDirt, 5, clPlayer, 8), | avoidClasses(clWater, 1, clHill, 0, clDirt, 5, clPlayer, 8), | ||||
scaleByMapSize(15, 45)); | scaleByMapSize(15, 45)); | ||||
RMS.SetProgress(50); | RMS.SetProgress(50); | ||||
log("Creating stone mines..."); | log("Creating stone mines..."); | ||||
createObjectGroups( | createObjectGroupsDeprecated( | ||||
new SimpleGroup( | new SimpleGroup( | ||||
[ | [ | ||||
new SimpleObject(oStoneSmall, 0, 2, 0, 4), | new SimpleObject(oStoneSmall, 0, 2, 0, 4), | ||||
new SimpleObject(oStoneLarge, 1, 1, 0, 4) | new SimpleObject(oStoneLarge, 1, 1, 0, 4) | ||||
], | ], | ||||
true, | true, | ||||
clRock), | clRock), | ||||
0, | 0, | ||||
[avoidClasses(clWater, 0, clPlayer, 20, clRock, 10, clHill, 1)], | [avoidClasses(clWater, 0, clPlayer, 20, clRock, 10, clHill, 1)], | ||||
scaleByMapSize(4, 16), | scaleByMapSize(4, 16), | ||||
100); | 100); | ||||
createObjectGroups( | createObjectGroupsDeprecated( | ||||
new SimpleGroup([new SimpleObject(oStoneSmall, 2, 5, 1, 3)], true, clRock), | new SimpleGroup([new SimpleObject(oStoneSmall, 2, 5, 1, 3)], true, clRock), | ||||
0, | 0, | ||||
[avoidClasses(clWater, 0, clPlayer, 20, clRock, 10, clHill, 1)], | [avoidClasses(clWater, 0, clPlayer, 20, clRock, 10, clHill, 1)], | ||||
scaleByMapSize(4, 16), | scaleByMapSize(4, 16), | ||||
100); | 100); | ||||
log("Creating metal mines..."); | log("Creating metal mines..."); | ||||
createObjectGroups( | createObjectGroupsDeprecated( | ||||
new SimpleGroup([new SimpleObject(oMetalLarge, 1, 1, 0, 4)], true, clMetal), | new SimpleGroup([new SimpleObject(oMetalLarge, 1, 1, 0, 4)], true, clMetal), | ||||
0, | 0, | ||||
[avoidClasses(clWater, 0, clPlayer, 20, clMetal, 10, clRock, 5, clHill, 1)], | [avoidClasses(clWater, 0, clPlayer, 20, clMetal, 10, clRock, 5, clHill, 1)], | ||||
scaleByMapSize(4, 16), | scaleByMapSize(4, 16), | ||||
100); | 100); | ||||
RMS.SetProgress(60); | RMS.SetProgress(60); | ||||
log("Creating small decorative rocks..."); | log("Creating small decorative rocks..."); | ||||
createObjectGroups( | createObjectGroupsDeprecated( | ||||
new SimpleGroup([new SimpleObject(aRockMedium, 1, 3, 0, 1)], true), | new SimpleGroup([new SimpleObject(aRockMedium, 1, 3, 0, 1)], true), | ||||
0, | 0, | ||||
avoidClasses(clPlayer, 1), | avoidClasses(clPlayer, 1), | ||||
scaleByMapSize(16, 262), | scaleByMapSize(16, 262), | ||||
50); | 50); | ||||
RMS.SetProgress(65); | RMS.SetProgress(65); | ||||
log("Creating large decorative rocks..."); | log("Creating large decorative rocks..."); | ||||
createObjectGroups( | createObjectGroupsDeprecated( | ||||
new SimpleGroup( | new SimpleGroup( | ||||
[ | [ | ||||
new SimpleObject(aRockLarge, 1, 2, 0, 1), | new SimpleObject(aRockLarge, 1, 2, 0, 1), | ||||
new SimpleObject(aRockMedium, 1, 3, 0, 2) | new SimpleObject(aRockMedium, 1, 3, 0, 2) | ||||
], | ], | ||||
true), | true), | ||||
0, | 0, | ||||
avoidClasses(clWater, 0, clForest, 0, clPlayer, 0, clHill, 0), | avoidClasses(clWater, 0, clForest, 0, clPlayer, 0, clHill, 0), | ||||
scaleByMapSize(8, 131), | scaleByMapSize(8, 131), | ||||
50); | 50); | ||||
RMS.SetProgress(70); | RMS.SetProgress(70); | ||||
log("Creating lions..."); | log("Creating lions..."); | ||||
createObjectGroups( | createObjectGroupsDeprecated( | ||||
new SimpleGroup( | new SimpleGroup( | ||||
[ | [ | ||||
new SimpleObject(oLion, 0, 1, 0, 4), | new SimpleObject(oLion, 0, 1, 0, 4), | ||||
new SimpleObject(oLioness, 2, 3, 0, 4) | new SimpleObject(oLioness, 2, 3, 0, 4) | ||||
], | ], | ||||
true, | true, | ||||
clFood), | clFood), | ||||
0, | 0, | ||||
avoidClasses(clWater, 1, clPlayer, 20, clFood, 11, clHill, 1), | avoidClasses(clWater, 1, clPlayer, 20, clFood, 11, clHill, 1), | ||||
scaleByMapSize(4, 12), | scaleByMapSize(4, 12), | ||||
50); | 50); | ||||
log("Creating zebras..."); | log("Creating zebras..."); | ||||
createObjectGroups( | createObjectGroupsDeprecated( | ||||
new SimpleGroup( | new SimpleGroup( | ||||
[new SimpleObject(oZebra, 4, 6, 0, 4)], | [new SimpleObject(oZebra, 4, 6, 0, 4)], | ||||
true, | true, | ||||
clFood), | clFood), | ||||
0, | 0, | ||||
avoidClasses(clWater, 0, clForest, 0, clPlayer, 20, clHill, 1, clFood, 13), | avoidClasses(clWater, 0, clForest, 0, clPlayer, 20, clHill, 1, clFood, 13), | ||||
3 * numPlayers, | 3 * numPlayers, | ||||
50); | 50); | ||||
log("Creating wildebeest..."); | log("Creating wildebeest..."); | ||||
createObjectGroups( | createObjectGroupsDeprecated( | ||||
new SimpleGroup( | new SimpleGroup( | ||||
[new SimpleObject(oWildebeest, 2, 4, 0, 4)], | [new SimpleObject(oWildebeest, 2, 4, 0, 4)], | ||||
true, | true, | ||||
clFood), | clFood), | ||||
0, | 0, | ||||
avoidClasses(clWater, 0, clForest, 0, clPlayer, 20, clHill, 1, clFood, 13), | avoidClasses(clWater, 0, clForest, 0, clPlayer, 20, clHill, 1, clFood, 13), | ||||
3 * numPlayers, | 3 * numPlayers, | ||||
50); | 50); | ||||
log("Creating crocodiles..."); | log("Creating crocodiles..."); | ||||
createObjectGroups( | createObjectGroupsDeprecated( | ||||
new SimpleGroup( | new SimpleGroup( | ||||
[new SimpleObject(oCrocodile, 2, 3, 0, 4)], | [new SimpleObject(oCrocodile, 2, 3, 0, 4)], | ||||
true, | true, | ||||
clFood), | clFood), | ||||
0, | 0, | ||||
[avoidClasses(clForest, 0, clPlayer, 20, clHill, 1, clFood, 13), stayClasses(clWater, 3)], | [avoidClasses(clForest, 0, clPlayer, 20, clHill, 1, clFood, 13), stayClasses(clWater, 3)], | ||||
5 * numPlayers, | 5 * numPlayers, | ||||
200); | 200); | ||||
log("Creating gazelles..."); | log("Creating gazelles..."); | ||||
createObjectGroups( | createObjectGroupsDeprecated( | ||||
new SimpleGroup( | new SimpleGroup( | ||||
[new SimpleObject(oGazelle, 4, 6, 0, 4)], | [new SimpleObject(oGazelle, 4, 6, 0, 4)], | ||||
true, | true, | ||||
clFood), | clFood), | ||||
0, | 0, | ||||
avoidClasses(clWater, 0, clForest, 0, clPlayer, 20, clHill, 1, clFood, 13), | avoidClasses(clWater, 0, clForest, 0, clPlayer, 20, clHill, 1, clFood, 13), | ||||
3 * numPlayers, | 3 * numPlayers, | ||||
50); | 50); | ||||
RMS.SetProgress(75); | RMS.SetProgress(75); | ||||
log("Creating rabbits..."); | log("Creating rabbits..."); | ||||
createObjectGroups( | createObjectGroupsDeprecated( | ||||
new SimpleGroup( | new SimpleGroup( | ||||
[new SimpleObject(oRabbit, 6, 8, 0, 2)], | [new SimpleObject(oRabbit, 6, 8, 0, 2)], | ||||
true, | true, | ||||
clFood), | clFood), | ||||
0, | 0, | ||||
avoidClasses(clWater, 0, clForest, 0, clPlayer, 20, clHill, 1, clFood, 13), | avoidClasses(clWater, 0, clForest, 0, clPlayer, 20, clHill, 1, clFood, 13), | ||||
6 * numPlayers, | 6 * numPlayers, | ||||
50); | 50); | ||||
log("Creating rhinos..."); | log("Creating rhinos..."); | ||||
createObjectGroups( | createObjectGroupsDeprecated( | ||||
new SimpleGroup( | new SimpleGroup( | ||||
[new SimpleObject(oRhino, 1, 1, 0, 2)], | [new SimpleObject(oRhino, 1, 1, 0, 2)], | ||||
true, | true, | ||||
clFood), | clFood), | ||||
0, | 0, | ||||
avoidClasses(clWater, 0, clForest, 0, clPlayer, 20, clHill, 1, clFood, 13), | avoidClasses(clWater, 0, clForest, 0, clPlayer, 20, clHill, 1, clFood, 13), | ||||
3 * numPlayers, | 3 * numPlayers, | ||||
50); | 50); | ||||
log("Creating elephants..."); | log("Creating elephants..."); | ||||
createObjectGroups( | createObjectGroupsDeprecated( | ||||
new SimpleGroup( | new SimpleGroup( | ||||
[new SimpleObject(oElephant, 2, 3, 0, 4), new SimpleObject(oElephantInfant, 1, 1, 0, 4)], | [new SimpleObject(oElephant, 2, 3, 0, 4), new SimpleObject(oElephantInfant, 1, 1, 0, 4)], | ||||
true, | true, | ||||
clFood), | clFood), | ||||
0, | 0, | ||||
avoidClasses(clWater, 0, clForest, 0, clPlayer, 20, clHill, 1, clFood, 13), | avoidClasses(clWater, 0, clForest, 0, clPlayer, 20, clHill, 1, clFood, 13), | ||||
3 * numPlayers, | 3 * numPlayers, | ||||
50); | 50); | ||||
log("Creating berry bushes..."); | log("Creating berry bushes..."); | ||||
createObjectGroups( | createObjectGroupsDeprecated( | ||||
new SimpleGroup( | new SimpleGroup( | ||||
[new SimpleObject(oBerryBush, 5, 7, 0, 4)], | [new SimpleObject(oBerryBush, 5, 7, 0, 4)], | ||||
true, | true, | ||||
clFood), | clFood), | ||||
0, | 0, | ||||
avoidClasses(clWater, 3, clForest, 0, clPlayer, 20, clHill, 1, clFood, 10), | avoidClasses(clWater, 3, clForest, 0, clPlayer, 20, clHill, 1, clFood, 10), | ||||
randIntInclusive(1, 4) * numPlayers + 2, | randIntInclusive(1, 4) * numPlayers + 2, | ||||
50); | 50); | ||||
RMS.SetProgress(80); | RMS.SetProgress(80); | ||||
log("Creating straggler trees..."); | log("Creating straggler trees..."); | ||||
let treeTypes = [oToona, oBaobab, oBush, oBush]; | let treeTypes = [oToona, oBaobab, oBush, oBush]; | ||||
for (let treeType of treeTypes) | for (let treeType of treeTypes) | ||||
createObjectGroups( | createObjectGroupsDeprecated( | ||||
new SimpleGroup( | new SimpleGroup( | ||||
[new SimpleObject(treeType, 1, 3, 0, 3)], | [new SimpleObject(treeType, 1, 3, 0, 3)], | ||||
true, | true, | ||||
clForest), | clForest), | ||||
0, | 0, | ||||
avoidClasses(clForest, 1, clWater, 1, clHill, 1, clPlayer, 13, clMetal, 1, clRock, 1), | avoidClasses(clForest, 1, clWater, 1, clHill, 1, clPlayer, 13, clMetal, 1, clRock, 1), | ||||
Math.floor(scaleByMapSize(60, 500) / treeTypes.length)); | Math.floor(scaleByMapSize(60, 500) / treeTypes.length)); | ||||
RMS.SetProgress(85); | RMS.SetProgress(85); | ||||
log("Creating small grass tufts..."); | log("Creating small grass tufts..."); | ||||
createObjectGroups( | createObjectGroupsDeprecated( | ||||
new SimpleGroup([new SimpleObject(aGrassShort, 1, 2, 0, 1, -PI/8, PI/8)]), | new SimpleGroup([new SimpleObject(aGrassShort, 1, 2, 0, 1, -PI/8, PI/8)]), | ||||
0, | 0, | ||||
avoidClasses(clWater, 2, clPlayer, 13, clDirt, 0), | avoidClasses(clWater, 2, clPlayer, 13, clDirt, 0), | ||||
scaleByMapSize(13, 200)); | scaleByMapSize(13, 200)); | ||||
RMS.SetProgress(90); | RMS.SetProgress(90); | ||||
log("Creating large grass tufts..."); | log("Creating large grass tufts..."); | ||||
createObjectGroups( | createObjectGroupsDeprecated( | ||||
new SimpleGroup([ | new SimpleGroup([ | ||||
new SimpleObject(aGrass, 2, 4, 0, 1.8, -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(aGrassShort, 3, 6, 1.2, 2.5, -PI/8, PI/8) | ||||
]), | ]), | ||||
0, | 0, | ||||
avoidClasses(clWater, 3, clPlayer, 13, clDirt, 1, clForest, 0), | avoidClasses(clWater, 3, clPlayer, 13, clDirt, 1, clForest, 0), | ||||
scaleByMapSize(13, 200)); | scaleByMapSize(13, 200)); | ||||
RMS.SetProgress(95); | RMS.SetProgress(95); | ||||
log("Creating bushes..."); | log("Creating bushes..."); | ||||
createObjectGroups( | createObjectGroupsDeprecated( | ||||
new SimpleGroup( | new SimpleGroup( | ||||
[ | [ | ||||
new SimpleObject(aBushMedium, 1, 2, 0, 2), | new SimpleObject(aBushMedium, 1, 2, 0, 2), | ||||
new SimpleObject(aBushSmall, 2, 4, 0, 2) | new SimpleObject(aBushSmall, 2, 4, 0, 2) | ||||
]), | ]), | ||||
0, | 0, | ||||
avoidClasses(clWater, 1, clPlayer, 13, clDirt, 1), | avoidClasses(clWater, 1, clPlayer, 13, clDirt, 1), | ||||
scaleByMapSize(13, 200), | scaleByMapSize(13, 200), | ||||
50); | 50); | ||||
log("Creating flowering shrubs..."); | log("Creating flowering shrubs..."); | ||||
createObjectGroups( | createObjectGroupsDeprecated( | ||||
new SimpleGroup([new SimpleObject(aShrub, 1, 1, 0, 2)]), | new SimpleGroup([new SimpleObject(aShrub, 1, 1, 0, 2)]), | ||||
0, | 0, | ||||
avoidClasses(clWater, 1, clPlayer, 13, clDirt, 1), | avoidClasses(clWater, 1, clPlayer, 13, clDirt, 1), | ||||
scaleByMapSize(13, 200), | scaleByMapSize(13, 200), | ||||
50); | 50); | ||||
log("Creating decorative palms..."); | log("Creating decorative palms..."); | ||||
createObjectGroups( | createObjectGroupsDeprecated( | ||||
new SimpleGroup([new SimpleObject(aPalm, 1, 3, 0, 2)]), | new SimpleGroup([new SimpleObject(aPalm, 1, 3, 0, 2)]), | ||||
0, | 0, | ||||
avoidClasses(clWater, 2, clPlayer, 12, clDirt, 1), | avoidClasses(clWater, 2, clPlayer, 12, clDirt, 1), | ||||
scaleByMapSize(13, 200), | scaleByMapSize(13, 200), | ||||
50); | 50); | ||||
log("Creating shrubs,flowers and other decorations..."); | log("Creating shrubs,flowers and other decorations..."); | ||||
createObjectGroups( | createObjectGroupsDeprecated( | ||||
new SimpleGroup( | new SimpleGroup( | ||||
[ | [ | ||||
new SimpleObject(aFlower, 0, 6, 0, 2), | new SimpleObject(aFlower, 0, 6, 0, 2), | ||||
new SimpleObject(aGrass2, 2, 5, 0, 2) | new SimpleObject(aGrass2, 2, 5, 0, 2) | ||||
]), | ]), | ||||
0, | 0, | ||||
avoidClasses(clWater, 1, clHill, 1, clPlayer, 13, clDirt, 1), | avoidClasses(clWater, 1, clHill, 1, clPlayer, 13, clDirt, 1), | ||||
scaleByMapSize(13, 200), | scaleByMapSize(13, 200), | ||||
Show All 17 Lines |
Wildfire Games · Phabricator