TorpedoReady

Check if torpedo is ready to fire

Usage: Used in 2 task(s)

Lua Implementation

-- Torpedo Ready
function evaluate(params)
    local torpedoSystem = this:getSystem("Torpedo")

    if torpedoSystem then
        local loaded = torpedoSystem:getAttribute("Loaded")
        local armed = torpedoSystem:getAttribute("Armed")
        local hasAmmo = torpedoSystem:getAmmunitionCount() > 0

        return loaded and armed and hasAmmo
    end

    return false
end