Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/maps/random/islands.js
Show First 20 Lines • Show All 405 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, 0, clRock, 10, clHill, 1), stayClasses(clLand, 5)], | [avoidClasses(clForest, 1, clPlayer, 0, clRock, 10, clHill, 1), stayClasses(clLand, 5)], | ||||
scaleByMapSize(4,16), 100 | scaleByMapSize(4,16), 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, 0, clRock, 10, clHill, 1), stayClasses(clLand, 5)], | [avoidClasses(clForest, 1, clPlayer, 0, clRock, 10, clHill, 1), stayClasses(clLand, 5)], | ||||
scaleByMapSize(4,16), 100 | scaleByMapSize(4,16), 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, 0, clMetal, 10, clRock, 5, clHill, 1), stayClasses(clLand, 5)], | [avoidClasses(clForest, 1, clPlayer, 0, clMetal, 10, clRock, 5, clHill, 1), stayClasses(clLand, 5)], | ||||
scaleByMapSize(4,16), 100 | scaleByMapSize(4,16), 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(clForest, 0, clPlayer, 0, clHill, 0), stayClasses(clLand, 5)], | [avoidClasses(clForest, 0, clPlayer, 0, clHill, 0), stayClasses(clLand, 5)], | ||||
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(clForest, 0, clPlayer, 0, clHill, 0), stayClasses(clLand, 5)], | [avoidClasses(clForest, 0, clPlayer, 0, clHill, 0), stayClasses(clLand, 5)], | ||||
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(clForest, 0, clPlayer, 0, clHill, 1, clFood, 20), stayClasses(clLand, 5)], | [avoidClasses(clForest, 0, clPlayer, 0, clHill, 1, clFood, 20), stayClasses(clLand, 5)], | ||||
3 * numPlayers, 50 | 3 * numPlayers, 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(clForest, 0, clPlayer, 0, clHill, 1, clFood, 20), stayClasses(clLand, 5)], | [avoidClasses(clForest, 0, clPlayer, 0, clHill, 1, clFood, 20), stayClasses(clLand, 5)], | ||||
3 * numPlayers, 50 | 3 * numPlayers, 50 | ||||
); | ); | ||||
// create fruit bush | // create fruit bush | ||||
log("Creating fruit bush..."); | log("Creating fruit 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(clForest, 0, clPlayer, 8, clHill, 1, clFood, 20), stayClasses(clLand, 5)], | [avoidClasses(clForest, 0, clPlayer, 8, clHill, 1, clFood, 20), stayClasses(clLand, 5)], | ||||
randIntInclusive(1, 4) * numPlayers + 2, 50 | randIntInclusive(1, 4) * numPlayers + 2, 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, 4, clForest, 2, clPlayer, 2, clHill, 2, clFood, 20), | avoidClasses(clLand, 4, clForest, 2, clPlayer, 2, clHill, 2, clFood, 20), | ||||
25 * numPlayers, 60 | 25 * 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(clForest, 1, clHill, 1, clPlayer, 0, clMetal, 6, clRock, 6), stayClasses(clLand, 6)], | [avoidClasses(clForest, 1, clHill, 1, clPlayer, 0, clMetal, 6, clRock, 6), stayClasses(clLand, 6)], | ||||
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(clHill, 2, clPlayer, 2, clDirt, 0), stayClasses(clLand, 6)], | [avoidClasses(clHill, 2, clPlayer, 2, clDirt, 0), stayClasses(clLand, 6)], | ||||
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(clHill, 2, clPlayer, 2, clDirt, 1, clForest, 0), stayClasses(clLand, 5)], | [avoidClasses(clHill, 2, clPlayer, 2, clDirt, 1, clForest, 0), stayClasses(clLand, 5)], | ||||
planetm * scaleByMapSize(13, 200) | planetm * scaleByMapSize(13, 200) | ||||
); | ); | ||||
RMS.SetProgress(95); | RMS.SetProgress(95); | ||||
// 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(clHill, 1, clPlayer, 1, clDirt, 1), stayClasses(clLand, 6)], | [avoidClasses(clHill, 1, clPlayer, 1, clDirt, 1), stayClasses(clLand, 6)], | ||||
planetm * scaleByMapSize(13, 200), 50 | planetm * scaleByMapSize(13, 200), 50 | ||||
); | ); | ||||
setSkySet(pickRandom(["cirrus", "cumulus", "sunny"])); | setSkySet(pickRandom(["cirrus", "cumulus", "sunny"])); | ||||
setSunRotation(randFloat(0, TWO_PI)); | setSunRotation(randFloat(0, TWO_PI)); | ||||
setSunElevation(randFloat(PI/ 5, PI / 3)); | setSunElevation(randFloat(PI/ 5, PI / 3)); | ||||
setWaterWaviness(2); | setWaterWaviness(2); | ||||
// Export map data | // Export map data | ||||
ExportMap(); | ExportMap(); |
Wildfire Games · Phabricator