Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/maps/random/dodecanese.js
Show First 20 Lines • Show All 360 Lines • ▼ Show 20 Lines | if (avoidClasses(clWater, 0).allows(Vector2D.add(bridgeCenter1, bridgeP)) || | ||||
continue; | continue; | ||||
++bridges; | ++bridges; | ||||
// This bridge model is not centered on the horizontal plane, so the angle is messy | // This bridge model is not centered on the horizontal plane, so the angle is messy | ||||
// TILE_CENTERED_HEIGHT_MAP also influences the outcome of the placement. | // TILE_CENTERED_HEIGHT_MAP also influences the outcome of the placement. | ||||
let bridgeOrientation = direction % 2 ? 0 : Math.PI / 2; | let bridgeOrientation = direction % 2 ? 0 : Math.PI / 2; | ||||
bridgeCenter1[direction % 2 ? "y" : "x"] += 0.25; | bridgeCenter1[direction % 2 ? "y" : "x"] += 0.25; | ||||
bridgeCenter2[direction % 2 ? "y" : "x"] -= 0.25 | bridgeCenter2[direction % 2 ? "y" : "x"] -= 0.25; | ||||
g_Map.placeEntityAnywhere(aBridge, 0, bridgeCenter1, bridgeOrientation); | g_Map.placeEntityAnywhere(aBridge, 0, bridgeCenter1, bridgeOrientation); | ||||
g_Map.placeEntityAnywhere(aBridge, 0, bridgeCenter2, bridgeOrientation + Math.PI); | g_Map.placeEntityAnywhere(aBridge, 0, bridgeCenter2, bridgeOrientation + Math.PI); | ||||
createArea( | createArea( | ||||
new RectPlacer(Vector2D.sub(bridgeStart, areaOffset), Vector2D.add(bridgeEnd1, areaOffset)), | new RectPlacer(Vector2D.sub(bridgeStart, areaOffset), Vector2D.add(bridgeEnd1, areaOffset)), | ||||
[ | [ | ||||
new ElevationPainter(heightBridge), | new ElevationPainter(heightBridge), | ||||
new TileClassPainter(clBridge) | new TileClassPainter(clBridge) | ||||
]); | ]); | ||||
for (let center of [bridgeStart, bridgeEnd2]) | for (let center of [bridgeStart, bridgeEnd2]) | ||||
createArea( | createArea( | ||||
new DiskPlacer(2, center), | new DiskPlacer(2, center), | ||||
new SmoothingPainter(1, 1, 1)); | new SmoothingPainter(1, 1, 1)); | ||||
break; | break; | ||||
} | } | ||||
if (bridges >= maxBridges) | if (bridges >= maxBridges) | ||||
break | break; | ||||
} | } | ||||
g_Map.log("Creating smoke"); | g_Map.log("Creating smoke"); | ||||
if (areasVolcano.length) | if (areasVolcano.length) | ||||
{ | { | ||||
createObjectGroupsByAreas( | createObjectGroupsByAreas( | ||||
new SimpleGroup([new SimpleObject(aSmokeBig, 1, 1, 0, 4)], false), | new SimpleGroup([new SimpleObject(aSmokeBig, 1, 1, 0, 4)], false), | ||||
0, | 0, | ||||
Show All 32 Lines |
Wildfire Games · Phabricator