1
0
forked from 0ad/0ad

Random nomad maps are now in default filter.

The number of starting units has been increased to speedup the startup
(building of cc)
Treasures are added when the starting resources are not sufficient to
either build a dock in water maps, or build a cc in land maps.

This was SVN commit r16447.
This commit is contained in:
mimo 2015-03-17 22:03:33 +00:00
parent bed480c433
commit 5dd3cbb254
2 changed files with 47 additions and 6 deletions

View File

@ -1326,11 +1326,53 @@ for (var i = 0; i < numPlayers; i++)
var iz = playerZ[i];
var civEntities = getStartingEntities(id-1);
var angle = randFloat(0, TWO_PI);
var pEntities = [civEntities[1].Template, civEntities[1].Template, civEntities[2].Template, civEntities[2].Template, civEntities[3].Template];
for (var p = 0; p < 5; ++p)
placeObject(ix+(2*cos(angle + p * TWO_PI / 5)), iz+(2*sin(angle + p * TWO_PI / 5)), pEntities[p], id, randFloat(0,TWO_PI));
for (var j = 1; j < 4; ++j)
{
var count = (civEntities[j].Count !== undefined ? civEntities[j].Count : 1);
var jx = ix + 2 * cos(angle);
var jz = iz + 2 * sin(angle);
var kAngle = randFloat(0, TWO_PI);
for (var k = 0; k < count; ++k)
placeObject(jx + cos(kAngle + k*TWO_PI/count), jz + sin(kAngle + k*TWO_PI/count), civEntities[j].Template, id, randFloat(0, TWO_PI));
angle += TWO_PI / 3;
}
if (md > 9) // maps without water, so we must have enough resources to build a cc
{
if (g_MapSettings.StartingResources < 500)
{
var loop = (g_MapSettings.StartingResources < 200) ? 2 : 1;
for (let l = 0; l < loop; ++l)
{
var angle = randFloat(0, TWO_PI);
var rad = randFloat(3, 5);
var jx = ix + rad * cos(angle);
var jz = iz + rad * sin(angle);
placeObject(jx, jz, "gaia/special_treasure_wood", 0, randFloat(0, TWO_PI));
var angle = randFloat(0, TWO_PI);
var rad = randFloat(3, 5);
var jx = ix + rad * cos(angle);
var jz = iz + rad * sin(angle);
placeObject(jx, jz, "gaia/special_treasure_stone", 0, randFloat(0, TWO_PI));
var angle = randFloat(0, TWO_PI);
var rad = randFloat(3, 5);
var jx = ix + rad * cos(angle);
var jz = iz + rad * sin(angle);
placeObject(jx, jz, "gaia/special_treasure_metal", 0, randFloat(0, TWO_PI));
}
}
}
else // we must have enough resources to build a dock
{
if (g_MapSettings.StartingResources < 200)
{
var angle = randFloat(0, TWO_PI);
var rad = randFloat(3, 5);
var jx = ix + rad * cos(angle);
var jz = iz + rad * sin(angle);
placeObject(jx, jz, "gaia/special_treasure_wood", 0, randFloat(0, TWO_PI));
}
}
}
for (var i = 0; i < numPlayers; i++)

View File

@ -6,7 +6,6 @@
"BaseTerrain" : ["medit_sand_wet"],
"BaseHeight" : -5,
"Preview" : "unknown.png",
"Keywords": ["demo"],
"CircularMap" : true,
"XXXXXX" : "Optionally define other things here, like we would for a scenario"
}