2018-11-18 18:12:00 +02:00
|
|
|
-- Author: flowild
|
|
|
|
|
|
|
|
local arm_width = 96
|
|
|
|
|
|
|
|
local function is_on_spiral(x, y, distance, angle_offset)
|
2018-11-21 15:42:39 +02:00
|
|
|
local angle = angle_offset + math.deg(math.atan2(x, y))
|
2018-11-18 18:12:00 +02:00
|
|
|
|
2018-11-21 15:42:39 +02:00
|
|
|
local offset = distance
|
|
|
|
if angle ~= 0 then
|
|
|
|
offset = offset + angle / 3.75 * 2
|
|
|
|
end
|
|
|
|
return offset % 96 * 2 >= 48 * 2
|
2018-11-18 18:12:00 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
return function(x, y, world)
|
2018-11-21 15:42:39 +02:00
|
|
|
local pseudo_x = x / (arm_width / 48)
|
|
|
|
local pseudo_y = y / (arm_width / 48)
|
|
|
|
local distance = math.sqrt(pseudo_x * pseudo_x + pseudo_y * pseudo_y)
|
2018-11-18 18:12:00 +02:00
|
|
|
|
2018-11-21 15:42:39 +02:00
|
|
|
return not (distance > 100 and not is_on_spiral(x, y, distance, 0))
|
2018-11-18 18:12:00 +02:00
|
|
|
end
|