Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/maps/random/unknown.js
Show First 20 Lines • Show All 76 Lines • ▼ Show 20 Lines | for (var ix = 0; ix < mapSize; ix++) | ||||
{ | { | ||||
var x = ix / (mapSize + 1.0); | var x = ix / (mapSize + 1.0); | ||||
var z = iz / (mapSize + 1.0); | var z = iz / (mapSize + 1.0); | ||||
placeTerrain(ix, iz, tWater); | placeTerrain(ix, iz, tWater); | ||||
} | } | ||||
} | } | ||||
var iberianTowers = false; | var iberianTowers = false; | ||||
var md = randInt(1,13); | var md = randIntInclusive(1,13); | ||||
var needsAdditionalWood = false; | var needsAdditionalWood = false; | ||||
//***************************************************************************************************************************** | //***************************************************************************************************************************** | ||||
if (md == 1) //archipelago and island | if (md == 1) //archipelago and island | ||||
{ | { | ||||
needsAdditionalWood = true; | needsAdditionalWood = true; | ||||
iberianTowers = true; | iberianTowers = true; | ||||
// randomize player order | // randomize player order | ||||
Show All 13 Lines | if (md == 1) //archipelago and island | ||||
var startAngle = randFloat(0, TWO_PI); | var startAngle = randFloat(0, TWO_PI); | ||||
for (var i = 0; i < numPlayers; i++) | for (var i = 0; i < numPlayers; i++) | ||||
{ | { | ||||
playerAngle[i] = startAngle + i*TWO_PI/numPlayers; | playerAngle[i] = startAngle + i*TWO_PI/numPlayers; | ||||
playerX[i] = 0.5 + 0.35*cos(playerAngle[i]); | playerX[i] = 0.5 + 0.35*cos(playerAngle[i]); | ||||
playerZ[i] = 0.5 + 0.35*sin(playerAngle[i]); | playerZ[i] = 0.5 + 0.35*sin(playerAngle[i]); | ||||
} | } | ||||
var mdd1 = randInt(1,3); | var mdd1 = randIntInclusive(1,3); | ||||
for (var i = 0; i < numPlayers; ++i) | for (var i = 0; i < numPlayers; ++i) | ||||
{ | { | ||||
var radius = scaleByMapSize(17, 29); | var radius = scaleByMapSize(17, 29); | ||||
var shoreRadius = 4; | var shoreRadius = 4; | ||||
var elevation = 3; | var elevation = 3; | ||||
var hillSize = PI * radius * radius; | var hillSize = PI * radius * radius; | ||||
Show All 24 Lines | terrainPainter = new LayeredPainter( | ||||
[tMainTerrain, tMainTerrain], // terrains | [tMainTerrain, tMainTerrain], // terrains | ||||
[2] // widths | [2] // widths | ||||
); | ); | ||||
elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3, 4); | elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3, 4); | ||||
createAreas( | createAreas( | ||||
placer, | placer, | ||||
[terrainPainter, elevationPainter, paintClass(clLand)], | [terrainPainter, elevationPainter, paintClass(clLand)], | ||||
null, | null, | ||||
scaleByMapSize(2, 5)*randInt(8,14) | scaleByMapSize(2, 5)*randIntInclusive(8,14) | ||||
); | ); | ||||
// create shore jaggedness | // create shore jaggedness | ||||
log("Creating shore jaggedness..."); | log("Creating shore jaggedness..."); | ||||
placer = new ClumpPlacer(scaleByMapSize(15, 80), 0.2, 0.1, 1); | placer = new ClumpPlacer(scaleByMapSize(15, 80), 0.2, 0.1, 1); | ||||
terrainPainter = new LayeredPainter( | terrainPainter = new LayeredPainter( | ||||
[tCliff, tHill], // terrains | [tCliff, tHill], // terrains | ||||
[2] // widths | [2] // widths | ||||
Show All 15 Lines | terrainPainter = new LayeredPainter( | ||||
[tMainTerrain, tMainTerrain], // terrains | [tMainTerrain, tMainTerrain], // terrains | ||||
[2] // widths | [2] // widths | ||||
); | ); | ||||
elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3, 4); | elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3, 4); | ||||
createAreas( | createAreas( | ||||
placer, | placer, | ||||
[terrainPainter, elevationPainter, paintClass(clLand)], | [terrainPainter, elevationPainter, paintClass(clLand)], | ||||
avoidClasses(clLand, 3, clPlayer, 3), | avoidClasses(clLand, 3, clPlayer, 3), | ||||
scaleByMapSize(6, 10)*randInt(8,14) | scaleByMapSize(6, 10)*randIntInclusive(8,14) | ||||
); | ); | ||||
// create small islands | // create small islands | ||||
log("Creating small islands..."); | log("Creating small islands..."); | ||||
placer = new ClumpPlacer(floor(hillSize*randFloat(0.3,0.7)), 0.80, 0.1, 0.07); | placer = new ClumpPlacer(floor(hillSize*randFloat(0.3,0.7)), 0.80, 0.1, 0.07); | ||||
terrainPainter = new LayeredPainter( | terrainPainter = new LayeredPainter( | ||||
[tMainTerrain, tMainTerrain], // terrains | [tMainTerrain, tMainTerrain], // terrains | ||||
[2] // widths | [2] // widths | ||||
); | ); | ||||
elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3, 6); | elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3, 6); | ||||
createAreas( | createAreas( | ||||
placer, | placer, | ||||
[terrainPainter, elevationPainter, paintClass(clLand)], | [terrainPainter, elevationPainter, paintClass(clLand)], | ||||
avoidClasses(clLand, 3, clPlayer, 3), | avoidClasses(clLand, 3, clPlayer, 3), | ||||
scaleByMapSize(2, 6)*randInt(6,15), 25 | scaleByMapSize(2, 6)*randIntInclusive(6,15), 25 | ||||
); | ); | ||||
} | } | ||||
else if (mdd1 == 3) // tight islands | else if (mdd1 == 3) // tight islands | ||||
{ | { | ||||
// create islands | // create islands | ||||
log("Creating islands..."); | log("Creating islands..."); | ||||
placer = new ClumpPlacer(floor(hillSize*randFloat(0.8,1.2)), 0.80, 0.1, 10); | placer = new ClumpPlacer(floor(hillSize*randFloat(0.8,1.2)), 0.80, 0.1, 10); | ||||
terrainPainter = new LayeredPainter( | terrainPainter = new LayeredPainter( | ||||
[tMainTerrain, tMainTerrain], // terrains | [tMainTerrain, tMainTerrain], // terrains | ||||
[2] // widths | [2] // widths | ||||
); | ); | ||||
elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3, 4); | elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3, 4); | ||||
createAreas( | createAreas( | ||||
placer, | placer, | ||||
[terrainPainter, elevationPainter, paintClass(clLand)], | [terrainPainter, elevationPainter, paintClass(clLand)], | ||||
avoidClasses(clLand, randInt(8, 16), clPlayer, 3), | avoidClasses(clLand, randIntInclusive(8, 16), clPlayer, 3), | ||||
scaleByMapSize(2, 5)*randInt(8,14) | scaleByMapSize(2, 5)*randIntInclusive(8,14) | ||||
); | ); | ||||
} | } | ||||
} | } | ||||
//******************************************************************************************************** | //******************************************************************************************************** | ||||
else if (md == 2) //continent | else if (md == 2) //continent | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | var elevationPainter = new SmoothElevationPainter( | ||||
ELEVATION_SET, // type | ELEVATION_SET, // type | ||||
3, // elevation | 3, // elevation | ||||
4 // blend radius | 4 // blend radius | ||||
); | ); | ||||
createArea(placer, [terrainPainter, elevationPainter, paintClass(clLand)], null); | createArea(placer, [terrainPainter, elevationPainter, paintClass(clLand)], null); | ||||
var clPeninsulaSteam = createTileClass(); | var clPeninsulaSteam = createTileClass(); | ||||
if (randInt(1,3)==1) // peninsula | if (randBool(1/3)) // peninsula | ||||
{ | { | ||||
var angle = randFloat(0, TWO_PI); | var angle = randFloat(0, TWO_PI); | ||||
var fx = fractionToTiles(0.5 + 0.25*cos(angle)); | var fx = fractionToTiles(0.5 + 0.25*cos(angle)); | ||||
var fz = fractionToTiles(0.5 + 0.25*sin(angle)); | var fz = fractionToTiles(0.5 + 0.25*sin(angle)); | ||||
ix = round(fx); | ix = round(fx); | ||||
iz = round(fz); | iz = round(fz); | ||||
▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | playerIDs = primeSortPlayers(sortPlayers(playerIDs)); | ||||
// place players | // place players | ||||
var playerX = new Array(numPlayers); | var playerX = new Array(numPlayers); | ||||
var playerZ = new Array(numPlayers); | var playerZ = new Array(numPlayers); | ||||
var playerAngle = new Array(numPlayers); | var playerAngle = new Array(numPlayers); | ||||
var playerPos = new Array(numPlayers); | var playerPos = new Array(numPlayers); | ||||
var iop = 0; | var iop = 0; | ||||
var mdd1 = randInt(1,2); | var mdd1 = randIntInclusive(1,2); | ||||
if (mdd1 == 1) //vertical | if (mdd1 == 1) //vertical | ||||
{ | { | ||||
for (var i = 0; i < numPlayers; i++) | for (var i = 0; i < numPlayers; i++) | ||||
{ | { | ||||
iop = i - 1; | iop = i - 1; | ||||
if (!(numPlayers%2)){ | if (!(numPlayers%2)){ | ||||
playerPos[i] = ((iop + abs(iop%2))/2 + 1) / ((numPlayers / 2) + 1); | playerPos[i] = ((iop + abs(iop%2))/2 + 1) / ((numPlayers / 2) + 1); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 135 Lines • ▼ Show 20 Lines | for (var iz = 0; iz < mapSize; iz++) | ||||
{ | { | ||||
setHeight(ix, iz, 3.1); | setHeight(ix, iz, 3.1); | ||||
addToClass(ix, iz, clLand); | addToClass(ix, iz, clLand); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } | ||||
if (!randInt(3)) | if (randBool(1/3)) | ||||
{ | { | ||||
// linked | // linked | ||||
if (mdd1 == 1) //vertical | if (mdd1 == 1) //vertical | ||||
{ | { | ||||
var placer = new PathPlacer(1, fractionToTiles(0.5), fractionToTiles(0.99), fractionToTiles(0.5), scaleByMapSize(randInt(16,24),randInt(100,140)), 0.5, 3*(scaleByMapSize(1,4)), 0.1, 0.01); | var placer = new PathPlacer(1, fractionToTiles(0.5), fractionToTiles(0.99), fractionToTiles(0.5), scaleByMapSize(randIntInclusive(16,24),randIntInclusive(100,140)), 0.5, 3*(scaleByMapSize(1,4)), 0.1, 0.01); | ||||
} | } | ||||
else | else | ||||
{ | { | ||||
var placer = new PathPlacer(fractionToTiles(0.5), 1, fractionToTiles(0.5), fractionToTiles(0.99), scaleByMapSize(randInt(16,24),randInt(100,140)), 0.5, 3*(scaleByMapSize(1,4)), 0.1, 0.01); | var placer = new PathPlacer(fractionToTiles(0.5), 1, fractionToTiles(0.5), fractionToTiles(0.99), scaleByMapSize(randIntInclusive(16,24),randIntInclusive(100,140)), 0.5, 3*(scaleByMapSize(1,4)), 0.1, 0.01); | ||||
} | } | ||||
var terrainPainter = new LayeredPainter( | var terrainPainter = new LayeredPainter( | ||||
[tMainTerrain, tMainTerrain, tMainTerrain], // terrains | [tMainTerrain, tMainTerrain, tMainTerrain], // terrains | ||||
[1, 3] // widths | [1, 3] // widths | ||||
); | ); | ||||
var elevationPainter = new SmoothElevationPainter( | var elevationPainter = new SmoothElevationPainter( | ||||
ELEVATION_SET, // type | ELEVATION_SET, // type | ||||
3.1, // elevation | 3.1, // elevation | ||||
4 // blend radius | 4 // blend radius | ||||
); | ); | ||||
createArea(placer, [terrainPainter, elevationPainter, unPaintClass(clWater)], null); | createArea(placer, [terrainPainter, elevationPainter, unPaintClass(clWater)], null); | ||||
} | } | ||||
var mdd2 = randInt(1,7); | var mdd2 = randIntInclusive(1,7); | ||||
if (mdd2 == 1) | if (mdd2 == 1) | ||||
{ | { | ||||
// create islands | // create islands | ||||
log("Creating islands..."); | log("Creating islands..."); | ||||
placer = new ClumpPlacer(randInt(scaleByMapSize(8,15),scaleByMapSize(15,23))*randInt(scaleByMapSize(8,15),scaleByMapSize(15,23)), 0.80, 0.1, randFloat(0.0, 0.2)); | placer = new ClumpPlacer(randIntInclusive(scaleByMapSize(8,15),scaleByMapSize(15,23))*randIntInclusive(scaleByMapSize(8,15),scaleByMapSize(15,23)), 0.80, 0.1, randFloat(0.0, 0.2)); | ||||
terrainPainter = new LayeredPainter( | terrainPainter = new LayeredPainter( | ||||
[tMainTerrain, tMainTerrain], // terrains | [tMainTerrain, tMainTerrain], // terrains | ||||
[2] // widths | [2] // widths | ||||
); | ); | ||||
elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3.1, 4); | elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3.1, 4); | ||||
createAreas( | createAreas( | ||||
placer, | placer, | ||||
[terrainPainter, elevationPainter, paintClass(clLand)], | [terrainPainter, elevationPainter, paintClass(clLand)], | ||||
avoidClasses(clLand, 3, clPlayer, 3), | avoidClasses(clLand, 3, clPlayer, 3), | ||||
scaleByMapSize(2, 5)*randInt(8,14) | scaleByMapSize(2, 5)*randIntInclusive(8,14) | ||||
); | ); | ||||
} | } | ||||
else if (mdd2 == 2) | else if (mdd2 == 2) | ||||
{ | { | ||||
// create extentions | // create extentions | ||||
log("Creating extentions..."); | log("Creating extentions..."); | ||||
placer = new ClumpPlacer(randInt(scaleByMapSize(13,24),scaleByMapSize(24,45))*randInt(scaleByMapSize(13,24),scaleByMapSize(24,45)), 0.80, 0.1, 10); | placer = new ClumpPlacer(randIntInclusive(scaleByMapSize(13,24),scaleByMapSize(24,45))*randIntInclusive(scaleByMapSize(13,24),scaleByMapSize(24,45)), 0.80, 0.1, 10); | ||||
terrainPainter = new LayeredPainter( | terrainPainter = new LayeredPainter( | ||||
[tMainTerrain, tMainTerrain], // terrains | [tMainTerrain, tMainTerrain], // terrains | ||||
[2] // widths | [2] // widths | ||||
); | ); | ||||
elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3.1, 4); | elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3.1, 4); | ||||
createAreas( | createAreas( | ||||
placer, | placer, | ||||
[terrainPainter, elevationPainter, paintClass(clLand)], | [terrainPainter, elevationPainter, paintClass(clLand)], | ||||
null, | null, | ||||
scaleByMapSize(2, 5)*randInt(8,14) | scaleByMapSize(2, 5)*randIntInclusive(8,14) | ||||
); | ); | ||||
} | } | ||||
} | } | ||||
//******************************************************************************************************** | //******************************************************************************************************** | ||||
else if (md == 4) //central river | else if (md == 4) //central river | ||||
{ | { | ||||
for (var ix = 0; ix < mapSize; ix++) | for (var ix = 0; ix < mapSize; ix++) | ||||
Show All 16 Lines | else if (md == 4) //central river | ||||
// place players | // place players | ||||
var playerX = new Array(numPlayers); | var playerX = new Array(numPlayers); | ||||
var playerZ = new Array(numPlayers); | var playerZ = new Array(numPlayers); | ||||
var playerAngle = new Array(numPlayers); | var playerAngle = new Array(numPlayers); | ||||
var playerPos = new Array(numPlayers); | var playerPos = new Array(numPlayers); | ||||
var iop = 0; | var iop = 0; | ||||
var mdd1 = randInt(1,2); | var mdd1 = randIntInclusive(1,2); | ||||
if (mdd1 == 1) //horizontal | if (mdd1 == 1) //horizontal | ||||
{ | { | ||||
for (var i = 0; i < numPlayers; i++) | for (var i = 0; i < numPlayers; i++) | ||||
{ | { | ||||
iop = i - 1; | iop = i - 1; | ||||
if (!(numPlayers%2)){ | if (!(numPlayers%2)){ | ||||
playerPos[i] = ((iop + abs(iop%2))/2 + 1) / ((numPlayers / 2) + 1); | playerPos[i] = ((iop + abs(iop%2))/2 + 1) / ((numPlayers / 2) + 1); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | if (mdd1 == 1) | ||||
placer = new ClumpPlacer(floor(PI*scaleByMapSize(10,20)*scaleByMapSize(10,20)/4), 0.95, 0.6, 10, fractionToTiles(0.99), fractionToTiles(0.5)); | placer = new ClumpPlacer(floor(PI*scaleByMapSize(10,20)*scaleByMapSize(10,20)/4), 0.95, 0.6, 10, fractionToTiles(0.99), fractionToTiles(0.5)); | ||||
else | else | ||||
placer = new ClumpPlacer(floor(PI*scaleByMapSize(10,20)*scaleByMapSize(10,20)/4), 0.95, 0.6, 10, fractionToTiles(0.5), fractionToTiles(0.99)); | placer = new ClumpPlacer(floor(PI*scaleByMapSize(10,20)*scaleByMapSize(10,20)/4), 0.95, 0.6, 10, fractionToTiles(0.5), fractionToTiles(0.99)); | ||||
var painter = new LayeredPainter([tWater, tWater], [1]); | var painter = new LayeredPainter([tWater, tWater], [1]); | ||||
var elevationPainter = new SmoothElevationPainter(ELEVATION_SET, -4, 2); | var elevationPainter = new SmoothElevationPainter(ELEVATION_SET, -4, 2); | ||||
createArea(placer, [painter, elevationPainter], avoidClasses(clPlayer, 8)); | createArea(placer, [painter, elevationPainter], avoidClasses(clPlayer, 8)); | ||||
var mdd2 = randInt(1,2); | var mdd2 = randIntInclusive(1,2); | ||||
if (mdd2 == 1) | if (mdd2 == 1) | ||||
{ | { | ||||
// create the shallows of the main river | // create the shallows of the main river | ||||
log("Creating the shallows of the main river"); | log("Creating the shallows of the main river"); | ||||
for (var i = 0; i <= randInt(1, scaleByMapSize(4,8)); i++) | for (var i = 0; i <= randIntInclusive(1, scaleByMapSize(4,8)); i++) | ||||
{ | { | ||||
var cLocation = randFloat(0.15,0.85); | var cLocation = randFloat(0.15,0.85); | ||||
if (mdd1 == 1) | if (mdd1 == 1) | ||||
passageMaker(floor(fractionToTiles(cLocation)), floor(fractionToTiles(0.35)), floor(fractionToTiles(cLocation)), floor(fractionToTiles(0.65)), scaleByMapSize(4,8), -2, -2, 2, clShallow, undefined, -4); | passageMaker(floor(fractionToTiles(cLocation)), floor(fractionToTiles(0.35)), floor(fractionToTiles(cLocation)), floor(fractionToTiles(0.65)), scaleByMapSize(4,8), -2, -2, 2, clShallow, undefined, -4); | ||||
else | else | ||||
passageMaker(floor(fractionToTiles(0.35)), floor(fractionToTiles(cLocation)), floor(fractionToTiles(0.65)), floor(fractionToTiles(cLocation)), scaleByMapSize(4,8), -2, -2, 2, clShallow, undefined, -4); | passageMaker(floor(fractionToTiles(0.35)), floor(fractionToTiles(cLocation)), floor(fractionToTiles(0.65)), floor(fractionToTiles(cLocation)), scaleByMapSize(4,8), -2, -2, 2, clShallow, undefined, -4); | ||||
} | } | ||||
} | } | ||||
if (randInt(1,2) == 1) | if (randBool()) | ||||
{ | { | ||||
for (var i = 0; i < numPlayers; i++) | for (var i = 0; i < numPlayers; i++) | ||||
{ | { | ||||
var fx = fractionToTiles(playerX[i]); | var fx = fractionToTiles(playerX[i]); | ||||
var fz = fractionToTiles(playerZ[i]); | var fz = fractionToTiles(playerZ[i]); | ||||
var ix = round(fx); | var ix = round(fx); | ||||
var iz = round(fz); | var iz = round(fz); | ||||
// create the city patch | // create the city patch | ||||
var cityRadius = scaleByMapSize(17,29)/3; | var cityRadius = scaleByMapSize(17,29)/3; | ||||
placer = new ClumpPlacer(PI*cityRadius*cityRadius, 0.6, 0.3, 10, ix, iz); | placer = new ClumpPlacer(PI*cityRadius*cityRadius, 0.6, 0.3, 10, ix, iz); | ||||
createArea(placer, paintClass(clPlayer), null); | createArea(placer, paintClass(clPlayer), null); | ||||
} | } | ||||
// create tributaries | // create tributaries | ||||
log("Creating tributaries"); | log("Creating tributaries"); | ||||
for (var i = 0; i <= randInt(8, (scaleByMapSize(12,20))); i++) | for (var i = 0; i <= randIntInclusive(8, (scaleByMapSize(12,20))); i++) | ||||
{ | { | ||||
var cLocation = randFloat(0.05,0.95); | var cLocation = randFloat(0.05,0.95); | ||||
var tang = randFloat(PI*0.2, PI*0.8)*((randInt(2)-0.5)*2); | var tang = randFloat(PI*0.2, PI*0.8)*((randIntInclusive(0, 1)-0.5)*2); | ||||
if (tang > 0) | if (tang > 0) | ||||
{ | { | ||||
var cDistance = 0.05; | var cDistance = 0.05; | ||||
} | } | ||||
else | else | ||||
{ | { | ||||
var cDistance = -0.05; | var cDistance = -0.05; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | else if (md == 5) //rivers and lake | ||||
{ | { | ||||
for (var iz = 0; iz < mapSize; iz++) | for (var iz = 0; iz < mapSize; iz++) | ||||
{ | { | ||||
var x = ix / (mapSize + 1.0); | var x = ix / (mapSize + 1.0); | ||||
var z = iz / (mapSize + 1.0); | var z = iz / (mapSize + 1.0); | ||||
setHeight(ix, iz, 3); | setHeight(ix, iz, 3); | ||||
} | } | ||||
} | } | ||||
var mdd1 = randInt(1,2); | var mdd1 = randIntInclusive(1,2); | ||||
if (mdd1 == 1) //lake | if (mdd1 == 1) //lake | ||||
{ | { | ||||
var fx = fractionToTiles(0.5); | var fx = fractionToTiles(0.5); | ||||
var fz = fractionToTiles(0.5); | var fz = fractionToTiles(0.5); | ||||
ix = round(fx); | ix = round(fx); | ||||
iz = round(fz); | iz = round(fz); | ||||
var lSize = sqrt(sqrt(sqrt(scaleByMapSize(1, 6)))); | var lSize = sqrt(sqrt(sqrt(scaleByMapSize(1, 6)))); | ||||
Show All 34 Lines | if (mdd1 == 1) //lake | ||||
createAreas( | createAreas( | ||||
placer, | placer, | ||||
[terrainPainter, elevationPainter, unPaintClass(clWater)], | [terrainPainter, elevationPainter, unPaintClass(clWater)], | ||||
borderClasses(clWater, 4, 7), | borderClasses(clWater, 4, 7), | ||||
scaleByMapSize(12, 130) * 2, 150 | scaleByMapSize(12, 130) * 2, 150 | ||||
); | ); | ||||
} | } | ||||
if (randInt(1,2) == 1) //rivers | if (randBool()) // rivers | ||||
{ | { | ||||
//create rivers | //create rivers | ||||
log ("Creating rivers..."); | log ("Creating rivers..."); | ||||
for (var m = 0; m < numPlayers; m++) | for (var m = 0; m < numPlayers; m++) | ||||
{ | { | ||||
var tang = startAngle + (m+0.5)*TWO_PI/(numPlayers); | var tang = startAngle + (m+0.5)*TWO_PI/(numPlayers); | ||||
var placer = new PathPlacer(fractionToTiles(0.5), fractionToTiles(0.5), fractionToTiles(0.5 + 0.49*cos(tang)), fractionToTiles(0.5 + 0.49*sin(tang)), scaleByMapSize(14,24), 0.4, 3*(scaleByMapSize(1,3)), 0.2, 0.05); | var placer = new PathPlacer(fractionToTiles(0.5), fractionToTiles(0.5), fractionToTiles(0.5 + 0.49*cos(tang)), fractionToTiles(0.5 + 0.49*sin(tang)), scaleByMapSize(14,24), 0.4, 3*(scaleByMapSize(1,3)), 0.2, 0.05); | ||||
var terrainPainter = new LayeredPainter( | var terrainPainter = new LayeredPainter( | ||||
Show All 26 Lines | if (randBool()) // rivers | ||||
var elevationPainter = new SmoothElevationPainter( | var elevationPainter = new SmoothElevationPainter( | ||||
ELEVATION_SET, // type | ELEVATION_SET, // type | ||||
-4, // elevation | -4, // elevation | ||||
4 // blend radius | 4 // blend radius | ||||
); | ); | ||||
createArea(placer, [terrainPainter, elevationPainter, paintClass(clWater)], null); | createArea(placer, [terrainPainter, elevationPainter, paintClass(clWater)], null); | ||||
} | } | ||||
if ((randInt(1,3) == 1)&&(mdd1 == 1))//island | if (randBool(1/3) &&(mdd1 == 1))//island | ||||
{ | { | ||||
var placer = new ClumpPlacer(mapArea * 0.006 * lSize, 0.7, 0.1, 10, ix, iz); | var placer = new ClumpPlacer(mapArea * 0.006 * lSize, 0.7, 0.1, 10, ix, iz); | ||||
var terrainPainter = new LayeredPainter( | var terrainPainter = new LayeredPainter( | ||||
[tShore, tWater, tWater, tWater], // terrains | [tShore, tWater, tWater, tWater], // terrains | ||||
[1, 4, 2] // widths | [1, 4, 2] // widths | ||||
); | ); | ||||
var elevationPainter = new SmoothElevationPainter( | var elevationPainter = new SmoothElevationPainter( | ||||
ELEVATION_SET, // type | ELEVATION_SET, // type | ||||
Show All 12 Lines | for (var ix = 0; ix < mapSize; ix++) | ||||
for (var iz = 0; iz < mapSize; iz++) | for (var iz = 0; iz < mapSize; iz++) | ||||
{ | { | ||||
var x = ix / (mapSize + 1.0); | var x = ix / (mapSize + 1.0); | ||||
var z = iz / (mapSize + 1.0); | var z = iz / (mapSize + 1.0); | ||||
setHeight(ix, iz, 3); | setHeight(ix, iz, 3); | ||||
} | } | ||||
} | } | ||||
var mdd1 = randInt(1,2); | var mdd1 = randIntInclusive(1,2); | ||||
// randomize player order | // randomize player order | ||||
var playerIDs = []; | var playerIDs = []; | ||||
for (var i = 0; i < numPlayers; i++) | for (var i = 0; i < numPlayers; i++) | ||||
{ | { | ||||
playerIDs.push(i+1); | playerIDs.push(i+1); | ||||
} | } | ||||
playerIDs = sortPlayers(playerIDs); | playerIDs = sortPlayers(playerIDs); | ||||
Show All 24 Lines | for (var i = 0; i < numPlayers; i++) | ||||
var iz = round(fz); | var iz = round(fz); | ||||
addToClass(ix, iz, clPlayer); | addToClass(ix, iz, clPlayer); | ||||
addToClass(ix+5, iz, clPlayer); | addToClass(ix+5, iz, clPlayer); | ||||
addToClass(ix, iz+5, clPlayer); | addToClass(ix, iz+5, clPlayer); | ||||
addToClass(ix-5, iz, clPlayer); | addToClass(ix-5, iz, clPlayer); | ||||
addToClass(ix, iz-5, clPlayer); | addToClass(ix, iz-5, clPlayer); | ||||
} | } | ||||
var mdd2 = randInt(1,3); | var mdd2 = randIntInclusive(1,3); | ||||
var fadedistance = 7; | var fadedistance = 7; | ||||
if (mdd1 == 1) | if (mdd1 == 1) | ||||
{ | { | ||||
if ((mdd2 == 1)||(mdd2 == 3)) | if ((mdd2 == 1)||(mdd2 == 3)) | ||||
{ | { | ||||
var distance = randFloat(0., 0.1); | var distance = randFloat(0., 0.1); | ||||
for (var ix = 0; ix < mapSize; ix++) | for (var ix = 0; ix < mapSize; ix++) | ||||
▲ Show 20 Lines • Show All 148 Lines • ▼ Show 20 Lines | else if (md == 6) //edge seas | ||||
elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3, 4); | elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3, 4); | ||||
createAreas( | createAreas( | ||||
placer, | placer, | ||||
[terrainPainter, elevationPainter, unPaintClass(clWater)], | [terrainPainter, elevationPainter, unPaintClass(clWater)], | ||||
borderClasses(clWater, 4, 7), | borderClasses(clWater, 4, 7), | ||||
scaleByMapSize(12, 130) * 2, 150 | scaleByMapSize(12, 130) * 2, 150 | ||||
); | ); | ||||
var mdd3 = randInt(1,3); | var mdd3 = randIntInclusive(1,3); | ||||
if (mdd3 == 1) | if (mdd3 == 1) | ||||
{ | { | ||||
// create islands | // create islands | ||||
log("Creating islands..."); | log("Creating islands..."); | ||||
placer = new ClumpPlacer(randInt(scaleByMapSize(8,15),scaleByMapSize(15,23))*randInt(scaleByMapSize(8,15),scaleByMapSize(15,23)), 0.80, 0.1, randFloat(0.0, 0.2)); | placer = new ClumpPlacer(randIntInclusive(scaleByMapSize(8,15),scaleByMapSize(15,23))*randIntInclusive(scaleByMapSize(8,15),scaleByMapSize(15,23)), 0.80, 0.1, randFloat(0.0, 0.2)); | ||||
terrainPainter = new LayeredPainter( | terrainPainter = new LayeredPainter( | ||||
[tMainTerrain, tMainTerrain], // terrains | [tMainTerrain, tMainTerrain], // terrains | ||||
[2] // widths | [2] // widths | ||||
); | ); | ||||
elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3.1, 4); | elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3.1, 4); | ||||
createAreas( | createAreas( | ||||
placer, | placer, | ||||
[terrainPainter, elevationPainter, paintClass(clLand)], | [terrainPainter, elevationPainter, paintClass(clLand)], | ||||
avoidClasses(clLand, 3, clPlayer, 3), | avoidClasses(clLand, 3, clPlayer, 3), | ||||
scaleByMapSize(2, 5)*randInt(8,14) | scaleByMapSize(2, 5)*randIntInclusive(8,14) | ||||
); | ); | ||||
} | } | ||||
else if (mdd3 == 2) | else if (mdd3 == 2) | ||||
{ | { | ||||
// create extentions | // create extentions | ||||
log("Creating extentions..."); | log("Creating extentions..."); | ||||
placer = new ClumpPlacer(randInt(scaleByMapSize(13,24),scaleByMapSize(24,45))*randInt(scaleByMapSize(13,24),scaleByMapSize(24,45)), 0.80, 0.1, 10); | placer = new ClumpPlacer(randIntInclusive(scaleByMapSize(13,24),scaleByMapSize(24,45))*randIntInclusive(scaleByMapSize(13,24),scaleByMapSize(24,45)), 0.80, 0.1, 10); | ||||
terrainPainter = new LayeredPainter( | terrainPainter = new LayeredPainter( | ||||
[tMainTerrain, tMainTerrain], // terrains | [tMainTerrain, tMainTerrain], // terrains | ||||
[2] // widths | [2] // widths | ||||
); | ); | ||||
elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3.1, 4); | elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3.1, 4); | ||||
createAreas( | createAreas( | ||||
placer, | placer, | ||||
[terrainPainter, elevationPainter, paintClass(clLand)], | [terrainPainter, elevationPainter, paintClass(clLand)], | ||||
null, | null, | ||||
scaleByMapSize(2, 5)*randInt(8,14) | scaleByMapSize(2, 5)*randIntInclusive(8,14) | ||||
); | ); | ||||
} | } | ||||
} | } | ||||
//******************************************************************************************************** | //******************************************************************************************************** | ||||
else if (md == 7) //gulf | else if (md == 7) //gulf | ||||
{ | { | ||||
for (var ix = 0; ix < mapSize; ix++) | for (var ix = 0; ix < mapSize; ix++) | ||||
▲ Show 20 Lines • Show All 151 Lines • ▼ Show 20 Lines | else if (md == 8) //lakes | ||||
// create lakes | // create lakes | ||||
log("Creating lakes..."); | log("Creating lakes..."); | ||||
placer = new ClumpPlacer(scaleByMapSize(160, 700), 0.2, 0.1, 1); | placer = new ClumpPlacer(scaleByMapSize(160, 700), 0.2, 0.1, 1); | ||||
terrainPainter = new LayeredPainter( | terrainPainter = new LayeredPainter( | ||||
[tShore, tWater, tWater], // terrains | [tShore, tWater, tWater], // terrains | ||||
[1, 3] // widths | [1, 3] // widths | ||||
); | ); | ||||
elevationPainter = new SmoothElevationPainter(ELEVATION_SET, -5, 5); | elevationPainter = new SmoothElevationPainter(ELEVATION_SET, -5, 5); | ||||
if (randInt(1,2) == 1) | if (randBool()) | ||||
{ | { | ||||
createAreas( | createAreas( | ||||
placer, | placer, | ||||
[terrainPainter, elevationPainter, paintClass(clWater)], | [terrainPainter, elevationPainter, paintClass(clWater)], | ||||
avoidClasses(clPlayer, 12, clWater, 8), | avoidClasses(clPlayer, 12, clWater, 8), | ||||
scaleByMapSize(5, 16) | scaleByMapSize(5, 16) | ||||
); | ); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | for (var m = 0; m < numPlayers; m++) | ||||
var elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 24, 0); | var elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 24, 0); | ||||
createArea(placer, [painter, elevationPainter], avoidClasses(clPlayer, 5)); | createArea(placer, [painter, elevationPainter], avoidClasses(clPlayer, 5)); | ||||
var placer = new PathPlacer(fractionToTiles(0.5 + 0.3*cos(tang) - 0.1 * cos(tang+PI/2)), fractionToTiles(0.5 + 0.3*sin(tang) - 0.1 * sin(tang+PI/2)), fractionToTiles(0.5 + 0.3*cos(tang) + 0.1 * cos(tang+PI/2)), fractionToTiles(0.5 + 0.3*sin(tang) + 0.1 * sin(tang+PI/2)), scaleByMapSize(14,24), 0.4, 3*(scaleByMapSize(1,3)), 0.2, 0.05); | var placer = new PathPlacer(fractionToTiles(0.5 + 0.3*cos(tang) - 0.1 * cos(tang+PI/2)), fractionToTiles(0.5 + 0.3*sin(tang) - 0.1 * sin(tang+PI/2)), fractionToTiles(0.5 + 0.3*cos(tang) + 0.1 * cos(tang+PI/2)), fractionToTiles(0.5 + 0.3*sin(tang) + 0.1 * sin(tang+PI/2)), scaleByMapSize(14,24), 0.4, 3*(scaleByMapSize(1,3)), 0.2, 0.05); | ||||
var painter = new LayeredPainter([tCliff, tCliff], [1]); | var painter = new LayeredPainter([tCliff, tCliff], [1]); | ||||
var elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3, 2); | var elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3, 2); | ||||
createArea(placer, [painter, elevationPainter], null); | createArea(placer, [painter, elevationPainter], null); | ||||
} | } | ||||
var mdd1 = randInt (1,3); | var mdd1 = randIntInclusive(1,3); | ||||
if (mdd1 <= 2) | if (mdd1 <= 2) | ||||
{ | { | ||||
var fx = fractionToTiles(0.5); | var fx = fractionToTiles(0.5); | ||||
var fz = fractionToTiles(0.5); | var fz = fractionToTiles(0.5); | ||||
ix = round(fx); | ix = round(fx); | ||||
iz = round(fz); | iz = round(fz); | ||||
var placer = new ClumpPlacer(mapArea * 0.005, 0.7, 0.1, 10, ix, iz); | var placer = new ClumpPlacer(mapArea * 0.005, 0.7, 0.1, 10, ix, iz); | ||||
▲ Show 20 Lines • Show All 306 Lines • ▼ Show 20 Lines | |||||
// create bumps | // create bumps | ||||
log("Creating bumps..."); | log("Creating bumps..."); | ||||
placer = new ClumpPlacer(scaleByMapSize(20, 50), 0.3, 0.06, 1); | placer = new ClumpPlacer(scaleByMapSize(20, 50), 0.3, 0.06, 1); | ||||
painter = new SmoothElevationPainter(ELEVATION_MODIFY, 2, 2); | painter = new SmoothElevationPainter(ELEVATION_MODIFY, 2, 2); | ||||
createAreas( | createAreas( | ||||
placer, | placer, | ||||
painter, | painter, | ||||
[avoidClasses(clWater, 2, clPlayer, 10), stayClasses(clLand, 3)], | [avoidClasses(clWater, 2, clPlayer, 10), stayClasses(clLand, 3)], | ||||
randInt(0,scaleByMapSize(200, 400)) | randIntInclusive(0,scaleByMapSize(200, 400)) | ||||
); | ); | ||||
// create hills | // create hills | ||||
log("Creating hills..."); | log("Creating hills..."); | ||||
placer = new ClumpPlacer(scaleByMapSize(20, 150), 0.2, 0.1, 1); | placer = new ClumpPlacer(scaleByMapSize(20, 150), 0.2, 0.1, 1); | ||||
terrainPainter = new LayeredPainter( | terrainPainter = new LayeredPainter( | ||||
[tCliff, tHill], // terrains | [tCliff, tHill], // terrains | ||||
[2] // widths | [2] // widths | ||||
); | ); | ||||
elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 18, 2); | elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 18, 2); | ||||
createAreas( | createAreas( | ||||
placer, | placer, | ||||
[terrainPainter, elevationPainter, paintClass(clHill)], | [terrainPainter, elevationPainter, paintClass(clHill)], | ||||
[avoidClasses(clPlayer, 20, clHill, randInt(6, 18)), stayClasses(clLand, 0)], | [avoidClasses(clPlayer, 20, clHill, randIntInclusive(6, 18)), stayClasses(clLand, 0)], | ||||
randInt(0, scaleByMapSize(4, 8))*randInt(1, scaleByMapSize(4, 9)) | randIntInclusive(0, scaleByMapSize(4, 8))*randIntInclusive(1, scaleByMapSize(4, 9)) | ||||
); | ); | ||||
var multiplier = sqrt(randFloat(0.5,1.2)*randFloat(0.5,1.2)); | var multiplier = sqrt(randFloat(0.5,1.2)*randFloat(0.5,1.2)); | ||||
// calculate desired number of trees for map (based on size) | // calculate desired number of trees for map (based on size) | ||||
if (random_terrain == g_BiomeSavanna) | if (random_terrain == g_BiomeSavanna) | ||||
{ | { | ||||
var MIN_TREES = floor(200*multiplier); | var MIN_TREES = floor(200*multiplier); | ||||
var MAX_TREES = floor(1250*multiplier); | var MAX_TREES = floor(1250*multiplier); | ||||
Show All 33 Lines | for (var i = 0; i < types.length; ++i) | ||||
placer = new ClumpPlacer(numForest / num, 0.1, 0.1, 1); | placer = new ClumpPlacer(numForest / num, 0.1, 0.1, 1); | ||||
painter = new LayeredPainter( | painter = new LayeredPainter( | ||||
types[i], // terrains | types[i], // terrains | ||||
[2] // widths | [2] // widths | ||||
); | ); | ||||
createAreas( | createAreas( | ||||
placer, | placer, | ||||
[painter, paintClass(clForest)], | [painter, paintClass(clForest)], | ||||
[avoidClasses(clPlayer, 20, clForest, randInt(5, 15), clHill, 0), stayClasses(clLand, 4)], | [avoidClasses(clPlayer, 20, clForest, randIntInclusive(5, 15), clHill, 0), stayClasses(clLand, 4)], | ||||
num | num | ||||
); | ); | ||||
} | } | ||||
RMS.SetProgress(50); | RMS.SetProgress(50); | ||||
// create dirt patches | // create dirt patches | ||||
log("Creating dirt patches..."); | log("Creating dirt patches..."); | ||||
var sizes = [scaleByMapSize(3, 48), scaleByMapSize(5, 84), scaleByMapSize(8, 128)]; | var sizes = [scaleByMapSize(3, 48), scaleByMapSize(5, 84), scaleByMapSize(8, 128)]; | ||||
Show All 32 Lines | |||||
RMS.SetProgress(55); | RMS.SetProgress(55); | ||||
log("Creating stone mines..."); | log("Creating stone mines..."); | ||||
// create large stone quarries | // create large stone quarries | ||||
group = new SimpleGroup([new SimpleObject(oStoneSmall, 0,2, 0,4), new SimpleObject(oStoneLarge, 1,1, 0,4)], true, clRock); | group = new SimpleGroup([new SimpleObject(oStoneSmall, 0,2, 0,4), new SimpleObject(oStoneLarge, 1,1, 0,4)], true, clRock); | ||||
createObjectGroups(group, 0, | createObjectGroups(group, 0, | ||||
[avoidClasses(clForest, 1, clPlayer, 20, clRock, 10, clHill, 1), stayClasses(clLand, 4)], | [avoidClasses(clForest, 1, clPlayer, 20, clRock, 10, clHill, 1), stayClasses(clLand, 4)], | ||||
randInt(scaleByMapSize(2,9),scaleByMapSize(9,40)), 100 | randIntInclusive(scaleByMapSize(2,9),scaleByMapSize(9,40)), 100 | ||||
); | ); | ||||
// create small stone quarries | // create small stone quarries | ||||
group = new SimpleGroup([new SimpleObject(oStoneSmall, 2,5, 1,3)], true, clRock); | group = new SimpleGroup([new SimpleObject(oStoneSmall, 2,5, 1,3)], true, clRock); | ||||
createObjectGroups(group, 0, | createObjectGroups(group, 0, | ||||
[avoidClasses(clForest, 1, clPlayer, 20, clRock, 10, clHill, 1), stayClasses(clLand, 4)], | [avoidClasses(clForest, 1, clPlayer, 20, clRock, 10, clHill, 1), stayClasses(clLand, 4)], | ||||
randInt(scaleByMapSize(2,9),scaleByMapSize(9,40)), 100 | randIntInclusive(scaleByMapSize(2,9),scaleByMapSize(9,40)), 100 | ||||
); | ); | ||||
log("Creating metal mines..."); | log("Creating metal mines..."); | ||||
// create large metal quarries | // create large metal quarries | ||||
group = new SimpleGroup([new SimpleObject(oMetalLarge, 1,1, 0,4)], true, clMetal); | group = new SimpleGroup([new SimpleObject(oMetalLarge, 1,1, 0,4)], true, clMetal); | ||||
createObjectGroups(group, 0, | createObjectGroups(group, 0, | ||||
[avoidClasses(clForest, 1, clPlayer, 20, clMetal, 10, clRock, 5, clHill, 1), stayClasses(clLand, 4)], | [avoidClasses(clForest, 1, clPlayer, 20, clMetal, 10, clRock, 5, clHill, 1), stayClasses(clLand, 4)], | ||||
randInt(scaleByMapSize(2,9),scaleByMapSize(9,40)), 100 | randIntInclusive(scaleByMapSize(2,9),scaleByMapSize(9,40)), 100 | ||||
); | ); | ||||
RMS.SetProgress(65); | RMS.SetProgress(65); | ||||
// create small decorative rocks | // create small decorative rocks | ||||
log("Creating small decorative rocks..."); | log("Creating small decorative rocks..."); | ||||
group = new SimpleGroup( | group = new SimpleGroup( | ||||
[new SimpleObject(aRockMedium, 1,3, 0,1)], | [new SimpleObject(aRockMedium, 1,3, 0,1)], | ||||
Show All 23 Lines | |||||
// create deer | // create deer | ||||
log("Creating deer..."); | log("Creating deer..."); | ||||
group = new SimpleGroup( | group = new SimpleGroup( | ||||
[new SimpleObject(oMainHuntableAnimal, 5,7, 0,4)], | [new SimpleObject(oMainHuntableAnimal, 5,7, 0,4)], | ||||
true, clFood | true, clFood | ||||
); | ); | ||||
createObjectGroups(group, 0, | createObjectGroups(group, 0, | ||||
[avoidClasses(clWater, 0, clForest, 0, clPlayer, 20, clHill, 1, clFood, 20), stayClasses(clLand, 4)], | [avoidClasses(clWater, 0, clForest, 0, clPlayer, 20, clHill, 1, clFood, 20), stayClasses(clLand, 4)], | ||||
randInt(numPlayers+3, 5*numPlayers+4), 50 | randIntInclusive(numPlayers+3, 5*numPlayers+4), 50 | ||||
); | ); | ||||
// create berry bush | // create berry bush | ||||
log("Creating berry bush..."); | log("Creating berry bush..."); | ||||
group = new SimpleGroup( | group = new SimpleGroup( | ||||
[new SimpleObject(oFruitBush, 5,7, 0,4)], | [new SimpleObject(oFruitBush, 5,7, 0,4)], | ||||
true, clFood | true, clFood | ||||
); | ); | ||||
createObjectGroups(group, 0, | createObjectGroups(group, 0, | ||||
[avoidClasses(clWater, 0, clForest, 0, clPlayer, 20, clHill, 1, clFood, 20), stayClasses(clLand, 4)], | [avoidClasses(clWater, 0, clForest, 0, clPlayer, 20, clHill, 1, clFood, 20), stayClasses(clLand, 4)], | ||||
randInt(1, 4) * numPlayers + 2, 50 | randIntInclusive(1, 4) * numPlayers + 2, 50 | ||||
); | ); | ||||
RMS.SetProgress(75); | RMS.SetProgress(75); | ||||
// create sheep | // create sheep | ||||
log("Creating sheep..."); | log("Creating sheep..."); | ||||
group = new SimpleGroup( | group = new SimpleGroup( | ||||
[new SimpleObject(oSecondaryHuntableAnimal, 2,3, 0,2)], | [new SimpleObject(oSecondaryHuntableAnimal, 2,3, 0,2)], | ||||
true, clFood | true, clFood | ||||
); | ); | ||||
createObjectGroups(group, 0, | createObjectGroups(group, 0, | ||||
[avoidClasses(clWater, 0, clForest, 0, clPlayer, 20, clHill, 1, clFood, 20), stayClasses(clLand, 4)], | [avoidClasses(clWater, 0, clForest, 0, clPlayer, 20, clHill, 1, clFood, 20), stayClasses(clLand, 4)], | ||||
randInt(numPlayers+3, 5*numPlayers+4), 50 | randIntInclusive(numPlayers+3, 5*numPlayers+4), 50 | ||||
); | ); | ||||
// create fish | // create fish | ||||
log("Creating fish..."); | log("Creating fish..."); | ||||
group = new SimpleGroup( | group = new SimpleGroup( | ||||
[new SimpleObject(oFish, 2,3, 0,2)], | [new SimpleObject(oFish, 2,3, 0,2)], | ||||
true, clFood | true, clFood | ||||
); | ); | ||||
createObjectGroups(group, 0, | createObjectGroups(group, 0, | ||||
avoidClasses(clLand, 5, clForest, 0, clPlayer, 0, clHill, 0, clFood, 20), | avoidClasses(clLand, 5, clForest, 0, clPlayer, 0, clHill, 0, clFood, 20), | ||||
randInt(15, 40) * numPlayers, 60 | randIntInclusive(15, 40) * numPlayers, 60 | ||||
); | ); | ||||
RMS.SetProgress(85); | RMS.SetProgress(85); | ||||
// create straggler trees | // create straggler trees | ||||
log("Creating straggler trees..."); | log("Creating straggler trees..."); | ||||
var types = [oTree1, oTree2, oTree4, oTree3]; // some variation | var types = [oTree1, oTree2, oTree4, oTree3]; // some variation | ||||
▲ Show 20 Lines • Show All 67 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator