LaunchTorpedo

Launch torpedo at target

Usage: Used in 19 task(s)

Lua Implementation

-- Launch Torpedo
function execute(params)
    local target = params.target
    local torpedoSystem = this:getSystem("Torpedo")

    if torpedoSystem and target and target:isValid() then
        torpedoSystem:setAttribute("Target", target)
        torpedoSystem:setAttribute("SearchPattern", params.search_pattern or "snake")
        torpedoSystem:setAttribute("Launch", true)
        return true
    end
    return false
end