mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-24 23:24:12 +00:00
Delete good old paintClass and unPaintClass proxies and create the painters directly, like we do with the other painters too.
This was SVN commit r21001.
This commit is contained in:
@@ -171,7 +171,7 @@ createAreas(
|
||||
[
|
||||
new LayeredPainter([tShoreLower, tShoreUpper, tHill], [2 ,1]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightIsland, 4),
|
||||
paintClass(clIsland)
|
||||
new TileClassPainter(clIsland)
|
||||
],
|
||||
[avoidClasses(clPlayer, 8, clForest, 1, clIsland, 15), stayClasses (clWater, 6)],
|
||||
scaleByMapSize(1, 4) * numPlayers
|
||||
|
||||
@@ -102,7 +102,7 @@ createAreas(
|
||||
[
|
||||
new LayeredPainter([tShore, tWater], [1]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 7),
|
||||
paintClass(clWater)
|
||||
new TileClassPainter(clWater)
|
||||
],
|
||||
avoidClasses(clPlayer, 22, clWater, 8, clHill, 2),
|
||||
scaleByMapSize(2, 5));
|
||||
|
||||
@@ -138,7 +138,7 @@ createAreas(
|
||||
[
|
||||
new LayeredPainter([tShore, tWater, tWater], [1, 3]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 5),
|
||||
paintClass(clWater)
|
||||
new TileClassPainter(clWater)
|
||||
],
|
||||
avoidClasses(clPlayer, 20, clWater, 8),
|
||||
scaleByMapSize(5, 16),
|
||||
|
||||
@@ -332,7 +332,7 @@ new MountainRangeBuilder({
|
||||
"painters":[
|
||||
new LayeredPainter([tCliff, tPrimary], [3]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightMountain, 2),
|
||||
paintClass(clHill)
|
||||
new TileClassPainter(clHill)
|
||||
],
|
||||
"constraint": avoidClasses(clPlayer, 20),
|
||||
"passageWidth": scaleByMapSize(10, 15),
|
||||
@@ -367,7 +367,7 @@ createAreas(
|
||||
[
|
||||
new LayeredPainter([tCliff, tSnowLimited], [2]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightMountain, 2),
|
||||
paintClass(clHill)
|
||||
new TileClassPainter(clHill)
|
||||
],
|
||||
avoidClasses(clPlayer, 20, clHill, 14),
|
||||
scaleByMapSize(10, 80) * numPlayers
|
||||
@@ -388,7 +388,7 @@ for (let type of types)
|
||||
new ClumpPlacer(forestTrees / num, 0.1, 0.1, 1),
|
||||
[
|
||||
new LayeredPainter(type, [2]),
|
||||
paintClass(clForest)
|
||||
new TileClassPainter(clForest)
|
||||
],
|
||||
avoidClasses(clPlayer, 12, clForest, 10, clHill, 0),
|
||||
num);
|
||||
@@ -400,7 +400,7 @@ for (let size of [scaleByMapSize(3, 48), scaleByMapSize(5, 84), scaleByMapSize(8
|
||||
new ClumpPlacer(size, 0.3, 0.06, 0.5),
|
||||
[
|
||||
new LayeredPainter([[tDirt, tHalfSnow], [tHalfSnow, tSnowLimited]], [2]),
|
||||
paintClass(clDirt)
|
||||
new TileClassPainter(clDirt)
|
||||
],
|
||||
avoidClasses(clForest, 0, clHill, 0, clDirt, 5, clPlayer, 12),
|
||||
scaleByMapSize(15, 45));
|
||||
|
||||
@@ -12,7 +12,7 @@ initTileClasses();
|
||||
|
||||
createArea(
|
||||
new MapBoundsPlacer(),
|
||||
paintClass(g_TileClasses.land));
|
||||
new TileClassPainter(g_TileClasses.land));
|
||||
|
||||
Engine.SetProgress(10);
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ for (let type of types)
|
||||
new ChainPlacer(1, Math.floor(scaleByMapSize(2, 3)), 4, 1),
|
||||
[
|
||||
new LayeredPainter(type, [2]),
|
||||
paintClass(clForest)
|
||||
new TileClassPainter(clForest)
|
||||
],
|
||||
avoidClasses(clPlayer, 13, clForest, 20, clHill, 1),
|
||||
num);
|
||||
|
||||
@@ -89,7 +89,7 @@ createAreas(
|
||||
scaleByMapSize(30, 70)),
|
||||
[
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightLand, 4),
|
||||
paintClass(clLand)
|
||||
new TileClassPainter(clLand)
|
||||
],
|
||||
null,
|
||||
scaleByMapSize(1, 5) * randIntInclusive(5, 10));
|
||||
@@ -108,7 +108,7 @@ placePlayerBases({
|
||||
"innerTerrain": tRoad,
|
||||
"radius": islandRadius / 3,
|
||||
"painters": [
|
||||
paintClass(clPlayer)
|
||||
new TileClassPainter(clPlayer)
|
||||
]
|
||||
},
|
||||
"Chicken": {
|
||||
|
||||
@@ -116,7 +116,7 @@ createAreas(
|
||||
[
|
||||
new LayeredPainter([tShore, tWater, tWater], [1, 3]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 5),
|
||||
paintClass(clWater)
|
||||
new TileClassPainter(clWater)
|
||||
],
|
||||
avoidClasses(clPlayer, 15),
|
||||
scaleByMapSize(1, 20));
|
||||
|
||||
@@ -162,7 +162,7 @@ log("Marking player territory larger than the city patch...");
|
||||
for (let i = 0; i < numPlayers; ++i)
|
||||
createArea(
|
||||
new ClumpPlacer(250, 0.95, 0.3, 0.1, playerPosition[i]),
|
||||
paintClass(clPlayer));
|
||||
new TileClassPainter(clPlayer));
|
||||
|
||||
Engine.SetProgress(30);
|
||||
|
||||
@@ -174,7 +174,7 @@ for (let size of [scaleByMapSize(50, 800), scaleByMapSize(50, 400), scaleByMapSi
|
||||
[
|
||||
new LayeredPainter([tCliff, [tForestFloor, tForestFloor, tCliff]], [2]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightHill, size < 50 ? 2 : 4),
|
||||
paintClass(clHill)
|
||||
new TileClassPainter(clHill)
|
||||
],
|
||||
avoidClasses(clPlayer, 8, clBaseResource, 2, clHill, 5),
|
||||
scaleByMapSize(1, 4));
|
||||
@@ -196,7 +196,7 @@ for (let size of [scaleByMapSize(50, 800), scaleByMapSize(50, 400), scaleByMapSi
|
||||
[
|
||||
new LayeredPainter([tCliff, tForestFloor], [2]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightRavineValley, 2),
|
||||
paintClass(clHill)
|
||||
new TileClassPainter(clHill)
|
||||
],
|
||||
avoidClasses(clPlayer, 6, clBaseResource, 2, clHill, 5),
|
||||
scaleByMapSize(1, 3));
|
||||
@@ -241,7 +241,7 @@ for (let size of [scaleByMapSize(50, 800), scaleByMapSize(50, 400), scaleByMapSi
|
||||
[
|
||||
new LayeredPainter([tCliff, tForestFloor], [2]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightRavineHill, 2),
|
||||
paintClass(clHill)
|
||||
new TileClassPainter(clHill)
|
||||
],
|
||||
[avoidClasses(clHillDeco, 2), borderClasses(clHill, 15, 1)],
|
||||
ravine.length * 2,
|
||||
@@ -300,7 +300,7 @@ createAreasInAreas(
|
||||
new ClumpPlacer(forestTrees / num, 0.1, 0.1, 1),
|
||||
[
|
||||
new TerrainPainter(pForest),
|
||||
paintClass(clForest)
|
||||
new TileClassPainter(clForest)
|
||||
],
|
||||
avoidClasses(clPlayer, 5, clBaseResource, 4, clForest, 6, clHill, 4),
|
||||
num,
|
||||
@@ -313,8 +313,8 @@ createAreasInAreas(
|
||||
new ClumpPlacer(forestTreesJoin / num, 0.1, 0.1, 1),
|
||||
[
|
||||
new TerrainPainter(pForest),
|
||||
paintClass(clForest),
|
||||
paintClass(clForestJoin)
|
||||
new TileClassPainter(clForest),
|
||||
new TileClassPainter(clForestJoin)
|
||||
],
|
||||
[avoidClasses(clPlayer, 5, clBaseResource, 4, clForestJoin, 5, clHill, 4), borderClasses(clForest, 1, 4)],
|
||||
num,
|
||||
|
||||
@@ -104,7 +104,7 @@ createAreas(
|
||||
[
|
||||
new LayeredPainter([tCliff, tHill], [2]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightHill, 2),
|
||||
paintClass(clHill)
|
||||
new TileClassPainter(clHill)
|
||||
],
|
||||
avoidClasses(clPlayer, 20, clHill, 15, clWater, 0),
|
||||
scaleByMapSize(1, 4) * numPlayers * 3);
|
||||
@@ -116,7 +116,7 @@ for (let i = 0; i < 2; ++i)
|
||||
[
|
||||
new LayeredPainter([tShoreBlend, tShore, tWater], [1, 1]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightMarsh, 3),
|
||||
paintClass(clWater)
|
||||
new TileClassPainter(clWater)
|
||||
],
|
||||
avoidClasses(clPlayer, 25, clWater, Math.round(scaleByMapSize(7, 16) * randFloat(0.8, 1.35))),
|
||||
scaleByMapSize(4, 20));
|
||||
@@ -149,7 +149,7 @@ for (let size of [scaleByMapSize(3, 6), scaleByMapSize(5, 10), scaleByMapSize(8,
|
||||
new ChainPlacer(2, Math.floor(scaleByMapSize(3, 6)), size, 1),
|
||||
[
|
||||
new LayeredPainter([tGrassA, tGrassB, tMud], [1, 1]),
|
||||
paintClass(clDirt)
|
||||
new TileClassPainter(clDirt)
|
||||
],
|
||||
avoidClasses(clWater, 1, clHill, 0, clDirt, 5, clPlayer, 8),
|
||||
scaleByMapSize(15, 45));
|
||||
|
||||
@@ -21,7 +21,7 @@ function placeRandomPathToHeight(
|
||||
let painters = [new TerrainPainter(texture)];
|
||||
|
||||
if (tileClass !== undefined)
|
||||
painters.push(paintClass(tileClass));
|
||||
painters.push(new TileClassPainter(tileClass));
|
||||
|
||||
createArea(
|
||||
new ClumpPlacer(diskArea(0.3 * width), 1, 1, 1, position),
|
||||
@@ -138,7 +138,7 @@ function placeGrove(point)
|
||||
new ClumpPlacer(5, 1, 1, 1, position),
|
||||
[
|
||||
new TerrainPainter("temp_grass_plants"),
|
||||
paintClass(clGrove)
|
||||
new TileClassPainter(clGrove)
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -189,7 +189,7 @@ function placeStartLocationResources(point, foodEntities = ["gaia/flora_bush_ber
|
||||
new ClumpPlacer(5, 1, 1, 1, woodPosition),
|
||||
[
|
||||
new TerrainPainter("temp_grass_plants"),
|
||||
paintClass(clGrove)
|
||||
new TileClassPainter(clGrove)
|
||||
]);
|
||||
currentAngle += dAngle;
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ for (let i = 0; i < numPlayers; ++i)
|
||||
[
|
||||
new LayeredPainter([tCliff, tHill], [2]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightHill, 2),
|
||||
paintClass(clPlayer)
|
||||
new TileClassPainter(clPlayer)
|
||||
]);
|
||||
|
||||
let angle = playerAngle[i] + Math.PI * (1 + randFloat(-1, 1) / 8);
|
||||
@@ -126,7 +126,7 @@ var waterAreas = createAreas(
|
||||
[
|
||||
new LayeredPainter([tShoreBlend, tShore, tWater], [1, 1]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 6),
|
||||
paintClass(clWater)
|
||||
new TileClassPainter(clWater)
|
||||
],
|
||||
avoidClasses(clPlayer, 2, clWater, 20),
|
||||
numLakes
|
||||
|
||||
@@ -72,7 +72,7 @@ for (let i = 0; i < numPlayers; ++i)
|
||||
[
|
||||
new LayeredPainter([tMainTerrain, tMainTerrain], [2]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightLand, 2),
|
||||
paintClass(j == 1 || isNomad() ? clLand : clPlayer)
|
||||
new TileClassPainter(j == 1 || isNomad() ? clLand : clPlayer)
|
||||
]);
|
||||
|
||||
log("Creating center area...");
|
||||
@@ -81,12 +81,12 @@ createArea(
|
||||
[
|
||||
new LayeredPainter([tMainTerrain, tMainTerrain], [3]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightLand, 3),
|
||||
paintClass(clLand)
|
||||
new TileClassPainter(clLand)
|
||||
]);
|
||||
|
||||
createArea(
|
||||
new ClumpPlacer(150, 0.6, 0.3, 10, mapCenter),
|
||||
paintClass(clHill));
|
||||
new TileClassPainter(clHill));
|
||||
|
||||
log("Creating hills...");
|
||||
for (let i = 0; i < scaleByMapSize(9, 16); ++i)
|
||||
@@ -101,7 +101,7 @@ for (let i = 0; i < scaleByMapSize(9, 16); ++i)
|
||||
0),
|
||||
[
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightHill, 3),
|
||||
paintClass(clHill2)
|
||||
new TileClassPainter(clHill2)
|
||||
],
|
||||
avoidClasses(clPlayer, 6, clHill2, 3, clHill, 2));
|
||||
|
||||
@@ -114,7 +114,7 @@ for (let g = 0; g < scaleByMapSize(5, 30); ++g)
|
||||
[
|
||||
new LayeredPainter([tMainTerrain, tMainTerrain], [3]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightLand, 3),
|
||||
paintClass(clLand)
|
||||
new TileClassPainter(clLand)
|
||||
],
|
||||
avoidClasses(clLand, 6));
|
||||
|
||||
@@ -152,7 +152,7 @@ for (let g = 0; g < scaleByMapSize(5, 30); ++g)
|
||||
[
|
||||
new LayeredPainter([tMainTerrain, tMainTerrain], [3]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightLand, 3),
|
||||
paintClass(clLand)
|
||||
new TileClassPainter(clLand)
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -174,8 +174,8 @@ for (let i = 0; i < numPlayers; ++i)
|
||||
[
|
||||
new LayeredPainter([tRoadWild, tRoad], [1]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightLand, 2),
|
||||
paintClass(clLand),
|
||||
paintClass(clHill)
|
||||
new TileClassPainter(clLand),
|
||||
new TileClassPainter(clHill)
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ createArea(
|
||||
[Math.floor(fractionToTiles(0.33))]),
|
||||
[
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightLand, 4),
|
||||
paintClass(clLand)
|
||||
new TileClassPainter(clLand)
|
||||
]);
|
||||
|
||||
var [playerIDs, playerPosition] = playerPlacementCircle(fractionToTiles(0.25));
|
||||
@@ -89,7 +89,7 @@ for (let i = 0; i < numPlayers; ++i)
|
||||
[Math.floor(scaleByMapSize(23, 50))]),
|
||||
[
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightLand, 4),
|
||||
paintClass(clLand)
|
||||
new TileClassPainter(clLand)
|
||||
]);
|
||||
|
||||
Engine.SetProgress(20);
|
||||
|
||||
@@ -93,7 +93,7 @@ for (let island = 0; island < 2; ++island)
|
||||
[
|
||||
new LayeredPainter([tCliffs, tGrass], [2]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightMain, 0),
|
||||
paintClass(clIsland)
|
||||
new TileClassPainter(clIsland)
|
||||
]);
|
||||
|
||||
log("Creating subislands...");
|
||||
@@ -106,7 +106,7 @@ for (let island = 0; island < 2; ++island)
|
||||
[
|
||||
new LayeredPainter([tCliffs, tGrass], [2]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightMain, 1),
|
||||
paintClass(clIsland)
|
||||
new TileClassPainter(clIsland)
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ for (let island = 0; island < 2; ++island)
|
||||
[
|
||||
new TerrainPainter(tSteepCliffs),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightCreeks, 0),
|
||||
paintClass(clCreek)
|
||||
new TileClassPainter(clCreek)
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -224,7 +224,7 @@ placePlayerBases({
|
||||
"coherence": 0.8,
|
||||
"radius": 6,
|
||||
"painters": [
|
||||
paintClass(clSettlement)
|
||||
new TileClassPainter(clSettlement)
|
||||
]
|
||||
},
|
||||
"Chicken": {
|
||||
@@ -366,7 +366,7 @@ createAreas(
|
||||
new ClumpPlacer(20, 0.3, 0.06, 0.5),
|
||||
[
|
||||
new TerrainPainter(tLushGrass),
|
||||
paintClass(clForest)
|
||||
new TileClassPainter(clForest)
|
||||
],
|
||||
avoidClasses(
|
||||
clWater, 1,
|
||||
|
||||
@@ -93,7 +93,7 @@ function createCycladicArchipelagoIsland(position, tileClass, radius, coralRadiu
|
||||
new ClumpPlacer(diskArea(radius + coralRadius), 0.7, 0.1, 10, position),
|
||||
[
|
||||
new LayeredPainter([tOceanRockDeep, tOceanCoral], [5]),
|
||||
paintClass(clCoral)
|
||||
new TileClassPainter(clCoral)
|
||||
],
|
||||
avoidClasses(clCoral, 0, clPlayer, 0));
|
||||
|
||||
@@ -104,7 +104,7 @@ function createCycladicArchipelagoIsland(position, tileClass, radius, coralRadiu
|
||||
[
|
||||
new LayeredPainter([tOceanCoral, tBeachWet, tBeachDry, tBeach, tBeachBlend, tGrass], [1, 3, 1, 1, 2]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightLand, 5),
|
||||
paintClass(tileClass)
|
||||
new TileClassPainter(tileClass)
|
||||
],
|
||||
avoidClasses(clPlayer, 0)));
|
||||
}
|
||||
@@ -135,7 +135,7 @@ placePlayerBases({
|
||||
"outerTerrain": tGrass,
|
||||
"innerTerrain": tCity,
|
||||
"painters": [
|
||||
paintClass(clCity)
|
||||
new TileClassPainter(clCity)
|
||||
]
|
||||
},
|
||||
"Chicken": {
|
||||
@@ -173,7 +173,7 @@ createAreasInAreas(
|
||||
[
|
||||
new LayeredPainter([tCliff, tCliffShrubs], [2]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightHill, 2),
|
||||
paintClass(clHill)
|
||||
new TileClassPainter(clHill)
|
||||
],
|
||||
avoidClasses(clCity, 15, clHill, 15),
|
||||
scaleByMapSize(5, 30), 15,
|
||||
@@ -196,7 +196,7 @@ for (let type of forestTypes)
|
||||
new ClumpPlacer(randIntInclusive(6, 17), 0.1, 0.1, 1),
|
||||
[
|
||||
new LayeredPainter(type, [2]),
|
||||
paintClass(clForest)
|
||||
new TileClassPainter(clForest)
|
||||
],
|
||||
avoidClasses(clCity, 1, clWater, 3, clForest, 3, clHill, 1, clBaseResource, 4),
|
||||
scaleByMapSize(10, 64),
|
||||
@@ -234,7 +234,7 @@ for (let size of [scaleByMapSize(2, 32), scaleByMapSize(3, 48), scaleByMapSize(5
|
||||
new ClumpPlacer(size, 0.3, 0.06, 0.5),
|
||||
[
|
||||
new LayeredPainter([tBeachBlend, tGrassShrubs], [1]),
|
||||
paintClass(clDirt)
|
||||
new TileClassPainter(clDirt)
|
||||
],
|
||||
avoidClasses(clWater, 3, clHill, 0, clDirt, 6, clCity, 0, clBaseResource, 4),
|
||||
scaleByMapSize(4, 16),
|
||||
@@ -248,7 +248,7 @@ for (let size of [scaleByMapSize(2, 32), scaleByMapSize(3, 48), scaleByMapSize(5
|
||||
new ClumpPlacer(size, 0.3, 0.06, 0.5),
|
||||
[
|
||||
new LayeredPainter([tGrassDry], []),
|
||||
paintClass(clDirt)
|
||||
new TileClassPainter(clDirt)
|
||||
],
|
||||
avoidClasses(clWater, 3, clHill, 0, clDirt, 6, clCity, 0, clBaseResource, 4),
|
||||
scaleByMapSize(4, 16),
|
||||
|
||||
@@ -236,7 +236,7 @@ if (gallicCC)
|
||||
[
|
||||
new LayeredPainter([tShore, tRoad, tRoad], [1, 3]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightPath, 4),
|
||||
paintClass(clPath)
|
||||
new TileClassPainter(clPath)
|
||||
]);
|
||||
|
||||
// Create the meeting place near the shoreline at the end of the path
|
||||
@@ -244,8 +244,8 @@ if (gallicCC)
|
||||
new ClumpPlacer(diskArea(mRadius), 0.6, 0.3, 10, meetingPlacePosition),
|
||||
[
|
||||
new TerrainPainter(tShore),
|
||||
paintClass(clPath),
|
||||
paintClass(clRitualPlace)
|
||||
new TileClassPainter(clPath),
|
||||
new TileClassPainter(clRitualPlace)
|
||||
]);
|
||||
|
||||
placeObject(meetingPlacePosition.x, meetingPlacePosition.y, aCampfire, 0, randomAngle());
|
||||
@@ -265,7 +265,7 @@ if (gallicCC)
|
||||
new ClumpPlacer(diskArea(gaulCityRadius), 0.6, 0.3, 10, civicCenterPosition),
|
||||
[
|
||||
new TerrainPainter(tShore),
|
||||
paintClass(clGauls)
|
||||
new TileClassPainter(clGauls)
|
||||
]);
|
||||
|
||||
// Place palisade fortress and some city buildings
|
||||
@@ -434,7 +434,7 @@ createAreas(
|
||||
[
|
||||
new LayeredPainter([tWater, tShore, tIsland], [2, 1]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightIsland, 4),
|
||||
paintClass(clIsland)
|
||||
new TileClassPainter(clIsland)
|
||||
],
|
||||
[avoidClasses(clIsland, 30), stayClasses (clWater, 10)],
|
||||
scaleByMapSize(1, 4) * numPlayers
|
||||
|
||||
@@ -75,7 +75,7 @@ placePlayerBases({
|
||||
"smoothness": 1/8,
|
||||
"painters": [
|
||||
new LayeredPainter([terrainBaseBorder, terrainBase, terrainBaseCenter], [baseRadius/4, baseRadius/4]),
|
||||
paintClass(clPlayer)
|
||||
new TileClassPainter(clPlayer)
|
||||
]
|
||||
},
|
||||
"Chicken": {
|
||||
@@ -116,7 +116,7 @@ for (let i = 0; i < numPlayers + (pathBlending ? 1 : 0); ++i)
|
||||
[
|
||||
new TerrainPainter(terrainPath),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightPath, 2, heightOffsetRandomPath),
|
||||
paintClass(clPath)
|
||||
new TileClassPainter(clPath)
|
||||
],
|
||||
avoidClasses(clHill, 0, clBaseResource, 4));
|
||||
}
|
||||
@@ -141,7 +141,7 @@ for (let i = 0; i < numPlayers; ++i)
|
||||
[
|
||||
new LayeredPainter([terrainHillBorder, terrainHill], [1]),
|
||||
new ElevationPainter(randFloat(1, 2)),
|
||||
paintClass(clHill)
|
||||
new TileClassPainter(clHill)
|
||||
]);
|
||||
}
|
||||
Engine.SetProgress(60);
|
||||
@@ -156,7 +156,7 @@ createArea(
|
||||
[
|
||||
new LayeredPainter([terrainHillBorder, terrainHill], [radiusEC/4]),
|
||||
new ElevationPainter(randFloat(1, 2)),
|
||||
paintClass(clHill)
|
||||
new TileClassPainter(clHill)
|
||||
]);
|
||||
|
||||
// Woods and general hight map
|
||||
@@ -185,7 +185,7 @@ for (var x = 0; x < mapSize; x++)
|
||||
[
|
||||
new TerrainPainter(border ? terrainWoodBorder : terrainWood),
|
||||
new ElevationPainter(randFloat(0, 1)),
|
||||
paintClass(clForest)
|
||||
new TileClassPainter(clForest)
|
||||
],
|
||||
avoidClasses(clPath, 1, clHill, border ? 0 : 1));
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ initTileClasses();
|
||||
|
||||
createArea(
|
||||
new MapBoundsPlacer(),
|
||||
paintClass(g_TileClasses.land));
|
||||
new TileClassPainter(g_TileClasses.land));
|
||||
|
||||
Engine.SetProgress(10);
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ if (!isNomad())
|
||||
[
|
||||
new LayeredPainter([tHillVeryDark, tHillMedium1], [playerMountainSize]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightPlayerHill, playerMountainSize),
|
||||
paintClass(clPlayer)
|
||||
new TileClassPainter(clPlayer)
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ createAreas(
|
||||
[
|
||||
new LayeredPainter([tShoreBlend, tShore, tWater], [1, 1]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 3),
|
||||
paintClass(clWater)
|
||||
new TileClassPainter(clWater)
|
||||
],
|
||||
avoidClasses(clPlayer, 0, clHill, 2, clWater, 12),
|
||||
Math.round(scaleByMapSize(6, 12)));
|
||||
@@ -159,7 +159,7 @@ createAreas(
|
||||
[
|
||||
new LayeredPainter([tHillDark, tHillDark, tHillDark], [2, 2]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightHill, 2),
|
||||
paintClass(clHill)
|
||||
new TileClassPainter(clHill)
|
||||
],
|
||||
avoidClasses(clPlayer, 0, clHill, 15, clWater, 2, clBaseResource, 2),
|
||||
scaleByMapSize(2, 8) * numPlayers);
|
||||
@@ -178,7 +178,7 @@ for (let type of types)
|
||||
new ClumpPlacer(forestTrees / num, 0.1, 0.1, 1),
|
||||
[
|
||||
new LayeredPainter(type, [2]),
|
||||
paintClass(clForest)
|
||||
new TileClassPainter(clForest)
|
||||
],
|
||||
avoidClasses(
|
||||
clPlayer, 4,
|
||||
@@ -195,7 +195,7 @@ for (let size of [scaleByMapSize(3, 48), scaleByMapSize(5, 84), scaleByMapSize(8
|
||||
new ClumpPlacer(size, 0.3, 0.06, 0.5),
|
||||
[
|
||||
new LayeredPainter(type, [1]),
|
||||
paintClass(clGrass)
|
||||
new TileClassPainter(clGrass)
|
||||
],
|
||||
avoidClasses(
|
||||
clWater, 3,
|
||||
|
||||
@@ -75,7 +75,7 @@ for (let i = 0; i < numPlayers; ++i)
|
||||
[
|
||||
new LayeredPainter([tShore, tMainTerrain], [shoreRadius]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightLand, shoreRadius),
|
||||
paintClass(clHill)
|
||||
new TileClassPainter(clHill)
|
||||
]);
|
||||
|
||||
placePlayerBases({
|
||||
@@ -123,7 +123,7 @@ createArea(
|
||||
[
|
||||
new LayeredPainter([tShore, tMainTerrain], [shoreRadius, 100]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightLand, shoreRadius),
|
||||
paintClass(clHill)
|
||||
new TileClassPainter(clHill)
|
||||
],
|
||||
avoidClasses(clPlayer, 40));
|
||||
|
||||
@@ -142,7 +142,7 @@ for (let m = 0; m < randIntInclusive(20, 34); ++m)
|
||||
[
|
||||
new LayeredPainter([tDirt, tHill], [Math.floor(elevRand / 3), 40]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, elevRand, Math.floor(elevRand / 3)),
|
||||
paintClass(clHill)
|
||||
new TileClassPainter(clHill)
|
||||
],
|
||||
[avoidClasses(clBaseResource, 2, clPlayer, 40), stayClasses(clHill, 6)]);
|
||||
}
|
||||
@@ -162,7 +162,7 @@ for (let m = 0; m < randIntInclusive(8, 17); ++m)
|
||||
[
|
||||
new LayeredPainter([tCliff, tForestFloor2], [Math.floor(elevRand / 3), 40]),
|
||||
new SmoothElevationPainter(ELEVATION_MODIFY, elevRand, Math.floor(elevRand / 3)),
|
||||
paintClass(clMountain)
|
||||
new TileClassPainter(clMountain)
|
||||
],
|
||||
[avoidClasses(clBaseResource, 2, clPlayer, 40), stayClasses(clHill, 6)]);
|
||||
}
|
||||
@@ -218,7 +218,7 @@ for (let size of [scaleByMapSize(3, 6), scaleByMapSize(5, 10), scaleByMapSize(8,
|
||||
new ChainPlacer(1, Math.floor(scaleByMapSize(3, 5)), size, 0.5),
|
||||
[
|
||||
new LayeredPainter([[tMainTerrain, tTier1Terrain], [tTier1Terrain, tTier2Terrain], [tTier2Terrain, tTier3Terrain]], [1, 1]),
|
||||
paintClass(clDirt)
|
||||
new TileClassPainter(clDirt)
|
||||
],
|
||||
avoidClasses(clForest, 0, clMountain, 0, clDirt, 5, clPlayer, 10),
|
||||
numb * scaleByMapSize(15, 45));
|
||||
|
||||
@@ -142,7 +142,7 @@ var waterAreas = createAreas(
|
||||
[
|
||||
new LayeredPainter([tShore, tWater, tWater], [1, 1]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 3),
|
||||
paintClass(clWater)
|
||||
new TileClassPainter(clWater)
|
||||
],
|
||||
avoidClasses(clPlayer, 7, clWater, 20),
|
||||
numLakes);
|
||||
@@ -193,7 +193,7 @@ for (let type of types)
|
||||
new ChainPlacer(1, Math.floor(scaleByMapSize(3, 5)), forestTrees / num, 0.5),
|
||||
[
|
||||
new LayeredPainter(type, [2]),
|
||||
paintClass(clForest)
|
||||
new TileClassPainter(clForest)
|
||||
],
|
||||
avoidClasses(clPlayer, 5, clWater, 3, clForest, 15, clHill, 1),
|
||||
num);
|
||||
|
||||
@@ -14,7 +14,7 @@ var g_Map = new RandomMap(randElevation, g_Terrains.mainTerrain);
|
||||
initTileClasses();
|
||||
createArea(
|
||||
new MapBoundsPlacer(),
|
||||
paintClass(g_TileClasses.land));
|
||||
new TileClassPainter(g_TileClasses.land));
|
||||
|
||||
Engine.SetProgress(20);
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ createArea(
|
||||
[
|
||||
new LayeredPainter([tGrass, tGrass, tGrass], [4, 2]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightLand, 4),
|
||||
paintClass(clLand)
|
||||
new TileClassPainter(clLand)
|
||||
]);
|
||||
|
||||
var playerPosition = playerPlacementCustomAngle(
|
||||
|
||||
@@ -209,7 +209,7 @@ for (let gulfLake of gulfLakePositions)
|
||||
[
|
||||
new LayeredPainter([tPrimary, tPrimary, tPrimary, tPrimary], [1, 4, 2]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 4),
|
||||
paintClass(clWater)
|
||||
new TileClassPainter(clWater)
|
||||
],
|
||||
avoidClasses(clPlayer,scaleByMapSize(20, 28)));
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ setFogFactor(0.04);
|
||||
|
||||
createArea(
|
||||
new MapBoundsPlacer(),
|
||||
paintClass(g_TileClasses.land));
|
||||
new TileClassPainter(g_TileClasses.land));
|
||||
|
||||
Engine.SetProgress(10);
|
||||
|
||||
@@ -312,7 +312,7 @@ function addCenterLake()
|
||||
[1, 100]
|
||||
),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 10),
|
||||
paintClass(g_TileClasses.water)
|
||||
new TileClassPainter(g_TileClasses.water)
|
||||
],
|
||||
avoidClasses(g_TileClasses.player, 20)
|
||||
);
|
||||
@@ -332,7 +332,7 @@ function addHarbors(players)
|
||||
[
|
||||
new LayeredPainter([g_Terrains.shore, g_Terrains.water], [2]),
|
||||
new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetHarbor, 3),
|
||||
paintClass(g_TileClasses.water)
|
||||
new TileClassPainter(g_TileClasses.water)
|
||||
],
|
||||
avoidClasses(
|
||||
g_TileClasses.player, 15,
|
||||
@@ -376,7 +376,7 @@ function addSpines()
|
||||
[
|
||||
new LayeredPainter([g_Terrains.cliff, spineTile], [3]),
|
||||
new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetSpine, 3),
|
||||
paintClass(g_TileClasses.spine)
|
||||
new TileClassPainter(g_TileClasses.spine)
|
||||
],
|
||||
avoidClasses(g_TileClasses.player, 5)
|
||||
);
|
||||
|
||||
@@ -15,7 +15,7 @@ const mapCenter = g_Map.getCenter();
|
||||
|
||||
createArea(
|
||||
new MapBoundsPlacer(),
|
||||
paintClass(g_TileClasses.land));
|
||||
new TileClassPainter(g_TileClasses.land));
|
||||
|
||||
Engine.SetProgress(10);
|
||||
|
||||
@@ -291,7 +291,7 @@ function placeBarriers()
|
||||
[
|
||||
new LayeredPainter([g_Terrains.cliff, spineTerrain], [2]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightBarrier, 2),
|
||||
paintClass(g_TileClasses.spine)
|
||||
new TileClassPainter(g_TileClasses.spine)
|
||||
],
|
||||
avoidClasses(g_TileClasses.player, 5, g_TileClasses.baseResource, 5));
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ createAreas(
|
||||
[
|
||||
new LayeredPainter([tCliff, tHill], [2]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightHill, 2),
|
||||
paintClass(clHill)
|
||||
new TileClassPainter(clHill)
|
||||
],
|
||||
avoidClasses(clPlayer, 20, clWater, 5, clHill, 15, clHighlands, 5),
|
||||
scaleByMapSize(1, 4) * numPlayers);
|
||||
@@ -166,7 +166,7 @@ for (let type of types)
|
||||
new ClumpPlacer(forestTrees / num, 0.1, 0.1, 1),
|
||||
[
|
||||
new LayeredPainter(type, [2]),
|
||||
paintClass(clForest)
|
||||
new TileClassPainter(clForest)
|
||||
],
|
||||
avoidClasses(clPlayer, 20, clWater, 3, clForest, 10, clHill, 0, clBaseResource, 3),
|
||||
num);
|
||||
@@ -183,7 +183,7 @@ for (let type of types)
|
||||
new ClumpPlacer(forestTrees / num, 0.1, 0.1, 1),
|
||||
[
|
||||
new LayeredPainter(type, [2]),
|
||||
paintClass(clForest)
|
||||
new TileClassPainter(clForest)
|
||||
],
|
||||
avoidClasses(clPlayer, 20, clWater, 3, clForest, 2, clHill, 0),
|
||||
num);
|
||||
@@ -195,7 +195,7 @@ for (let size of [scaleByMapSize(3, 48), scaleByMapSize(5, 84), scaleByMapSize(8
|
||||
new ClumpPlacer(size, 0.3, 0.06, 0.5),
|
||||
[
|
||||
new LayeredPainter([[tGrass, tGrassA], [tGrassA, tGrassB], [tGrassB, tGrassC]], [1, 1]),
|
||||
paintClass(clDirt)
|
||||
new TileClassPainter(clDirt)
|
||||
],
|
||||
avoidClasses(clWater, 1, clForest, 0, clHill, 0, clDirt, 5, clPlayer, 4),
|
||||
scaleByMapSize(15, 45));
|
||||
|
||||
@@ -95,7 +95,7 @@ createArea(
|
||||
[Math.floor(scaleByMapSize(15, 40))]),
|
||||
[
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 4),
|
||||
paintClass(clWater)
|
||||
new TileClassPainter(clWater)
|
||||
],
|
||||
avoidClasses(clPlayer, 2));
|
||||
|
||||
@@ -104,7 +104,7 @@ createAreas(
|
||||
new ChainPlacer(2, Math.floor(scaleByMapSize(4, 6)), 3, 1),
|
||||
[
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightShore, 4),
|
||||
unPaintClass(clWater)
|
||||
new TileClassUnPainter(clWater)
|
||||
],
|
||||
borderClasses(clWater, 4, 7),
|
||||
scaleByMapSize(12, 130) * 2, 150
|
||||
|
||||
@@ -93,7 +93,7 @@ for (let i = 0; i < teams.length; ++i)
|
||||
[
|
||||
new LayeredPainter([tMainTerrain, tMainTerrain, tMainTerrain], [1, 6]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightLand, 6),
|
||||
paintClass(clLand)
|
||||
new TileClassPainter(clLand)
|
||||
]);
|
||||
|
||||
placeCivDefaultStartingEntities(playerPosition[p], teams[i][p], false);
|
||||
@@ -181,7 +181,7 @@ createAreas(
|
||||
[
|
||||
new LayeredPainter([tMainTerrain, tMainTerrain], [2]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightLand, 6),
|
||||
paintClass(clLand)
|
||||
new TileClassPainter(clLand)
|
||||
],
|
||||
avoidClasses(clLand, 3, clPlayer, 3),
|
||||
scaleByMapSize(4, 14) * (isNomad() ? 2 : 1),
|
||||
@@ -193,7 +193,7 @@ createAreas(
|
||||
[
|
||||
new LayeredPainter([tMainTerrain, tMainTerrain], [2]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightLand, 6),
|
||||
paintClass(clLand)
|
||||
new TileClassPainter(clLand)
|
||||
],
|
||||
avoidClasses(clLand, 3, clPlayer, 3),
|
||||
scaleByMapSize(6, 55),
|
||||
@@ -242,7 +242,7 @@ createAreas(
|
||||
[
|
||||
new LayeredPainter([tCliff, tHill], [2]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightHill, 2),
|
||||
paintClass(clHill)
|
||||
new TileClassPainter(clHill)
|
||||
],
|
||||
[avoidClasses(clBaseResource, 20, clHill, 15, clRock, 6, clMetal, 6), stayClasses(clLand, 0)],
|
||||
scaleByMapSize(4, 13)
|
||||
@@ -298,7 +298,7 @@ for (let size of [scaleByMapSize(3, 6), scaleByMapSize(5, 10), scaleByMapSize(8,
|
||||
new ChainPlacer(1, Math.floor(scaleByMapSize(3, 5)), size, 0.5),
|
||||
[
|
||||
new LayeredPainter([[tMainTerrain, tTier1Terrain], [tTier1Terrain, tTier2Terrain], [tTier2Terrain, tTier3Terrain]], [1, 1]),
|
||||
paintClass(clDirt)
|
||||
new TileClassPainter(clDirt)
|
||||
],
|
||||
[avoidClasses(clForest, 0, clHill, 0, clDirt, 5, clPlayer, 0), stayClasses(clLand, 4)],
|
||||
numb*scaleByMapSize(15, 45));
|
||||
|
||||
@@ -79,8 +79,8 @@ if (!isNomad())
|
||||
[
|
||||
new LayeredPainter([tMainTerrain , tMainTerrain, tMainTerrain], [1, 6]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightLand, 6),
|
||||
paintClass(clLand),
|
||||
paintClass(clPlayer)
|
||||
new TileClassPainter(clLand),
|
||||
new TileClassPainter(clPlayer)
|
||||
]);
|
||||
|
||||
let dockLocation = findLocationInDirectionBasedOnHeight(playerPosition[i], mapCenter, -3 , heightLand - 0.5, heightLand);
|
||||
@@ -98,7 +98,7 @@ createAreas(
|
||||
[
|
||||
new LayeredPainter([tMainTerrain, tMainTerrain], [2]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightLand, 6),
|
||||
paintClass(clLand)
|
||||
new TileClassPainter(clLand)
|
||||
],
|
||||
avoidClasses(clLand, scaleByMapSize(8, 12)),
|
||||
scaleByMapSize(4, 14));
|
||||
@@ -113,7 +113,7 @@ createAreas(
|
||||
[
|
||||
new LayeredPainter([tMainTerrain, tMainTerrain], [2]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightLand, 6),
|
||||
paintClass(clLand)
|
||||
new TileClassPainter(clLand)
|
||||
],
|
||||
avoidClasses(clLand, scaleByMapSize(8, 12)),
|
||||
scaleByMapSize(6, 54));
|
||||
@@ -172,7 +172,7 @@ createAreas(
|
||||
[
|
||||
new LayeredPainter([tCliff, tHill], [2]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightHill, 2),
|
||||
paintClass(clHill)
|
||||
new TileClassPainter(clHill)
|
||||
],
|
||||
[avoidClasses(clPlayer, 2, clHill, 15), stayClasses(clLand, 0)],
|
||||
scaleByMapSize(4, 13));
|
||||
@@ -193,7 +193,7 @@ if (currentBiome() != "savanna")
|
||||
new ChainPlacer(1, Math.floor(scaleByMapSize(3, 5)), forestTrees / (num * Math.floor(scaleByMapSize(2, 5))), 0.5),
|
||||
[
|
||||
new LayeredPainter(type, [2]),
|
||||
paintClass(clForest)
|
||||
new TileClassPainter(clForest)
|
||||
],
|
||||
[avoidClasses(clPlayer, 0, clForest, 10, clHill, 0), stayClasses(clLand, 6)],
|
||||
num);
|
||||
@@ -207,7 +207,7 @@ for (let size of [scaleByMapSize(3, 6), scaleByMapSize(5, 10), scaleByMapSize(8,
|
||||
new ChainPlacer(1, Math.floor(scaleByMapSize(3, 5)), size, 0.5),
|
||||
[
|
||||
new LayeredPainter([[tMainTerrain, tTier1Terrain], [tTier1Terrain, tTier2Terrain], [tTier2Terrain, tTier3Terrain]], [1, 1]),
|
||||
paintClass(clDirt)
|
||||
new TileClassPainter(clDirt)
|
||||
],
|
||||
[avoidClasses(clForest, 0, clHill, 0, clDirt, 5, clPlayer, 0), stayClasses(clLand, 6)],
|
||||
numberOfPatches);
|
||||
|
||||
@@ -122,7 +122,7 @@ for (let i = 0; i < scaleByMapSize(20, 120); ++i)
|
||||
[
|
||||
new LayeredPainter([tGrass, tGrass], [2]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightLand, 3),
|
||||
unPaintClass(clWater)
|
||||
new TileClassUnPainter(clWater)
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ createAreas(
|
||||
[
|
||||
new LayeredPainter([tCliff, tGrass], [3]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightHill, 3),
|
||||
paintClass(clHill)
|
||||
new TileClassPainter(clHill)
|
||||
],
|
||||
[avoidClasses(clPlayer, 20, clHill, 5, clWater, 2, clBaseResource, 2), stayClasses(clMountains, 0)],
|
||||
scaleByMapSize(5, 40) * numPlayers);
|
||||
@@ -161,7 +161,7 @@ for (let type of types)
|
||||
0.5),
|
||||
[
|
||||
new LayeredPainter(type, [2]),
|
||||
paintClass(clForest)
|
||||
new TileClassPainter(clForest)
|
||||
],
|
||||
avoidClasses(clPlayer, 20, clForest, 10, clHill, 0, clWater, 8),
|
||||
num);
|
||||
@@ -174,7 +174,7 @@ for (let size of [scaleByMapSize(3, 6), scaleByMapSize(5, 10), scaleByMapSize(8,
|
||||
new ChainPlacer(1, Math.floor(scaleByMapSize(3, 5)), size, 0.5),
|
||||
[
|
||||
new LayeredPainter([tGrassC, tGrassA, tGrassB], [2, 1]),
|
||||
paintClass(clDirt)
|
||||
new TileClassPainter(clDirt)
|
||||
],
|
||||
avoidClasses(clWater, 8, clForest, 0, clHill, 0, clPlayer, 12, clDirt, 16),
|
||||
scaleByMapSize(20, 80));
|
||||
@@ -184,7 +184,7 @@ for (let size of [scaleByMapSize(2, 4), scaleByMapSize(3, 7), scaleByMapSize(5,
|
||||
new ChainPlacer(1, Math.floor(scaleByMapSize(3, 5)), size, 0.5),
|
||||
[
|
||||
new LayeredPainter([tPlants, tPlants], [1]),
|
||||
paintClass(clDirt)
|
||||
new TileClassPainter(clDirt)
|
||||
],
|
||||
avoidClasses(clWater, 8, clForest, 0, clHill, 0, clPlayer, 12, clDirt, 16),
|
||||
scaleByMapSize(20, 80));
|
||||
|
||||
@@ -77,7 +77,7 @@ createArea(
|
||||
[Math.floor(fractionToTiles(0.2))]),
|
||||
[
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 4),
|
||||
paintClass(clWater)
|
||||
new TileClassPainter(clWater)
|
||||
],
|
||||
avoidClasses(clPlayer, 20));
|
||||
|
||||
@@ -86,7 +86,7 @@ createAreas(
|
||||
new ChainPlacer(2, Math.floor(scaleByMapSize(4, 6)), 3, 1),
|
||||
[
|
||||
new LayeredPainter([tCliff, tHill], [2]),
|
||||
unPaintClass(clWater)
|
||||
new TileClassUnPainter(clWater)
|
||||
],
|
||||
borderClasses(clWater, 4, 7),
|
||||
scaleByMapSize(12, 130) * 2,
|
||||
|
||||
@@ -20,7 +20,7 @@ const startAngle = randomAngle();
|
||||
initTileClasses(["step"]);
|
||||
createArea(
|
||||
new MapBoundsPlacer(),
|
||||
paintClass(g_TileClasses.land));
|
||||
new TileClassPainter(g_TileClasses.land));
|
||||
|
||||
Engine.SetProgress(10);
|
||||
|
||||
@@ -486,7 +486,7 @@ function createSunkenTerrain()
|
||||
[
|
||||
new LayeredPainter([g_Terrains.cliff, lower], [3]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightValley, 3),
|
||||
paintClass(g_TileClasses.valley)
|
||||
new TileClassPainter(g_TileClasses.valley)
|
||||
]);
|
||||
|
||||
log("Creating central hill...");
|
||||
@@ -495,7 +495,7 @@ function createSunkenTerrain()
|
||||
[
|
||||
new LayeredPainter([g_Terrains.cliff, topTerrain], [3]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightHill, 3),
|
||||
paintClass(g_TileClasses.mountain)
|
||||
new TileClassPainter(g_TileClasses.mountain)
|
||||
]);
|
||||
|
||||
let getCoords = (distance, playerID, playerIDOffset) => {
|
||||
@@ -514,7 +514,7 @@ function createSunkenTerrain()
|
||||
[
|
||||
new LayeredPainter([g_Terrains.cliff, middle, road], [3, 4]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightPath, 3),
|
||||
paintClass(g_TileClasses.step)
|
||||
new TileClassPainter(g_TileClasses.step)
|
||||
]);
|
||||
|
||||
log("Creating path from player to the neighbor...");
|
||||
@@ -527,7 +527,7 @@ function createSunkenTerrain()
|
||||
[
|
||||
new LayeredPainter([g_Terrains.cliff, middle, road], [3, 6]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightPath, 3),
|
||||
paintClass(g_TileClasses.step)
|
||||
new TileClassPainter(g_TileClasses.step)
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -537,7 +537,7 @@ function createSunkenTerrain()
|
||||
[
|
||||
new LayeredPainter([g_Terrains.cliff, base], [3]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightDen, 3),
|
||||
paintClass(g_TileClasses.valley)
|
||||
new TileClassPainter(g_TileClasses.valley)
|
||||
]);
|
||||
|
||||
log("Creating the expansion of the player...");
|
||||
@@ -546,7 +546,7 @@ function createSunkenTerrain()
|
||||
[
|
||||
new LayeredPainter([g_Terrains.cliff, base], [3]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightDen, 3),
|
||||
paintClass(g_TileClasses.settlement)
|
||||
new TileClassPainter(g_TileClasses.settlement)
|
||||
],
|
||||
[avoidClasses(g_TileClasses.settlement, 2)]);
|
||||
}
|
||||
@@ -560,7 +560,7 @@ function createSunkenTerrain()
|
||||
[
|
||||
new LayeredPainter([g_Terrains.cliff, lower], [3]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightValley, 3),
|
||||
paintClass(g_TileClasses.settlement)
|
||||
new TileClassPainter(g_TileClasses.settlement)
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ placePlayerBases({
|
||||
"outerTerrain": tRoadWild,
|
||||
"innerTerrain": tRoad,
|
||||
"painters": [
|
||||
paintClass(clPlayer)
|
||||
new TileClassPainter(clPlayer)
|
||||
]
|
||||
},
|
||||
"Chicken": {
|
||||
@@ -176,7 +176,7 @@ for (let size of [scaleByMapSize(3, 6), scaleByMapSize(5, 10), scaleByMapSize(8,
|
||||
new ChainPlacer(1, Math.floor(scaleByMapSize(3, 5)), size, 0.5),
|
||||
[
|
||||
new LayeredPainter([[tGrass,tGrassA], tGrassB, [tGrassB,tGrassC]], [1, 1]),
|
||||
paintClass(clDirt)
|
||||
new TileClassPainter(clDirt)
|
||||
],
|
||||
avoidClasses(clWater, 1, clForest, 0, clHill, 0, clDirt, 5, clPlayer, 6),
|
||||
scaleByMapSize(15, 45)
|
||||
|
||||
@@ -79,8 +79,8 @@ for (let i = 0; i < numPlayers; ++i)
|
||||
[
|
||||
new LayeredPainter([tWater, tShore, tMainTerrain], [1, 4]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightLand, 4),
|
||||
paintClass(clIsland),
|
||||
paintClass(isNomad() ? clLand : clPlayer)
|
||||
new TileClassPainter(clIsland),
|
||||
new TileClassPainter(isNomad() ? clLand : clPlayer)
|
||||
]);
|
||||
|
||||
if (isNomad())
|
||||
@@ -133,7 +133,7 @@ createArea(
|
||||
[
|
||||
new LayeredPainter([tWater, tShore, tMainTerrain], [4, 2]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightLand, 4),
|
||||
paintClass(clLand)
|
||||
new TileClassPainter(clLand)
|
||||
],
|
||||
avoidClasses(clIsland, 8));
|
||||
Engine.SetProgress(20);
|
||||
@@ -144,7 +144,7 @@ createAreas(
|
||||
[
|
||||
new LayeredPainter([tMainTerrain, tMainTerrain], [2]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightLand, 4),
|
||||
paintClass(clLand)
|
||||
new TileClassPainter(clLand)
|
||||
],
|
||||
[
|
||||
borderClasses(clLand, 6, 3),
|
||||
@@ -172,7 +172,7 @@ createAreas(
|
||||
[
|
||||
new LayeredPainter([tCliff, tHill], [2]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightHill, 2),
|
||||
paintClass(clHill)
|
||||
new TileClassPainter(clHill)
|
||||
],
|
||||
[avoidClasses(clIsland, 10, clHill, 15), stayClasses(clLand, 7)],
|
||||
scaleByMapSize(1, 4) * numPlayers
|
||||
@@ -195,7 +195,7 @@ for (let type of types)
|
||||
new ClumpPlacer(forestTrees / num, 0.1, 0.1, 1),
|
||||
[
|
||||
new LayeredPainter(type, [2]),
|
||||
paintClass(clForest)
|
||||
new TileClassPainter(clForest)
|
||||
],
|
||||
[avoidClasses(clPlayer, 6, clForest, 10, clHill, 0), stayClasses(clLand, 7)],
|
||||
num);
|
||||
@@ -209,7 +209,7 @@ for (let size of [scaleByMapSize(3, 48), scaleByMapSize(5, 84), scaleByMapSize(8
|
||||
new LayeredPainter(
|
||||
[[tMainTerrain, tTier1Terrain], [tTier1Terrain, tTier2Terrain], [tTier2Terrain, tTier3Terrain]],
|
||||
[1, 1]),
|
||||
paintClass(clDirt)
|
||||
new TileClassPainter(clDirt)
|
||||
],
|
||||
[
|
||||
avoidClasses(
|
||||
|
||||
@@ -69,7 +69,7 @@ if (!isNomad())
|
||||
for (let i = 0; i < numPlayers; ++i)
|
||||
createArea(
|
||||
new ClumpPlacer(diskArea(defaultPlayerBaseRadius()), 0.9, 0.5, 10, playerPosition[i]),
|
||||
paintClass(clPlayer));
|
||||
new TileClassPainter(clPlayer));
|
||||
|
||||
placePlayerBases({
|
||||
"PlayerPlacement": [playerIDs, playerPosition],
|
||||
@@ -104,7 +104,7 @@ createAreas(
|
||||
new ClumpPlacer(scaleByMapSize(40, 150), 0.2, 0.1, 0),
|
||||
[
|
||||
new TerrainPainter(tDunes),
|
||||
paintClass(clPatch)
|
||||
new TileClassPainter(clPatch)
|
||||
],
|
||||
avoidClasses(clPatch, 2, clPlayer, 0),
|
||||
scaleByMapSize(5, 20));
|
||||
@@ -115,7 +115,7 @@ createAreas(
|
||||
new ClumpPlacer(scaleByMapSize(25, 100), 0.2, 0.1, 0),
|
||||
[
|
||||
new TerrainPainter([tSand, tFineSand]),
|
||||
paintClass(clPatch)
|
||||
new TileClassPainter(clPatch)
|
||||
],
|
||||
avoidClasses(clPatch, 2, clPlayer, 0),
|
||||
scaleByMapSize(15, 50));
|
||||
@@ -126,7 +126,7 @@ createAreas(
|
||||
new ClumpPlacer(scaleByMapSize(25, 100), 0.2, 0.1, 0),
|
||||
[
|
||||
new TerrainPainter([tDirt]),
|
||||
paintClass(clPatch)
|
||||
new TileClassPainter(clPatch)
|
||||
],
|
||||
avoidClasses(clPatch, 2, clPlayer, 0),
|
||||
scaleByMapSize(15, 50));
|
||||
@@ -138,7 +138,7 @@ createArea(
|
||||
[
|
||||
new LayeredPainter([[tSand, pForest], [tGrassSand25, pForestOasis], tGrassSand25, tShore, tWaterDeep], [2, 3, 1, 1]),
|
||||
new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetOasis, 8),
|
||||
paintClass(clOasis)
|
||||
new TileClassPainter(clOasis)
|
||||
]);
|
||||
|
||||
Engine.SetProgress(30);
|
||||
@@ -195,7 +195,7 @@ var hillAreas = createAreas(
|
||||
[
|
||||
new LayeredPainter([tCliff, tSand], [1]),
|
||||
new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetHill1, 1),
|
||||
paintClass(clHill1)
|
||||
new TileClassPainter(clHill1)
|
||||
],
|
||||
avoidClasses(clOasis, 3, clPlayer, 0, clHill1, 10),
|
||||
scaleByMapSize(10,20), 100
|
||||
@@ -209,7 +209,7 @@ hillAreas = hillAreas.concat(
|
||||
[
|
||||
new LayeredPainter([tCliff, tSand], [1]),
|
||||
new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetHill2, 1),
|
||||
paintClass(clHill1)
|
||||
new TileClassPainter(clHill1)
|
||||
],
|
||||
avoidClasses(clOasis, 3, clPlayer, 0, clHill1, 3),
|
||||
scaleByMapSize(15,25),
|
||||
@@ -273,7 +273,7 @@ createAreas(
|
||||
new ClumpPlacer(forestTrees / num, 0.15, 0.1, 0.5),
|
||||
[
|
||||
new TerrainPainter([tSand, pForest]),
|
||||
paintClass(clForest)
|
||||
new TileClassPainter(clForest)
|
||||
],
|
||||
avoidClasses(clPlayer, 1, clOasis, 10, clForest, 10, clHill1, 1),
|
||||
num,
|
||||
|
||||
@@ -102,7 +102,7 @@ for (let i = 0; i < scaleByMapSize(20, 120); ++i)
|
||||
[
|
||||
new LayeredPainter([tSnowA, tSnowA], [2]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightLand, 3),
|
||||
unPaintClass(clWater)
|
||||
new TileClassUnPainter(clWater)
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -112,8 +112,8 @@ createAreas(
|
||||
[
|
||||
new LayeredPainter([tSnowA, tSnowA], [3]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightLand, 3),
|
||||
paintClass(clIsland),
|
||||
unPaintClass(clWater)
|
||||
new TileClassPainter(clIsland),
|
||||
new TileClassUnPainter(clWater)
|
||||
],
|
||||
stayClasses(clWater, 7),
|
||||
scaleByMapSize(10, 80));
|
||||
@@ -126,7 +126,7 @@ createAreas(
|
||||
[
|
||||
new LayeredPainter([tShoreBlend, tShore, tWater], [1, 1]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightLake, 3),
|
||||
paintClass(clWater)
|
||||
new TileClassPainter(clWater)
|
||||
],
|
||||
avoidClasses(clPlayer, 20, clWater, 20),
|
||||
Math.round(scaleByMapSize(1, 4) * numPlayers));
|
||||
@@ -142,7 +142,7 @@ createAreas(
|
||||
[
|
||||
new LayeredPainter([tCliff, tSnowA], [3]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightHill, 3),
|
||||
paintClass(clHill)
|
||||
new TileClassPainter(clHill)
|
||||
],
|
||||
avoidClasses(clPlayer, 20, clHill, 15, clWater, 2, clBaseResource, 2),
|
||||
scaleByMapSize(1, 4) * numPlayers
|
||||
@@ -163,7 +163,7 @@ for (let type of types)
|
||||
new ChainPlacer(1, Math.floor(scaleByMapSize(3, 5)), forestTrees / (num * Math.floor(scaleByMapSize(2, 4))), 1),
|
||||
[
|
||||
new LayeredPainter(type, [2]),
|
||||
paintClass(clForest)
|
||||
new TileClassPainter(clForest)
|
||||
],
|
||||
avoidClasses(clPlayer, 20, clForest, 20, clHill, 0, clWater, 8),
|
||||
num);
|
||||
@@ -183,7 +183,7 @@ for (let size of [scaleByMapSize(3, 6), scaleByMapSize(5, 10), scaleByMapSize(8,
|
||||
new ChainPlacer(1, Math.floor(scaleByMapSize(3, 5)), size, 0.5),
|
||||
[
|
||||
new LayeredPainter([tSnowD, tSnowB, tSnowC], [2, 1]),
|
||||
paintClass(clDirt)
|
||||
new TileClassPainter(clDirt)
|
||||
],
|
||||
avoidClasses(
|
||||
clWater, 8,
|
||||
@@ -198,7 +198,7 @@ for (let size of [scaleByMapSize(2, 4), scaleByMapSize(3, 7), scaleByMapSize(5,
|
||||
new ChainPlacer(1, Math.floor(scaleByMapSize(3, 5)), size, 0.5),
|
||||
[
|
||||
new LayeredPainter([tSnowE, tSnowE], [1]),
|
||||
paintClass(clDirt)
|
||||
new TileClassPainter(clDirt)
|
||||
],
|
||||
avoidClasses(
|
||||
clWater, 8,
|
||||
|
||||
@@ -80,7 +80,7 @@ for (let i = 0; i < numPlayers; ++i)
|
||||
new ClumpPlacer(70, 1, 0.5, 10, forestPosition),
|
||||
[
|
||||
new LayeredPainter([tForestFloor, pForestMain], [0]),
|
||||
paintClass(clBaseResource)
|
||||
new TileClassPainter(clBaseResource)
|
||||
],
|
||||
avoidClasses(clBaseResource, 0)));
|
||||
|
||||
@@ -129,7 +129,7 @@ placePlayerBases({
|
||||
"outerTerrain": tRoadWild,
|
||||
"innerTerrain": tRoad,
|
||||
"painters": [
|
||||
paintClass(clPlayer)
|
||||
new TileClassPainter(clPlayer)
|
||||
]
|
||||
},
|
||||
"Chicken": {
|
||||
@@ -157,7 +157,7 @@ createArea(
|
||||
[
|
||||
new LayeredPainter([pOasisForestLight, tWater], [forestDistance]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, forestDistance + shoreDistance),
|
||||
paintClass(clOasis)
|
||||
new TileClassPainter(clOasis)
|
||||
]);
|
||||
|
||||
Engine.SetProgress(40);
|
||||
@@ -198,7 +198,7 @@ if (mapSize > 150 && randBool())
|
||||
[
|
||||
new TerrainPainter(tSand),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightOasisPath, 5),
|
||||
paintClass(clPassage)
|
||||
new TileClassPainter(clPassage)
|
||||
]);
|
||||
}
|
||||
log("Creating some straggler trees around the passage...");
|
||||
|
||||
@@ -73,7 +73,7 @@ placePlayerBases({
|
||||
"outerTerrain": tCity,
|
||||
"innerTerrain": tCity,
|
||||
"painters": [
|
||||
paintClass(clPlayer)
|
||||
new TileClassPainter(clPlayer)
|
||||
]
|
||||
},
|
||||
"Chicken": {
|
||||
@@ -101,7 +101,7 @@ createAreas(
|
||||
new ChainPlacer(1, Math.floor(scaleByMapSize(3, 6)), Math.floor(scaleByMapSize(20, 45)), 0),
|
||||
[
|
||||
new TerrainPainter(tRocky),
|
||||
paintClass(clPatch)
|
||||
new TileClassPainter(clPatch)
|
||||
],
|
||||
avoidClasses(clPatch, 2, clPlayer, 0),
|
||||
scaleByMapSize(5, 20));
|
||||
@@ -112,7 +112,7 @@ createAreas(
|
||||
new ChainPlacer(1, Math.floor(scaleByMapSize(3, 5)), Math.floor(scaleByMapSize(15, 40)), 0),
|
||||
[
|
||||
new TerrainPainter([tRocky, tRocks]),
|
||||
paintClass(clPatch)
|
||||
new TileClassPainter(clPatch)
|
||||
],
|
||||
avoidClasses(clPatch, 2, clPlayer, 4),
|
||||
scaleByMapSize(15, 50));
|
||||
@@ -127,7 +127,7 @@ createAreas(
|
||||
0),
|
||||
[
|
||||
new TerrainPainter([tGrass]),
|
||||
paintClass(clPatch)
|
||||
new TileClassPainter(clPatch)
|
||||
],
|
||||
avoidClasses(clPatch, 2, clPlayer, 4),
|
||||
scaleByMapSize(15, 50));
|
||||
@@ -146,7 +146,7 @@ createArea(
|
||||
[
|
||||
new LayeredPainter([tLakebed2, tLakebed1], [6]),
|
||||
new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetValley, 8),
|
||||
paintClass(clCP)
|
||||
new TileClassPainter(clCP)
|
||||
],
|
||||
avoidClasses(clPlayer, 18));
|
||||
Engine.SetProgress(30);
|
||||
@@ -183,7 +183,7 @@ for (let type of types)
|
||||
1),
|
||||
[
|
||||
new LayeredPainter(type, [2]),
|
||||
paintClass(clForest)
|
||||
new TileClassPainter(clForest)
|
||||
],
|
||||
avoidClasses(
|
||||
clPlayer, 6,
|
||||
|
||||
@@ -131,7 +131,7 @@ createAreas(
|
||||
[
|
||||
new LayeredPainter([tCliff, tHill], [2]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightHill, 2),
|
||||
paintClass(clHill)
|
||||
new TileClassPainter(clHill)
|
||||
],
|
||||
avoidClasses(clPlayer, 20, clForest, 1, clHill, 15, clWater, 0),
|
||||
scaleByMapSize(1, 4) * numPlayers * 3);
|
||||
@@ -143,7 +143,7 @@ createAreas(
|
||||
new ChainPlacer(1, Math.floor(scaleByMapSize(3, 5)), forestTrees / (num * Math.floor(scaleByMapSize(2, 5))), 0.5),
|
||||
[
|
||||
new TerrainPainter([tForestFloor, pForest]),
|
||||
paintClass(clForest)
|
||||
new TileClassPainter(clForest)
|
||||
],
|
||||
avoidClasses(clPlayer, 20, clForest, 10, clWater, 1, clHill, 1, clBaseResource, 3),
|
||||
num,
|
||||
@@ -158,7 +158,7 @@ for (let size of [scaleByMapSize(3, 6), scaleByMapSize(5, 10), scaleByMapSize(8,
|
||||
new LayeredPainter(
|
||||
[[tGrass, tRocksShrubs], [tRocksShrubs, tRocksGrass], [tRocksGrass, tGrass]],
|
||||
[1, 1]),
|
||||
paintClass(clDirt)
|
||||
new TileClassPainter(clDirt)
|
||||
],
|
||||
avoidClasses(clForest, 0, clGrass, 5, clPlayer, 10, clWater, 4, clDirt, 5, clHill, 1),
|
||||
scaleByMapSize(15, 45));
|
||||
@@ -172,7 +172,7 @@ for (let size of [scaleByMapSize(3, 6), scaleByMapSize(5, 10), scaleByMapSize(8,
|
||||
new LayeredPainter(
|
||||
[[tDirt, tDirtB], [tDirt, tMainDirt], [tDirtB, tMainDirt]],
|
||||
[1, 1]),
|
||||
paintClass(clDirt)
|
||||
new TileClassPainter(clDirt)
|
||||
],
|
||||
avoidClasses(clForest, 0, clDirt, 5, clPlayer, 10, clWater, 4, clGrass, 5, clHill, 1),
|
||||
scaleByMapSize(15, 45));
|
||||
@@ -184,8 +184,8 @@ createAreas(
|
||||
[
|
||||
new LayeredPainter([tShore, tHill], [12]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightIsland, 8),
|
||||
paintClass(clIsland),
|
||||
unPaintClass(clWater)
|
||||
new TileClassPainter(clIsland),
|
||||
new TileClassUnPainter(clWater)
|
||||
],
|
||||
[stayClasses (clWater, 8)],
|
||||
1,
|
||||
|
||||
@@ -101,7 +101,7 @@ createArea(
|
||||
[
|
||||
new LayeredPainter([tShore, tWater, tWater, tWater], [1, 4, 2]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 4),
|
||||
paintClass(clWater)
|
||||
new TileClassPainter(clWater)
|
||||
],
|
||||
avoidClasses(clPlayer, 20));
|
||||
|
||||
@@ -113,7 +113,7 @@ createAreas(
|
||||
[
|
||||
new LayeredPainter([tShore, tWater, tWater], [1, 3]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 5),
|
||||
paintClass(clWater)
|
||||
new TileClassPainter(clWater)
|
||||
],
|
||||
avoidClasses(clPlayer, 20),
|
||||
scaleByMapSize(10, 16),
|
||||
|
||||
@@ -294,7 +294,7 @@ for (let ocean of distributePointsOnCircle(2, oceanAngle, fractionToTiles(0.48),
|
||||
new ClumpPlacer(diskArea(fractionToTiles(0.18)), 0.9, 0.05, 10, ocean),
|
||||
[
|
||||
new ElevationPainter(heightOcean),
|
||||
paintClass(clWater)
|
||||
new TileClassPainter(clWater)
|
||||
]);
|
||||
|
||||
log("Smoothing around the water...");
|
||||
@@ -327,7 +327,7 @@ createAreas(
|
||||
[
|
||||
new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetHill, 4, heightOffsetHillRandom),
|
||||
new TerrainPainter(tGrassSpecific),
|
||||
paintClass(clHill)
|
||||
new TileClassPainter(clHill)
|
||||
],
|
||||
avoidClasses(clWater, 5, clPlayer, 20, clBaseResource, 6, clPyrenneans, 2), scaleByMapSize(5, 35));
|
||||
|
||||
@@ -340,7 +340,7 @@ for (let type of types)
|
||||
new ClumpPlacer(size, 0.2, 0.1, 1),
|
||||
[
|
||||
new LayeredPainter(type, [scaleByMapSize(1, 2), scaleByMapSize(3, 6), scaleByMapSize(3, 6)]),
|
||||
paintClass(clForest)
|
||||
new TileClassPainter(clForest)
|
||||
],
|
||||
avoidClasses(clPlayer, 20, clPyrenneans,0, clForest, 7, clWater, 2),
|
||||
num);
|
||||
@@ -391,7 +391,7 @@ for (let size of [scaleByMapSize(3, 20), scaleByMapSize(5, 40), scaleByMapSize(8
|
||||
new ClumpPlacer(size, 0.3, 0.06, 0.5),
|
||||
[
|
||||
new TerrainPainter(tDirtyGrass),
|
||||
paintClass(clDirt)
|
||||
new TileClassPainter(clDirt)
|
||||
],
|
||||
avoidClasses(clWater, 3, clForest, 0, clPyrenneans,5, clHill, 0, clDirt, 5, clPlayer, 6),
|
||||
scaleByMapSize(15, 45));
|
||||
|
||||
@@ -94,7 +94,7 @@ for (let i = 0; i < 7; ++i)
|
||||
[
|
||||
new LayeredPainter([tShoreBlend, tShore, tWater], [1, 1]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightMarsh, 3),
|
||||
paintClass(clWater)
|
||||
new TileClassPainter(clWater)
|
||||
],
|
||||
avoidClasses(clPlayer, 20, clWater, Math.round(scaleByMapSize(7,16)*randFloat(0.8,1.35))),
|
||||
scaleByMapSize(4,20));
|
||||
@@ -127,7 +127,7 @@ for (let type of types)
|
||||
new ChainPlacer(1, Math.floor(scaleByMapSize(3, 5)), forestTrees / (num * Math.floor(scaleByMapSize(2, 4))), 1),
|
||||
[
|
||||
new LayeredPainter(type, [2]),
|
||||
paintClass(clForest)
|
||||
new TileClassPainter(clForest)
|
||||
],
|
||||
avoidClasses(clPlayer, 20, clWater, 0, clForest, 10),
|
||||
num);
|
||||
@@ -139,7 +139,7 @@ for (let size of [scaleByMapSize(3, 6), scaleByMapSize(5, 10), scaleByMapSize(8,
|
||||
new ChainPlacer(1, Math.floor(scaleByMapSize(3, 5)), size, 1),
|
||||
[
|
||||
new LayeredPainter([tGrassA, tGrassB, tMud], [1, 1]),
|
||||
paintClass(clDirt)
|
||||
new TileClassPainter(clDirt)
|
||||
],
|
||||
avoidClasses(clWater, 1, clForest, 0, clDirt, 5, clPlayer, 8),
|
||||
scaleByMapSize(15, 45));
|
||||
|
||||
@@ -99,7 +99,7 @@ for (let i = 0; i < stripWidths.length; ++i)
|
||||
[
|
||||
new LayeredPainter([tGrass, tGrass], [2]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightLand, 3),
|
||||
paintClass(clStrip[i])
|
||||
new TileClassPainter(clStrip[i])
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -118,7 +118,7 @@ for (let i = 0; i < numPlayers; ++i)
|
||||
[
|
||||
new LayeredPainter([tGrass, tGrass, tGrass], [1, 4]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightLand, 4),
|
||||
paintClass(clPlayerTerritory)
|
||||
new TileClassPainter(clPlayerTerritory)
|
||||
]);
|
||||
|
||||
placePlayerBases({
|
||||
@@ -192,7 +192,7 @@ createAreas(
|
||||
[
|
||||
new LayeredPainter([tCliff, tGrass], [3]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightHill, 3),
|
||||
paintClass(clHill)
|
||||
new TileClassPainter(clHill)
|
||||
],
|
||||
[
|
||||
avoidClasses(
|
||||
@@ -225,7 +225,7 @@ for (let type of types)
|
||||
0.5),
|
||||
[
|
||||
new LayeredPainter(type, [2]),
|
||||
paintClass(clForest)
|
||||
new TileClassPainter(clForest)
|
||||
],
|
||||
avoidClasses(
|
||||
clPlayer, 12,
|
||||
@@ -257,7 +257,7 @@ for (let size of [scaleByMapSize(3, 6), scaleByMapSize(5, 10), scaleByMapSize(8,
|
||||
new ChainPlacer(1, Math.floor(scaleByMapSize(3, 5)), size, 0.5),
|
||||
[
|
||||
new LayeredPainter([tGrassC, tGrassA, tGrassB], [2, 1]),
|
||||
paintClass(clDirt)
|
||||
new TileClassPainter(clDirt)
|
||||
],
|
||||
avoidClasses(
|
||||
clWater, 8,
|
||||
@@ -274,7 +274,7 @@ for (let size of [scaleByMapSize(2, 4), scaleByMapSize(3, 7), scaleByMapSize(5,
|
||||
new ChainPlacer(1, Math.floor(scaleByMapSize(3, 5)), size, 0.5),
|
||||
[
|
||||
new LayeredPainter([tPlants, tPlants], [1]),
|
||||
paintClass(clDirt)
|
||||
new TileClassPainter(clDirt)
|
||||
],
|
||||
avoidClasses(
|
||||
clWater, 8,
|
||||
|
||||
@@ -103,7 +103,7 @@ createArea(
|
||||
[
|
||||
new LayeredPainter([tShore, tWater, tWater, tWater], [1, 4, 2]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 4),
|
||||
paintClass(clWater)
|
||||
new TileClassPainter(clWater)
|
||||
]);
|
||||
|
||||
log("Creating rivers between opponents...");
|
||||
|
||||
@@ -42,7 +42,7 @@ function createForests(terrainSet, constraint, tileClass, treeCount)
|
||||
new ChainPlacer(1, Math.floor(scaleByMapSize(3, 5)), treeCount / numberOfForests, 0.5),
|
||||
[
|
||||
new LayeredPainter([forestVariant.borderTerrains, forestVariant.interiorTerrains], [2]),
|
||||
paintClass(tileClass)
|
||||
new TileClassPainter(tileClass)
|
||||
],
|
||||
constraint,
|
||||
numberOfForests);
|
||||
|
||||
@@ -34,7 +34,7 @@ function createHills(terrainset, constraint, tileClass, count, minSize, maxSize,
|
||||
[
|
||||
new LayeredPainter(terrainset, [1, elevationSmoothing]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, elevation, elevationSmoothing),
|
||||
paintClass(tileClass)
|
||||
new TileClassPainter(tileClass)
|
||||
],
|
||||
constraint,
|
||||
count || scaleByMapSize(1, 4) * getNumPlayers());
|
||||
@@ -259,7 +259,7 @@ function createVolcano(position, tileClass, terrainTexture, lavaTextures, smoke,
|
||||
[
|
||||
layers[i].painter || new LayeredPainter([terrainTexture, terrainTexture], [3]),
|
||||
new SmoothElevationPainter(elevationType, layers[i].elevation, layers[i].steepness),
|
||||
paintClass(layers[i].tileClass)
|
||||
new TileClassPainter(layers[i].tileClass)
|
||||
],
|
||||
i == 0 ? null : stayClasses(layers[i - 1].tileClass, 1));
|
||||
|
||||
@@ -288,7 +288,7 @@ function createPatches(sizes, terrain, constraint, count, tileClass, failFracti
|
||||
new ChainPlacer(1, Math.floor(scaleByMapSize(3, 5)), size, failFraction),
|
||||
[
|
||||
new TerrainPainter(terrain),
|
||||
paintClass(tileClass)
|
||||
new TileClassPainter(tileClass)
|
||||
],
|
||||
constraint,
|
||||
count);
|
||||
@@ -304,7 +304,7 @@ function createLayeredPatches(sizes, terrains, terrainWidths, constraint, count,
|
||||
new ChainPlacer(1, Math.floor(scaleByMapSize(3, 5)), size, failFraction),
|
||||
[
|
||||
new LayeredPainter(terrains, terrainWidths),
|
||||
paintClass(tileClass)
|
||||
new TileClassPainter(tileClass)
|
||||
],
|
||||
constraint,
|
||||
count);
|
||||
@@ -488,7 +488,7 @@ function createTributaryRivers(riverAngle, riverCount, riverWidth, heightRiverbe
|
||||
new PathPlacer(start, end, riverWidth, waviness, smoothness, offset, tapering),
|
||||
[
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightRiverbed, 4),
|
||||
paintClass(tributaryRiverTileClass)
|
||||
new TileClassPainter(tributaryRiverTileClass)
|
||||
],
|
||||
new AndConstraint([constraint, riverConstraint])))
|
||||
continue;
|
||||
|
||||
@@ -273,22 +273,6 @@ function removeFromClass(x, z, id)
|
||||
tileClass.remove(x, z);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a painter for the given class
|
||||
*/
|
||||
function paintClass(id)
|
||||
{
|
||||
return new TileClassPainter(getTileClass(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a painter for the given class
|
||||
*/
|
||||
function unPaintClass(id)
|
||||
{
|
||||
return new TileClassUnPainter(getTileClass(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an avoid constraint for the given classes by the given distances
|
||||
*/
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
/**
|
||||
* Marks the affected area with the given tileclass.
|
||||
*/
|
||||
function TileClassPainter(tileClass)
|
||||
function TileClassPainter(tileClassID)
|
||||
{
|
||||
this.tileClass = tileClass;
|
||||
this.tileClass = getTileClass(tileClassID);
|
||||
}
|
||||
|
||||
TileClassPainter.prototype.paint = function(area)
|
||||
@@ -20,9 +20,9 @@ TileClassPainter.prototype.paint = function(area)
|
||||
/**
|
||||
* Removes the given tileclass from a given area.
|
||||
*/
|
||||
function TileClassUnPainter(tileClass)
|
||||
function TileClassUnPainter(tileClassID)
|
||||
{
|
||||
this.tileClass = tileClass;
|
||||
this.tileClass = getTileClass(tileClass);
|
||||
}
|
||||
|
||||
TileClassUnPainter.prototype.paint = function(area)
|
||||
|
||||
@@ -41,7 +41,7 @@ function addBluffs(constraint, size, deviation, fill, baseHeight)
|
||||
[
|
||||
new LayeredPainter([g_Terrains.cliff, g_Terrains.mainTerrain, constrastTerrain], [2, 3]),
|
||||
new SmoothElevationPainter(ELEVATION_MODIFY, Math.floor(elevation * offset), 2),
|
||||
paintClass(g_TileClasses.bluff)
|
||||
new TileClassPainter(g_TileClasses.bluff)
|
||||
],
|
||||
constraint,
|
||||
1);
|
||||
@@ -400,7 +400,7 @@ function addElevation(constraint, el)
|
||||
[
|
||||
new LayeredPainter(el.painter, [widths.concat(pSmooth)]),
|
||||
new SmoothElevationPainter(elType, pElevation, pSmooth),
|
||||
paintClass(el.class)
|
||||
new TileClassPainter(el.class)
|
||||
],
|
||||
constraint,
|
||||
1);
|
||||
@@ -514,7 +514,7 @@ function addLayeredPatches(constraint, size, deviation, fill)
|
||||
[g_Terrains.tier4Terrain]
|
||||
],
|
||||
[1, 1]),
|
||||
paintClass(g_TileClasses.dirt)
|
||||
new TileClassPainter(g_TileClasses.dirt)
|
||||
],
|
||||
constraint,
|
||||
count * offset);
|
||||
@@ -581,7 +581,7 @@ function addPlateaus(constraint, size, deviation, fill)
|
||||
[
|
||||
new LayeredPainter([plateauTile, plateauTile], [3]),
|
||||
new SmoothElevationPainter(ELEVATION_MODIFY, hillElevation, hillElevation - 2),
|
||||
paintClass(g_TileClasses.hill)
|
||||
new TileClassPainter(g_TileClasses.hill)
|
||||
],
|
||||
[
|
||||
avoidClasses(g_TileClasses.hill, 7),
|
||||
@@ -802,7 +802,7 @@ function addForests(constraint, size, deviation, fill)
|
||||
new ChainPlacer(1, Math.floor(scaleByMapSize(3, 5) * offset), Math.floor(50 * offset), 0.5),
|
||||
[
|
||||
new LayeredPainter(forestType, [2]),
|
||||
paintClass(g_TileClasses.forest)
|
||||
new TileClassPainter(g_TileClasses.forest)
|
||||
],
|
||||
constraint,
|
||||
10 * fill);
|
||||
|
||||
@@ -158,7 +158,7 @@ function createBase(player, walls = true)
|
||||
"outerTerrain": g_Terrains.roadWild,
|
||||
"innerTerrain": g_Terrains.road,
|
||||
"painters": [
|
||||
paintClass(g_TileClasses.player)
|
||||
new TileClassPainter(g_TileClasses.player)
|
||||
]
|
||||
},
|
||||
"Chicken": {
|
||||
|
||||
@@ -94,7 +94,7 @@ for (let i = 0; i < numPlayers; ++i)
|
||||
[tSLush ,[tLush, pForest], [tLush, pForest], tShore, tShore, tWaterDeep],
|
||||
[2, 2, 1, 3, 1]),
|
||||
new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetOasis, 10),
|
||||
paintClass(clWater)
|
||||
new TileClassPainter(clWater)
|
||||
]);
|
||||
}
|
||||
Engine.SetProgress(50);
|
||||
@@ -108,7 +108,7 @@ for (let size of [scaleByMapSize(3, 48), scaleByMapSize(5, 84), scaleByMapSize(8
|
||||
[[tDirt1, tSandDunes], [tSandDunes, tDirt2], [tDirt2, tDirt1]],
|
||||
[1, 1]
|
||||
),
|
||||
paintClass(clDirt)
|
||||
new TileClassPainter(clDirt)
|
||||
],
|
||||
avoidClasses(clForest, 0, clPlayer, 0, clWater, 1, clDirt, 5),
|
||||
scaleByMapSize(15, 45));
|
||||
@@ -123,7 +123,7 @@ for (let size of [scaleByMapSize(3, 48), scaleByMapSize(5, 84), scaleByMapSize(8
|
||||
[[tDirt2, tDirtCracks], [tDirt2, tFineSand], [tDirtCracks, tFineSand]],
|
||||
[1, 1]
|
||||
),
|
||||
paintClass(clDirt)
|
||||
new TileClassPainter(clDirt)
|
||||
],
|
||||
avoidClasses(clForest, 0, clDirt, 5, clPlayer, 0, clWater, 1),
|
||||
scaleByMapSize(15, 45));
|
||||
|
||||
@@ -102,7 +102,7 @@ createAreas(
|
||||
[
|
||||
new LayeredPainter([tShore, tWater], [1]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 7),
|
||||
paintClass(clWater)
|
||||
new TileClassPainter(clWater)
|
||||
],
|
||||
avoidClasses(clPlayer, 24),
|
||||
scaleByMapSize(1, 3));
|
||||
|
||||
@@ -102,7 +102,7 @@ for (let i = 0; i < numPlayers; ++i)
|
||||
new ClumpPlacer(diskArea(scaleByMapSize(5, 30)), 0.95, 0.6, 10, riverStart[i]),
|
||||
[
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 4),
|
||||
paintClass(clWater)
|
||||
new TileClassPainter(clWater)
|
||||
],
|
||||
avoidClasses(clPlayer, 5));
|
||||
|
||||
@@ -112,7 +112,7 @@ for (let i = 0; i < numPlayers; ++i)
|
||||
[
|
||||
new LayeredPainter([tShore, tWater, tWater], [1, 3]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 4),
|
||||
paintClass(clWater)
|
||||
new TileClassPainter(clWater)
|
||||
],
|
||||
avoidClasses(clPlayer, 5));
|
||||
|
||||
@@ -121,7 +121,7 @@ for (let i = 0; i < numPlayers; ++i)
|
||||
new ClumpPlacer(diskArea(scaleByMapSize(5, 22)), 0.95, 0.6, 10, riverEnd[i]),
|
||||
[
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 4),
|
||||
paintClass(clWater)
|
||||
new TileClassPainter(clWater)
|
||||
],
|
||||
avoidClasses(clPlayer, 5));
|
||||
|
||||
@@ -170,7 +170,7 @@ createAreas(
|
||||
[
|
||||
new LayeredPainter([tGrass, tCliff, tHill], [1, 2]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightHill, 3),
|
||||
paintClass(clHill)
|
||||
new TileClassPainter(clHill)
|
||||
],
|
||||
avoidClasses(clPlayer, 20, clHill, 15, clWater, 3),
|
||||
scaleByMapSize(1, 4) * numPlayers);
|
||||
@@ -188,7 +188,7 @@ for (let type of types)
|
||||
new ClumpPlacer(forestTrees / num, 0.1, 0.1, 1),
|
||||
[
|
||||
new LayeredPainter(type, [2]),
|
||||
paintClass(clForest)
|
||||
new TileClassPainter(clForest)
|
||||
],
|
||||
avoidClasses(clPlayer, 20, clForest, 10, clHill, 0, clWater, 2),
|
||||
num
|
||||
@@ -203,7 +203,7 @@ for (let size of [scaleByMapSize(3, 48), scaleByMapSize(5, 84), scaleByMapSize(8
|
||||
new LayeredPainter(
|
||||
[[tGrass, tDirtRocksA], [tDirtRocksA, tDirtRocksB], [tDirtRocksB, tDirtRocksC]],
|
||||
[1, 1]),
|
||||
paintClass(clDirt)
|
||||
new TileClassPainter(clDirt)
|
||||
],
|
||||
avoidClasses(clWater, 3, clForest, 0, clHill, 0, clPlayer, 20),
|
||||
scaleByMapSize(15, 45));
|
||||
|
||||
@@ -157,7 +157,7 @@ placePlayerBases({
|
||||
"smoothness": 1/8,
|
||||
"painters": [
|
||||
new TerrainPainter([baseTex], [baseRadius/4, baseRadius/4]),
|
||||
paintClass(clPlayer)
|
||||
new TileClassPainter(clPlayer)
|
||||
]
|
||||
},
|
||||
// No chicken
|
||||
@@ -227,7 +227,7 @@ for (let i = 0; i < numPlayers + (pathBlending ? 1 : 0); ++i)
|
||||
[
|
||||
new TerrainPainter(terrainPath),
|
||||
new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetPath, 1),
|
||||
paintClass(clPath)
|
||||
new TileClassPainter(clPath)
|
||||
],
|
||||
avoidClasses(clPath, 0, clOpen, 0 ,clWater, 4, clBaseResource, 4));
|
||||
}
|
||||
@@ -306,7 +306,7 @@ for (var x = 0; x < mapSize; x++)
|
||||
new RectPlacer(x, z, x, z),
|
||||
[
|
||||
new TerrainPainter(border ? terrainWoodBorder : terrainWood),
|
||||
paintClass(clForest)
|
||||
new TileClassPainter(clForest)
|
||||
],
|
||||
border ?
|
||||
avoidClasses(clPath, 1, clOpen, 2, clWater, 3, clMetal, 4, clRock, 4) :
|
||||
|
||||
@@ -85,7 +85,7 @@ function createIsland(islandID, size, tileClass)
|
||||
[
|
||||
new LayeredPainter([tCliff, tHill], [2]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightIsland, 2),
|
||||
paintClass(tileClass)
|
||||
new TileClassPainter(tileClass)
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -282,7 +282,7 @@ for (let type of types)
|
||||
new ClumpPlacer(forestTrees / num, 0.1, 0.1, 1),
|
||||
[
|
||||
new LayeredPainter(type, [2]),
|
||||
paintClass(clForest)
|
||||
new TileClassPainter(clForest)
|
||||
],
|
||||
[avoidClasses(clPlayer, 6, clForest, 10), stayClasses(clLand, 4)],
|
||||
num);
|
||||
@@ -316,7 +316,7 @@ for (let size of [scaleByMapSize(3, 48), scaleByMapSize(5, 84), scaleByMapSize(8
|
||||
new ClumpPlacer(size, 0.3, 0.06, 0.5),
|
||||
[
|
||||
new LayeredPainter([[tMainTerrain, tTier1Terrain],[tTier1Terrain, tTier2Terrain], [tTier2Terrain, tTier3Terrain]], [1, 1]),
|
||||
paintClass(clDirt)
|
||||
new TileClassPainter(clDirt)
|
||||
],
|
||||
[avoidClasses(clForest, 0, clDirt, 5, clPlayer, 12), stayClasses(clLand, 5)],
|
||||
scaleByMapSize(15, 45));
|
||||
|
||||
@@ -12,7 +12,7 @@ initTileClasses();
|
||||
|
||||
createArea(
|
||||
new MapBoundsPlacer(),
|
||||
paintClass(g_TileClasses.land));
|
||||
new TileClassPainter(g_TileClasses.land));
|
||||
|
||||
Engine.SetProgress(20);
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ createArea(
|
||||
[
|
||||
new LayeredPainter([tMainTerrain, tMainTerrain], [3]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightLand, 3),
|
||||
paintClass(clLand)
|
||||
new TileClassPainter(clLand)
|
||||
]);
|
||||
Engine.SetProgress(10);
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ for (let i = 0; i < numPlayers; ++i)
|
||||
if (!isNomad())
|
||||
createArea(
|
||||
new ClumpPlacer(diskArea(defaultPlayerBaseRadius()), 0.9, 0.5, 10, playerPosition[i]),
|
||||
paintClass(clPlayer));
|
||||
new TileClassPainter(clPlayer));
|
||||
|
||||
log("Creating big grass patches surrounding the city patches...");
|
||||
createArea(
|
||||
@@ -71,7 +71,7 @@ for (let i = 0; i < numPlayers; ++i)
|
||||
[Math.floor(scaleByMapSize(16, 30))]),
|
||||
[
|
||||
new LayeredPainter([tGrassSands, tGrass], [3]),
|
||||
paintClass(clGrass)
|
||||
new TileClassPainter(clGrass)
|
||||
]);
|
||||
}
|
||||
Engine.SetProgress(10);
|
||||
@@ -119,7 +119,7 @@ createAreas(
|
||||
[
|
||||
new LayeredPainter([tCliff, tHill], [2]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightHill, 2),
|
||||
paintClass(clHill)
|
||||
new TileClassPainter(clHill)
|
||||
],
|
||||
avoidClasses(clPlayer, 3, clGrass, 1, clHill, 10),
|
||||
scaleByMapSize(1, 3) * numPlayers * 3);
|
||||
@@ -143,7 +143,7 @@ for (let type of types)
|
||||
0.5),
|
||||
[
|
||||
new LayeredPainter(type, [2]),
|
||||
paintClass(clForest)
|
||||
new TileClassPainter(clForest)
|
||||
],
|
||||
avoidClasses(clPlayer, 1, clGrass, 1, clForest, 10, clHill, 1),
|
||||
num);
|
||||
|
||||
@@ -188,7 +188,7 @@ var waterAreas = createAreas(
|
||||
[
|
||||
new LayeredPainter([tShore, tShore, tShore], [1, 1]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightPonds, 4),
|
||||
paintClass(clPond)
|
||||
new TileClassPainter(clPond)
|
||||
],
|
||||
avoidClasses(clPlayer, 25, clWater, 20, clPond, 10),
|
||||
numLakes);
|
||||
@@ -218,7 +218,7 @@ createAreas(
|
||||
new ClumpPlacer(forestTrees / num, 0.15, 0.1, 0.5),
|
||||
[
|
||||
new TerrainPainter([pForest, tForestFloor]),
|
||||
paintClass(clForest)
|
||||
new TileClassPainter(clForest)
|
||||
],
|
||||
avoidClasses(clPlayer, 19, clForest, 4, clWater, 1, clDesert, 5, clPond, 2, clBaseResource, 3),
|
||||
num,
|
||||
@@ -234,7 +234,7 @@ for (let size of [scaleByMapSize(3, 48), scaleByMapSize(5, 84), scaleByMapSize(8
|
||||
new LayeredPainter(
|
||||
[[tGrass, tGrassSand50], [tGrassSand50, tGrassSand25], [tGrassSand25, tGrass]],
|
||||
[1, 1]),
|
||||
paintClass(clDirt)
|
||||
new TileClassPainter(clDirt)
|
||||
],
|
||||
avoidClasses(clForest, 0, clGrass, 5, clPlayer, 10, clWater, 1, clDirt, 5, clShore, 1, clPond, 1),
|
||||
scaleByMapSize(15, 45));
|
||||
@@ -248,7 +248,7 @@ for (let size of [scaleByMapSize(3, 48), scaleByMapSize(5, 84), scaleByMapSize(8
|
||||
new LayeredPainter(
|
||||
[[tDirt, tDirtCracks], [tDirt, tFineSand], [tDirtCracks, tFineSand]],
|
||||
[1, 1]),
|
||||
paintClass(clDirt)
|
||||
new TileClassPainter(clDirt)
|
||||
],
|
||||
avoidClasses(clForest, 0, clDirt, 5, clPlayer, 10, clWater, 1, clGrass, 5, clShore, 1, clPond, 1),
|
||||
scaleByMapSize(15, 45));
|
||||
|
||||
@@ -156,7 +156,7 @@ function unknownArchipelago()
|
||||
new ClumpPlacer(islandSize * randFloat(0.8, 1.2), 0.8, 0.1, 10),
|
||||
[
|
||||
landElevationPainter,
|
||||
paintClass(clLand)
|
||||
new TileClassPainter(clLand)
|
||||
],
|
||||
null,
|
||||
scaleByMapSize(2, 5) * randIntInclusive(8, 14));
|
||||
@@ -166,7 +166,7 @@ function unknownArchipelago()
|
||||
new ClumpPlacer(scaleByMapSize(15, 80), 0.2, 0.1, 1),
|
||||
[
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightLand, 4),
|
||||
paintClass(clLand)
|
||||
new TileClassPainter(clLand)
|
||||
],
|
||||
borderClasses(clLand, 6, 3),
|
||||
scaleByMapSize(12, 130) * 2,
|
||||
@@ -179,7 +179,7 @@ function unknownArchipelago()
|
||||
new ClumpPlacer(islandSize * randFloat(0.6, 1.4), 0.8, 0.1, randFloat(0.0, 0.2)),
|
||||
[
|
||||
landElevationPainter,
|
||||
paintClass(clLand)
|
||||
new TileClassPainter(clLand)
|
||||
],
|
||||
avoidClasses(clLand, 3, clPlayerTerritory, 3),
|
||||
scaleByMapSize(6, 10) * randIntInclusive(8, 14));
|
||||
@@ -189,7 +189,7 @@ function unknownArchipelago()
|
||||
new ClumpPlacer(islandSize * randFloat(0.3, 0.7), 0.8, 0.1, 0.07),
|
||||
[
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightLand, 6),
|
||||
paintClass(clLand)
|
||||
new TileClassPainter(clLand)
|
||||
],
|
||||
avoidClasses(clLand, 3, clPlayerTerritory, 3),
|
||||
scaleByMapSize(2, 6) * randIntInclusive(6, 15),
|
||||
@@ -202,7 +202,7 @@ function unknownArchipelago()
|
||||
new ClumpPlacer(islandSize * randFloat(0.8, 1.2), 0.8, 0.1, 10),
|
||||
[
|
||||
landElevationPainter,
|
||||
paintClass(clLand)
|
||||
new TileClassPainter(clLand)
|
||||
],
|
||||
avoidClasses(clLand, randIntInclusive(8, 16), clPlayerTerritory, 3),
|
||||
scaleByMapSize(2, 5) * randIntInclusive(8, 14));
|
||||
@@ -234,7 +234,7 @@ function unknownContinent()
|
||||
[Math.floor(scaleByMapSize(23, 50))]),
|
||||
[
|
||||
landElevationPainter,
|
||||
paintClass(clLand)
|
||||
new TileClassPainter(clLand)
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -243,7 +243,7 @@ function unknownContinent()
|
||||
new ClumpPlacer(diskArea(fractionToTiles(0.38)), 0.9, 0.09, 10, mapCenter),
|
||||
[
|
||||
landElevationPainter,
|
||||
paintClass(clLand)
|
||||
new TileClassPainter(clLand)
|
||||
]);
|
||||
|
||||
if (randBool(1/3))
|
||||
@@ -255,14 +255,14 @@ function unknownContinent()
|
||||
new ClumpPlacer(diskArea(fractionToTiles(0.38)), 0.9, 0.09, 10, peninsulaPosition1),
|
||||
[
|
||||
landElevationPainter,
|
||||
paintClass(clLand)
|
||||
new TileClassPainter(clLand)
|
||||
]);
|
||||
|
||||
log("Remembering to not paint shorelines into the peninsula...");
|
||||
let peninsulaPosition2 = Vector2D.add(mapCenter, new Vector2D(fractionToTiles(0.35), 0).rotate(-angle));
|
||||
createArea(
|
||||
new ClumpPlacer(diskArea(fractionToTiles(0.33)), 0.9, 0.01, 10, peninsulaPosition2),
|
||||
paintClass(clPeninsulaSteam));
|
||||
new TileClassPainter(clPeninsulaSteam));
|
||||
}
|
||||
|
||||
createShoreJaggedness(waterHeight, clLand, 7);
|
||||
@@ -321,8 +321,8 @@ function unknownCentralSea()
|
||||
0.01),
|
||||
[
|
||||
landElevationPainter,
|
||||
paintClass(clLand),
|
||||
unPaintClass(clWater)
|
||||
new TileClassPainter(clLand),
|
||||
new TileClassUnPainter(clWater)
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -423,7 +423,7 @@ function unknownRiversAndLake()
|
||||
new ClumpPlacer(diskArea(fractionToTiles(0.17)), 0.7, 0.1, 10, mapCenter),
|
||||
[
|
||||
new SmoothElevationPainter(ELEVATION_SET, waterHeight, 4),
|
||||
paintClass(clWater)
|
||||
new TileClassPainter(clWater)
|
||||
]);
|
||||
|
||||
createShoreJaggedness(waterHeight, clWater, 3);
|
||||
@@ -439,7 +439,7 @@ function unknownRiversAndLake()
|
||||
new PathPlacer(mapCenter, river, scaleByMapSize(14, 24), 0.4, 3 * scaleByMapSize(1, 3), 0.2, 0.05),
|
||||
[
|
||||
new SmoothElevationPainter(ELEVATION_SET, waterHeight, 4),
|
||||
paintClass(clWater)
|
||||
new TileClassPainter(clWater)
|
||||
],
|
||||
avoidClasses(clPlayer, 5));
|
||||
|
||||
@@ -447,7 +447,7 @@ function unknownRiversAndLake()
|
||||
new ClumpPlacer(diskArea(scaleByMapSize(4, 22)), 0.95, 0.6, 10, river),
|
||||
[
|
||||
new SmoothElevationPainter(ELEVATION_SET, waterHeight, 0),
|
||||
paintClass(clWater)
|
||||
new TileClassPainter(clWater)
|
||||
],
|
||||
avoidClasses(clPlayer, 5));
|
||||
}
|
||||
@@ -457,7 +457,7 @@ function unknownRiversAndLake()
|
||||
new ClumpPlacer(diskArea(fractionToTiles(0.04)), 0.7, 0.1, 10, mapCenter),
|
||||
[
|
||||
new SmoothElevationPainter(ELEVATION_SET, waterHeight, 4),
|
||||
paintClass(clWater)
|
||||
new TileClassPainter(clWater)
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -468,7 +468,7 @@ function unknownRiversAndLake()
|
||||
new ClumpPlacer(diskArea(fractionToTiles(0.05)), 0.7, 0.1, 10, mapCenter),
|
||||
[
|
||||
landElevationPainter,
|
||||
paintClass(clWater)
|
||||
new TileClassPainter(clWater)
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -549,7 +549,7 @@ function unknownGulf()
|
||||
new ClumpPlacer(diskArea(gulfPart.radius), 0.7, 0.05, 10, position),
|
||||
[
|
||||
new SmoothElevationPainter(ELEVATION_SET, waterHeight, 4),
|
||||
paintClass(clWater)
|
||||
new TileClassPainter(clWater)
|
||||
],
|
||||
avoidClasses(clPlayerTerritory, defaultPlayerBaseRadius()));
|
||||
}
|
||||
@@ -577,7 +577,7 @@ function unknownLakes()
|
||||
new ClumpPlacer(scaleByMapSize(160, 700), 0.2, 0.1, 1),
|
||||
[
|
||||
new SmoothElevationPainter(ELEVATION_SET, waterHeight, 5),
|
||||
paintClass(clWater)
|
||||
new TileClassPainter(clWater)
|
||||
],
|
||||
[avoidClasses(clPlayerTerritory, 12), randBool() ? avoidClasses(clWater, 8) : new NullConstraint()],
|
||||
scaleByMapSize(5, 16));
|
||||
@@ -613,7 +613,7 @@ function unknownPasses()
|
||||
[
|
||||
// More smoothing than this often results in the mountainrange becoming passable to one player.
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightMountain, 1),
|
||||
paintClass(clWater)
|
||||
new TileClassPainter(clWater)
|
||||
],
|
||||
avoidClasses(clPlayer, 5));
|
||||
|
||||
@@ -647,7 +647,7 @@ function unknownPasses()
|
||||
new ClumpPlacer(diskArea(fractionToTiles(0.1)), 0.7, 0.1, 10, mapCenter),
|
||||
[
|
||||
new SmoothElevationPainter(ELEVATION_SET, waterHeight, 3),
|
||||
paintClass(clWater)
|
||||
new TileClassPainter(clWater)
|
||||
]);
|
||||
}
|
||||
else
|
||||
@@ -657,7 +657,7 @@ function unknownPasses()
|
||||
new ClumpPlacer(diskArea(fractionToTiles(0.05)), 0.7, 0.1, 10, mapCenter),
|
||||
[
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightMountain, 4),
|
||||
paintClass(clWater)
|
||||
new TileClassPainter(clWater)
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -700,7 +700,7 @@ function unknownLowlands()
|
||||
new ClumpPlacer(diskArea(scaleByMapSize(18, 32)), 0.65, 0.1, 10, valley),
|
||||
[
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightLand, 2),
|
||||
paintClass(clLand)
|
||||
new TileClassPainter(clLand)
|
||||
]);
|
||||
|
||||
log("Creating passes from player areas to the center...");
|
||||
@@ -708,7 +708,7 @@ function unknownLowlands()
|
||||
new PathPlacer(mapCenter, valley, scaleByMapSize(14, 24), 0.4, 3 * scaleByMapSize(1, 3), 0.2, 0.05),
|
||||
[
|
||||
landElevationPainter,
|
||||
paintClass(clWater)
|
||||
new TileClassPainter(clWater)
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -717,7 +717,7 @@ function unknownLowlands()
|
||||
new ClumpPlacer(diskArea(fractionToTiles(0.18)), 0.7, 0.1, 10, mapCenter),
|
||||
[
|
||||
landElevationPainter,
|
||||
paintClass(clWater)
|
||||
new TileClassPainter(clWater)
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -754,7 +754,7 @@ function createShoreJaggedness(waterHeight, borderClass, shoreDist, inwards = tr
|
||||
new ChainPlacer(2, Math.floor(scaleByMapSize(4, 6)), 15, 1),
|
||||
[
|
||||
new SmoothElevationPainter(ELEVATION_SET, i ? heightLand : waterHeight, 4),
|
||||
i ? paintClass(clLand) : unPaintClass(clLand)
|
||||
i ? new TileClassPainter(clLand) : new TileClassUnPainter(clLand)
|
||||
],
|
||||
[
|
||||
avoidClasses(clPlayer, 20, clPeninsulaSteam, 20),
|
||||
@@ -775,7 +775,7 @@ function createExtensionsOrIslands()
|
||||
new ClumpPlacer(Math.square(randIntInclusive(scaleByMapSize(8, 15), scaleByMapSize(15, 23))), 0.8, 0.1, randFloat(0, 0.2)),
|
||||
[
|
||||
landElevationPainter,
|
||||
paintClass(clLand)
|
||||
new TileClassPainter(clLand)
|
||||
],
|
||||
avoidClasses(clLand, 3, clPlayer, 3),
|
||||
scaleByMapSize(2, 5) * randIntInclusive(8, 14));
|
||||
@@ -787,7 +787,7 @@ function createExtensionsOrIslands()
|
||||
new ChainPlacer(Math.floor(scaleByMapSize(4, 7)), Math.floor(scaleByMapSize(7, 10)), Math.floor(scaleByMapSize(16, 40)), 0.07),
|
||||
[
|
||||
landElevationPainter,
|
||||
paintClass(clLand)
|
||||
new TileClassPainter(clLand)
|
||||
],
|
||||
null,
|
||||
scaleByMapSize(2, 5) * randIntInclusive(8, 14));
|
||||
@@ -806,7 +806,7 @@ function markPlayerArea(size)
|
||||
if (size == "large")
|
||||
createArea(
|
||||
new ClumpPlacer(diskArea(scaleByMapSize(17, 29) / 3), 0.6, 0.3, 10, playerPosition[i]),
|
||||
paintClass(clPlayerTerritory));
|
||||
new TileClassPainter(clPlayerTerritory));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -843,7 +843,7 @@ function createUnknownObjects()
|
||||
[
|
||||
new LayeredPainter([tCliff, tHill], [2]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightHill, 2),
|
||||
paintClass(clHill)
|
||||
new TileClassPainter(clHill)
|
||||
],
|
||||
[avoidClasses(clPlayer, 15, clHill, randIntInclusive(6, 18)), stayClasses(clLand, 0)],
|
||||
randIntInclusive(0, scaleByMapSize(4, 8))*randIntInclusive(1, scaleByMapSize(4, 9))
|
||||
@@ -864,7 +864,7 @@ function createUnknownObjects()
|
||||
new ClumpPlacer(numForest / num, 0.1, 0.1, 1),
|
||||
[
|
||||
new LayeredPainter(type, [2]),
|
||||
paintClass(clForest)
|
||||
new TileClassPainter(clForest)
|
||||
],
|
||||
[avoidClasses(clPlayer, 20, clForest, randIntInclusive(5, 15), clHill, 2), stayClasses(clLand, 4)],
|
||||
num);
|
||||
@@ -877,7 +877,7 @@ function createUnknownObjects()
|
||||
new ClumpPlacer(size, 0.3, 0.06, 0.5),
|
||||
[
|
||||
new LayeredPainter([[tMainTerrain, tTier1Terrain], [tTier1Terrain, tTier2Terrain], [tTier2Terrain, tTier3Terrain]], [1, 1]),
|
||||
paintClass(clDirt)
|
||||
new TileClassPainter(clDirt)
|
||||
],
|
||||
[avoidClasses(clForest, 0, clHill, 2, clDirt, 5, clPlayer, 7), stayClasses(clLand, 4)],
|
||||
patchCount);
|
||||
@@ -1028,7 +1028,7 @@ function createUnknownPlayerBases()
|
||||
"outerTerrain": tRoadWild,
|
||||
"innerTerrain": tRoad,
|
||||
"painters": [
|
||||
paintClass(clPlayer)
|
||||
new TileClassPainter(clPlayer)
|
||||
]
|
||||
},
|
||||
"Chicken": {
|
||||
|
||||
@@ -69,7 +69,7 @@ createAreas(
|
||||
[
|
||||
new LayeredPainter([tCliff, tGrass], [2]),
|
||||
new SmoothElevationPainter(ELEVATION_SET, heightHill, 2),
|
||||
paintClass(clHill)
|
||||
new TileClassPainter(clHill)
|
||||
],
|
||||
avoidClasses(clPlayer, 12, clHill, 15, clBaseResource, 2),
|
||||
scaleByMapSize(2, 8) * numPlayers
|
||||
@@ -88,7 +88,7 @@ for (let type of types)
|
||||
new ClumpPlacer(forestTrees / num, 0.1, 0.1, 1),
|
||||
[
|
||||
new LayeredPainter(type, [2]),
|
||||
paintClass(clForest)
|
||||
new TileClassPainter(clForest)
|
||||
],
|
||||
avoidClasses(clPlayer, 12, clForest, 10, clHill, 0, clBaseResource, 6),
|
||||
num);
|
||||
@@ -101,7 +101,7 @@ for (let size of [scaleByMapSize(3, 48), scaleByMapSize(5, 84), scaleByMapSize(8
|
||||
new ClumpPlacer(size, 0.3, 0.06, 0.5),
|
||||
[
|
||||
new LayeredPainter([tGrassA, tGrassA], [1]),
|
||||
paintClass(clDirt)
|
||||
new TileClassPainter(clDirt)
|
||||
],
|
||||
avoidClasses(clForest, 0, clHill, 0, clPlayer, 12),
|
||||
scaleByMapSize(20, 80));
|
||||
@@ -111,7 +111,7 @@ for (let size of [scaleByMapSize(3, 48), scaleByMapSize(5, 84), scaleByMapSize(8
|
||||
new ClumpPlacer(size, 0.3, 0.06, 0.5),
|
||||
[
|
||||
new LayeredPainter([tGrassB, tGrassB], [1]),
|
||||
paintClass(clDirt)
|
||||
new TileClassPainter(clDirt)
|
||||
],
|
||||
avoidClasses(clForest, 0, clHill, 0, clPlayer, 12),
|
||||
scaleByMapSize(20, 80));
|
||||
@@ -121,7 +121,7 @@ for (let size of [scaleByMapSize(3, 48), scaleByMapSize(5, 84), scaleByMapSize(8
|
||||
new ClumpPlacer(size, 0.3, 0.06, 0.5),
|
||||
[
|
||||
new LayeredPainter([tGrassC, tGrassC], [1]),
|
||||
paintClass(clDirt)
|
||||
new TileClassPainter(clDirt)
|
||||
],
|
||||
avoidClasses(clForest, 0, clHill, 0, clPlayer, 12),
|
||||
scaleByMapSize(20, 80)
|
||||
|
||||
@@ -254,7 +254,7 @@ function placeGrove(point,
|
||||
|
||||
let painters = [new TerrainPainter(groveTerrainTexture)];
|
||||
if (groveTileClass)
|
||||
painters.push(paintClass(groveTileClass));
|
||||
painters.push(new TileClassPainter(groveTileClass));
|
||||
|
||||
createArea(
|
||||
new ClumpPlacer(5, 1, 1, 1, position),
|
||||
@@ -383,7 +383,7 @@ function placeStartLocationResources(
|
||||
new ClumpPlacer(5, 1, 1, 1, position),
|
||||
[
|
||||
new TerrainPainter(groveTerrainTexture),
|
||||
paintClass(clGrove)
|
||||
new TileClassPainter(clGrove)
|
||||
]);
|
||||
|
||||
currentAngle += dAngle;
|
||||
|
||||
Reference in New Issue
Block a user