Hey, this is an awesome mod idea! Found some issues though...
So first of all there's a bug - you don't decrease the damage intensity (called distance for some reason in the code) when a player is standing in the safe zone. The fix is easy.. add an else to the safe zone check:
elseif global.flOre[p.name] then
global.flOre[p.name] = global.flOre[p.name] - 1
if global.flOre[p.name] <= 0 then
global.flOre[p.name] = nil
end
end
And move this line out of the if statement (before it): if not global.flOre then global.flOre = {} end
My second issue is that the damage intensity (=distance) affects how close you can be to resources without taking damage. This seems to be incorrect by design - why do you need to stand further and further away from the ore to decrease the damage intensity? As long as you don't stay in ore it should be fine IMO. i.e. remove it from the count function:
local count = p.surface.count_entities_filtered{type="resource", area={{p.position.x-10, p.position.y-10}, {p.position.x+10, p.position.y+10}}}
These two issues together makes playing with the fl0re is lava option impossible. I added some debug printing and found that my "distance" was 30, so I couldn't move outside the safe zone at all, and the game froze every time the check was made due to it scanning a 600x600 area for resources. Also, the mod doesn't kill me in singleplayer, but I couldn't find a reason I'm not dead in the code... is this intended behavior? I think it's a good "feature" for singleplayer, but I'm curious since I can't figure out how it works. :)