Description
Scans surface after launching a rocket with radars. The radius increases if you launch a rocket with more than 20 radars.
You can change the radius in the mod settings.
function(event)
local rocket = event.rocket
local force = rocket.force
local count = rocket.get_item_count("radar")
if count > 20 then
local radius = settings.global["radius-scan-rocket-with-radars"].value * count
force.chart(rocket.surface, {{rocket.position.x - radius,rocket.position.y - radius}, {rocket.position.x + radius, rocket.position.y + radius}})
elseif count > 0 then
local radius = settings.global["radius-scan-rocket-with-radars"].value * 19
force.chart(rocket.surface, {{rocket.position.x - radius,rocket.position.y - radius}, {rocket.position.x + radius, rocket.position.y + radius}})
end
end)
Normally radar scans 7x7=49 chunks. It looks like that it has scan radius = 3.5. If this radar is two times powerful then it covers 98 (or 100) chunks, then the radius must be 5.