Recovery tanker

This commit is contained in:
Frank 2022-04-28 20:50:30 +02:00
parent 3a907ec7c2
commit 02dad179cd
2 changed files with 69 additions and 1 deletions

View File

@ -407,6 +407,7 @@ _AUFTRAGSNR=0
-- @field #string RELOCATECOHORT Relocate a cohort from one legion to another.
-- @field #string AIRDEFENSE Air defense.
-- @field #string EWR Early Warning Radar.
-- @field #string RECOVERYTANKER Recovery tanker.
-- @field #string NOTHING Nothing.
AUFTRAG.Type={
ANTISHIP="Anti Ship",
@ -447,6 +448,7 @@ AUFTRAG.Type={
RELOCATECOHORT="Relocate Cohort",
AIRDEFENSE="Air Defence",
EWR="Early Warning Radar",
RECOVERYTANKER="Recovery Tanker",
NOTHING="Nothing",
}
@ -466,6 +468,8 @@ AUFTRAG.Type={
-- @field #string FERRY Ferry mission.
-- @field #string RELOCATECOHORT Relocate cohort.
-- @field #string AIRDEFENSE Air defense.
-- @field #string EWR Early Warning Radar.
-- @field #string RECOVERYTANKER Recovery tanker.
-- @field #string NOTHING Nothing.
AUFTRAG.SpecialTask={
FORMATION="Formation",
@ -484,6 +488,7 @@ AUFTRAG.SpecialTask={
RELOCATECOHORT="Relocate Cohort",
AIRDEFENSE="Air Defense",
EWR="Early Warning Radar",
RECOVERYTANKER="Recovery Tanker",
NOTHING="Nothing",
}
@ -1610,6 +1615,29 @@ function AUFTRAG:NewRESCUEHELO(Carrier)
return mission
end
--- **[AIRPANE]** Create a RECOVERY TANKER mission.
-- @param #AUFTRAG self
-- @param Wrapper.Unit#UNIT Carrier The carrier unit.
-- @return #AUFTRAG self
function AUFTRAG:NewRECOVERYTANKER(Carrier)
local mission=AUFTRAG:New(AUFTRAG.Type.RECOVERYTANKER)
mission:_TargetFromObject(Carrier)
-- Mission options:
mission.missionTask=ENUMS.MissionTask.REFUELING
mission.missionFraction=0.5
mission.optionROE=ENUMS.ROE.WeaponHold
mission.optionROT=ENUMS.ROT.NoReaction
mission.categories={AUFTRAG.Category.AIRPLANE}
mission.DCStask=mission:GetDCSMissionTask()
return mission
end
--- **[AIR ROTARY, GROUND]** Create a TROOP TRANSPORT mission.
-- @param #AUFTRAG self
@ -5207,6 +5235,36 @@ function AUFTRAG:GetDCSMissionTask(TaskControllable)
DCStask.params=param
table.insert(DCStasks, DCStask)
elseif self.type==AUFTRAG.Type.RECOVERYTANKER then
--[[
local DCStask={}
DCStask.id=AUFTRAG.SpecialTask.RECOVERYTANKER
-- We create a "fake" DCS task.
local param={}
DCStask.params=param
]]
local Carrier=self:GetObjective() --Wrapper.Unit#UNIT
local heading=Carrier:GetHeading()
local Altitude=2000
local Coordinate=Carrier:GetCoordinate():SetAltitude(2000)
local RaceTrack=Coordinate:Translate(1000, heading, true)
local DCStask=CONTROLLABLE.TaskOrbit(nil, Coordinate, Altitude, 300, RaceTrack)
DCStask.params.carrier=Carrier
table.insert(DCStasks, DCStask)
elseif self.type==AUFTRAG.Type.INTERCEPT then

View File

@ -5128,7 +5128,7 @@ function OPSGROUP:RouteToMission(mission, delay)
---
-- Relocation
---
-- Roughly go to the new legion.
local ToCoordinate=mission.DCStask.params.legion:GetCoordinate()
@ -5138,6 +5138,16 @@ function OPSGROUP:RouteToMission(mission, delay)
waypointcoord=self:GetCoordinate():GetIntermediateCoordinate(ToCoordinate, 0.05)
end
elseif mission.type==AUFTRAG.Type.RECOVERYTANKER then
---
-- Recoverytanker
---
-- Roughly go to the new legion.
local CarrierCoordinate=mission.DCStask.params.carrier:GetCoordinate()
waypointcoord=CarrierCoordinate:Translate(5000, 90):SetAltitude(2000)
else
---
-- Default case