Fix wrong argument order in Island Stronghold in 02fe3ef3e3.

Fix Island Stronghold tiny map starting islands since 875a774da9.
Fix berries inside CC on Schwarzwald since 921850cdef.
Prevent starting mines on mountains on Pompeii and other rmgen2 maps,
refs 5acd064cb9.

This was SVN commit r21177.
This commit is contained in:
elexis
2018-02-11 16:02:51 +00:00
parent 7f9652d6ff
commit 45a9714865
4 changed files with 8 additions and 10 deletions
@@ -90,10 +90,10 @@ for (let i = 0; i < teams.length; ++i)
addCivicCenterAreaToClass(playerPosition[p], clPlayer);
createArea(
new ChainPlacer(2, Math.floor(scaleByMapSize(5, 11)), Math.floor(scaleByMapSize(60, 250)), Infinity, playerPosition[p], 0, [Math.floor(fractionToTiles(0.01))]),
new ChainPlacer(2, Math.floor(scaleByMapSize(5, 11)), Math.floor(scaleByMapSize(60, 250)), Infinity, playerPosition[p], Infinity, [defaultPlayerBaseRadius() * 3/4]),
[
new LayeredPainter([tMainTerrain, tMainTerrain, tMainTerrain], [1, 6]),
new SmoothElevationPainter(ELEVATION_SET, heightLand, 6),
new SmoothElevationPainter(ELEVATION_SET, heightLand, 2),
new TileClassPainter(clLand)
]);
@@ -252,7 +252,7 @@ createAreas(
g_Map.log("Smoothing heightmap");
createArea(
new MapBoundsPlacer(),
new SmoothingPainter(0.8, 1, 3));
new SmoothingPainter(1, 0.8, 3));
createStragglerTrees(
[oTree1, oTree2, oTree4, oTree3],
@@ -115,7 +115,7 @@ LayeredPainter.prototype.paint = function(area)
*/
function SmoothingPainter(size, strength, iterations)
{
if (size <= 0)
if (size < 1)
throw new Error("Invalid size: " + size);
if (strength <= 0 || strength > 1)
@@ -124,7 +124,7 @@ function SmoothingPainter(size, strength, iterations)
if (iterations <= 0)
throw new Error("Invalid iterations: " + iterations);
this.size = size;
this.size = Math.floor(size);
this.strength = strength;
this.iterations = iterations;
}
@@ -132,7 +132,7 @@ function SmoothingPainter(size, strength, iterations)
SmoothingPainter.prototype.paint = function(area)
{
let brushPoints = getPointsInBoundingBox(getBoundingBox(
new Array(2).fill(0).map((zero, i) => new Vector2D(1, 1).mult(this.size).floor().mult(i ? 1 : -1))));
new Array(2).fill(0).map((zero, i) => new Vector2D(1, 1).mult(this.size).mult(i ? 1 : -1))));
for (let i = 0; i < this.iterations; ++i)
{
@@ -155,7 +155,7 @@ function createBase(player, walls = true)
"playerPosition": player.position,
"PlayerTileClass": g_TileClasses.player,
"BaseResourceClass": g_TileClasses.baseResource,
"baseResourceConstraint": avoidClasses(g_TileClasses.water, 0),
"baseResourceConstraint": avoidClasses(g_TileClasses.water, 0, g_TileClasses.mountain, 0),
"Walls": g_Map.getSize() > 192 && walls,
"CityPatch": {
"outerTerrain": g_Terrains.roadWild,
@@ -165,9 +165,7 @@ placePlayerBases({
"Berries": {
"template": "gaia/flora_bush_berry",
"minCount": 2,
"maxCount": 2,
"minDist": 10,
"maxDist": 10
"maxCount": 2
},
"Mines": {
"types": [