Changeset View
Standalone View
binaries/data/mods/public/maps/random/fortress.js
Show First 20 Lines • Show All 103 Lines • ▼ Show 20 Lines | new ConvexPolygonPlacer( | ||||
Infinity), | Infinity), | ||||
[ | [ | ||||
new TerrainPainter(tRoad), | new TerrainPainter(tRoad), | ||||
new TileClassPainter(clPlayer) | new TileClassPainter(clPlayer) | ||||
]); | ]); | ||||
// Fortress | // Fortress | ||||
// To take into account houses that offer a lower population bonus | // To take into account houses that offer a lower population bonus | ||||
if (Engine.GetTemplate("structures/" + civ + "_house").Cost.PopulationBonus <= 5) | if (Engine.GetTemplate("structures/" + civ + "_house").Population.Bonus <= 5) | ||||
{ | { | ||||
var wall = ["gate", "tower", "long", | var wall = ["gate", "tower", "long", | ||||
"cornerIn", "long", "barracks", "tower", "long", "tower", "house", "long", | "cornerIn", "long", "barracks", "tower", "long", "tower", "house", "long", | ||||
"cornerIn", "long", "house", "tower", "gate", "tower", "house", "long", | "cornerIn", "long", "house", "tower", "gate", "tower", "house", "long", | ||||
"cornerIn", "long", "house", "tower", "long", "tower", "house", "long", | "cornerIn", "long", "house", "tower", "long", "tower", "house", "long", | ||||
"cornerIn", "long", "house", "tower"]; | "cornerIn", "long", "house", "tower"]; | ||||
} | } | ||||
else | else | ||||
{ | { | ||||
var wall = ["gate", "tower", "long", | var wall = ["gate", "tower", "long", | ||||
"cornerIn", "long", "barracks", "tower", "long", "tower", "long", | "cornerIn", "long", "barracks", "tower", "long", "tower", "long", | ||||
"cornerIn", "long", "house", "tower", "gate", "tower", "long", | "cornerIn", "long", "house", "tower", "gate", "tower", "long", | ||||
"cornerIn", "long", "house", "tower", "long", "tower", "long", | "cornerIn", "long", "house", "tower", "long", "tower", "long", | ||||
"cornerIn", "long", "house", "tower"]; | "cornerIn", "long", "house", "tower"]; | ||||
} | } | ||||
placeCustomFortress(playerPosition[i], new Fortress("Spahbod", wall), civ, playerIDs[i], playerAngle); | placeCustomFortress(playerPosition[i], new Fortress("Spahbod", wall), civ, playerIDs[i], playerAngle); | ||||
} | } | ||||
g_Map.log("Creating lakes"); | g_Map.log("Creating lakes"); | ||||
var numLakes = Math.round(scaleByMapSize(1,4) * numPlayers); | var numLakes = Math.round(scaleByMapSize(1,4) * numPlayers); | ||||
Lint: ESLintBear (comma-spacing): `A space is required after ','.` | |||||
var waterAreas = createAreas( | var waterAreas = createAreas( | ||||
new ClumpPlacer(scaleByMapSize(100,250), 0.8, 0.1, Infinity), | new ClumpPlacer(scaleByMapSize(100,250), 0.8, 0.1, Infinity), | ||||
Lint: ESLintBear (comma-spacing) A space is required after ','. Lint: ESLintBear (comma-spacing): `A space is required after ','.` | |||||
[ | [ | ||||
new LayeredPainter([tShore, tWater], [1]), | new LayeredPainter([tShore, tWater], [1]), | ||||
new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 3), | new SmoothElevationPainter(ELEVATION_SET, heightSeaGround, 3), | ||||
new TileClassPainter(clWater) | new TileClassPainter(clWater) | ||||
], | ], | ||||
avoidClasses(clPlayer, 7, clWater, 20), | avoidClasses(clPlayer, 7, clWater, 20), | ||||
numLakes); | numLakes); | ||||
Engine.SetProgress(15); | Engine.SetProgress(15); | ||||
g_Map.log("Creating reeds"); | g_Map.log("Creating reeds"); | ||||
createObjectGroupsByAreasDeprecated( | createObjectGroupsByAreasDeprecated( | ||||
new SimpleGroup([new SimpleObject(aReeds, 5,10, 0,4), new SimpleObject(aLillies, 0,1, 0,4)], true), | new SimpleGroup([new SimpleObject(aReeds, 5,10, 0,4), new SimpleObject(aLillies, 0,1, 0,4)], true), | ||||
Lint: ESLintBear (comma-spacing) A space is required after ','. Lint: ESLintBear (comma-spacing): `A space is required after ','.` | |||||
Lint: ESLintBear (comma-spacing) A space is required after ','. Lint: ESLintBear (comma-spacing): `A space is required after ','.` | |||||
Lint: ESLintBear (comma-spacing) A space is required after ','. Lint: ESLintBear (comma-spacing): `A space is required after ','.` | |||||
Lint: ESLintBear (comma-spacing) A space is required after ','. Lint: ESLintBear (comma-spacing): `A space is required after ','.` | |||||
0, | 0, | ||||
[borderClasses(clWater, 3, 0), stayClasses(clWater, 1)], | [borderClasses(clWater, 3, 0), stayClasses(clWater, 1)], | ||||
numLakes, 100, | numLakes, 100, | ||||
waterAreas); | waterAreas); | ||||
Engine.SetProgress(25); | Engine.SetProgress(25); | ||||
g_Map.log("Creating fish"); | g_Map.log("Creating fish"); | ||||
createObjectGroupsByAreasDeprecated( | createObjectGroupsByAreasDeprecated( | ||||
new SimpleGroup( | new SimpleGroup( | ||||
[new SimpleObject(oFish, 1,1, 0,1)], | [new SimpleObject(oFish, 1,1, 0,1)], | ||||
Lint: ESLintBear (comma-spacing) A space is required after ','. Lint: ESLintBear (comma-spacing): `A space is required after ','.` | |||||
Lint: ESLintBear (comma-spacing) A space is required after ','. Lint: ESLintBear (comma-spacing): `A space is required after ','.` | |||||
true, clFood | true, clFood | ||||
), | ), | ||||
0, | 0, | ||||
[stayClasses(clWater, 4), avoidClasses(clFood, 8)], | [stayClasses(clWater, 4), avoidClasses(clFood, 8)], | ||||
Lint: ESLintBear (no-multi-spaces) Multiple spaces found before 'avoidClasses'. Lint: ESLintBear (no-multi-spaces): `Multiple spaces found before 'avoidClasses'.` | |||||
numLakes / 4, | numLakes / 4, | ||||
50, | 50, | ||||
waterAreas); | waterAreas); | ||||
Engine.SetProgress(30); | Engine.SetProgress(30); | ||||
createBumps(avoidClasses(clWater, 2, clPlayer, 5)); | createBumps(avoidClasses(clWater, 2, clPlayer, 5)); | ||||
Engine.SetProgress(35); | Engine.SetProgress(35); | ||||
createHills([tCliff, tCliff, tHill], avoidClasses(clPlayer, 5, clWater, 5, clHill, 15), clHill, scaleByMapSize(1, 4) * numPlayers); | createHills([tCliff, tCliff, tHill], avoidClasses(clPlayer, 5, clWater, 5, clHill, 15), clHill, scaleByMapSize(1, 4) * numPlayers); | ||||
Engine.SetProgress(40); | Engine.SetProgress(40); | ||||
g_Map.log("Creating forests"); | g_Map.log("Creating forests"); | ||||
var [forestTrees, stragglerTrees] = getTreeCounts(500, 2500, 0.7); | var [forestTrees, stragglerTrees] = getTreeCounts(500, 2500, 0.7); | ||||
var types = [ | var types = [ | ||||
[[tForestFloor, tGrass, pForestD], [tForestFloor, pForestD]], | [[tForestFloor, tGrass, pForestD], [tForestFloor, pForestD]], | ||||
[[tForestFloor, tGrass, pForestO], [tForestFloor, pForestO]], | [[tForestFloor, tGrass, pForestO], [tForestFloor, pForestO]], | ||||
[[tForestFloor, tGrass, pForestP], [tForestFloor, pForestP]] | [[tForestFloor, tGrass, pForestP], [tForestFloor, pForestP]] | ||||
]; | ]; | ||||
var size = forestTrees / (scaleByMapSize(3,6) * numPlayers); | var size = forestTrees / (scaleByMapSize(3,6) * numPlayers); | ||||
Lint: ESLintBear (comma-spacing) A space is required after ','. Lint: ESLintBear (comma-spacing): `A space is required after ','.` | |||||
var num = Math.floor(size / types.length); | var num = Math.floor(size / types.length); | ||||
for (let type of types) | for (let type of types) | ||||
createAreas( | createAreas( | ||||
new ChainPlacer(1, Math.floor(scaleByMapSize(3, 5)), forestTrees / num, 0.5), | new ChainPlacer(1, Math.floor(scaleByMapSize(3, 5)), forestTrees / num, 0.5), | ||||
[ | [ | ||||
new LayeredPainter(type, [2]), | new LayeredPainter(type, [2]), | ||||
new TileClassPainter(clForest) | new TileClassPainter(clForest) | ||||
], | ], | ||||
avoidClasses(clPlayer, 5, clWater, 3, clForest, 15, clHill, 1), | avoidClasses(clPlayer, 5, clWater, 3, clForest, 15, clHill, 1), | ||||
num); | num); | ||||
Engine.SetProgress(50); | Engine.SetProgress(50); | ||||
g_Map.log("Creating dirt patches"); | g_Map.log("Creating dirt patches"); | ||||
createLayeredPatches( | createLayeredPatches( | ||||
[scaleByMapSize(3, 6), scaleByMapSize(5, 10), scaleByMapSize(8, 21)], | [scaleByMapSize(3, 6), scaleByMapSize(5, 10), scaleByMapSize(8, 21)], | ||||
Lint: ESLintBear (indent) Expected indentation of 1 tab but found 1 space. Lint: ESLintBear (indent): `Expected indentation of 1 tab but found 1 space.` | |||||
[[tGrass,tGrassA],[tGrassA,tGrassB], [tGrassB,tGrassC]], | [[tGrass,tGrassA],[tGrassA,tGrassB], [tGrassB,tGrassC]], | ||||
Lint: ESLintBear (indent) Expected indentation of 1 tab but found 1 space. Lint: ESLintBear (indent): `Expected indentation of 1 tab but found 1 space.` | |||||
Lint: ESLintBear (comma-spacing) A space is required after ','. Lint: ESLintBear (comma-spacing): `A space is required after ','.` | |||||
Lint: ESLintBear (comma-spacing) A space is required after ','. Lint: ESLintBear (comma-spacing): `A space is required after ','.` | |||||
Lint: ESLintBear (comma-spacing) A space is required after ','. Lint: ESLintBear (comma-spacing): `A space is required after ','.` | |||||
Lint: ESLintBear (comma-spacing) A space is required after ','. Lint: ESLintBear (comma-spacing): `A space is required after ','.` | |||||
[1,1], | [1,1], | ||||
Lint: ESLintBear (indent) Expected indentation of 1 tab but found 1 space. Lint: ESLintBear (indent): `Expected indentation of 1 tab but found 1 space.` | |||||
Lint: ESLintBear (comma-spacing) A space is required after ','. Lint: ESLintBear (comma-spacing): `A space is required after ','.` | |||||
avoidClasses(clWater, 1, clForest, 0, clHill, 0, clDirt, 5, clPlayer, 1), | avoidClasses(clWater, 1, clForest, 0, clHill, 0, clDirt, 5, clPlayer, 1), | ||||
Lint: ESLintBear (indent) Expected indentation of 1 tab but found 1 space. Lint: ESLintBear (indent): `Expected indentation of 1 tab but found 1 space.` | |||||
scaleByMapSize(15, 45), | scaleByMapSize(15, 45), | ||||
Lint: ESLintBear (indent) Expected indentation of 1 tab but found 1 space. Lint: ESLintBear (indent): `Expected indentation of 1 tab but found 1 space.` | |||||
clDirt); | clDirt); | ||||
Lint: ESLintBear (indent) Expected indentation of 1 tab but found 1 space. Lint: ESLintBear (indent): `Expected indentation of 1 tab but found 1 space.` | |||||
Engine.SetProgress(55); | Engine.SetProgress(55); | ||||
g_Map.log("Creating grass patches"); | g_Map.log("Creating grass patches"); | ||||
createPatches( | createPatches( | ||||
[scaleByMapSize(2, 4), scaleByMapSize(3, 7), scaleByMapSize(5, 15)], | [scaleByMapSize(2, 4), scaleByMapSize(3, 7), scaleByMapSize(5, 15)], | ||||
Lint: ESLintBear (indent) Expected indentation of 1 tab but found 1 space. Lint: ESLintBear (indent): `Expected indentation of 1 tab but found 1 space.` | |||||
tGrassPatch, | tGrassPatch, | ||||
Lint: ESLintBear (indent) Expected indentation of 1 tab but found 1 space. Lint: ESLintBear (indent): `Expected indentation of 1 tab but found 1 space.` | |||||
avoidClasses(clWater, 1, clForest, 0, clHill, 0, clDirt, 5, clPlayer, 1), | avoidClasses(clWater, 1, clForest, 0, clHill, 0, clDirt, 5, clPlayer, 1), | ||||
Lint: ESLintBear (indent) Expected indentation of 1 tab but found 1 space. Lint: ESLintBear (indent): `Expected indentation of 1 tab but found 1 space.` | |||||
scaleByMapSize(15, 45), | scaleByMapSize(15, 45), | ||||
Lint: ESLintBear (indent) Expected indentation of 1 tab but found 1 space. Lint: ESLintBear (indent): `Expected indentation of 1 tab but found 1 space.` | |||||
clDirt); | clDirt); | ||||
Lint: ESLintBear (indent) Expected indentation of 1 tab but found 1 space. Lint: ESLintBear (indent): `Expected indentation of 1 tab but found 1 space.` | |||||
Engine.SetProgress(60); | Engine.SetProgress(60); | ||||
g_Map.log("Creating stone mines"); | g_Map.log("Creating stone mines"); | ||||
createMines( | createMines( | ||||
[ | [ | ||||
Lint: ESLintBear (indent) Expected indentation of 1 tab but found 1 space. Lint: ESLintBear (indent): `Expected indentation of 1 tab but found 1 space.` | |||||
[new SimpleObject(oStoneSmall, 0, 2, 0, 4, 0, 2 * Math.PI, 1), new SimpleObject(oStoneLarge, 1, 1, 0, 4, 0, 2 * Math.PI, 4)], | [new SimpleObject(oStoneSmall, 0, 2, 0, 4, 0, 2 * Math.PI, 1), new SimpleObject(oStoneLarge, 1, 1, 0, 4, 0, 2 * Math.PI, 4)], | ||||
Lint: ESLintBear (indent) Expected indentation of 2 tabs but found 2 spaces. Lint: ESLintBear (indent): `Expected indentation of 2 tabs but found 2 spaces.` | |||||
[new SimpleObject(oStoneSmall, 2,5, 1,3)] | [new SimpleObject(oStoneSmall, 2,5, 1,3)] | ||||
Lint: ESLintBear (indent) Expected indentation of 2 tabs but found 2 spaces. Lint: ESLintBear (indent): `Expected indentation of 2 tabs but found 2 spaces.` | |||||
Lint: ESLintBear (comma-spacing) A space is required after ','. Lint: ESLintBear (comma-spacing): `A space is required after ','.` | |||||
Lint: ESLintBear (comma-spacing) A space is required after ','. Lint: ESLintBear (comma-spacing): `A space is required after ','.` | |||||
], | ], | ||||
Lint: ESLintBear (indent) Expected indentation of 1 tab but found 1 space. Lint: ESLintBear (indent): `Expected indentation of 1 tab but found 1 space.` | |||||
avoidClasses(clWater, 0, clForest, 1, clPlayer, 5, clRock, 10, clHill, 1), | avoidClasses(clWater, 0, clForest, 1, clPlayer, 5, clRock, 10, clHill, 1), | ||||
Lint: ESLintBear (indent) Expected indentation of 1 tab but found 1 space. Lint: ESLintBear (indent): `Expected indentation of 1 tab but found 1 space.` | |||||
clRock); | clRock); | ||||
Lint: ESLintBear (indent) Expected indentation of 1 tab but found 1 space. Lint: ESLintBear (indent): `Expected indentation of 1 tab but found 1 space.` | |||||
Engine.SetProgress(65); | Engine.SetProgress(65); | ||||
g_Map.log("Creating metal mines"); | g_Map.log("Creating metal mines"); | ||||
createMines( | createMines( | ||||
[ | [ | ||||
Lint: ESLintBear (indent) Expected indentation of 1 tab but found 1 space. Lint: ESLintBear (indent): `Expected indentation of 1 tab but found 1 space.` | |||||
[new SimpleObject(oMetalLarge, 1,1, 0,4)] | [new SimpleObject(oMetalLarge, 1,1, 0,4)] | ||||
Lint: ESLintBear (indent) Expected indentation of 2 tabs but found 2 spaces. Lint: ESLintBear (indent): `Expected indentation of 2 tabs but found 2 spaces.` | |||||
Lint: ESLintBear (comma-spacing) A space is required after ','. Lint: ESLintBear (comma-spacing): `A space is required after ','.` | |||||
Lint: ESLintBear (comma-spacing) A space is required after ','. Lint: ESLintBear (comma-spacing): `A space is required after ','.` | |||||
], | ], | ||||
Lint: ESLintBear (indent) Expected indentation of 1 tab but found 1 space. Lint: ESLintBear (indent): `Expected indentation of 1 tab but found 1 space.` | |||||
avoidClasses(clWater, 0, clForest, 1, clPlayer, 5, clMetal, 10, clRock, 5, clHill, 1), | avoidClasses(clWater, 0, clForest, 1, clPlayer, 5, clMetal, 10, clRock, 5, clHill, 1), | ||||
Lint: ESLintBear (indent) Expected indentation of 1 tab but found 1 space. Lint: ESLintBear (indent): `Expected indentation of 1 tab but found 1 space.` | |||||
clMetal | clMetal | ||||
Lint: ESLintBear (indent) Expected indentation of 1 tab but found 1 space. Lint: ESLintBear (indent): `Expected indentation of 1 tab but found 1 space.` | |||||
); | ); | ||||
Engine.SetProgress(70); | Engine.SetProgress(70); | ||||
createDecoration( | createDecoration( | ||||
[ | [ | ||||
[new SimpleObject(aRockMedium, 1, 3, 0, 1)], | [new SimpleObject(aRockMedium, 1, 3, 0, 1)], | ||||
[new SimpleObject(aRockLarge, 1, 2, 0, 1), new SimpleObject(aRockMedium, 1, 3, 0, 2)], | [new SimpleObject(aRockLarge, 1, 2, 0, 1), new SimpleObject(aRockMedium, 1, 3, 0, 2)], | ||||
[new SimpleObject(aGrassShort, 1, 2, 0, 1)], | [new SimpleObject(aGrassShort, 1, 2, 0, 1)], | ||||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | createStragglerTrees( | ||||
clForest, | clForest, | ||||
stragglerTrees); | stragglerTrees); | ||||
Engine.SetProgress(95); | Engine.SetProgress(95); | ||||
placePlayersNomad(clPlayer, avoidClasses(clWater, 2, clHill, 2, clForest, 1, clMetal, 4, clRock, 4, clHill, 4, clFood, 2)); | placePlayersNomad(clPlayer, avoidClasses(clWater, 2, clHill, 2, clForest, 1, clMetal, 4, clRock, 4, clHill, 4, clFood, 2)); | ||||
setSkySet("sunny"); | setSkySet("sunny"); | ||||
setWaterColor(0.157, 0.149, 0.443); | setWaterColor(0.157, 0.149, 0.443); | ||||
setWaterTint(0.443,0.42,0.824); | setWaterTint(0.443,0.42,0.824); | ||||
Lint: ESLintBear (comma-spacing) A space is required after ','. Lint: ESLintBear (comma-spacing): `A space is required after ','.` | |||||
Lint: ESLintBear (comma-spacing) A space is required after ','. Lint: ESLintBear (comma-spacing): `A space is required after ','.` | |||||
setWaterWaviness(2.0); | setWaterWaviness(2.0); | ||||
setWaterType("lake"); | setWaterType("lake"); | ||||
setWaterMurkiness(0.83); | setWaterMurkiness(0.83); | ||||
setFogFactor(0.35); | setFogFactor(0.35); | ||||
setFogThickness(0.22); | setFogThickness(0.22); | ||||
setFogColor(0.82,0.82, 0.73); | setFogColor(0.82,0.82, 0.73); | ||||
Lint: ESLintBear (comma-spacing) A space is required after ','. Lint: ESLintBear (comma-spacing): `A space is required after ','.` | |||||
setPPSaturation(0.56); | setPPSaturation(0.56); | ||||
setPPContrast(0.56); | setPPContrast(0.56); | ||||
setPPBloom(0.38); | setPPBloom(0.38); | ||||
setPPEffect("hdr"); | setPPEffect("hdr"); | ||||
g_Map.ExportMap(); | g_Map.ExportMap(); |
A space is required after ','.