mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-02 09:27:03 +00:00
Remove isNomad from rmgen-common
This removes a usage of the global `g_MapSettings`.
The conversion to bool isn't required.
`mapSettings` (non-global) is available since e01ea16ae5.
This commit is contained in:
@@ -35,7 +35,7 @@ export function* generateMap(mapSettings)
|
|||||||
undefined),
|
undefined),
|
||||||
playerbaseTypes[mapSettings.PlayerPlacement].walls);
|
playerbaseTypes[mapSettings.PlayerPlacement].walls);
|
||||||
|
|
||||||
if (!isNomad())
|
if (!mapSettings.Nomad)
|
||||||
markPlayerAvoidanceArea(playerPosition, defaultPlayerBaseRadius());
|
markPlayerAvoidanceArea(playerPosition, defaultPlayerBaseRadius());
|
||||||
|
|
||||||
yield 20;
|
yield 20;
|
||||||
@@ -63,7 +63,7 @@ export function* generateMap(mapSettings)
|
|||||||
]);
|
]);
|
||||||
yield 30;
|
yield 30;
|
||||||
|
|
||||||
if (!isNomad())
|
if (!mapSettings.Nomad)
|
||||||
createBluffsPassages(playerPosition);
|
createBluffsPassages(playerPosition);
|
||||||
|
|
||||||
addElements([
|
addElements([
|
||||||
@@ -224,7 +224,7 @@ export function* generateMap(mapSettings)
|
|||||||
]));
|
]));
|
||||||
yield 90;
|
yield 90;
|
||||||
|
|
||||||
if (isNomad())
|
if (mapSettings.Nomad)
|
||||||
{
|
{
|
||||||
g_Map.log("Preventing units to be spawned at the map border");
|
g_Map.log("Preventing units to be spawned at the map border");
|
||||||
createArea(
|
createArea(
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ export function* generateMap(mapSettings)
|
|||||||
]);
|
]);
|
||||||
yield 45;
|
yield 45;
|
||||||
|
|
||||||
if (!isNomad())
|
if (!mapSettings.Nomad)
|
||||||
{
|
{
|
||||||
g_Map.log("Placing players");
|
g_Map.log("Placing players");
|
||||||
const [playerIDs, playerPosition] = createBases(
|
const [playerIDs, playerPosition] = createBases(
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ Engine.LoadLibrary("rmgen");
|
|||||||
Engine.LoadLibrary("rmgen-common");
|
Engine.LoadLibrary("rmgen-common");
|
||||||
Engine.LoadLibrary("heightmap");
|
Engine.LoadLibrary("heightmap");
|
||||||
|
|
||||||
export function* generateMap()
|
export function* generateMap(mapSettings)
|
||||||
{
|
{
|
||||||
const tPrimary = ["temp_grass", "temp_grass_b", "temp_grass_c", "temp_grass_d",
|
const tPrimary = ["temp_grass", "temp_grass_b", "temp_grass_c", "temp_grass_d",
|
||||||
"temp_grass_long_b", "temp_grass_clovers_2", "temp_grass_mossy", "temp_grass_plants"];
|
"temp_grass_long_b", "temp_grass_clovers_2", "temp_grass_mossy", "temp_grass_plants"];
|
||||||
@@ -261,7 +261,7 @@ export function* generateMap()
|
|||||||
|
|
||||||
yield 90;
|
yield 90;
|
||||||
|
|
||||||
if (isNomad())
|
if (mapSettings.Nomad)
|
||||||
placePlayersNomad(g_Map.createTileClass(),
|
placePlayersNomad(g_Map.createTileClass(),
|
||||||
new HeightConstraint(lowerHeightLimit, upperHeightLimit));
|
new HeightConstraint(lowerHeightLimit, upperHeightLimit));
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ Engine.LoadLibrary("rmgen-common");
|
|||||||
Engine.LoadLibrary("rmbiome");
|
Engine.LoadLibrary("rmbiome");
|
||||||
Engine.LoadLibrary("heightmap");
|
Engine.LoadLibrary("heightmap");
|
||||||
|
|
||||||
export function* generateMap()
|
export function* generateMap(mapSettings)
|
||||||
{
|
{
|
||||||
const tGrove = "temp_grass_plants";
|
const tGrove = "temp_grass_plants";
|
||||||
const tPath = "road_rome_a";
|
const tPath = "road_rome_a";
|
||||||
@@ -614,7 +614,7 @@ export function* generateMap()
|
|||||||
yield 80;
|
yield 80;
|
||||||
|
|
||||||
g_Map.log("Placing players");
|
g_Map.log("Placing players");
|
||||||
if (isNomad())
|
if (mapSettings.Nomad)
|
||||||
placePlayersNomad(g_Map.createTileClass(),
|
placePlayersNomad(g_Map.createTileClass(),
|
||||||
new HeightConstraint(heighLimits[4], heighLimits[5]));
|
new HeightConstraint(heighLimits[4], heighLimits[5]));
|
||||||
else
|
else
|
||||||
@@ -628,7 +628,7 @@ export function* generateMap()
|
|||||||
for (let i = 0; i < resourceSpots.length; ++i)
|
for (let i = 0; i < resourceSpots.length; ++i)
|
||||||
{
|
{
|
||||||
const pos = new Vector2D(resourceSpots[i].x, resourceSpots[i].y);
|
const pos = new Vector2D(resourceSpots[i].x, resourceSpots[i].y);
|
||||||
const choice = i % (isNomad() ? 4 : 5);
|
const choice = i % (mapSettings.Nomad ? 4 : 5);
|
||||||
if (choice == 0)
|
if (choice == 0)
|
||||||
placeMine(pos, "gaia/rock/temperate_large_02");
|
placeMine(pos, "gaia/rock/temperate_large_02");
|
||||||
if (choice == 1)
|
if (choice == 1)
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ export function* generateMap(mapSettings)
|
|||||||
const clFood = g_Map.createTileClass();
|
const clFood = g_Map.createTileClass();
|
||||||
const clBaseResource = g_Map.createTileClass();
|
const clBaseResource = g_Map.createTileClass();
|
||||||
|
|
||||||
const playerHillRadius = defaultPlayerBaseRadius() / (isNomad() ? 1.5 : 1);
|
const playerHillRadius = defaultPlayerBaseRadius() / (mapSettings.Nomad ? 1.5 : 1);
|
||||||
|
|
||||||
const [playerIDs, playerPosition, playerAngle] = playerPlacementCircle(fractionToTiles(0.35));
|
const [playerIDs, playerPosition, playerAngle] = playerPlacementCircle(fractionToTiles(0.35));
|
||||||
|
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ export function* generateMap(mapSettings)
|
|||||||
[
|
[
|
||||||
new TerrainPainter(tMainTerrain),
|
new TerrainPainter(tMainTerrain),
|
||||||
new SmoothElevationPainter(ELEVATION_SET, heightLand, 2),
|
new SmoothElevationPainter(ELEVATION_SET, heightLand, 2),
|
||||||
new TileClassPainter(j == 1 || isNomad() ? clLand : clPlayer)
|
new TileClassPainter(j == 1 || mapSettings.Nomad ? clLand : clPlayer)
|
||||||
]);
|
]);
|
||||||
|
|
||||||
g_Map.log("Creating center area");
|
g_Map.log("Creating center area");
|
||||||
|
|||||||
@@ -254,7 +254,7 @@ export function* generateMap(mapSettings)
|
|||||||
"length": 0,
|
"length": 0,
|
||||||
"indent": 4,
|
"indent": 4,
|
||||||
"bend": 0,
|
"bend": 0,
|
||||||
"templateName": mapSize >= normalMapSize ? (isNomad() ? oSentryTower : oTower) :
|
"templateName": mapSize >= normalMapSize ? (mapSettings.Nomad ? oSentryTower : oTower) :
|
||||||
oWatchTower
|
oWatchTower
|
||||||
},
|
},
|
||||||
"pillar": readyWallElement(oPalisadePillar),
|
"pillar": readyWallElement(oPalisadePillar),
|
||||||
@@ -734,7 +734,7 @@ export function* generateMap(mapSettings)
|
|||||||
clFood);
|
clFood);
|
||||||
|
|
||||||
g_Map.log("Creating violent animals");
|
g_Map.log("Creating violent animals");
|
||||||
if (!isNomad())
|
if (!mapSettings.Nomad)
|
||||||
createFood(
|
createFood(
|
||||||
[
|
[
|
||||||
[new SimpleObject(oWolf, 1, 3, 0, 4)],
|
[new SimpleObject(oWolf, 1, 3, 0, 4)],
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
Engine.LoadLibrary("rmgen");
|
Engine.LoadLibrary("rmgen");
|
||||||
Engine.LoadLibrary("rmgen-common");
|
Engine.LoadLibrary("rmgen-common");
|
||||||
|
|
||||||
export function* generateMap()
|
export function* generateMap(mapSettings)
|
||||||
{
|
{
|
||||||
TILE_CENTERED_HEIGHT_MAP = true;
|
TILE_CENTERED_HEIGHT_MAP = true;
|
||||||
|
|
||||||
@@ -123,7 +123,7 @@ export function* generateMap()
|
|||||||
new TerrainPainter(tPrimary),
|
new TerrainPainter(tPrimary),
|
||||||
new SmoothElevationPainter(ELEVATION_SET, heightLand, 4),
|
new SmoothElevationPainter(ELEVATION_SET, heightLand, 4),
|
||||||
new TileClassPainter(clIsland)
|
new TileClassPainter(clIsland)
|
||||||
].concat(isNomad() ? [] : [new TileClassPainter(clPlayerIsland)]));
|
].concat(mapSettings.Nomad ? [] : [new TileClassPainter(clPlayerIsland)]));
|
||||||
yield 10;
|
yield 10;
|
||||||
|
|
||||||
g_Map.log("Creating islands");
|
g_Map.log("Creating islands");
|
||||||
|
|||||||
@@ -505,7 +505,7 @@ export function* generateMap(mapSettings)
|
|||||||
50);
|
50);
|
||||||
yield 83;
|
yield 83;
|
||||||
|
|
||||||
if (!isNomad())
|
if (!mapSettings.Nomad)
|
||||||
{
|
{
|
||||||
g_Map.log("Creating lions");
|
g_Map.log("Creating lions");
|
||||||
createObjectGroups(
|
createObjectGroups(
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ export function* generateMap(mapSettings)
|
|||||||
undefined);
|
undefined);
|
||||||
|
|
||||||
g_Map.log("Creating CC mountains");
|
g_Map.log("Creating CC mountains");
|
||||||
if (!isNomad())
|
if (!mapSettings.Nomad)
|
||||||
for (let i = 0; i < numPlayers; ++i)
|
for (let i = 0; i < numPlayers; ++i)
|
||||||
{
|
{
|
||||||
// This one consists of many bumps, creating an omnidirectional ramp
|
// This one consists of many bumps, creating an omnidirectional ramp
|
||||||
@@ -299,7 +299,7 @@ export function* generateMap(mapSettings)
|
|||||||
100);
|
100);
|
||||||
yield 65;
|
yield 65;
|
||||||
|
|
||||||
if (!isNomad())
|
if (!mapSettings.Nomad)
|
||||||
{
|
{
|
||||||
g_Map.log("Creating towers");
|
g_Map.log("Creating towers");
|
||||||
createObjectGroupsDeprecated(
|
createObjectGroupsDeprecated(
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ export function* generateMap(mapSettings)
|
|||||||
const oField = "structures/kush/field";
|
const oField = "structures/kush/field";
|
||||||
const oPyramid = "structures/kush/pyramid_small";
|
const oPyramid = "structures/kush/pyramid_small";
|
||||||
const oPyramidLarge = "structures/kush/pyramid_large";
|
const oPyramidLarge = "structures/kush/pyramid_large";
|
||||||
const oKushUnits = isNomad() ?
|
const oKushUnits = mapSettings.Nomad ?
|
||||||
"units/kush/support_female_citizen" :
|
"units/kush/support_female_citizen" :
|
||||||
"units/kush/infantry_javelineer_merc_e";
|
"units/kush/infantry_javelineer_merc_e";
|
||||||
|
|
||||||
@@ -395,7 +395,7 @@ export function* generateMap(mapSettings)
|
|||||||
50);
|
50);
|
||||||
|
|
||||||
g_Map.log("Creating lions");
|
g_Map.log("Creating lions");
|
||||||
if (!isNomad())
|
if (!mapSettings.Nomad)
|
||||||
createObjectGroups(
|
createObjectGroups(
|
||||||
new SimpleGroup([new SimpleObject(oLion, 2, 3, 0, 2)], true, clFood),
|
new SimpleGroup([new SimpleObject(oLion, 2, 3, 0, 2)], true, clFood),
|
||||||
0,
|
0,
|
||||||
@@ -450,7 +450,7 @@ export function* generateMap(mapSettings)
|
|||||||
clRiver, 15,
|
clRiver, 15,
|
||||||
clKushiteVillages, 15),
|
clKushiteVillages, 15),
|
||||||
clForest,
|
clForest,
|
||||||
stragglerTrees * (isNomad() ? 3 : 1));
|
stragglerTrees * (mapSettings.Nomad ? 3 : 1));
|
||||||
|
|
||||||
createStragglerTrees(
|
createStragglerTrees(
|
||||||
[oDatePalm, oSDatePalm],
|
[oDatePalm, oSDatePalm],
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
Engine.LoadLibrary("rmgen");
|
Engine.LoadLibrary("rmgen");
|
||||||
Engine.LoadLibrary("rmgen-common");
|
Engine.LoadLibrary("rmgen-common");
|
||||||
|
|
||||||
export function* generateMap()
|
export function* generateMap(mapSettings)
|
||||||
{
|
{
|
||||||
const tGrass = ["temperate_grass_04", "temperate_grass_03", "temperate_grass_04"];
|
const tGrass = ["temperate_grass_04", "temperate_grass_03", "temperate_grass_04"];
|
||||||
const tForestFloor = "temperate_forestfloor_01";
|
const tForestFloor = "temperate_forestfloor_01";
|
||||||
@@ -74,7 +74,7 @@ export function* generateMap()
|
|||||||
const playerAngle = BUILDING_ORIENTATION;
|
const playerAngle = BUILDING_ORIENTATION;
|
||||||
for (let i = 0; i < numPlayers; ++i)
|
for (let i = 0; i < numPlayers; ++i)
|
||||||
{
|
{
|
||||||
if (isNomad())
|
if (mapSettings.Nomad)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// CC and units
|
// CC and units
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ export function* generateMap(mapSettings)
|
|||||||
|
|
||||||
yield 20;
|
yield 20;
|
||||||
|
|
||||||
if (!isNomad())
|
if (!mapSettings.Nomad)
|
||||||
{
|
{
|
||||||
createBases(
|
createBases(
|
||||||
...playerPlacementByPattern(
|
...playerPlacementByPattern(
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ export function* generateMap(mapSettings)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isNomad())
|
if (mapSettings.Nomad)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
g_Map.log("Finding player locations");
|
g_Map.log("Finding player locations");
|
||||||
@@ -191,7 +191,7 @@ export function* generateMap(mapSettings)
|
|||||||
}
|
}
|
||||||
yield 35;
|
yield 35;
|
||||||
|
|
||||||
if (!isNomad())
|
if (!mapSettings.Nomad)
|
||||||
{
|
{
|
||||||
g_Map.log("Flattening initial CC area");
|
g_Map.log("Flattening initial CC area");
|
||||||
const playerRadius = defaultPlayerBaseRadius() * 0.8;
|
const playerRadius = defaultPlayerBaseRadius() * 0.8;
|
||||||
@@ -246,7 +246,7 @@ export function* generateMap(mapSettings)
|
|||||||
|
|
||||||
for (let i = 0; i < numPlayers; ++i)
|
for (let i = 0; i < numPlayers; ++i)
|
||||||
{
|
{
|
||||||
if (isNomad())
|
if (mapSettings.Nomad)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
const localBiome = constraintHighlands.allows(playerPosition[i]) ? biomes.highlands :
|
const localBiome = constraintHighlands.allows(playerPosition[i]) ? biomes.highlands :
|
||||||
|
|||||||
@@ -274,7 +274,7 @@ export function* generateMap(mapSettings)
|
|||||||
if (currentBiome() == "generic/autumn")
|
if (currentBiome() == "generic/autumn")
|
||||||
spineTerrain = g_Terrains.tier4Terrain;
|
spineTerrain = g_Terrains.tier4Terrain;
|
||||||
|
|
||||||
const spineCount = isNomad() ? randIntInclusive(1, 4) : teamsArray.length;
|
const spineCount = mapSettings.Nomad ? randIntInclusive(1, 4) : teamsArray.length;
|
||||||
|
|
||||||
for (let i = 0; i < spineCount; ++i)
|
for (let i = 0; i < spineCount; ++i)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ export function* generateMap(mapSettings)
|
|||||||
|
|
||||||
for (let i = 0; i < teams.length; ++i)
|
for (let i = 0; i < teams.length; ++i)
|
||||||
{
|
{
|
||||||
if (!teams[i] || isNomad())
|
if (!teams[i] || mapSettings.Nomad)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
++teamNo;
|
++teamNo;
|
||||||
@@ -212,8 +212,8 @@ export function* generateMap(mapSettings)
|
|||||||
g_Map.log("Creating big islands");
|
g_Map.log("Creating big islands");
|
||||||
createAreas(
|
createAreas(
|
||||||
new ChainPlacer(
|
new ChainPlacer(
|
||||||
Math.floor(scaleByMapSize(4, 8) * (isNomad() ? 2 : 1)),
|
Math.floor(scaleByMapSize(4, 8) * (mapSettings.Nomad ? 2 : 1)),
|
||||||
Math.floor(scaleByMapSize(8, 16) * (isNomad() ? 2 : 1)),
|
Math.floor(scaleByMapSize(8, 16) * (mapSettings.Nomad ? 2 : 1)),
|
||||||
Math.floor(scaleByMapSize(25, 60)),
|
Math.floor(scaleByMapSize(25, 60)),
|
||||||
0.07,
|
0.07,
|
||||||
undefined,
|
undefined,
|
||||||
@@ -224,7 +224,7 @@ export function* generateMap(mapSettings)
|
|||||||
new TileClassPainter(clLand)
|
new TileClassPainter(clLand)
|
||||||
],
|
],
|
||||||
avoidClasses(clLand, 3, clPlayer, 3),
|
avoidClasses(clLand, 3, clPlayer, 3),
|
||||||
scaleByMapSize(4, 14) * (isNomad() ? 2 : 1),
|
scaleByMapSize(4, 14) * (mapSettings.Nomad ? 2 : 1),
|
||||||
1);
|
1);
|
||||||
|
|
||||||
g_Map.log("Creating small islands");
|
g_Map.log("Creating small islands");
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ export function* generateMap(mapSettings)
|
|||||||
|
|
||||||
const [playerIDs, playerPosition, playerAngle] = playerPlacementCircle(fractionToTiles(0.35));
|
const [playerIDs, playerPosition, playerAngle] = playerPlacementCircle(fractionToTiles(0.35));
|
||||||
|
|
||||||
if (!isNomad())
|
if (!mapSettings.Nomad)
|
||||||
{
|
{
|
||||||
g_Map.log("Creating player islands and docks");
|
g_Map.log("Creating player islands and docks");
|
||||||
for (let i = 0; i < numPlayers; i++)
|
for (let i = 0; i < numPlayers; i++)
|
||||||
|
|||||||
@@ -433,7 +433,7 @@ export function* generateMap(mapSettings)
|
|||||||
0.05 * Math.PI,
|
0.05 * Math.PI,
|
||||||
0.55 * Math.PI);
|
0.55 * Math.PI);
|
||||||
|
|
||||||
if (!isNomad())
|
if (!mapSettings.Nomad)
|
||||||
{
|
{
|
||||||
g_Map.log("Marking player positions");
|
g_Map.log("Marking player positions");
|
||||||
for (const position of playerPosition)
|
for (const position of playerPosition)
|
||||||
@@ -1271,7 +1271,7 @@ export function* generateMap(mapSettings)
|
|||||||
[areaDesert]);
|
[areaDesert]);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let i = 0; i < (isNomad() ? scaleByMapSize(6, 16) : scaleByMapSize(0, 8)); ++i)
|
for (let i = 0; i < (mapSettings.Nomad ? scaleByMapSize(6, 16) : scaleByMapSize(0, 8)); ++i)
|
||||||
{
|
{
|
||||||
const mineObjectsBiome = pickRandom(mineObjectsPerBiome);
|
const mineObjectsBiome = pickRandom(mineObjectsPerBiome);
|
||||||
createObjectGroupsByAreas(
|
createObjectGroupsByAreas(
|
||||||
@@ -1351,7 +1351,7 @@ export function* generateMap(mapSettings)
|
|||||||
50,
|
50,
|
||||||
[areaDesert]);
|
[areaDesert]);
|
||||||
|
|
||||||
if (!isNomad())
|
if (!mapSettings.Nomad)
|
||||||
{
|
{
|
||||||
g_Map.log("Creating lions");
|
g_Map.log("Creating lions");
|
||||||
createObjectGroupsByAreas(
|
createObjectGroupsByAreas(
|
||||||
@@ -1381,7 +1381,7 @@ export function* generateMap(mapSettings)
|
|||||||
[areaDesert]);
|
[areaDesert]);
|
||||||
|
|
||||||
g_Map.log("Creating crocodiles");
|
g_Map.log("Creating crocodiles");
|
||||||
if (!isNomad())
|
if (!mapSettings.Nomad)
|
||||||
createObjectGroupsByAreas(
|
createObjectGroupsByAreas(
|
||||||
new SimpleGroup([new SimpleObject(oCrocodile, 2, 3, 3, 5)], true, clFood),
|
new SimpleGroup([new SimpleObject(oCrocodile, 2, 3, 3, 5)], true, clFood),
|
||||||
0,
|
0,
|
||||||
@@ -1467,7 +1467,7 @@ export function* generateMap(mapSettings)
|
|||||||
avoidCollisions,
|
avoidCollisions,
|
||||||
new NearTileClassConstraint(clPyramid, 10)
|
new NearTileClassConstraint(clPyramid, 10)
|
||||||
]);
|
]);
|
||||||
if (!isNomad())
|
if (!mapSettings.Nomad)
|
||||||
{
|
{
|
||||||
g_Map.log("Placing soldiers near pyramids");
|
g_Map.log("Placing soldiers near pyramids");
|
||||||
createObjectGroupsByAreas(
|
createObjectGroupsByAreas(
|
||||||
|
|||||||
@@ -92,10 +92,10 @@ export function* generateMap(mapSettings)
|
|||||||
new LayeredPainter([tWater, tShore, tMainTerrain], [1, 4]),
|
new LayeredPainter([tWater, tShore, tMainTerrain], [1, 4]),
|
||||||
new SmoothElevationPainter(ELEVATION_SET, heightLand, 4),
|
new SmoothElevationPainter(ELEVATION_SET, heightLand, 4),
|
||||||
new TileClassPainter(clIsland),
|
new TileClassPainter(clIsland),
|
||||||
new TileClassPainter(isNomad() ? clLand : clPlayer)
|
new TileClassPainter(mapSettings.Nomad ? clLand : clPlayer)
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if (isNomad())
|
if (mapSettings.Nomad)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
const dockLocation =
|
const dockLocation =
|
||||||
|
|||||||
@@ -548,7 +548,7 @@ export function* generateMap(mapSettings)
|
|||||||
|
|
||||||
// Den
|
// Den
|
||||||
createArea(
|
createArea(
|
||||||
new ClumpPlacer(diskArea(fractionToTiles(0.1)) / (isNomad() ? 2 : 1), 0.9, 0.3,
|
new ClumpPlacer(diskArea(fractionToTiles(0.1)) / (mapSettings.Nomad ? 2 : 1), 0.9, 0.3,
|
||||||
Infinity, playerPosition),
|
Infinity, playerPosition),
|
||||||
[
|
[
|
||||||
new LayeredPainter([g_Terrains.cliff, base], [3]),
|
new LayeredPainter([g_Terrains.cliff, base], [3]),
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ export function* generateMap(mapSettings)
|
|||||||
|
|
||||||
let playerIDs = [];
|
let playerIDs = [];
|
||||||
let playerPosition = [];
|
let playerPosition = [];
|
||||||
if (!isNomad())
|
if (!mapSettings.Nomad)
|
||||||
{
|
{
|
||||||
g_Map.log("Finding player locations");
|
g_Map.log("Finding player locations");
|
||||||
[playerIDs, playerPosition] = playerPlacementRandom(sortAllPlayers(),
|
[playerIDs, playerPosition] = playerPlacementRandom(sortAllPlayers(),
|
||||||
@@ -386,7 +386,7 @@ export function* generateMap(mapSettings)
|
|||||||
50);
|
50);
|
||||||
yield 80;
|
yield 80;
|
||||||
|
|
||||||
if (!isNomad())
|
if (!mapSettings.Nomad)
|
||||||
{
|
{
|
||||||
g_Map.log("Creating lions");
|
g_Map.log("Creating lions");
|
||||||
createObjectGroups(
|
createObjectGroups(
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ export function* generateMap(mapSettings)
|
|||||||
]);
|
]);
|
||||||
yield 45;
|
yield 45;
|
||||||
|
|
||||||
if (!isNomad())
|
if (!mapSettings.Nomad)
|
||||||
{
|
{
|
||||||
g_Map.log("Placing players");
|
g_Map.log("Placing players");
|
||||||
const [playerIDs, playerPosition] = createBases(
|
const [playerIDs, playerPosition] = createBases(
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ export function* generateMap(mapSettings)
|
|||||||
}
|
}
|
||||||
yield 45;
|
yield 45;
|
||||||
|
|
||||||
if (!isNomad())
|
if (!mapSettings.Nomad)
|
||||||
{
|
{
|
||||||
g_Map.log("Finding player positions");
|
g_Map.log("Finding player positions");
|
||||||
|
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ export function* generateMap(mapSettings)
|
|||||||
new LayeredPainter([tWater, tShore, tMainTerrain], [1, 4]),
|
new LayeredPainter([tWater, tShore, tMainTerrain], [1, 4]),
|
||||||
new SmoothElevationPainter(ELEVATION_SET, heightLand, 4),
|
new SmoothElevationPainter(ELEVATION_SET, heightLand, 4),
|
||||||
new TileClassPainter(clIsland),
|
new TileClassPainter(clIsland),
|
||||||
new TileClassPainter(isNomad() ? clLand : clPlayer)
|
new TileClassPainter(mapSettings.Nomad ? clLand : clPlayer)
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
yield 10;
|
yield 10;
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ export function* generateMap(mapSettings)
|
|||||||
randomAngle(),
|
randomAngle(),
|
||||||
undefined);
|
undefined);
|
||||||
|
|
||||||
if (!isNomad())
|
if (!mapSettings.Nomad)
|
||||||
for (let i = 0; i < numPlayers; ++i)
|
for (let i = 0; i < numPlayers; ++i)
|
||||||
createArea(
|
createArea(
|
||||||
new ClumpPlacer(diskArea(defaultPlayerBaseRadius()), 0.9, 0.5, Infinity,
|
new ClumpPlacer(diskArea(defaultPlayerBaseRadius()), 0.9, 0.5, Infinity,
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ export function* generateMap(mapSettings)
|
|||||||
new SlopeConstraint(2, Infinity));
|
new SlopeConstraint(2, Infinity));
|
||||||
yield 55;
|
yield 55;
|
||||||
|
|
||||||
if (!isNomad())
|
if (!mapSettings.Nomad)
|
||||||
{
|
{
|
||||||
g_Map.log("Placing players");
|
g_Map.log("Placing players");
|
||||||
const [playerIDs, playerPosition] = createBases(
|
const [playerIDs, playerPosition] = createBases(
|
||||||
|
|||||||
@@ -49,11 +49,11 @@ export function* generateMap(mapSettings)
|
|||||||
|
|
||||||
const treasures = [{
|
const treasures = [{
|
||||||
"template": oWoodTreasure,
|
"template": oWoodTreasure,
|
||||||
"count": isNomad() ? 16 : 14
|
"count": mapSettings.Nomad ? 16 : 14
|
||||||
}];
|
}];
|
||||||
|
|
||||||
g_Map.log("Creating player markets");
|
g_Map.log("Creating player markets");
|
||||||
if (!isNomad())
|
if (!mapSettings.Nomad)
|
||||||
for (let i = 0; i < numPlayers; ++i)
|
for (let i = 0; i < numPlayers; ++i)
|
||||||
{
|
{
|
||||||
const marketPos =
|
const marketPos =
|
||||||
@@ -188,7 +188,7 @@ export function* generateMap(mapSettings)
|
|||||||
createFood(
|
createFood(
|
||||||
[
|
[
|
||||||
[new SimpleObject(oArcticFox, 1, 2, 0, 3)],
|
[new SimpleObject(oArcticFox, 1, 2, 0, 3)],
|
||||||
[new SimpleObject(isNomad() ? oArcticFox : oArcticWolf, 4, 6, 0, 4)],
|
[new SimpleObject(mapSettings.Nomad ? oArcticFox : oArcticWolf, 4, 6, 0, 4)],
|
||||||
[new SimpleObject(oWalrus, 2, 3, 0, 2)],
|
[new SimpleObject(oWalrus, 2, 3, 0, 2)],
|
||||||
[new SimpleObject(oMuskox, 2, 3, 0, 2)]
|
[new SimpleObject(oMuskox, 2, 3, 0, 2)]
|
||||||
],
|
],
|
||||||
@@ -246,7 +246,7 @@ export function* generateMap(mapSettings)
|
|||||||
setSunElevation(Math.PI * randFloat(1/9, 1/7));
|
setSunElevation(Math.PI * randFloat(1/9, 1/7));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isNomad())
|
if (mapSettings.Nomad)
|
||||||
{
|
{
|
||||||
const constraint = avoidClasses(clWater, 4, clMetal, 4, clRock, 4, clHill, 4, clFood, 2);
|
const constraint = avoidClasses(clWater, 4, clMetal, 4, clRock, 4, clHill, 4, clFood, 2);
|
||||||
[playerIDs, playerPosition] = placePlayersNomad(clPlayer, constraint);
|
[playerIDs, playerPosition] = placePlayersNomad(clPlayer, constraint);
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ export function* generateMap(mapSettings)
|
|||||||
[areaVesuv]);
|
[areaVesuv]);
|
||||||
yield 48;
|
yield 48;
|
||||||
|
|
||||||
if (!isNomad())
|
if (!mapSettings.Nomad)
|
||||||
{
|
{
|
||||||
g_Map.log("Placing players");
|
g_Map.log("Placing players");
|
||||||
const [playerIDs, playerPosition] = createBases(
|
const [playerIDs, playerPosition] = createBases(
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ export function* generateMap(mapSettings)
|
|||||||
]);
|
]);
|
||||||
yield 45;
|
yield 45;
|
||||||
|
|
||||||
if (!isNomad())
|
if (!mapSettings.Nomad)
|
||||||
{
|
{
|
||||||
g_Map.log("Placing players");
|
g_Map.log("Placing players");
|
||||||
const [playerIDs, playerPosition] = createBases(
|
const [playerIDs, playerPosition] = createBases(
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
Engine.LoadLibrary("rmgen");
|
Engine.LoadLibrary("rmgen");
|
||||||
Engine.LoadLibrary("rmgen-common");
|
Engine.LoadLibrary("rmgen-common");
|
||||||
|
|
||||||
export function* generateMap()
|
export function* generateMap(mapSettings)
|
||||||
{
|
{
|
||||||
const tGrass = [
|
const tGrass = [
|
||||||
"tropic_grass_c",
|
"tropic_grass_c",
|
||||||
@@ -194,7 +194,7 @@ export function* generateMap()
|
|||||||
|
|
||||||
yield 40;
|
yield 40;
|
||||||
|
|
||||||
if (!isNomad())
|
if (!mapSettings.Nomad)
|
||||||
{
|
{
|
||||||
g_Map.log("Creating gaia");
|
g_Map.log("Creating gaia");
|
||||||
for (let i = 0; i < 2; ++i)
|
for (let i = 0; i < 2; ++i)
|
||||||
|
|||||||
@@ -120,12 +120,12 @@ export function* generateMap(mapSettings)
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
g_Map.log("Creating rivers between opponents");
|
g_Map.log("Creating rivers between opponents");
|
||||||
const numRivers = isNomad() ? randIntInclusive(4, 8) : numPlayers;
|
const numRivers = mapSettings.Nomad ? randIntInclusive(4, 8) : numPlayers;
|
||||||
const rivers = distributePointsOnCircle(numRivers, startAngle + Math.PI / numRivers,
|
const rivers = distributePointsOnCircle(numRivers, startAngle + Math.PI / numRivers,
|
||||||
fractionToTiles(0.5), mapCenter)[0];
|
fractionToTiles(0.5), mapCenter)[0];
|
||||||
for (let i = 0; i < numRivers; ++i)
|
for (let i = 0; i < numRivers; ++i)
|
||||||
{
|
{
|
||||||
if (isNomad() ? randBool() : areAllies(playerIDs[i], playerIDs[(i + 1) % numPlayers]))
|
if (mapSettings.Nomad ? randBool() : areAllies(playerIDs[i], playerIDs[(i + 1) % numPlayers]))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
const shallowLocation = randFloat(0.2, 0.7);
|
const shallowLocation = randFloat(0.2, 0.7);
|
||||||
|
|||||||
@@ -26,11 +26,6 @@ var g_PlayerBaseFunctions = [
|
|||||||
"Decoratives"
|
"Decoratives"
|
||||||
];
|
];
|
||||||
|
|
||||||
function isNomad()
|
|
||||||
{
|
|
||||||
return !!g_MapSettings.Nomad;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getNumPlayers()
|
function getNumPlayers()
|
||||||
{
|
{
|
||||||
return g_MapSettings.PlayerData.length - 1;
|
return g_MapSettings.PlayerData.length - 1;
|
||||||
@@ -153,7 +148,7 @@ function placePlayerBases(playerBaseArgs)
|
|||||||
*/
|
*/
|
||||||
function placePlayerBase(playerBaseArgs)
|
function placePlayerBase(playerBaseArgs)
|
||||||
{
|
{
|
||||||
if (isNomad())
|
if (g_MapSettings.Nomad)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
placeCivDefaultStartingEntities(
|
placeCivDefaultStartingEntities(
|
||||||
@@ -459,7 +454,7 @@ function placePlayerBaseDecoratives(args)
|
|||||||
|
|
||||||
function placePlayersNomad(playerClass, constraints)
|
function placePlayersNomad(playerClass, constraints)
|
||||||
{
|
{
|
||||||
if (!isNomad())
|
if (!g_MapSettings.Nomad)
|
||||||
return undefined;
|
return undefined;
|
||||||
|
|
||||||
g_Map.log("Placing nomad starting units");
|
g_Map.log("Placing nomad starting units");
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
Engine.LoadLibrary("rmgen");
|
Engine.LoadLibrary("rmgen");
|
||||||
Engine.LoadLibrary("rmgen-common");
|
Engine.LoadLibrary("rmgen-common");
|
||||||
|
|
||||||
export function* generateMap()
|
export function* generateMap(mapSettings)
|
||||||
{
|
{
|
||||||
const tMainTerrain = "alpine_snow_a";
|
const tMainTerrain = "alpine_snow_a";
|
||||||
const tTier1Terrain = "snow rough";
|
const tTier1Terrain = "snow rough";
|
||||||
@@ -80,7 +80,7 @@ export function* generateMap()
|
|||||||
|
|
||||||
const [playerIDs, playerPosition] = playerPlacementRiver(startAngle, fractionToTiles(0.6));
|
const [playerIDs, playerPosition] = playerPlacementRiver(startAngle, fractionToTiles(0.6));
|
||||||
|
|
||||||
if (!isNomad())
|
if (!mapSettings.Nomad)
|
||||||
for (const position of playerPosition)
|
for (const position of playerPosition)
|
||||||
addCivicCenterAreaToClass(position, clPlayer);
|
addCivicCenterAreaToClass(position, clPlayer);
|
||||||
|
|
||||||
|
|||||||
@@ -235,7 +235,7 @@ export function* generateMap(mapSettings)
|
|||||||
for (let i = 0; i < numPlayers; ++i)
|
for (let i = 0; i < numPlayers; ++i)
|
||||||
{
|
{
|
||||||
islandPos[i] = playerPosition[i];
|
islandPos[i] = playerPosition[i];
|
||||||
createIsland(i, 1, isNomad() ? clLand : clPlayer);
|
createIsland(i, 1, mapSettings.Nomad ? clLand : clPlayer);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_Map.log("Creating connectors");
|
g_Map.log("Creating connectors");
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ export function* generateMap(mapSettings)
|
|||||||
}
|
}
|
||||||
]));
|
]));
|
||||||
|
|
||||||
if (!isNomad())
|
if (!mapSettings.Nomad)
|
||||||
createBluffsPassages(playerPosition);
|
createBluffsPassages(playerPosition);
|
||||||
|
|
||||||
yield 60;
|
yield 60;
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ export function* generateMap(mapSettings)
|
|||||||
g_Map.log("Creating big grass patches around the playerbases");
|
g_Map.log("Creating big grass patches around the playerbases");
|
||||||
for (let i = 0; i < numPlayers; ++i)
|
for (let i = 0; i < numPlayers; ++i)
|
||||||
{
|
{
|
||||||
if (!isNomad())
|
if (!mapSettings.Nomad)
|
||||||
createArea(
|
createArea(
|
||||||
new ClumpPlacer(diskArea(defaultPlayerBaseRadius()), 0.9, 0.5, Infinity,
|
new ClumpPlacer(diskArea(defaultPlayerBaseRadius()), 0.9, 0.5, Infinity,
|
||||||
playerPosition[i]),
|
playerPosition[i]),
|
||||||
@@ -73,7 +73,7 @@ export function* generateMap(mapSettings)
|
|||||||
new ChainPlacer(
|
new ChainPlacer(
|
||||||
2,
|
2,
|
||||||
Math.floor(scaleByMapSize(5, 12)),
|
Math.floor(scaleByMapSize(5, 12)),
|
||||||
Math.floor(scaleByMapSize(25, 60)) / (isNomad() ? 2 : 1),
|
Math.floor(scaleByMapSize(25, 60)) / (mapSettings.Nomad ? 2 : 1),
|
||||||
Infinity,
|
Infinity,
|
||||||
playerPosition[i],
|
playerPosition[i],
|
||||||
0,
|
0,
|
||||||
@@ -277,7 +277,7 @@ export function* generateMap(mapSettings)
|
|||||||
stayClasses(clGrass, 3)
|
stayClasses(clGrass, 3)
|
||||||
],
|
],
|
||||||
clForest,
|
clForest,
|
||||||
stragglerTrees * (isNomad() ? 3 : 1));
|
stragglerTrees * (mapSettings.Nomad ? 3 : 1));
|
||||||
|
|
||||||
placePlayersNomad(clPlayer, avoidClasses(clForest, 1, clMetal, 4, clRock, 4, clHill, 4, clFood, 2));
|
placePlayersNomad(clPlayer, avoidClasses(clForest, 1, clMetal, 4, clRock, 4, clHill, 4, clFood, 2));
|
||||||
|
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ export function* generateMap(mapSettings)
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!isNomad())
|
if (!mapSettings.Nomad)
|
||||||
{
|
{
|
||||||
[playerIDs, playerPosition] =
|
[playerIDs, playerPosition] =
|
||||||
playerPlacementRiver(startAngle + Math.PI / 2, fractionToTiles(0.6));
|
playerPlacementRiver(startAngle + Math.PI / 2, fractionToTiles(0.6));
|
||||||
@@ -178,7 +178,7 @@ export function* generateMap(mapSettings)
|
|||||||
|
|
||||||
const startAngle = randomAngle();
|
const startAngle = randomAngle();
|
||||||
|
|
||||||
if (!isNomad())
|
if (!mapSettings.Nomad)
|
||||||
{
|
{
|
||||||
[playerIDs, playerPosition] =
|
[playerIDs, playerPosition] =
|
||||||
playerPlacementRiver(startAngle + Math.PI / 2, fractionToTiles(0.5));
|
playerPlacementRiver(startAngle + Math.PI / 2, fractionToTiles(0.5));
|
||||||
@@ -242,7 +242,7 @@ export function* generateMap(mapSettings)
|
|||||||
g_StartingTreasures = true;
|
g_StartingTreasures = true;
|
||||||
|
|
||||||
const [pIDs, islandPosition] = playerPlacementCircle(fractionToTiles(0.35));
|
const [pIDs, islandPosition] = playerPlacementCircle(fractionToTiles(0.35));
|
||||||
if (!isNomad())
|
if (!mapSettings.Nomad)
|
||||||
{
|
{
|
||||||
[playerIDs, playerPosition] = [pIDs, islandPosition];
|
[playerIDs, playerPosition] = [pIDs, islandPosition];
|
||||||
markPlayerArea("large");
|
markPlayerArea("large");
|
||||||
@@ -255,7 +255,7 @@ export function* generateMap(mapSettings)
|
|||||||
new ClumpPlacer(islandSize, 0.8, 0.1, Infinity, islandPosition[i]),
|
new ClumpPlacer(islandSize, 0.8, 0.1, Infinity, islandPosition[i]),
|
||||||
landElevationPainter);
|
landElevationPainter);
|
||||||
|
|
||||||
switch (randIntInclusive(1, isNomad() ? 2 : 3))
|
switch (randIntInclusive(1, mapSettings.Nomad ? 2 : 3))
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
g_Map.log("Creating archipelago");
|
g_Map.log("Creating archipelago");
|
||||||
@@ -319,7 +319,7 @@ export function* generateMap(mapSettings)
|
|||||||
"Continent": () => {
|
"Continent": () => {
|
||||||
const waterHeight = -5;
|
const waterHeight = -5;
|
||||||
|
|
||||||
if (!isNomad())
|
if (!mapSettings.Nomad)
|
||||||
{
|
{
|
||||||
g_Map.log("Ensuring player area");
|
g_Map.log("Ensuring player area");
|
||||||
[playerIDs, playerPosition] = playerPlacementCircle(fractionToTiles(0.25));
|
[playerIDs, playerPosition] = playerPlacementCircle(fractionToTiles(0.25));
|
||||||
@@ -392,7 +392,7 @@ export function* generateMap(mapSettings)
|
|||||||
new ElevationPainter(heightLand));
|
new ElevationPainter(heightLand));
|
||||||
|
|
||||||
let startAngle;
|
let startAngle;
|
||||||
if (!isNomad())
|
if (!mapSettings.Nomad)
|
||||||
{
|
{
|
||||||
let playerAngle;
|
let playerAngle;
|
||||||
[playerIDs, playerPosition, playerAngle, startAngle] =
|
[playerIDs, playerPosition, playerAngle, startAngle] =
|
||||||
@@ -475,7 +475,7 @@ export function* generateMap(mapSettings)
|
|||||||
new ElevationPainter(heightLand));
|
new ElevationPainter(heightLand));
|
||||||
|
|
||||||
const startAngle = randomAngle();
|
const startAngle = randomAngle();
|
||||||
if (!isNomad())
|
if (!mapSettings.Nomad)
|
||||||
{
|
{
|
||||||
playerIDs = sortAllPlayers();
|
playerIDs = sortAllPlayers();
|
||||||
playerPosition =
|
playerPosition =
|
||||||
@@ -516,7 +516,7 @@ export function* generateMap(mapSettings)
|
|||||||
new ElevationPainter(heightLand));
|
new ElevationPainter(heightLand));
|
||||||
|
|
||||||
const startAngle = randomAngle();
|
const startAngle = randomAngle();
|
||||||
if (!isNomad())
|
if (!mapSettings.Nomad)
|
||||||
{
|
{
|
||||||
g_Map.log("Determining player locations");
|
g_Map.log("Determining player locations");
|
||||||
|
|
||||||
@@ -557,7 +557,7 @@ export function* generateMap(mapSettings)
|
|||||||
new MapBoundsPlacer(),
|
new MapBoundsPlacer(),
|
||||||
new ElevationPainter(heightLand));
|
new ElevationPainter(heightLand));
|
||||||
|
|
||||||
if (!isNomad())
|
if (!mapSettings.Nomad)
|
||||||
{
|
{
|
||||||
[playerIDs, playerPosition] = playerPlacementCircle(fractionToTiles(0.35));
|
[playerIDs, playerPosition] = playerPlacementCircle(fractionToTiles(0.35));
|
||||||
markPlayerArea("large");
|
markPlayerArea("large");
|
||||||
@@ -589,7 +589,7 @@ export function* generateMap(mapSettings)
|
|||||||
|
|
||||||
let playerAngle;
|
let playerAngle;
|
||||||
let startAngle;
|
let startAngle;
|
||||||
if (!isNomad())
|
if (!mapSettings.Nomad)
|
||||||
{
|
{
|
||||||
[playerIDs, playerPosition, playerAngle, startAngle] =
|
[playerIDs, playerPosition, playerAngle, startAngle] =
|
||||||
playerPlacementCircle(fractionToTiles(0.35));
|
playerPlacementCircle(fractionToTiles(0.35));
|
||||||
@@ -688,7 +688,7 @@ export function* generateMap(mapSettings)
|
|||||||
|
|
||||||
let playerAngle;
|
let playerAngle;
|
||||||
let startAngle;
|
let startAngle;
|
||||||
if (!isNomad())
|
if (!mapSettings.Nomad)
|
||||||
{
|
{
|
||||||
[playerIDs, playerPosition, playerAngle, startAngle] =
|
[playerIDs, playerPosition, playerAngle, startAngle] =
|
||||||
playerPlacementCircle(fractionToTiles(0.35));
|
playerPlacementCircle(fractionToTiles(0.35));
|
||||||
@@ -745,7 +745,7 @@ export function* generateMap(mapSettings)
|
|||||||
new MapBoundsPlacer(),
|
new MapBoundsPlacer(),
|
||||||
new ElevationPainter(3));
|
new ElevationPainter(3));
|
||||||
|
|
||||||
if (!isNomad())
|
if (!mapSettings.Nomad)
|
||||||
{
|
{
|
||||||
[playerIDs, playerPosition] = playerPlacementCircle(fractionToTiles(0.35));
|
[playerIDs, playerPosition] = playerPlacementCircle(fractionToTiles(0.35));
|
||||||
markPlayerArea("small");
|
markPlayerArea("small");
|
||||||
|
|||||||
@@ -634,7 +634,7 @@ export function* generateMap(mapSettings)
|
|||||||
yield 55;
|
yield 55;
|
||||||
|
|
||||||
g_Map.log("Placing players");
|
g_Map.log("Placing players");
|
||||||
if (isNomad())
|
if (mapSettings.Nomad)
|
||||||
placePlayersNomad(
|
placePlayersNomad(
|
||||||
g_Map.createTileClass(),
|
g_Map.createTileClass(),
|
||||||
[
|
[
|
||||||
@@ -648,12 +648,12 @@ export function* generateMap(mapSettings)
|
|||||||
placeStartLocationResources(playerPosition[p]);
|
placeStartLocationResources(playerPosition[p]);
|
||||||
}
|
}
|
||||||
|
|
||||||
let mercenaryCamps = isNomad() ? 0 : Math.ceil(g_Map.size / 256);
|
let mercenaryCamps = mapSettings.Nomad ? 0 : Math.ceil(g_Map.size / 256);
|
||||||
g_Map.log("Placing at most " + mercenaryCamps + " mercenary camps");
|
g_Map.log("Placing at most " + mercenaryCamps + " mercenary camps");
|
||||||
for (let i = 0; i < resourceSpots.length; ++i)
|
for (let i = 0; i < resourceSpots.length; ++i)
|
||||||
{
|
{
|
||||||
let radius;
|
let radius;
|
||||||
const choice = i % (isNomad() ? 4 : 5);
|
const choice = i % (mapSettings.Nomad ? 4 : 5);
|
||||||
if (choice == 0)
|
if (choice == 0)
|
||||||
placeMine(resourceSpots[i], g_Gaia.stoneLarge);
|
placeMine(resourceSpots[i], g_Gaia.stoneLarge);
|
||||||
if (choice == 1)
|
if (choice == 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user