ManeuverShip

Maneuver naval vessel

Usage: Used in 2 task(s)

Lua Implementation

-- Maneuver Ship
function execute(params)
    local maneuver = params.maneuver_type  -- "evasive", "attack", "patrol"

    if maneuver == "evasive" then
        local currentHeading = this:getHeading()
        local newHeading = (currentHeading + math.pi/2) % (2 * math.pi)
        this:setOrientation(newHeading, 0, 0)
        this:setSpeed(this:getSpeed() * 1.5)
    end

    return true
end