Пользовательские дополнения

На главную


device.GetCooldown( usableDeviceId, actionIndex )

Возвращает информацию о кулдауне одного экшена используемого устройства (например, рули, пушки на корабле). Если устройство не найдено, не является UsableDevice или действия с указанным индексом нет, то бросает исключение и возвращает nil.

-- библиотека:
device

-- объявление:
function GetCooldown( usableDeviceId, actionIndex )

-- параметры:
usableDeviceId: ObjectId (not nil) -- идентификатор устройства
actionIndex: number (int) - номер экшена устройства

-- возвращаемые значения -
table or nil - Если устройство найдено, то возвращается таблица информации о кулдауне:
  remainingMs: number( int ) - сколько времени кулдауна осталось в миллисекундах
  durationMs: number( int ) - сколько кулдаун длится в миллисекундах

-- пример:
local cooldown = device.GetCooldown( usableDeviceId, 0 )
if cooldown then
  local remaining = cooldown.remainingMs
  local duration = cooldown.durationMs
end

Search: "CategoryLuaApi" "CategoryDevice"

EnumTurnReason
EnumUsedev
EventBeamCannonShotStarted
EventCannonShotFinished
EventCannonShotPreparationStarted
EventCannonShotStarted
EventChestLooterChanged
EventDeviceActionEffectivenessChanged
EventDeviceActiveActionChanged
EventDeviceCooldownFinished
EventDeviceCooldownsEnableChanged
EventDeviceCooldownStarted
EventDeviceDamageReceived
EventDeviceDeadChanged
EventDeviceOfflineChanged
EventDeviceOfflineReason
EventDeviceRelatedQuestsChanged
EventDevicesChanged
EventDeviceZeroSpeed
EventNavigationScanerHubPveInfo
EventNavigationScanerHubPvpInfo
EventNavigationScanerHubStarted
EventNavigationScanerHubTrailsInfo
EventNavigatorFollowedChanged
EventNavigatorTargetChestsChanged
EventShieldRegenInProgressChanged
EventShieldStrengthChanged
EventUsableDevicesChanged
FunctionAvatarGetActiveUsableDevice
FunctionDeviceCanUse
FunctionDeviceGetCannonTarget
FunctionDeviceGetCooldown
FunctionDeviceGetItemInstalled
FunctionDeviceGetMass
FunctionDeviceGetNavigatorTargetChests
FunctionDeviceGetRelatedQuestObjectives
FunctionDeviceGetShieldStrength
FunctionDeviceGetShipSlotInfo
FunctionDeviceGetTitle
FunctionDeviceGetTransport
FunctionDeviceGetUsableDeviceActionInfo
FunctionDeviceGetUsableDeviceActionsInfo
FunctionDeviceGetUsableDeviceInfo
FunctionDeviceGetUsableDeviceType
FunctionDeviceHasNavigatorFollowedMarker
FunctionDeviceHasRelatedQuestObjectives
FunctionDeviceIsInUse
FunctionDeviceIsOffline
FunctionDeviceIsShieldRegenInProgress
FunctionDeviceIsUsable
FunctionDeviceNavigatorGetTarget
FunctionDeviceNavigatorGetZoomedObject
FunctionDeviceNavigatorSetTarget
FunctionDeviceNavigatorZoom
FunctionTransportGetDevices


CategoryLuaApi CategoryFunction CategoryDevice

На главную