2017-07-30 21:20:54 +02:00
|
|
|
local function apply_config()
|
|
|
|
if not global.scenario.config.enable_radar then
|
|
|
|
game.forces["player"].recipes["radar"].enabled = false
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2017-06-13 13:16:07 +02:00
|
|
|
Event.register(-1, function()
|
|
|
|
global.scenario = {}
|
2017-07-12 02:06:49 +02:00
|
|
|
global.scenario.variables = {}
|
|
|
|
global.scenario.variables.time_set_moment = 0
|
|
|
|
global.scenario.variables.current_month = 1
|
|
|
|
global.scenario.variables.current_day = 1
|
|
|
|
global.scenario.variables.current_h = 0
|
|
|
|
global.scenario.variables.current_m = 0
|
|
|
|
global.scenario.variables.days_passed = 0
|
2017-09-09 11:55:18 +01:00
|
|
|
|
|
|
|
global.scenario.variables.mods = require "locale.resources.mods"
|
|
|
|
global.scenario.variables.regulars = require "locale.resources.regulars"
|
2017-08-23 23:06:58 +02:00
|
|
|
|
2017-07-19 02:04:41 +02:00
|
|
|
global.scenario.variables.player_positions = {}
|
|
|
|
global.scenario.variables.player_walk_distances = {}
|
2017-06-13 13:16:07 +02:00
|
|
|
global.scenario.config = {}
|
|
|
|
global.scenario.config.announcements_enabled = false -- if true announcements will be shown
|
|
|
|
global.scenario.config.announcement_delay = 1000 -- number of seconds between each announcement
|
|
|
|
global.scenario.config.score_delay = 8 -- delay in seconds before hiding rocket score window (0 = never show)
|
|
|
|
global.scenario.config.autolaunch_default = false -- default autolaunch option
|
|
|
|
global.scenario.config.logistic_research_enabled = true -- if true then research for requesters and active providers will be enabled.
|
2017-07-30 21:20:54 +02:00
|
|
|
global.scenario.config.enable_radar = true
|
2017-06-13 13:16:07 +02:00
|
|
|
global.scenario.config.mapsettings = global.scenario.config.mapsettings or {}
|
|
|
|
global.scenario.config.mapsettings.cross_width = 200 -- total width of cross
|
|
|
|
global.scenario.config.mapsettings.spiral_land_width = 70 -- width of land in spiral
|
|
|
|
global.scenario.config.mapsettings.spiral_water_width = 70 -- width of water in spiral
|
|
|
|
global.scenario.custom_functions = {}
|
2017-07-08 22:24:24 +02:00
|
|
|
global.scenario.config.nuke_min_time_hours = 3 --how long a player must be on the server to be allowed to use the nuke
|
2017-07-30 21:20:54 +02:00
|
|
|
apply_config()
|
2017-06-13 13:16:07 +02:00
|
|
|
end)
|
2017-07-30 21:20:54 +02:00
|
|
|
|
|
|
|
local function on_research_started(event)
|
|
|
|
if not global.scenario.config.logistic_research_enabled then
|
|
|
|
if event.research.name == "logistic-robotics" then
|
|
|
|
game.forces["player"].current_research = nil
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
Event.register(defines.events.on_research_started, on_research_started)
|