Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/maps/random/unknown.js
Show First 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | |||||
const clRock = g_Map.createTileClass(); | const clRock = g_Map.createTileClass(); | ||||
const clMetal = g_Map.createTileClass(); | const clMetal = g_Map.createTileClass(); | ||||
const clFood = g_Map.createTileClass(); | const clFood = g_Map.createTileClass(); | ||||
const clPeninsulaSteam = g_Map.createTileClass(); | const clPeninsulaSteam = g_Map.createTileClass(); | ||||
const clBaseResource = g_Map.createTileClass(); | const clBaseResource = g_Map.createTileClass(); | ||||
const clLand = g_Map.createTileClass(); | const clLand = g_Map.createTileClass(); | ||||
const clShallow = g_Map.createTileClass(); | const clShallow = g_Map.createTileClass(); | ||||
var landElevationPainter = new SmoothElevationPainter(ELEVATION_SET, heightLand, 4); | const landElevationPainter = new SmoothElevationPainter(ELEVATION_SET, heightLand, 4); | ||||
var unknownMapFunctions = { | const unknownMapFunctions = { | ||||
"land": [ | "land": [ | ||||
"Continent", | "Continent", | ||||
"Isthmus", | "Isthmus", | ||||
"CentralRiverLand", | "CentralRiverLand", | ||||
"EdgeSeas", | "EdgeSeas", | ||||
"Gulf", | "Gulf", | ||||
"Lakes", | "Lakes", | ||||
"Passes", | "Passes", | ||||
"Lowlands", | "Lowlands", | ||||
"Mainland" | "Mainland" | ||||
], | ], | ||||
"naval": [ | "naval": [ | ||||
"CentralSea", | "CentralSea", | ||||
"CentralRiverNaval", | "CentralRiverNaval", | ||||
"Archipelago", | "Archipelago", | ||||
"RiversAndLake" | "RiversAndLake" | ||||
] | ] | ||||
}; | }; | ||||
/** | /** | ||||
* The player IDs and locations shall only be determined by the landscape functions if it's not a nomad game, | * The player IDs and locations shall only be determined by the landscape functions if it's not a nomad game, | ||||
* because nomad maps randomize the locations after the terrain generation. | * because nomad maps randomize the locations after the terrain generation. | ||||
* The locations should only determined by the landscape functions to avoid placing bodies of water and resources into civic centers and the starting resources. | * The locations should only determined by the landscape functions to avoid placing bodies of water and resources into civic centers and the starting resources. | ||||
*/ | */ | ||||
var playerIDs = sortAllPlayers(); | let playerIDs = sortAllPlayers(); | ||||
var playerPosition = []; | let playerPosition = []; | ||||
var g_StartingTreasures = false; | let g_StartingTreasures = false; | ||||
var g_StartingWalls = true; | let g_StartingWalls = true; | ||||
function createUnknownMap() | function createUnknownMap() | ||||
{ | { | ||||
const landscape = g_MapSettings.Landscape || pickRandom([...unknownMapFunctions.land, ...unknownMapFunctions.naval]); | const landscape = g_MapSettings.Landscape || pickRandom([...unknownMapFunctions.land, ...unknownMapFunctions.naval]); | ||||
global["unknown" + landscape](); | global["unknown" + landscape](); | ||||
paintUnknownMapBasedOnHeight(); | paintUnknownMapBasedOnHeight(); | ||||
▲ Show 20 Lines • Show All 492 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator