Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/maps/random/english_channel.js
Show First 20 Lines • Show All 217 Lines • ▼ Show 20 Lines | if (z > cu + 0.5 - WATER_WIDTH/2 && | ||||
setHeight(ix, iz, h); | setHeight(ix, iz, h); | ||||
} | } | ||||
else | else | ||||
setHeight(ix, iz, 3.1); | setHeight(ix, iz, 3.1); | ||||
} | } | ||||
RMS.SetProgress(20); | RMS.SetProgress(20); | ||||
log("Creating rivers"); | log("Creating rivers"); | ||||
for (var i = 0; i <= randInt(8, (scaleByMapSize(12,20))); i++) | for (let 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 = 2*PI * randFloat(0.2, 0.8) * (randInt(2) - 0.5); | |||||
var cDistance = 0.05 * (tang > 0 ? 1 : -1); | var sign = randBool() ? 1 : -1; | ||||
var tang = sign * PI * randFloat(0.2, 0.8); | |||||
var cDistance = sign * 0.05; | |||||
var point = getTIPIADBON([fractionToTiles(cLocation), fractionToTiles(0.5 + cDistance)], [fractionToTiles(cLocation), fractionToTiles(0.5 - cDistance)], [-6, -1.5], 0.5, 4, 0.01); | var point = getTIPIADBON([fractionToTiles(cLocation), fractionToTiles(0.5 + cDistance)], [fractionToTiles(cLocation), fractionToTiles(0.5 - cDistance)], [-6, -1.5], 0.5, 4, 0.01); | ||||
if (point !== undefined) | if (point !== undefined) | ||||
{ | { | ||||
var placer = new PathPlacer(floor(point[0]), floor(point[1]), floor(fractionToTiles(0.5 + 0.49*cos(tang))), floor(fractionToTiles(0.5 + 0.49*sin(tang))), scaleByMapSize(10,20), 0.4, 3*(scaleByMapSize(1,4)), 0.1, 0.05); | var placer = new PathPlacer(floor(point[0]), floor(point[1]), floor(fractionToTiles(0.5 + 0.49*cos(tang))), floor(fractionToTiles(0.5 + 0.49*sin(tang))), scaleByMapSize(10,20), 0.4, 3*(scaleByMapSize(1,4)), 0.1, 0.05); | ||||
var terrainPainter = new LayeredPainter( | var terrainPainter = new LayeredPainter( | ||||
[tShore, tWater, tWater], // terrains | [tShore, tWater, tWater], // terrains | ||||
[1, 3] // widths | [1, 3] // widths | ||||
▲ Show 20 Lines • Show All 169 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator