Guest User

Untitled

a guest
Jul 4th, 2016
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.85 KB | None | 0 0
  1. local function autoplace_settings(name, coverage, starting_area_bonus)
  2. local ret = {
  3. control = name,
  4. sharpness = 1,
  5. richness_multiplier = 1500,
  6. richness_multiplier_distance_bonus = 20,
  7. richness_base = 500,
  8. coverage = coverage,
  9. peaks = {
  10. {
  11. noise_layer = name,
  12. noise_octaves_difference = -1.5,
  13. noise_persistence = 0.3,
  14. starting_area_weight_optimal = 0,
  15. starting_area_weight_range = 0,
  16. starting_area_weight_max_range = 2,
  17. },
  18. {
  19. noise_layer = name,
  20. noise_octaves_difference = -2,
  21. noise_persistence = 0.3,
  22. starting_area_weight_optimal = 1,
  23. starting_area_weight_range = 0,
  24. starting_area_weight_max_range = 2,
  25. },
  26. {
  27. influence = 0.15 + starting_area_bonus,
  28. starting_area_weight_optimal = 1,
  29. starting_area_weight_range = 0,
  30. starting_area_weight_max_range = 2,
  31. }
  32. }
  33. }
  34. for i, resource in ipairs({"titanite","copper-ore", "iron-ore", "coal", "stone" }) do
  35. if resource ~= name then
  36. ret.peaks[#ret.peaks + 1] = {
  37. {
  38. influence = -0.3;
  39. max_influence = 0;
  40. noise_layer = resource,
  41. noise_octaves_difference = -2,
  42. noise_persistence = 0.3,
  43. starting_area_weight_optimal = 1,
  44. starting_area_weight_range = 0,
  45. starting_area_weight_max_range = 2,
  46. },
  47. }
  48. end
  49. end
  50. return ret
  51. end
  52. local function resource(name, map_color, hardness, coverage, starting_area_bonus,icon,filename)
  53. if hardness == nil then hardness = 0.9 end
  54. if coverage == nil then coverage = 0.02 end
  55. if starting_area_bonus == nil then starting_area_bonus = 0 end
  56. return {
  57. type = "resource",
  58. name = name,
  59. icon = icon,
  60. flags = {"placeable-neutral"},
  61. order="a-b-a",
  62. minable =
  63. {
  64. hardness = hardness,
  65. mining_time = 2,
  66. result = name
  67. },
  68. collision_box = {{ -0.1, -0.1}, {0.1, 0.1}},
  69. selection_box = {{ -0.5, -0.5}, {0.5, 0.5}},
  70. autoplace = autoplace_settings(name, coverage, starting_area_bonus),
  71. stage_counts = {1000, 600, 400, 200, 100, 50, 20, 1},
  72. stages =
  73. {
  74. sheet =
  75. {
  76. filename = filename,
  77. priority = "extra-high",
  78. width = 38,
  79. height = 38,
  80. frame_count = 4,
  81. variation_count = 8
  82. }
  83. },
  84. map_color = map_color
  85. }
  86. end
  87. data:extend({
  88.  
  89. {
  90. type = "autoplace-control",
  91. name = "titanite",
  92. richness = true,
  93. order = "b-f"
  94. },
  95.  
  96. {
  97. resource(
  98. "titantie", -- name
  99. {r=0.478, g=0.450, b=0.317}, -- map color
  100. 0.4, --hardness
  101. 0.01, --coverage
  102. 0, -- starting area bonus
  103. "__WeaponsExtended__/graphics/titanite_icon.png", -- icon path
  104. "__WeaponsExtended__/graphics/titanite.png" -- file path
  105. )
  106. }
  107. })
Advertisement
Add Comment
Please, Sign In to add comment