This commit is contained in:
2025-01-21 19:05:14 +09:00
parent 3c876d4873
commit 30f9e32550
4 changed files with 18 additions and 13 deletions

View File

@@ -27,8 +27,4 @@ return {
},
ignore_permisison = "bypass-nukeprotect", -- @setting ignore_permisison The permission that nukeprotect will ignore
ignore_admins = true, -- @setting ignore_admins Ignore admins, true by default. Allows usage outside of the roles module
disable_nuke_research = false, -- @setting disable_nuke_research Disable the nuke research, true by default
disable_nuke_research_names = {
["atomic-bomb"] = true,
}, -- @setting disable_nuke_research_names The names of the researches to disabled
}

View File

@@ -159,4 +159,13 @@ return {
["follower-robot-count-5"] = 5,
}
},
-- prevent research up to a certain level
limit_res = {
-- Artillery Range
["artillery-shell-range-1"] = 7,
-- Artillery Speed
["artillery-shell-speed-1"] = 7,
-- Atomic Bomb
-- ["atomic-bomb"] = 1
},
}

View File

@@ -43,12 +43,3 @@ for _, inventory in ipairs(config.inventories) do
end)
end
end
if config.disable_nuke_research then
Event.add(defines.events.on_research_started, function(event)
local name = event.research.name
if config.disable_nuke_research_names[name] then
event.research.force.cancel_current_research()
end
end)
end

View File

@@ -309,6 +309,15 @@ Event.add(defines.events.on_research_finished, function(event)
end
end)
Event.add(defines.events.on_research_started, function(event)
local r = event.research
local res_name = config.limit_res[r.name]
if res_name and r.level > res_name then
table.remove(r.force.research_queue)
end
end)
Event.on_nth_tick(60, function()
local current_time = research_time_format(game.tick)