TunnelSafe

Check if tunnel is safe to enter

Usage: Used in 8 task(s)

Lua Implementation

-- Tunnel Safe
function evaluate(params)
    local tunnel = params.tunnel_location

    if not tunnel then
        return false
    end

    -- Check for threats, traps, flooding
    local hasThreats = HostilesPresent{search_radius = 100}
    local hasTraps = this:hasStateProperty("TrapsDetected")
    local isFlooded = this:hasStateProperty("TunnelFlooded")

    return not hasThreats and not hasTraps and not isFlooded
end