Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/maps/random/cycladic_archipelago.js
Show First 20 Lines • Show All 79 Lines • ▼ Show 20 Lines | |||||
const centralIslandRadius = scaleByMapSize(15, 30); | const centralIslandRadius = scaleByMapSize(15, 30); | ||||
const centralIslandCount = Math.floor(scaleByMapSize(1, 4)); | const centralIslandCount = Math.floor(scaleByMapSize(1, 4)); | ||||
const centralIslandPosition = new Array(numPlayers).fill(0).map((v, i) => | const centralIslandPosition = new Array(numPlayers).fill(0).map((v, i) => | ||||
Vector2D.add(mapCenter, new Vector2D(fractionToTiles(randFloat(0.1, 0.16)), 0).rotate( | Vector2D.add(mapCenter, new Vector2D(fractionToTiles(randFloat(0.1, 0.16)), 0).rotate( | ||||
-startAngle - Math.PI * (i * 2 / centralIslandCount + randFloat(-1, 1) / 8)).round())); | -startAngle - Math.PI * (i * 2 / centralIslandCount + randFloat(-1, 1) / 8)).round())); | ||||
const areas = []; | const areas = []; | ||||
var nPlayer = 0; | let nPlayer = 0; | ||||
var playerPosition = []; | const playerPosition = []; | ||||
function createCycladicArchipelagoIsland(position, tileClass, radius, coralRadius) | function createCycladicArchipelagoIsland(position, tileClass, radius, coralRadius) | ||||
{ | { | ||||
// Deep ocean rocks | // Deep ocean rocks | ||||
createArea( | createArea( | ||||
new ClumpPlacer(diskArea(radius + coralRadius), 0.7, 0.1, Infinity, position), | new ClumpPlacer(diskArea(radius + coralRadius), 0.7, 0.1, Infinity, position), | ||||
[ | [ | ||||
new LayeredPainter([tOceanRockDeep, tOceanCoral], [5]), | new LayeredPainter([tOceanRockDeep, tOceanCoral], [5]), | ||||
▲ Show 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | createAreasInAreas( | ||||
scaleByMapSize(5, 30), 15, | scaleByMapSize(5, 30), 15, | ||||
areas); | areas); | ||||
Engine.SetProgress(38); | Engine.SetProgress(38); | ||||
paintTileClassBasedOnHeight(-Infinity, 0, Elevation_ExcludeMin_ExcludeMax, clWater); | paintTileClassBasedOnHeight(-Infinity, 0, Elevation_ExcludeMin_ExcludeMax, clWater); | ||||
g_Map.log("Creating forests"); | g_Map.log("Creating forests"); | ||||
var forestTypes = [ | const forestTypes = [ | ||||
[[tForestFloor, tGrass, pPalmForest], [tForestFloor, pPalmForest]], | [[tForestFloor, tGrass, pPalmForest], [tForestFloor, pPalmForest]], | ||||
[[tForestFloor, tGrass, pPineForest], [tForestFloor, pPineForest]], | [[tForestFloor, tGrass, pPineForest], [tForestFloor, pPineForest]], | ||||
[[tForestFloor, tGrass, pPoplarForest], [tForestFloor, pPoplarForest]], | [[tForestFloor, tGrass, pPoplarForest], [tForestFloor, pPoplarForest]], | ||||
[[tForestFloor, tGrass, pMainForest], [tForestFloor, pMainForest]] | [[tForestFloor, tGrass, pMainForest], [tForestFloor, pMainForest]] | ||||
]; | ]; | ||||
for (const type of forestTypes) | for (const type of forestTypes) | ||||
createAreasInAreas( | createAreasInAreas( | ||||
▲ Show 20 Lines • Show All 167 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator