DeploySAM

Deploy surface-to-air missile system

Usage: Used in 11 task(s)

Lua Implementation

-- Deploy SAM
function execute(params)
    local deployLoc = params.location
    local samType = params.sam_type

    this:addTask("DtGoto", {location = deployLoc})
    this:setStateProperty("SAMDeployed", true)
    this:setStateProperty("SAMType", samType)
    this:setStateProperty("CoverageRadius", params.coverage_radius or 30000)

    -- Activate radar
    local radar = this:getSystem("Radar")
    if radar then
        radar:setMode("search")
        radar:setPower(true)
    end

    return true
end