Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/maps/random/island_stronghold.js
Show First 20 Lines • Show All 259 Lines • ▼ Show 20 Lines | |||||
let landAreaLen; | let landAreaLen; | ||||
let numIslands = scaleByMapSize(4, 14); | let numIslands = scaleByMapSize(4, 14); | ||||
for (let i = 0; i < numIslands; ++i) | for (let i = 0; i < numIslands; ++i) | ||||
{ | { | ||||
landAreaLen = landAreas.length; | landAreaLen = landAreas.length; | ||||
if (!landAreaLen) | if (!landAreaLen) | ||||
break; | break; | ||||
chosenPoint = landAreas[randInt(landAreaLen)]; | chosenPoint = pickRandom(landAreas); | ||||
// create big islands | // create big islands | ||||
let placer = new ChainPlacer(floor(scaleByMapSize(4, 8)), floor(scaleByMapSize(8, 14)), floor(scaleByMapSize(25, 60)), 0.07, chosenPoint[0], chosenPoint[1], scaleByMapSize(30, 70)); | let placer = new ChainPlacer(floor(scaleByMapSize(4, 8)), floor(scaleByMapSize(8, 14)), floor(scaleByMapSize(25, 60)), 0.07, chosenPoint[0], chosenPoint[1], scaleByMapSize(30, 70)); | ||||
let terrainPainter = new LayeredPainter( | let terrainPainter = new LayeredPainter( | ||||
[tMainTerrain, tMainTerrain], // terrains | [tMainTerrain, tMainTerrain], // terrains | ||||
[2] // widths | [2] // widths | ||||
); | ); | ||||
Show All 26 Lines | |||||
log("Creating small islands..."); | log("Creating small islands..."); | ||||
numIslands = scaleByMapSize(6, 18) * scaleByMapSize(1, 3); | numIslands = scaleByMapSize(6, 18) * scaleByMapSize(1, 3); | ||||
for (let i = 0; i < numIslands; ++i) | for (let i = 0; i < numIslands; ++i) | ||||
{ | { | ||||
landAreaLen = landAreas.length; | landAreaLen = landAreas.length; | ||||
if (!landAreaLen) | if (!landAreaLen) | ||||
break; | break; | ||||
chosenPoint = landAreas[randInt(0, landAreaLen)]; | chosenPoint = pickRandom(landAreas); | ||||
let placer = new ChainPlacer(floor(scaleByMapSize(4, 7)), floor(scaleByMapSize(7, 10)), floor(scaleByMapSize(16, 40)), 0.07, chosenPoint[0], chosenPoint[1], scaleByMapSize(22, 40)); | let placer = new ChainPlacer(floor(scaleByMapSize(4, 7)), floor(scaleByMapSize(7, 10)), floor(scaleByMapSize(16, 40)), 0.07, chosenPoint[0], chosenPoint[1], scaleByMapSize(22, 40)); | ||||
let terrainPainter = new LayeredPainter( | let terrainPainter = new LayeredPainter( | ||||
[tMainTerrain, tMainTerrain], // terrains | [tMainTerrain, tMainTerrain], // terrains | ||||
[2] // widths | [2] // widths | ||||
); | ); | ||||
let elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3, 6); | let elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3, 6); | ||||
▲ Show 20 Lines • Show All 242 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator