1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2024-12-12 10:04:40 +02:00

Implemented 9th dimention: Nihil

This commit is contained in:
Valansch 2017-10-28 11:31:59 +02:00
parent b30d20c5c5
commit c3ad532058

View File

@ -41,13 +41,31 @@ local function init()
local enemy_settings = create_resource_setting("enemy-base") local enemy_settings = create_resource_setting("enemy-base")
enemy_settings.autoplace_controls["enemy-base"] = {frequency = "very-high", size = "very-big", richness = "very-good"} enemy_settings.autoplace_controls["enemy-base"] = {frequency = "very-high", size = "very-big", richness = "very-good"}
game.create_surface("Zerus", enemy_settings) game.create_surface("Zerus", enemy_settings)
game.create_surface("Nihil", create_resource_setting("copper-ore"))
end end
end end
local function generate_nihil(event)
for _,e in pairs(event.surface.find_entities_filtered{}) do
if e.type ~= "player" then
e.destroy()
end
end
local tiles = {}
for x = event.area.left_top.x, event.area.right_bottom.x do
for y = event.area.left_top.y, event.area.right_bottom.y do
table.insert(tiles,{name="lab-dark-1", position = {x,y}})
end
end
event.surface.set_tiles(tiles)
end
function run_combined_module(event) function run_combined_module(event)
init() init()
if event.surface.name == "Zerus" then if event.surface.name == "Zerus" then
wrech_items_module.on_chunk_generated(event) wrech_items_module.on_chunk_generated(event)
elseif event.surface.name == "Nihil" then
generate_nihil(event)
end end
end end