Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/maps/random/kerala.js
Show First 20 Lines • Show All 192 Lines • ▼ Show 20 Lines | else if (ix > 0.69 * mapSize) | ||||
addToClass(ix, iz, clMountains); | addToClass(ix, iz, clMountains); | ||||
} | } | ||||
} | } | ||||
// create shore | // create shore | ||||
log("Creating shores..."); | log("Creating shores..."); | ||||
for (var i = 0; i < scaleByMapSize(20,120); i++) | for (var i = 0; i < scaleByMapSize(20,120); i++) | ||||
{ | { | ||||
placer = new ChainPlacer(1, floor(scaleByMapSize(4, 6)), floor(scaleByMapSize(16, 30)), 1, floor(randFloat(0.28,0.34)*mapSize), floor(randFloat(0.1,0.9)*mapSize)); | placer = new ChainPlacer( | ||||
1, | |||||
Math.floor(scaleByMapSize(4, 6)), | |||||
Math.floor(scaleByMapSize(16, 30)), | |||||
1, | |||||
randIntExclusive(0.28 * mapSize, 0.34 * mapSize), | |||||
randIntExclusive(0.1 * mapSize, 0.9 * mapSize)); | |||||
var terrainPainter = new LayeredPainter( | var terrainPainter = new LayeredPainter( | ||||
[tGrass, tGrass], // terrains | [tGrass, tGrass], // terrains | ||||
[2] // widths | [2] // widths | ||||
); | ); | ||||
var elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3, 3); | var elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3, 3); | ||||
createArea( | createArea( | ||||
placer, | placer, | ||||
[terrainPainter, elevationPainter, unPaintClass(clWater)], | [terrainPainter, elevationPainter, unPaintClass(clWater)], | ||||
▲ Show 20 Lines • Show All 211 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(oBush, 5,7, 0,4)], | [new SimpleObject(oBush, 5,7, 0,4)], | ||||
true, clFood | true, clFood | ||||
); | ); | ||||
createObjectGroups(group, 0, | createObjectGroups(group, 0, | ||||
avoidClasses(clWater, 6, clForest, 0, clPlayer, 20, clHill, 1, clFood, 10), | avoidClasses(clWater, 6, clForest, 0, clPlayer, 20, clHill, 1, clFood, 10), | ||||
randInt(1, 4) * numPlayers + 2, 50 | randIntInclusive(1, 4) * numPlayers + 2, 50 | ||||
); | ); | ||||
// create sheep | // create sheep | ||||
log("Creating sheep..."); | log("Creating sheep..."); | ||||
group = new SimpleGroup( | group = new SimpleGroup( | ||||
[new SimpleObject(oSheep, 2,3, 0,2)], | [new SimpleObject(oSheep, 2,3, 0,2)], | ||||
true, clFood | true, clFood | ||||
); | ); | ||||
Show All 35 Lines |
Wildfire Games · Phabricator