mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
OPS
- Airwing added :SetPayloadAmount() and SetAirboss() functions - AUFTRAG fixed Failure to Failed event name - CHIEF added statics as targets - LEGION added check that runway is operational and carrier is not recovering for mission selection
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
-- @field #table pointsTANKER Table of Tanker points.
|
||||
-- @field #table pointsAWACS Table of AWACS points.
|
||||
-- @field #boolean markpoints Display markers on the F10 map.
|
||||
-- @field Ops.Airboss#AIRBOSS airboss Airboss attached to this wing.
|
||||
--
|
||||
-- @field Ops.RescueHelo#RESCUEHELO rescuehelo The rescue helo.
|
||||
-- @field Ops.RecoveryTanker#RECOVERYTANKER recoverytanker The recoverytanker.
|
||||
@@ -173,7 +174,7 @@ AIRWING.version="0.9.0"
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
-- TODO: Spawn in air ==> Needs WAREHOUSE update.
|
||||
-- DONE: Spawn in air.
|
||||
-- DONE: Spawn hot.
|
||||
-- TODO: Make special request to transfer squadrons to anther airwing (or warehouse).
|
||||
-- TODO: Check that airbase has enough parking spots if a request is BIG.
|
||||
-- DONE: Add squadrons to warehouse.
|
||||
@@ -340,13 +341,11 @@ function AIRWING:NewPayload(Unit, Npayloads, MissionTypes, Performance)
|
||||
payload.unitname=Unit:GetName()
|
||||
payload.aircrafttype=Unit:GetTypeName()
|
||||
payload.pylons=Unit:GetTemplatePayload()
|
||||
payload.unlimited=Npayloads<0
|
||||
if payload.unlimited then
|
||||
payload.navail=1
|
||||
else
|
||||
payload.navail=Npayloads or 99
|
||||
end
|
||||
|
||||
-- Set the number of available payloads.
|
||||
self:SetPayloadAmount(payload, Npayloads)
|
||||
|
||||
-- Payload capabilities.
|
||||
payload.capabilities={}
|
||||
for _,missiontype in pairs(MissionTypes) do
|
||||
local capability={} --Ops.Auftrag#AUFTRAG.Capability
|
||||
@@ -381,6 +380,29 @@ function AIRWING:NewPayload(Unit, Npayloads, MissionTypes, Performance)
|
||||
return nil
|
||||
end
|
||||
|
||||
--- Set the number of payload available.
|
||||
-- @param #AIRWING self
|
||||
-- @param #AIRWING.Payload Payload The payload table created by the `:NewPayload` function.
|
||||
-- @param #number Navailable Number of payloads available to the airwing resources. Default 99 (which should be enough for most scenarios). Set to -1 for unlimited.
|
||||
-- @return #AIRWING self
|
||||
function AIRWING:SetPayloadAmount(Payload, Navailable)
|
||||
|
||||
Navailable=Navailable or 99
|
||||
|
||||
if Payload then
|
||||
|
||||
Payload.unlimited=Navailable<0
|
||||
if Payload.unlimited then
|
||||
Payload.navail=1
|
||||
else
|
||||
Payload.navail=Navailable
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
--- Add a mission capability to an existing payload.
|
||||
-- @param #AIRWING self
|
||||
-- @param #AIRWING.Payload Payload The payload table to which the capability should be added.
|
||||
@@ -775,6 +797,15 @@ function AIRWING:AddPatrolPointAWACS(Coordinate, Altitude, Speed, Heading, LegLe
|
||||
return self
|
||||
end
|
||||
|
||||
--- Set airboss of this wing. He/she will take care that no missions are launched if the carrier is recovering.
|
||||
-- @param #AIRWING self
|
||||
-- @param Ops.Airboss#AIRBOSS airboss The AIRBOSS object.
|
||||
-- @return #AIRWING self
|
||||
function AIRWING:SetAirboss(airboss)
|
||||
self.airboss=airboss
|
||||
return self
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-- Start & Status
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user