mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 19:45:22 +09:00
Added Pollution Grading
This commit is contained in:
13
modules/addons/pollution-grading.lua
Normal file
13
modules/addons/pollution-grading.lua
Normal file
@@ -0,0 +1,13 @@
|
||||
local Event = require 'utils.event'
|
||||
local config = require 'config.pollution_grading'
|
||||
|
||||
local delay = config.update_delay * 3600 -- convert from minutes to ticks
|
||||
Event.on_nth_tick(delay,function()
|
||||
local surface = game.surfaces[1]
|
||||
local true_max = surface.get_pollution(config.reference_point)
|
||||
local max = true_max*config.max_scalar
|
||||
local min = max*config.min_scalar
|
||||
local settings = game.map_settings.pollution
|
||||
settings.expected_max_per_chunk = max
|
||||
settings.min_to_show_per_chunk = min
|
||||
end)
|
||||
Reference in New Issue
Block a user