Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/maps/random/flood.js
Show First 20 Lines • Show All 218 Lines • ▼ Show 20 Lines | |||||
); | ); | ||||
elevationPainter = new SmoothElevationPainter( | elevationPainter = new SmoothElevationPainter( | ||||
ELEVATION_SET, // type | ELEVATION_SET, // type | ||||
elevation, // elevation | elevation, // elevation | ||||
shoreRadius // blend radius | shoreRadius // blend radius | ||||
); | ); | ||||
createArea(placer, [terrainPainter, elevationPainter, paintClass(clHill)], avoidClasses(clPlayer, 40)); | createArea(placer, [terrainPainter, elevationPainter, paintClass(clHill)], avoidClasses(clPlayer, 40)); | ||||
let randMountains = 20 + randInt(15); | for (let m = 0; m < randIntInclusive(20, 34); ++m) | ||||
for (let m = 0; m < randMountains; ++m) | |||||
{ | { | ||||
let randX = randInt(mapSize); | let placer = new ChainPlacer( | ||||
let randY = randInt(mapSize); | Math.floor(scaleByMapSize(7, 7)), | ||||
let placer = new ChainPlacer(floor(scaleByMapSize(7, 7)), floor(scaleByMapSize(15, 15)), floor(scaleByMapSize(15, 20)), 1, randX, randY, 0, [floor(mapSize * 0.01)]); | Math.floor(scaleByMapSize(15, 15)), | ||||
let elevRand = 6 + randInt(15); | Math.floor(scaleByMapSize(15, 20)), | ||||
1, | |||||
randIntExclusive(0, mapSize), | |||||
randIntExclusive(0, mapSize), | |||||
0, | |||||
[Math.floor(mapSize * 0.01)]); | |||||
let elevRand = randIntInclusive(6, 20); | |||||
let terrainPainter = new LayeredPainter( | let terrainPainter = new LayeredPainter( | ||||
[tDirt, tHill], // terrains | [tDirt, tHill], // terrains | ||||
[floor(elevRand / 3), 40] // widths | [floor(elevRand / 3), 40] // widths | ||||
); | ); | ||||
let elevationPainter = new SmoothElevationPainter( | let elevationPainter = new SmoothElevationPainter( | ||||
ELEVATION_SET, // type | ELEVATION_SET, // type | ||||
elevRand, // elevation | elevRand, // elevation | ||||
floor(elevRand / 3) // blend radius | floor(elevRand / 3) // blend radius | ||||
); | ); | ||||
createArea(placer, [terrainPainter, elevationPainter, paintClass(clHill)], [avoidClasses(clBaseResource, 2, clPlayer, 40), stayClasses(clHill, 6)]); | createArea(placer, [terrainPainter, elevationPainter, paintClass(clHill)], [avoidClasses(clBaseResource, 2, clPlayer, 40), stayClasses(clHill, 6)]); | ||||
} | } | ||||
randMountains = 8 + randInt(10); | for (let m = 0; m < randIntInclusive(8, 17); ++m) | ||||
for (let m = 0; m < randMountains; ++m) | |||||
{ | { | ||||
let randX = randInt(mapSize); | let placer = new ChainPlacer( | ||||
let randY = randInt(mapSize); | Math.floor(scaleByMapSize(5, 5)), | ||||
let placer = new ChainPlacer(floor(scaleByMapSize(5, 5)), floor(scaleByMapSize(8, 8)), floor(scaleByMapSize(15, 20)), 1, randX, randY, 0, [floor(mapSize * 0.01)]); | Math.floor(scaleByMapSize(8, 8)), | ||||
let elevRand = 15 + randInt(15); | Math.floor(scaleByMapSize(15, 20)), | ||||
1, | |||||
randIntExclusive(0, mapSize), | |||||
randIntExclusive(0, mapSize), | |||||
0, | |||||
[Math.floor(mapSize * 0.01)]); | |||||
let elevRand = randIntInclusive(15, 29); | |||||
let terrainPainter = new LayeredPainter( | let terrainPainter = new LayeredPainter( | ||||
[tCliff, tForestFloor2], // terrains | [tCliff, tForestFloor2], // terrains | ||||
[floor(elevRand / 3), 40] // widths | [floor(elevRand / 3), 40] // widths | ||||
); | ); | ||||
let elevationPainter = new SmoothElevationPainter( | let elevationPainter = new SmoothElevationPainter( | ||||
ELEVATION_MODIFY, // type | ELEVATION_MODIFY, // type | ||||
elevRand, // elevation | elevRand, // elevation | ||||
floor(elevRand / 3) // blend radius | floor(elevRand / 3) // blend radius | ||||
▲ Show 20 Lines • Show All 150 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator