mirror of
https://github.com/veden/Rampant.git
synced 2025-02-09 13:36:53 +02:00
23 lines
456 B
Lua
23 lines
456 B
Lua
|
local aiPredicates = {}
|
||
|
|
||
|
-- imports
|
||
|
|
||
|
local constants = require("Constants")
|
||
|
local nocturnalUtils = require("NocturnalUtils")
|
||
|
|
||
|
-- constants
|
||
|
|
||
|
local AI_STATE_AGGRESSIVE = constants.AI_STATE_AGGRESSIVE
|
||
|
|
||
|
-- imported functions
|
||
|
|
||
|
local canAttackNocturnal = nocturnalUtils.canAttack
|
||
|
|
||
|
-- module code
|
||
|
|
||
|
function aiPredicates.canAttack(natives, surface)
|
||
|
return (natives.state == AI_STATE_AGGRESSIVE) or canAttackNocturnal(natives, surface)
|
||
|
end
|
||
|
|
||
|
return aiPredicates
|