Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/maps/random/lorraine_plain.js
Show First 20 Lines • Show All 204 Lines • ▼ Show 20 Lines | |||||
placer = new ClumpPlacer(floor(PI*scaleByMapSize(10,20)*scaleByMapSize(10,20)/4), 0.95, 0.6, 10, fractionToTiles(0.99), fractionToTiles(0.5)); | placer = new ClumpPlacer(floor(PI*scaleByMapSize(10,20)*scaleByMapSize(10,20)/4), 0.95, 0.6, 10, fractionToTiles(0.99), fractionToTiles(0.5)); | ||||
var painter = new LayeredPainter([tWater, tWater], [1]); | var painter = new LayeredPainter([tWater, tWater], [1]); | ||||
var elevationPainter = new SmoothElevationPainter(ELEVATION_SET, -4, 2); | var elevationPainter = new SmoothElevationPainter(ELEVATION_SET, -4, 2); | ||||
createArea(placer, [painter, elevationPainter], avoidClasses(clPlayer, 8)); | createArea(placer, [painter, elevationPainter], avoidClasses(clPlayer, 8)); | ||||
// create the shallows of the main river | // create the shallows of the main river | ||||
log("Creating the shallows of the main river"); | log("Creating the shallows of the main river"); | ||||
for (var i = 0; i <= randInt(3, scaleByMapSize(4,6)); i++) | for (let i = 0; i <= randIntInclusive(3, scaleByMapSize(4, 6)); ++i) | ||||
{ | { | ||||
var cLocation = randFloat(0.15,0.85); | var cLocation = randFloat(0.15,0.85); | ||||
passageMaker(floor(fractionToTiles(cLocation)), floor(fractionToTiles(0.35)), floor(fractionToTiles(cLocation)), floor(fractionToTiles(0.65)), scaleByMapSize(4,8), -2, -2, 2, clShallow, undefined, -4); | passageMaker(floor(fractionToTiles(cLocation)), floor(fractionToTiles(0.35)), floor(fractionToTiles(cLocation)), floor(fractionToTiles(0.65)), scaleByMapSize(4,8), -2, -2, 2, clShallow, undefined, -4); | ||||
} | } | ||||
// create tributaries | // create tributaries | ||||
log("Creating tributaries"); | log("Creating tributaries"); | ||||
for (let i = 0; i <= randIntInclusive(8, scaleByMapSize(12, 20)); ++i) | for (let i = 0; i <= randIntInclusive(8, scaleByMapSize(12, 20)); ++i) | ||||
▲ Show 20 Lines • Show All 200 Lines • ▼ Show 20 Lines | |||||
// create berry bush | // create berry bush | ||||
log("Creating berry bush..."); | log("Creating berry bush..."); | ||||
group = new SimpleGroup( | group = new SimpleGroup( | ||||
[new SimpleObject(oBerryBush, 5,7, 0,4)], | [new SimpleObject(oBerryBush, 5,7, 0,4)], | ||||
true, clFood | true, clFood | ||||
); | ); | ||||
createObjectGroups(group, 0, | createObjectGroups(group, 0, | ||||
avoidClasses(clWater, 3, clForest, 0, clPlayer, 15, clHill, 1, clFood, 10), | avoidClasses(clWater, 3, clForest, 0, clPlayer, 15, clHill, 1, clFood, 10), | ||||
randInt(1, 4) * numPlayers + 2, 50 | randIntInclusive(1, 4) * numPlayers + 2, 50 | ||||
); | ); | ||||
// create straggler trees | // create straggler trees | ||||
log("Creating straggler trees..."); | log("Creating straggler trees..."); | ||||
var types = [oOak, oBeech]; // some variation | var types = [oOak, oBeech]; // 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) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 62 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator