Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/maps/random/ardennes_forest.js
Show First 20 Lines • Show All 390 Lines • ▼ Show 20 Lines | for (var iz = 0; iz < mapSize; iz++) | ||||
{ | { | ||||
// explorable area | // explorable area | ||||
var pt = {}; | var pt = {}; | ||||
pt.x = ix; | pt.x = ix; | ||||
pt.z = iz; | pt.z = iz; | ||||
explorableArea.points.push(pt); | explorableArea.points.push(pt); | ||||
} | } | ||||
if(h > 35) | if (h > 35 && g_Map.validT(ix, iz) && randFloat(0, 1) < 0.1 || | ||||
{ | h < 15 && g_Map.validT(ix, iz) && randFloat(0, 1) < 0.05 && hillDecoClass.countMembersInRadius(ix, iz, 1) == 0) | ||||
var rnd = randFloat(); | placeObject(ix + randFloat(0, 1), iz + randFloat(0, 1), pickRandom(aTrees), 0, randFloat(0, 2 * PI)); | ||||
if(g_Map.validT(ix, iz) && rnd < 0.1) | |||||
{ | |||||
var i = randInt(aTrees.length); | |||||
placeObject(ix+randFloat(), iz+randFloat(), aTrees[i], 0, randFloat(0, TWO_PI)); | |||||
} | |||||
} | |||||
else if(h < 15 && hillDecoClass.countMembersInRadius(ix, iz, 1) == 0) | |||||
{ | |||||
var rnd = randFloat(); | |||||
if(g_Map.validT(ix, iz) && rnd < 0.05) | |||||
{ | |||||
var i = randInt(aTrees.length); | |||||
placeObject(ix+randFloat(), iz+randFloat(), aTrees[i], 0, randFloat(0, TWO_PI)); | |||||
} | |||||
} | |||||
} | } | ||||
} | } | ||||
RMS.SetProgress(55); | RMS.SetProgress(55); | ||||
// Add some general noise - after placing height dependant trees | // Add some general noise - after placing height dependant trees | ||||
for (var ix = 0; ix < mapSize; ix++) | for (var ix = 0; ix < mapSize; ix++) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 219 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator