Advertisement
Guest User

Untitled

a guest
Apr 5th, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 7.57 KB | None | 0 0
  1. Index: binaries/data/mods/public/maps/random/fields_of_meroe.js
  2. ===================================================================
  3. --- binaries/data/mods/public/maps/random/fields_of_meroe.js    (revision 21660)
  4. +++ binaries/data/mods/public/maps/random/fields_of_meroe.js    (working copy)
  5. @@ -26,12 +26,14 @@ const oSDatePalm = "gaia/flora_tree_cret
  6.  const oGazelle = "gaia/fauna_gazelle";
  7.  const oGiraffe = "gaia/fauna_giraffe";
  8.  const oLion = "gaia/fauna_lion";
  9.  const oFish = "gaia/fauna_fish";
  10.  const oHawk = "gaia/fauna_hawk";
  11. -const oStoneSmall = "gaia/geology_stone_savanna_small";
  12. +const oStoneLarge = "gaia/geology_stonemine_savanna_quarry";
  13. +const oStoneSmall = "gaia/geology_stone_desert_small";
  14.  const oMetalLarge = "gaia/geology_metal_savanna_slabs";
  15. +const oMetalSmall = "gaia/geology_metal_desert_small";
  16.  
  17.  const oHouse = "structures/kush_house";
  18.  const oFarmstead = "structures/kush_farmstead";
  19.  const oField = "structures/kush_field";
  20.  const oPyramid = "structures/kush_pyramid_small";
  21. @@ -41,20 +43,24 @@ const oKushSoldiers = "units/kush_infant
  22.  const aRain = g_Decoratives.rain;
  23.  const aBushA = g_Decoratives.bushA;
  24.  const aBushB = g_Decoratives.bushB;
  25.  const aBushes = [aBushA, aBushB];
  26.  const aReeds = "actor|props/flora/reeds_pond_lush_a.xml";
  27. -const aRock = "actor|geology/stone_desert_med.xml";
  28. +const aRockA = "actor|geology/stone_desert_med.xml";
  29. +const aRockB = "actor|geology/shoreline_large.xml";
  30. +const aRockC = "actor|geology/shoreline_small.xml";
  31.  
  32.  const pForestP = [tForestFloor + TERRAIN_SEPARATOR + oAcacia, tForestFloor];
  33.  
  34.  const heightSeaGround = g_Heights.seaGround;
  35.  const heightReedsDepth = -2.5;
  36. +const heightCataract = -1;
  37.  const heightShore = 1;
  38.  const heightLand = 2;
  39.  const heightDunes = 11;
  40.  const heightOffsetBump = 1.4;
  41. +const heightOffsetBumpPassage = 4;
  42.  
  43.  const g_Map = new RandomMap(heightLand, tMainDirt);
  44.  
  45.  const numPlayers = getNumPlayers();
  46.  const mapCenter = g_Map.getCenter();
  47. @@ -69,10 +75,11 @@ var clForest = g_Map.createTileClass();
  48.  var clRock = g_Map.createTileClass();
  49.  var clMetal = g_Map.createTileClass();
  50.  var clFood = g_Map.createTileClass();
  51.  var clBaseResource = g_Map.createTileClass();
  52.  var clRain = g_Map.createTileClass();
  53. +var clCataract = g_Map.createTileClass();
  54.  
  55.  var kushVillageBuildings = {
  56.     "houseA": { "template": oHouse, "offset": new Vector2D(5, 5) },
  57.     "houseB": { "template": oHouse, "offset": new Vector2D(5, 0) },
  58.     "houseC": { "template": oHouse, "offset": new Vector2D(5, -5) },
  59. @@ -124,10 +131,48 @@ paintRiver({
  60.                 }
  61.     }
  62.  });
  63.  Engine.SetProgress(10);
  64.  
  65. +g_Map.log("Creating cataracts");
  66. +for (let x of [fractionToTiles(randFloat(0.15, 0.25)), fractionToTiles(randFloat(0.75, 0.85))])
  67. +{
  68. +   let anglePassage = riverAngle + Math.PI / 2 * randFloat(0.8, 1.2);
  69. +
  70. +   let areaPassage = createArea(
  71. +       new PathPlacer(
  72. +           new Vector2D(x, mapBounds.bottom).rotateAround(anglePassage, mapCenter),
  73. +           new Vector2D(x, mapBounds.top).rotateAround(anglePassage, mapCenter),
  74. +           scaleByMapSize(20, 30),
  75. +           0,
  76. +           1,
  77. +           0,
  78. +           0,
  79. +           Infinity),
  80. +       [
  81. +           new SmoothElevationPainter(ELEVATION_SET, heightCataract, 2),
  82. +           new TileClassPainter(clCataract)
  83. +       ],
  84. +       new HeightConstraint(-Infinity, 0));
  85. +
  86. +   createAreasInAreas(
  87. +       new ClumpPlacer(4, 0.4, 0.6),
  88. +       new SmoothElevationPainter(ELEVATION_MODIFY, heightOffsetBumpPassage, 2),
  89. +       undefined,
  90. +       scaleByMapSize(15, 30),
  91. +       20,
  92. +       [areaPassage]);
  93. +
  94. +   createObjectGroupsByAreas(
  95. +       new SimpleGroup([new SimpleObject(aReeds, 2, 4, 0, 1)], true),
  96. +       0,
  97. +       undefined,
  98. +       scaleByMapSize(20, 50),
  99. +       20,
  100. +       [areaPassage])
  101. +}
  102. +
  103.  var [playerIDs, playerPosition] = playerPlacementRandom(sortAllPlayers(), avoidClasses(clRiver, 15, clPlayer, 30));
  104.  placePlayerBases({
  105.     "PlayerPlacement": [playerIDs, playerPosition],
  106.     "BaseResourceClass": clBaseResource,
  107.     "CityPatch": {
  108. @@ -238,32 +283,28 @@ for (let size of [scaleByMapSize(30, 40)
  109.         avoidClasses(clDunes, 3, clForest, 3, clPlayer, 5, clKushiteVillages, 5, clRiver, 10),
  110.         scaleByMapSize(1, 10));
  111.  Engine.SetProgress(60);
  112.  
  113.  g_Map.log("Creating stone mines");
  114. -createObjectGroups(
  115. -   new SimpleGroup([new SimpleObject(oStoneSmall, 1, 1, 0, 4), new RandomObject(aBushes, 2, 4, 0, 2)], true, clRock),
  116. -   0,
  117. -   [avoidClasses(clForest, 1, clPlayer, 10, clRock, 10, clDunes, 1, clRiver, 15, clKushiteVillages, 10)],
  118. -   scaleByMapSize(2, 8),
  119. -   100);
  120. -
  121. -g_Map.log("Creating small stone quarries");
  122. -createObjectGroups(
  123. -   new SimpleGroup([new SimpleObject(oStoneSmall, 2, 5, 1, 3), new RandomObject(aBushes, 2, 4, 0, 2)], true, clRock),
  124. -   0,
  125. -   [avoidClasses(clForest, 1, clPlayer, 10, clRock, 10, clDunes, 1, clRiver, 15, clKushiteVillages, 10)],
  126. -   scaleByMapSize(2, 8),
  127. -   100);
  128. +createMines(
  129. +   [
  130. +       [new SimpleObject(oStoneSmall, 0, 2, 0, 4, 0, 2 * Math.PI, 1), new SimpleObject(oStoneLarge, 1, 1, 0, 4, 0, 2 * Math.PI, 4)],
  131. +       [new SimpleObject(oStoneSmall, 2, 5, 1, 3, 0, 2 * Math.PI, 1)]
  132. +   ],
  133. +   avoidClasses(clRiver, 4, clCataract, 4, clPlayer, 20, clRock, 10, clKushiteVillages, 5, clDunes, 2, clForest, 4),
  134. +   clRock,
  135. +   scaleByMapSize(6, 24));
  136.  
  137.  g_Map.log("Creating metal mines");
  138. -createObjectGroups(
  139. -   new SimpleGroup([new SimpleObject(oMetalLarge, 1, 1, 0, 4), new RandomObject(aBushes, 2, 4, 0, 2)], true, clMetal),
  140. -   0,
  141. -   [avoidClasses(clForest, 1, clPlayer, 10, clMetal, 10, clRock, 5, clDunes, 1, clRiver, 15, clKushiteVillages, 10)],
  142. -   scaleByMapSize(2, 8),
  143. -   100);
  144. +createMines(
  145. +   [
  146. +       [new SimpleObject(oMetalSmall, 0, 2, 0, 4, 0, 2 * Math.PI, 1), new SimpleObject(oMetalLarge, 1, 1, 0, 4, 0, 2 * Math.PI, 4)],
  147. +       [new SimpleObject(oMetalSmall, 2, 5, 1, 3, 0, 2 * Math.PI, 1)]
  148. +   ],
  149. +   avoidClasses(clRiver, 4, clCataract, 4, clPlayer, 20, clRock, 10, clKushiteVillages, 5, clDunes, 2, clForest, 4),
  150. +   clMetal,
  151. +   scaleByMapSize(6, 24));
  152.  Engine.SetProgress(70);
  153.  
  154.  g_Map.log("Creating gazelle");
  155.  createObjectGroups(
  156.     new SimpleGroup([new SimpleObject(oGazelle, 4, 6, 1, 4)], true, clFood),
  157. @@ -295,11 +336,11 @@ for (let i = 0; i < scaleByMapSize(1, 3)
  158.  
  159.  g_Map.log("Creating fish");
  160.  createObjectGroups(
  161.     new SimpleGroup([new SimpleObject(oFish, 1, 2, 0, 1)], true, clFood),
  162.     0,
  163. -   [stayClasses(clRiver, 4), avoidClasses(clFood, 16)],
  164. +   [stayClasses(clRiver, 4), avoidClasses(clFood, 16, clCataract, 10)],
  165.     scaleByMapSize(15, 80),
  166.     50);
  167.  Engine.SetProgress(80);
  168.  
  169.  createStragglerTrees(
  170. @@ -320,26 +361,39 @@ createStragglerTrees(
  171.     clForest,
  172.     stragglerTrees * 10);
  173.  
  174.  Engine.SetProgress(90);
  175.  
  176. -g_Map.log("Creating reeds on the shore.");
  177. +g_Map.log("Creating reeds on the shore");
  178.  createObjectGroups(
  179.     new SimpleGroup([new SimpleObject(aReeds, 3, 5, 0, 1)], true),
  180.     0,
  181. -   new HeightConstraint(heightReedsDepth, heightShore),
  182. +   [
  183. +       new HeightConstraint(heightReedsDepth, heightShore),
  184. +       avoidClasses(clCataract, 2)
  185. +   ],
  186.     scaleByMapSize(500, 1000),
  187.     50);
  188.  
  189.  g_Map.log("Creating small decorative rocks");
  190.  createObjectGroups(
  191. -   new SimpleGroup([new SimpleObject(aRock, 1, 3, 0, 1)], true),
  192. +   new SimpleGroup([new SimpleObject(aRockA, 1, 3, 0, 1)], true),
  193.     0,
  194.     avoidClasses(clForest, 0, clPlayer, 0, clDunes, 0),
  195.     scaleByMapSize(16, 262),
  196.     50);
  197.  
  198. +createObjectGroups(
  199. +   new SimpleGroup([new SimpleObject(aRockB, 1, 2, 0, 1), new SimpleObject(aRockC, 1, 3, 0, 1)], true),
  200. +   0,
  201. +   [
  202. +       new NearTileClassConstraint(clCataract, 5),
  203. +       new HeightConstraint(-Infinity, heightShore)
  204. +   ],
  205. +   scaleByMapSize(30, 50),
  206. +   200);
  207. +
  208.  g_Map.log("Creating bushes");
  209.  createObjectGroups(
  210.     new SimpleGroup([new SimpleObject(aBushB, 1, 2, 0, 1), new SimpleObject(aBushA, 1, 3, 0, 2)], true),
  211.     0,
  212.     avoidClasses(clForest, 0, clPlayer, 0, clDunes, 0, clRiver, 15),
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement