mirror of
https://github.com/Refactorio/RedMew.git
synced 2025-01-26 03:52:00 +02:00
Merge branch 'develop_decos' of https://github.com/Valansch/RedMew into develop_decos
This commit is contained in:
commit
b54cf39e03
@ -330,250 +330,3 @@ function check_entities(tile, x, y)
|
||||
|
||||
return tile_entity_list
|
||||
end
|
||||
|
||||
function run_combined_module(event)
|
||||
|
||||
if MAP_GEN == nil then
|
||||
game.print("MAP_GEN not set")
|
||||
return
|
||||
end
|
||||
|
||||
local area = event.area
|
||||
local surface = event.surface
|
||||
MAP_GEN_SURFACE = surface
|
||||
|
||||
|
||||
local top_x = area.left_top.x
|
||||
local top_y = area.left_top.y
|
||||
|
||||
if map_gen_decoratives then
|
||||
for _, e in pairs(surface.find_entities_filtered{area=area, type="decorative"}) do
|
||||
e.destroy()
|
||||
end
|
||||
for _, e in pairs(surface.find_entities_filtered{area=area, type="tree"}) do
|
||||
e.destroy()
|
||||
end
|
||||
for _, e in pairs(surface.find_entities_filtered{area=area, type="simple-entity"}) do
|
||||
e.destroy()
|
||||
end
|
||||
end
|
||||
|
||||
Thread.queue_action("run_init", {} )
|
||||
|
||||
Thread.queue_action("run_calc_items", {surface = event.surface, top_x = top_x, top_y = top_y})
|
||||
|
||||
Thread.queue_action("run_place_tiles", {surface = event.surface})
|
||||
Thread.queue_action("run_place_items", {surface = event.surface})
|
||||
Thread.queue_action("run_chart_update", {area = event.area, surface = event.surface} )
|
||||
|
||||
end
|
||||
|
||||
local decorative_options = {
|
||||
["concrete"] = {},
|
||||
["deepwater"] = {},
|
||||
["deepwater-green"] = {
|
||||
{"brown-carpet-grass", 100},
|
||||
{"brown-cane-cluster", 500},
|
||||
},
|
||||
["dirt"] = {
|
||||
{"brown-carpet-grass", 100},
|
||||
{"brown-cane-cluster", 200},
|
||||
{"red-desert-rock-tiny", 150},
|
||||
},
|
||||
["dirt-dark"] = {
|
||||
{"red-desert-rock-tiny", 150},
|
||||
{"red-asterisk", 45},
|
||||
{"red-desert-bush", 12},
|
||||
{"red-desert-rock-medium", 375},
|
||||
|
||||
|
||||
},
|
||||
["grass"] = {
|
||||
{"green-carpet-grass", 3},
|
||||
{"green-hairy-grass", 7},
|
||||
{"green-bush-mini", 10},
|
||||
{"green-pita", 6},
|
||||
{"green-small-grass", 12},
|
||||
{"green-asterisk", 25},
|
||||
{"green-bush-mini", 7},
|
||||
{"garballo", 20},
|
||||
},
|
||||
["grass-medium"] = {
|
||||
{"green-carpet-grass", 12},
|
||||
{"green-hairy-grass", 28},
|
||||
{"green-bush-mini", 40},
|
||||
{"green-pita", 24},
|
||||
{"green-small-grass", 48},
|
||||
{"green-asterisk", 100},
|
||||
{"green-bush-mini", 28},
|
||||
},
|
||||
["grass-dry"] = {
|
||||
{"green-hairy-grass", 56},
|
||||
{"green-bush-mini", 80},
|
||||
{"green-pita", 48},
|
||||
{"green-small-grass", 96},
|
||||
{"green-asterisk", 200},
|
||||
{"green-bush-mini", 56},
|
||||
{"brown-cane-cluster", 100},
|
||||
{"brown-carpet-grass", 100},
|
||||
},
|
||||
["hazard-concrete-left"] = {},
|
||||
["hazard-concrete-right"] = {},
|
||||
["lab-dark-1"] = {},
|
||||
["lab-dark-2"] = {},
|
||||
["red-desert"] = {
|
||||
{"brown-carpet-grass", 35},
|
||||
{"orange-coral-mini", 45},
|
||||
{"red-asterisk", 45},
|
||||
{"red-desert-bush", 12},
|
||||
{"red-desert-rock-medium", 375},
|
||||
{"red-desert-rock-small", 200},
|
||||
{"red-desert-rock-tiny", 30},
|
||||
},
|
||||
["red-desert-dark"] = {
|
||||
{"brown-carpet-grass", 70},
|
||||
{"orange-coral-mini", 90},
|
||||
{"red-asterisk", 90},
|
||||
{"red-desert-bush", 35},
|
||||
{"red-desert-rock-medium", 375},
|
||||
{"red-desert-rock-small", 200},
|
||||
{"red-desert-rock-tiny", 150},
|
||||
},
|
||||
["sand"] = {
|
||||
{"brown-carpet-grass", 35},
|
||||
{"orange-coral-mini", 45},
|
||||
{"red-asterisk", 45},
|
||||
{"brown-asterisk", 45},
|
||||
},
|
||||
["sand-dark"] = {
|
||||
{"brown-carpet-grass", 35},
|
||||
{"orange-coral-mini", 45},
|
||||
{"brown-asterisk", 45},
|
||||
},
|
||||
["stone-path"] = {},
|
||||
["water"] = {},
|
||||
["water-green"] = {},
|
||||
["out-of-map"] = {},
|
||||
}
|
||||
|
||||
function check_decorative(tile, x, y)
|
||||
local options = decorative_options[tile]
|
||||
local tile_decoratives = {}
|
||||
|
||||
for _,e in ipairs(options) do
|
||||
name = e[1]
|
||||
high_roll = e[2]
|
||||
if poisson_rng_next(high_roll / 2 ) == 1 then
|
||||
table.insert(tile_decoratives, {name=name, amount=1, position={x,y}})
|
||||
end
|
||||
end
|
||||
|
||||
return tile_decoratives
|
||||
end
|
||||
|
||||
local entity_options = {
|
||||
["concrete"] = {},
|
||||
["deepwater"] = {},
|
||||
["deepwater-green"] = {},
|
||||
["water"] = {},
|
||||
["water-green"] = {},
|
||||
["dirt"] = {
|
||||
{"tree-01", 500},
|
||||
{"tree-06", 300},
|
||||
{"tree-07", 800},
|
||||
{"tree-09", 2000},
|
||||
{"stone-rock", 400},
|
||||
},
|
||||
["dirt-dark"] = {
|
||||
{"tree-06", 150},
|
||||
{"tree-07", 400},
|
||||
{"tree-09", 1000},
|
||||
{"stone-rock", 300},
|
||||
},
|
||||
["grass"] = {
|
||||
{"tree-01", 150},
|
||||
{"tree-04", 400},
|
||||
{"tree-06", 400},
|
||||
{"tree-07", 400},
|
||||
{"tree-09", 1000},
|
||||
{"stone-rock", 400},
|
||||
{"green-coral", 10000},
|
||||
},
|
||||
["grass-medium"] = {
|
||||
{"tree-02", 400},
|
||||
{"tree-03", 400},
|
||||
{"tree-04", 800},
|
||||
{"tree-06", 300},
|
||||
{"tree-07", 800},
|
||||
{"tree-08", 400},
|
||||
{"tree-09", 2000},
|
||||
{"stone-rock", 400},
|
||||
},
|
||||
["grass-dry"] = {
|
||||
{"tree-04", 800},
|
||||
{"tree-06", 300},
|
||||
{"tree-07", 400},
|
||||
{"tree-09", 1000},
|
||||
{"dry-tree", 1000},
|
||||
{"stone-rock", 200},
|
||||
},
|
||||
["hazard-concrete-left"] = {},
|
||||
["hazard-concrete-right"] = {},
|
||||
["lab-dark-1"] = {},
|
||||
["lab-dark-2"] = {},
|
||||
["red-desert"] = {
|
||||
{"dry-tree", 400},
|
||||
{"dry-hairy-tree", 400},
|
||||
{"tree-06", 500},
|
||||
{"tree-06", 500},
|
||||
{"tree-01", 500},
|
||||
{"tree-02", 500},
|
||||
{"tree-03", 500},
|
||||
{"red-desert-rock-big-01", 200},
|
||||
{"red-desert-rock-huge-01", 400},
|
||||
{"red-desert-rock-huge-02", 400},
|
||||
},
|
||||
["red-desert-dark"] = {
|
||||
{"dry-tree", 400},
|
||||
{"dry-hairy-tree", 400},
|
||||
{"tree-06", 500},
|
||||
{"tree-06", 500},
|
||||
{"tree-01", 500},
|
||||
{"tree-02", 500},
|
||||
{"tree-03", 500},
|
||||
{"red-desert-rock-big-01", 200},
|
||||
{"red-desert-rock-huge-01", 400},
|
||||
{"red-desert-rock-huge-02", 400},
|
||||
},
|
||||
["sand"] = {
|
||||
{"dry-tree", 1000},
|
||||
{"dry-hairy-tree", 1000},
|
||||
{"dead-tree", 1000},
|
||||
{"stone-rock", 150},
|
||||
|
||||
},
|
||||
["sand-dark"] = {
|
||||
{"dead-tree", 1000},
|
||||
{"dry-tree", 1000},
|
||||
{"dry-hairy-tree", 1000},
|
||||
{"stone-rock", 150},
|
||||
|
||||
},
|
||||
["stone-path"] = {},
|
||||
["out-of-map"] = {},
|
||||
}
|
||||
|
||||
function check_entities(tile, x, y)
|
||||
local options = entity_options[tile]
|
||||
local tile_entity_list = {}
|
||||
|
||||
for _,e in ipairs(options) do
|
||||
name = e[1]
|
||||
high_roll = e[2]
|
||||
if poisson_rng_next( high_roll / 2 ) == 1 then
|
||||
table.insert(tile_entity_list, {name=name, position={x,y}})
|
||||
end
|
||||
end
|
||||
|
||||
return tile_entity_list
|
||||
end
|
||||
|
@ -25,7 +25,7 @@ in this file and your run_*type*_module(event) function will be called.
|
||||
--MAP_GEN = require "locale.gen_combined.grilledham_map_gen.presets.maori"
|
||||
--MAP_GEN = require "locale.gen_combined.grilledham_map_gen.presets.goat"
|
||||
--MAP_GEN = require "locale.gen_combined.grilledham_map_gen.presets.biome_test"
|
||||
MAP_GEN = require "locale.gen_combined.grilledham_map_gen.presets.GoT"
|
||||
--MAP_GEN = require "locale.gen_combined.grilledham_map_gen.presets.GoT"
|
||||
--require "locale.grilledham_map_gen.presets.UK"
|
||||
|
||||
--shapes--
|
||||
|
Loading…
x
Reference in New Issue
Block a user