1
0
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:
RedRafe 2024-11-23 20:45:36 +01:00 committed by GitHub
parent f04b99e40d
commit a2a61dbea6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 31 additions and 0 deletions

View File

@ -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,

View 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

View File

@ -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