Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/maps/random/unknown_land.js
Show First 20 Lines • Show All 1,619 Lines • ▼ Show 20 Lines | for (var i = 0; i < sizes.length; i++) | ||||
); | ); | ||||
} | } | ||||
RMS.SetProgress(55); | RMS.SetProgress(55); | ||||
log("Creating stone mines..."); | log("Creating stone mines..."); | ||||
// create large stone quarries | // create large stone quarries | ||||
group = new SimpleGroup([new SimpleObject(oStoneSmall, 0,2, 0,4), new SimpleObject(oStoneLarge, 1,1, 0,4)], true, clRock); | group = new SimpleGroup([new SimpleObject(oStoneSmall, 0,2, 0,4), new SimpleObject(oStoneLarge, 1,1, 0,4)], true, clRock); | ||||
createObjectGroups(group, 0, | createObjectGroupsDeprecated(group, 0, | ||||
[avoidClasses(clForest, 1, clPlayer, 20, clRock, 10, clHill, 1), stayClasses(clLand, 4)], | [avoidClasses(clForest, 1, clPlayer, 20, clRock, 10, clHill, 1), stayClasses(clLand, 4)], | ||||
randInt(scaleByMapSize(2,9),scaleByMapSize(9,40)), 100 | randInt(scaleByMapSize(2,9),scaleByMapSize(9,40)), 100 | ||||
); | ); | ||||
// create small stone quarries | // create small stone quarries | ||||
group = new SimpleGroup([new SimpleObject(oStoneSmall, 2,5, 1,3)], true, clRock); | group = new SimpleGroup([new SimpleObject(oStoneSmall, 2,5, 1,3)], true, clRock); | ||||
createObjectGroups(group, 0, | createObjectGroupsDeprecated(group, 0, | ||||
[avoidClasses(clForest, 1, clPlayer, 20, clRock, 10, clHill, 1), stayClasses(clLand, 4)], | [avoidClasses(clForest, 1, clPlayer, 20, clRock, 10, clHill, 1), stayClasses(clLand, 4)], | ||||
randInt(scaleByMapSize(2,9),scaleByMapSize(9,40)), 100 | randInt(scaleByMapSize(2,9),scaleByMapSize(9,40)), 100 | ||||
); | ); | ||||
log("Creating metal mines..."); | log("Creating metal mines..."); | ||||
// create large metal quarries | // create large metal quarries | ||||
group = new SimpleGroup([new SimpleObject(oMetalLarge, 1,1, 0,4)], true, clMetal); | group = new SimpleGroup([new SimpleObject(oMetalLarge, 1,1, 0,4)], true, clMetal); | ||||
createObjectGroups(group, 0, | createObjectGroupsDeprecated(group, 0, | ||||
[avoidClasses(clForest, 1, clPlayer, 20, clMetal, 10, clRock, 5, clHill, 1), stayClasses(clLand, 4)], | [avoidClasses(clForest, 1, clPlayer, 20, clMetal, 10, clRock, 5, clHill, 1), stayClasses(clLand, 4)], | ||||
randInt(scaleByMapSize(2,9),scaleByMapSize(9,40)), 100 | randInt(scaleByMapSize(2,9),scaleByMapSize(9,40)), 100 | ||||
); | ); | ||||
RMS.SetProgress(65); | RMS.SetProgress(65); | ||||
// create small decorative rocks | // create small decorative rocks | ||||
log("Creating small decorative rocks..."); | log("Creating small decorative rocks..."); | ||||
group = new SimpleGroup( | group = new SimpleGroup( | ||||
[new SimpleObject(aRockMedium, 1,3, 0,1)], | [new SimpleObject(aRockMedium, 1,3, 0,1)], | ||||
true | true | ||||
); | ); | ||||
createObjectGroups( | createObjectGroupsDeprecated( | ||||
group, 0, | group, 0, | ||||
[avoidClasses(clWater, 0, clForest, 0, clPlayer, 0, clHill, 0), stayClasses(clLand, 4)], | [avoidClasses(clWater, 0, clForest, 0, clPlayer, 0, clHill, 0), stayClasses(clLand, 4)], | ||||
scaleByMapSize(16, 262), 50 | scaleByMapSize(16, 262), 50 | ||||
); | ); | ||||
// create large decorative rocks | // create large decorative rocks | ||||
log("Creating large decorative rocks..."); | log("Creating large decorative rocks..."); | ||||
group = new SimpleGroup( | group = new SimpleGroup( | ||||
[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)], | ||||
true | true | ||||
); | ); | ||||
createObjectGroups( | createObjectGroupsDeprecated( | ||||
group, 0, | group, 0, | ||||
[avoidClasses(clWater, 0, clForest, 0, clPlayer, 0, clHill, 0), stayClasses(clLand, 4)], | [avoidClasses(clWater, 0, clForest, 0, clPlayer, 0, clHill, 0), stayClasses(clLand, 4)], | ||||
scaleByMapSize(8, 131), 50 | scaleByMapSize(8, 131), 50 | ||||
); | ); | ||||
RMS.SetProgress(70); | RMS.SetProgress(70); | ||||
// create deer | // create deer | ||||
log("Creating deer..."); | log("Creating deer..."); | ||||
group = new SimpleGroup( | group = new SimpleGroup( | ||||
[new SimpleObject(oMainHuntableAnimal, 5,7, 0,4)], | [new SimpleObject(oMainHuntableAnimal, 5,7, 0,4)], | ||||
true, clFood | true, clFood | ||||
); | ); | ||||
createObjectGroups(group, 0, | createObjectGroupsDeprecated(group, 0, | ||||
[avoidClasses(clWater, 0, clForest, 0, clPlayer, 20, clHill, 1, clFood, 20), stayClasses(clLand, 4)], | [avoidClasses(clWater, 0, clForest, 0, clPlayer, 20, clHill, 1, clFood, 20), stayClasses(clLand, 4)], | ||||
randInt(numPlayers+3, 5*numPlayers+4), 50 | randInt(numPlayers+3, 5*numPlayers+4), 50 | ||||
); | ); | ||||
// create berry bush | // create berry bush | ||||
log("Creating berry bush..."); | log("Creating berry bush..."); | ||||
group = new SimpleGroup( | group = new SimpleGroup( | ||||
[new SimpleObject(oFruitBush, 5,7, 0,4)], | [new SimpleObject(oFruitBush, 5,7, 0,4)], | ||||
true, clFood | true, clFood | ||||
); | ); | ||||
createObjectGroups(group, 0, | createObjectGroupsDeprecated(group, 0, | ||||
[avoidClasses(clWater, 0, clForest, 0, clPlayer, 20, clHill, 1, clFood, 20), stayClasses(clLand, 4)], | [avoidClasses(clWater, 0, clForest, 0, clPlayer, 20, clHill, 1, clFood, 20), stayClasses(clLand, 4)], | ||||
randInt(1, 4) * numPlayers + 2, 50 | randInt(1, 4) * numPlayers + 2, 50 | ||||
); | ); | ||||
RMS.SetProgress(75); | RMS.SetProgress(75); | ||||
// create sheep | // create sheep | ||||
log("Creating sheep..."); | log("Creating sheep..."); | ||||
group = new SimpleGroup( | group = new SimpleGroup( | ||||
[new SimpleObject(oSecondaryHuntableAnimal, 2,3, 0,2)], | [new SimpleObject(oSecondaryHuntableAnimal, 2,3, 0,2)], | ||||
true, clFood | true, clFood | ||||
); | ); | ||||
createObjectGroups(group, 0, | createObjectGroupsDeprecated(group, 0, | ||||
[avoidClasses(clWater, 0, clForest, 0, clPlayer, 20, clHill, 1, clFood, 20), stayClasses(clLand, 4)], | [avoidClasses(clWater, 0, clForest, 0, clPlayer, 20, clHill, 1, clFood, 20), stayClasses(clLand, 4)], | ||||
randInt(numPlayers+3, 5*numPlayers+4), 50 | randInt(numPlayers+3, 5*numPlayers+4), 50 | ||||
); | ); | ||||
// create fish | // create fish | ||||
log("Creating fish..."); | log("Creating fish..."); | ||||
group = new SimpleGroup( | group = new SimpleGroup( | ||||
[new SimpleObject(oFish, 2,3, 0,2)], | [new SimpleObject(oFish, 2,3, 0,2)], | ||||
true, clFood | true, clFood | ||||
); | ); | ||||
createObjectGroups(group, 0, | createObjectGroupsDeprecated(group, 0, | ||||
avoidClasses(clLand, 5, clForest, 0, clPlayer, 0, clHill, 0, clFood, 20), | avoidClasses(clLand, 5, clForest, 0, clPlayer, 0, clHill, 0, clFood, 20), | ||||
randInt(15, 40) * numPlayers, 60 | randInt(15, 40) * numPlayers, 60 | ||||
); | ); | ||||
RMS.SetProgress(85); | RMS.SetProgress(85); | ||||
// create straggler trees | // create straggler trees | ||||
log("Creating straggler trees..."); | log("Creating straggler trees..."); | ||||
var types = [oTree1, oTree2, oTree4, oTree3]; // some variation | var types = [oTree1, oTree2, oTree4, oTree3]; // some variation | ||||
var num = floor(numStragglers / types.length); | var num = floor(numStragglers / types.length); | ||||
for (var i = 0; i < types.length; ++i) | for (var i = 0; i < types.length; ++i) | ||||
{ | { | ||||
group = new SimpleGroup( | group = new SimpleGroup( | ||||
[new SimpleObject(types[i], 1,1, 0,3)], | [new SimpleObject(types[i], 1,1, 0,3)], | ||||
true, clForest | true, clForest | ||||
); | ); | ||||
createObjectGroups(group, 0, | createObjectGroupsDeprecated(group, 0, | ||||
[avoidClasses(clWater, 1, clForest, 7, clHill, 1, clPlayer, 0, clMetal, 6, clRock, 6), stayClasses(clLand, 4)], | [avoidClasses(clWater, 1, clForest, 7, clHill, 1, clPlayer, 0, clMetal, 6, clRock, 6), stayClasses(clLand, 4)], | ||||
num | num | ||||
); | ); | ||||
} | } | ||||
var planetm = 1; | var planetm = 1; | ||||
if (random_terrain == g_BiomeTropic) | if (random_terrain == g_BiomeTropic) | ||||
planetm = 8; | 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(aGrassShort, 1,2, 0,1, -PI/8,PI/8)] | [new SimpleObject(aGrassShort, 1,2, 0,1, -PI/8,PI/8)] | ||||
); | ); | ||||
createObjectGroups(group, 0, | createObjectGroupsDeprecated(group, 0, | ||||
[avoidClasses(clWater, 2, clHill, 2, clPlayer, 2, clDirt, 0), stayClasses(clLand, 4)], | [avoidClasses(clWater, 2, clHill, 2, clPlayer, 2, clDirt, 0), stayClasses(clLand, 4)], | ||||
planetm * scaleByMapSize(13, 200) | planetm * scaleByMapSize(13, 200) | ||||
); | ); | ||||
RMS.SetProgress(90); | RMS.SetProgress(90); | ||||
// create large grass tufts | // create large grass tufts | ||||
log("Creating large grass tufts..."); | log("Creating large grass tufts..."); | ||||
group = new SimpleGroup( | group = new SimpleGroup( | ||||
[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)] | ||||
); | ); | ||||
createObjectGroups(group, 0, | createObjectGroupsDeprecated(group, 0, | ||||
[avoidClasses(clWater, 3, clHill, 2, clPlayer, 2, clDirt, 1, clForest, 0), stayClasses(clLand, 4)], | [avoidClasses(clWater, 3, clHill, 2, clPlayer, 2, clDirt, 1, clForest, 0), stayClasses(clLand, 4)], | ||||
planetm * scaleByMapSize(13, 200) | planetm * scaleByMapSize(13, 200) | ||||
); | ); | ||||
RMS.SetProgress(95); | RMS.SetProgress(95); | ||||
// create shallow flora | // create shallow flora | ||||
log("Creating shallow flora..."); | log("Creating shallow flora..."); | ||||
group = new SimpleGroup( | group = new SimpleGroup( | ||||
[new SimpleObject(aLillies, 1,2, 0,2), new SimpleObject(aReeds, 2,4, 0,2)] | [new SimpleObject(aLillies, 1,2, 0,2), new SimpleObject(aReeds, 2,4, 0,2)] | ||||
); | ); | ||||
createObjectGroups(group, 0, | createObjectGroupsDeprecated(group, 0, | ||||
stayClasses(clShallow, 1), | stayClasses(clShallow, 1), | ||||
60 * scaleByMapSize(13, 200), 80 | 60 * scaleByMapSize(13, 200), 80 | ||||
); | ); | ||||
// create bushes | // create bushes | ||||
log("Creating bushes..."); | log("Creating bushes..."); | ||||
group = new SimpleGroup( | group = new SimpleGroup( | ||||
[new SimpleObject(aBushMedium, 1,2, 0,2), new SimpleObject(aBushSmall, 2,4, 0,2)] | [new SimpleObject(aBushMedium, 1,2, 0,2), new SimpleObject(aBushSmall, 2,4, 0,2)] | ||||
); | ); | ||||
createObjectGroups(group, 0, | createObjectGroupsDeprecated(group, 0, | ||||
[avoidClasses(clWater, 1, clHill, 1, clPlayer, 1, clDirt, 1), stayClasses(clLand, 3)], | [avoidClasses(clWater, 1, clHill, 1, clPlayer, 1, clDirt, 1), stayClasses(clLand, 3)], | ||||
planetm * scaleByMapSize(13, 200), 50 | planetm * scaleByMapSize(13, 200), 50 | ||||
); | ); | ||||
setSkySet(pickRandom(["cirrus", "cumulus", "sunny", "sunny 1", "mountainous", "stratus"])); | setSkySet(pickRandom(["cirrus", "cumulus", "sunny", "sunny 1", "mountainous", "stratus"])); | ||||
setSunRotation(randFloat(0, TWO_PI)); | setSunRotation(randFloat(0, TWO_PI)); | ||||
setSunElevation(randFloat(PI/ 5, PI / 3)); | setSunElevation(randFloat(PI/ 5, PI / 3)); | ||||
// Export map data | // Export map data | ||||
ExportMap(); | ExportMap(); |
Wildfire Games · Phabricator