1
0
forked from mirrors/0ad

Make passages on Jebel Barkal much more noticeable by placing many reeds there.

Replace the createPassage call with a generic createArea call.

This was SVN commit r21696.
This commit is contained in:
elexis
2018-04-11 18:18:24 +00:00
parent f009e07e32
commit c16c5b4926
@@ -466,6 +466,7 @@ for (let area of irrigationCanalAreas)
}
g_Map.log("Creating passages");
var areasPassages = [];
irrigationCanalLocations.sort((a, b) => a - b);
for (let i = 0; i < irrigationCanalLocations.length; ++i)
{
@@ -488,17 +489,28 @@ for (let i = 0; i < irrigationCanalLocations.length; ++i)
break;
}
createPassage({
"start": new Vector2D(x1, y).rotateAround(-riverAngle, mapCenter),
"end": new Vector2D(x2, y).rotateAround(-riverAngle, mapCenter),
"startHeight": heightPassage,
"endHeight": heightPassage,
"constraints": [new HeightConstraint(-Infinity, heightPassage), stayClasses(clFertileLand, 2)],
"tileClass": clPassage,
"startWidth": 10,
"endWidth": 10,
"smoothWidth": 2
});
let area =
createArea(
new PathPlacer(
new Vector2D(x1, y).rotateAround(-riverAngle, mapCenter),
new Vector2D(x2, y).rotateAround(-riverAngle, mapCenter),
10,
0,
1,
0,
0,
Infinity),
[
new SmoothElevationPainter(ELEVATION_SET, heightPassage, 2),
new TileClassPainter(clPassage)
],
[
new HeightConstraint(-Infinity, heightPassage),
stayClasses(clFertileLand, 2)
]);
if (area && area.getPoints().length)
areasPassages.push(area);
}
Engine.SetProgress(40);
@@ -1286,6 +1298,16 @@ createObjectGroupsByAreas(
20,
[areaWater]);
g_Map.log("Creating reeds at the irrigation canals");
if (areasPassages.length)
createObjectGroupsByAreas(
new SimpleGroup([new RandomObject(aWaterDecoratives, 2, 4, 1, 2)], true),
0,
undefined,
scaleByMapSize(50, 250),
20,
areasPassages);
g_Map.log("Creating hawk");
for (let i = 0; i < scaleByMapSize(0, 2); ++i)
g_Map.placeEntityAnywhere(oHawk, 0, mapCenter, randomAngle());