Files
factorio-scenario-ExpCluster/exp_scenario/module/control/pollution_grading.lua
Cooldude2606 9bd699ebf1 Refactor legacy addons into Clusterio format (#413)
* Refactor custom start

* Refactor afk kick

* Fix use of assert get player

* Refactor chat popup

* Refactor chat auto reply

* Refactor help bubbles

* Refactor damage popups

* Refactor death markers

* Refactor deconstruction log

* Remove FAGC logging

* Refactor discord alerts

* Refactor insert pickup

* Refactor inventory clear

* Refactor extra logging

* Refactor nuke protection

* Refactor pollution grading

* Refactor protection jail

* Refactor report jail

* Refactor mine depletion

* Refactor degrading tiles

* Refactor station auto name

* Refactor spawn area

* Refactor fast deconstruction

* Bug Fixes
2025-12-02 18:34:24 +00:00

28 lines
775 B
Lua

--[[-- Control - Pollution Grading
Makes pollution look much nice of the map, ie not one big red mess
]]
local config = require("modules.exp_legacy.config.pollution_grading")
local function check_surfaces()
local max_reference = 0
for _, surface in pairs(game.surfaces) do
local reference = surface.get_pollution(config.reference_point)
if reference > max_reference then
max_reference = reference
end
end
local max = max_reference * 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
return {
on_nth_tick = {
[config.update_delay * 3600] = check_surfaces,
}
}