Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/maps/random/caledonian_meadows.js
Show First 20 Lines • Show All 705 Lines • ▼ Show 20 Lines | for (let h = 0; h < heighLimits.length; ++h) | ||||
{ | { | ||||
let x = areas[h][t].x; | let x = areas[h][t].x; | ||||
let y = areas[h][t].y; | let y = areas[h][t].y; | ||||
let actor = undefined; | let actor = undefined; | ||||
let texture = pickRandom(myBiome[h].texture); | let texture = pickRandom(myBiome[h].texture); | ||||
if (slopeMap[x][y] < 0.4 * (minSlope[h] + maxSlope[h])) | if (slopeMap[x][y] < 0.4 * (minSlope[h] + maxSlope[h])) | ||||
{ | { | ||||
if (randFloat() < myBiome[h].actor[1]) | if (randBool(myBiome[h].actor[1])) | ||||
actor = pickRandom(myBiome[h].actor[0]); | actor = pickRandom(myBiome[h].actor[0]); | ||||
} | } | ||||
else | else | ||||
{ | { | ||||
texture = pickRandom(myBiome[h].textureHS); | texture = pickRandom(myBiome[h].textureHS); | ||||
if (randFloat() < myBiome[h].actorHS[1]) | if (randBool(myBiome[h].actorHS[1])) | ||||
actor = pickRandom(myBiome[h].actorHS[0]); | actor = pickRandom(myBiome[h].actorHS[0]); | ||||
} | } | ||||
g_Map.setTexture(x, y, texture); | g_Map.setTexture(x, y, texture); | ||||
if (actor) | if (actor) | ||||
placeObject(x + randFloat(), y + randFloat(), actor, 0, randFloat() * TWO_PI); | placeObject(x + randFloat(), y + randFloat(), actor, 0, randFloat() * TWO_PI); | ||||
} | } | ||||
} | } | ||||
Show All 37 Lines |
Wildfire Games · Phabricator