1
0
forked from 0ad/0ad

Remove useless terrain painting that is overwritten with the paintTerrainBasedOnHeight calls following that.

Prevent rare resource collision of the starting trees with the civic
centers.

Refs https://code.wildfiregames.com/D363

This was SVN commit r19453.
This commit is contained in:
elexis 2017-04-25 10:46:50 +00:00
parent e3daa35075
commit 24e51f96eb

View File

@ -1,12 +1,7 @@
RMS.LoadLibrary("rmgen");
const tGrass1 = "savanna_grass_a";
const tGrass2 = "savanna_grass_b";
const tGrass3 = "savanna_shrubs_a";
const tCliff = "savanna_cliff_a";
const tDirt1 = "savanna_dirt_a";
const tDirt2 = "savanna_dirt_plants_a";
const tDirt3 = "savanna_dirt_plants_cracked";
const tDirt4 = "savanna_dirt_b";
const tCityTiles = "savanna_tile_a_dirt_red";
const tShore = "savanna_riparian_bank";
@ -119,12 +114,12 @@ for (let i = 0; i < numPlayers; ++i)
// Create starting trees
var num = Math.floor(PI * radius * radius / 300);
var tAngle = randFloat(-PI/3, 4 * PI/3);
var tDist = randFloat(11, 13);
var tDist = randFloat(13, 15);
var tX = Math.round(fx + tDist * Math.cos(tAngle));
var tZ = Math.round(fz + tDist * Math.sin(tAngle));
createObjectGroup(
new SimpleGroup(
[new SimpleObject(oTree, num, num, 5, 12)],
[new SimpleObject(oTree, num, num, 4, 6)],
false, clBaseResource, tX, tZ
),
0,
@ -140,32 +135,6 @@ createAreas(
scaleByMapSize(300, 800)
);
log("Creating big patches...");
var patches = [tGrass2, tGrass3];
for (let i = 0; i < patches.length; ++i)
createAreas(
new ChainPlacer(
Math.floor(scaleByMapSize(3, 6)),
Math.floor(scaleByMapSize(10, 20)),
Math.floor(scaleByMapSize(15, 60)),
1),
new TerrainPainter(patches[i]),
avoidClasses(clPlayer, 10),
scaleByMapSize(5, 20)
);
log("Creating small patches...");
var patches = [tDirt1, tDirt2, tDirt3];
var sizes = [scaleByMapSize(3, 6), scaleByMapSize(5, 10), scaleByMapSize(8, 21)];
for (let i = 0; i < sizes.length; ++i)
for (let j = 0; j < patches.length; ++j)
createAreas(
new ChainPlacer(1, Math.floor(scaleByMapSize(3, 5)), sizes[i], 1),
new TerrainPainter(patches[j]),
avoidClasses(clPlayer, 12),
scaleByMapSize(4, 15)
);
log("Creating the half dried-up lake...");
createArea(
new ChainPlacer(
@ -178,7 +147,6 @@ createArea(
0,
[Math.floor(mapSize * 0.008 * Math.pow(scaleByMapSize(1, 66), 1/8))]),
[
new LayeredPainter([tShore, tWater, tWater, tWater], [1, 4, 2]),
new SmoothElevationPainter(ELEVATION_SET, -3, 4),
paintClass(clWater)
],
@ -188,7 +156,6 @@ log("Creating more shore jaggedness...");
createAreas(
new ChainPlacer(2, Math.floor(scaleByMapSize(4, 6)), 3, 1),
[
new LayeredPainter([tCliff, tDirt1], [2]),
new SmoothElevationPainter(ELEVATION_SET, 3, 4),
unPaintClass(clWater)
],