1
0
mirror of https://github.com/veden/Rampant.git synced 2025-01-03 22:52:20 +02:00
Rampant/libs/NocturnalUtils.lua

22 lines
407 B
Lua
Raw Normal View History

2017-05-14 00:32:16 +02:00
local nocturnalUtils = {}
-- imports
local constants = require("Constants")
-- constants
local AI_STATE_NOCTURNAL = constants.AI_STATE_NOCTURNAL
-- module code
function nocturnalUtils.isDark(surface)
return surface.darkness > 0.65
2017-05-14 00:32:16 +02:00
end
function nocturnalUtils.canAttack(natives, surface)
return nocturnalUtils.isDark(surface) and natives.state == AI_STATE_NOCTURNAL
end
return nocturnalUtils