mirror of
https://github.com/Refactorio/RedMew.git
synced 2024-12-10 10:00:00 +02:00
Add solid_rock
This commit is contained in:
parent
75e6d6abf4
commit
d58e2a7606
88
map_gen/maps/solid_rock.lua
Normal file
88
map_gen/maps/solid_rock.lua
Normal file
@ -0,0 +1,88 @@
|
||||
--[[
|
||||
The theme of the map is no underground belts or pipes.
|
||||
For balance, logistics systems research is disabled.
|
||||
]]
|
||||
local b = require 'map_gen.shared.builders'
|
||||
local RecipeLocker = require 'utils.recipe_locker'
|
||||
local table = require 'utils.table'
|
||||
local Event = require 'utils.event'
|
||||
local RS = require 'map_gen.shared.redmew_surface'
|
||||
local ScenarioInfo = require 'features.gui.info'
|
||||
local MGSP = require 'resources.map_gen_settings'
|
||||
local market_items = require 'resources.market_items'
|
||||
|
||||
local insert = table.insert
|
||||
local config = global.config
|
||||
|
||||
ScenarioInfo.set_map_name('Solid Rock')
|
||||
ScenarioInfo.set_map_description("The entire planet is so solid that we can't seem to dig into it.")
|
||||
ScenarioInfo.add_map_extra_info([[
|
||||
- This planet's ground is completely impenetrable.
|
||||
- This planet has a magnetic field that will make logistics systems impossible.
|
||||
- We brought wood and rail on our journey and it is available in the market.
|
||||
- The beasts on this planet are savage and unrelenting.
|
||||
]])
|
||||
|
||||
RS.set_map_gen_settings({MGSP.enemy_very_high, MGSP.tree_none, MGSP.cliff_very_high})
|
||||
|
||||
config.hail_hydra.enabled = true
|
||||
|
||||
-- Setup market inventory
|
||||
config.market.enabled = true
|
||||
local items_to_modify = {
|
||||
{name = 'rail', price = 0.25},
|
||||
{name = 'rail-signal', price = 1},
|
||||
{name = 'rail-chain-signal', price = 1},
|
||||
{name = 'train-stop', price = 7.5},
|
||||
{name = 'locomotive', price = 35},
|
||||
{name = 'cargo-wagon', price = 15},
|
||||
{name = 'raw-wood', price = 0.25}
|
||||
}
|
||||
|
||||
-- Modify market items
|
||||
for i = 1, #items_to_modify do
|
||||
insert(market_items, items_to_modify[i])
|
||||
end
|
||||
|
||||
RecipeLocker.lock_recipes(
|
||||
{
|
||||
'underground-belt',
|
||||
'fast-underground-belt',
|
||||
'express-underground-belt',
|
||||
'pipe-to-ground',
|
||||
'logistic-chest-requester',
|
||||
'logistic-chest-buffer',
|
||||
'logistic-chest-active-provider'
|
||||
}
|
||||
)
|
||||
|
||||
Event.on_init(
|
||||
function()
|
||||
game.forces.player.technologies['logistic-system'].enabled = false
|
||||
end
|
||||
)
|
||||
|
||||
-- Map
|
||||
|
||||
local function on_chunk_generated(event)
|
||||
local bd_box = event.area
|
||||
local surface = event.surface
|
||||
if surface ~= RS.get_surface() then
|
||||
return
|
||||
end
|
||||
|
||||
-- remove rocks
|
||||
local ents = surface.find_entities_filtered {area = bd_box, type = 'simple-entity'}
|
||||
for i = 1, #ents do
|
||||
ents[i].destroy()
|
||||
end
|
||||
end
|
||||
|
||||
Event.add(defines.events.on_chunk_generated, on_chunk_generated)
|
||||
|
||||
local start = b.full_shape
|
||||
start = b.change_map_gen_collision_tile(start, 'ground-tile', 'refined-concrete')
|
||||
start = b.change_map_gen_collision_hidden_tile(start, 'ground-tile', 'lab-dark-2')
|
||||
local map = b.if_else(start, b.full_shape)
|
||||
|
||||
return map
|
@ -38,7 +38,7 @@ Event.on_init(
|
||||
)
|
||||
|
||||
--- Locks recipes, preventing them from being enabled by research.
|
||||
-- Does not check if they should be enabled/disabled by existing research.
|
||||
-- Does not check if they should be enabled/disabled by research already completed.
|
||||
-- @param tbl <table> an array of recipe strings
|
||||
function Public.lock_recipes(tbl)
|
||||
for i = 1, #tbl do
|
||||
@ -47,7 +47,7 @@ function Public.lock_recipes(tbl)
|
||||
end
|
||||
|
||||
--- Unlocks recipes, allowing them to be enabled by research.
|
||||
-- Does not check if they should be enabled/disabled by existing research.
|
||||
-- Does not check if they should be enabled/disabled by research already completed.
|
||||
-- @param tbl <table> an array of recipe strings
|
||||
function Public.unlock_recipes(tbl)
|
||||
for i = 1, #tbl do
|
||||
|
Loading…
Reference in New Issue
Block a user