ReadyToAssault

Check if unit is ready to assault

Usage: Used in 9 task(s)

Lua Implementation

-- Ready To Assault
function evaluate(params)
    local assaultPos = this:getStateProperty("AssaultPosition")
    local objective = this:getStateProperty("Objective")

    if not assaultPos or not objective then
        return false
    end

    -- Check if at assault position
    local atPosition = IsAtLocation{location = assaultPos, tolerance = 100}

    -- Check if unit is operational
    local operational = IsOperational{}

    return atPosition and operational
end