mirror of
https://github.com/Refactorio/RedMew.git
synced 2024-12-12 10:04:40 +02:00
Add startup techs to DO (#1452)
This commit is contained in:
parent
f04b99e40d
commit
a2a61dbea6
@ -64,6 +64,13 @@ return {
|
||||
max_pollution = 15000,
|
||||
pollution_increment = 4,
|
||||
},
|
||||
technologies = {
|
||||
enabled = true,
|
||||
unlocks = {
|
||||
['uranium-mining'] = { 'uranium-processing' },
|
||||
['oil-gathering'] = { 'oil-processing', 'coal-liquefaction' },
|
||||
},
|
||||
},
|
||||
game = {
|
||||
draw_resource_selection = false,
|
||||
technology_price_multiplier = 25,
|
||||
|
20
map_gen/maps/danger_ores/modules/technologies.lua
Normal file
20
map_gen/maps/danger_ores/modules/technologies.lua
Normal file
@ -0,0 +1,20 @@
|
||||
local Event = require 'utils.event'
|
||||
|
||||
return function(config)
|
||||
local unlocks = config.unlocks or {}
|
||||
if table_size(unlocks) == 0 then
|
||||
return
|
||||
end
|
||||
|
||||
Event.add(defines.events.on_research_finished, function(event)
|
||||
local research = event.research
|
||||
local techs = research.force.technologies
|
||||
|
||||
for _, name in pairs(unlocks[research.name] or {}) do
|
||||
local tech = techs[name]
|
||||
if tech then
|
||||
tech.researched = true
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
@ -47,6 +47,7 @@ local map_builder = require 'map_gen.maps.danger_ores.modules.map'
|
||||
local mining_productivity = require 'map_gen.maps.danger_ores.modules.mining_productivity'
|
||||
local restart_command = require 'map_gen.maps.danger_ores.modules.restart_command'
|
||||
local rocket_launched = require 'map_gen.maps.danger_ores.modules.rocket_launched_simple'
|
||||
local technologies = require 'map_gen.maps.danger_ores.modules.technologies'
|
||||
local terraforming = require 'map_gen.maps.danger_ores.modules.terraforming'
|
||||
|
||||
local Public = {}
|
||||
@ -101,6 +102,9 @@ Public.register = function(danger_ores_config)
|
||||
if _C.terraforming.enabled then
|
||||
terraforming(_C.terraforming)
|
||||
end
|
||||
if _C.technologies.enabled then
|
||||
technologies(_C.technologies)
|
||||
end
|
||||
|
||||
Event.on_init(function()
|
||||
game.draw_resource_selection = _C.game.draw_resource_selection or false
|
||||
|
Loading…
Reference in New Issue
Block a user