mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
#AUFTRAG - fix condition for assets done test
This commit is contained in:
parent
1e9c45c115
commit
429db73854
@ -1715,6 +1715,42 @@ function AUFTRAG:NewSEAD(Target, Altitude)
|
|||||||
return mission
|
return mission
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- **[AIR]** Create a SEAD in Zone mission.
|
||||||
|
-- @param #AUFTRAG self
|
||||||
|
-- @param Core.Zone#ZONE TargetZone The target zone to attack.
|
||||||
|
-- @param #number Altitude Engage altitude in feet. Default 25000 ft.
|
||||||
|
-- @param #table TargetTypes Table of string of DCS known target types, defaults to {"Air defence"}. See [DCS Target Attributes](https://wiki.hoggitworld.com/view/DCS_enum_attributes)
|
||||||
|
-- @param #number Duration Engage this much time when the AUFTRAG starts executing.
|
||||||
|
-- @return #AUFTRAG self
|
||||||
|
function AUFTRAG:NewSEADInZone(TargetZone, Altitude, TargetTypes, Duration)
|
||||||
|
|
||||||
|
local mission=AUFTRAG:New(AUFTRAG.Type.SEAD)
|
||||||
|
|
||||||
|
mission:_TargetFromObject(TargetZone)
|
||||||
|
|
||||||
|
-- DCS Task options:
|
||||||
|
mission.engageWeaponType=ENUMS.WeaponFlag.Auto
|
||||||
|
mission.engageWeaponExpend=AI.Task.WeaponExpend.ALL
|
||||||
|
mission.engageAltitude=UTILS.FeetToMeters(Altitude or 25000)
|
||||||
|
mission.engageZone = TargetZone
|
||||||
|
mission.engageTargetTypes = TargetTypes or {"Air defence"}
|
||||||
|
|
||||||
|
-- Mission options:
|
||||||
|
mission.missionTask=ENUMS.MissionTask.SEAD
|
||||||
|
mission.missionAltitude=mission.engageAltitude
|
||||||
|
mission.missionFraction=0.2
|
||||||
|
mission.optionROE=ENUMS.ROE.OpenFire
|
||||||
|
mission.optionROT=ENUMS.ROT.EvadeFire
|
||||||
|
|
||||||
|
mission.categories={AUFTRAG.Category.AIRCRAFT}
|
||||||
|
|
||||||
|
mission.DCStask=mission:GetDCSMissionTask()
|
||||||
|
|
||||||
|
mission:SetDuration(Duration or 1800)
|
||||||
|
|
||||||
|
return mission
|
||||||
|
end
|
||||||
|
|
||||||
--- **[AIR]** Create a STRIKE mission. Flight will attack the closest map object to the specified coordinate.
|
--- **[AIR]** Create a STRIKE mission. Flight will attack the closest map object to the specified coordinate.
|
||||||
-- @param #AUFTRAG self
|
-- @param #AUFTRAG self
|
||||||
-- @param Core.Point#COORDINATE Target The target coordinate. Can also be given as a GROUP, UNIT, STATIC, SET_GROUP, SET_UNIT, SET_STATIC or TARGET object.
|
-- @param Core.Point#COORDINATE Target The target coordinate. Can also be given as a GROUP, UNIT, STATIC, SET_GROUP, SET_UNIT, SET_STATIC or TARGET object.
|
||||||
@ -4825,10 +4861,10 @@ function AUFTRAG:CheckGroupsDone()
|
|||||||
|
|
||||||
if (self:IsStarted() or self:IsExecuting()) and self:CountOpsGroups()>0 then
|
if (self:IsStarted() or self:IsExecuting()) and self:CountOpsGroups()>0 then
|
||||||
self:T(self.lid..string.format("CheckGroupsDone: Mission is STARTED state %s [FSM=%s] and count of alive OPSGROUP > zero. Mission NOT DONE!", self.status, self:GetState()))
|
self:T(self.lid..string.format("CheckGroupsDone: Mission is STARTED state %s [FSM=%s] and count of alive OPSGROUP > zero. Mission NOT DONE!", self.status, self:GetState()))
|
||||||
return true
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
return true
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
@ -6330,7 +6366,7 @@ function AUFTRAG:GetDCSMissionTask()
|
|||||||
local unit = _unit -- Wrapper.Unit#UNTI
|
local unit = _unit -- Wrapper.Unit#UNTI
|
||||||
if unit and unit:IsAlive() and unit:HasSEAD() then
|
if unit and unit:IsAlive() and unit:HasSEAD() then
|
||||||
self:T("Adding UNIT for SEAD: "..unit:GetName())
|
self:T("Adding UNIT for SEAD: "..unit:GetName())
|
||||||
local task = CONTROLLABLE.TaskAttackUnit(nil,unit,GroupAttack,AI.Task.WeaponExpend.ALL,1,Direction,self.engageAltitude,4161536)
|
local task = CONTROLLABLE.TaskAttackUnit(nil,unit,GroupAttack,AI.Task.WeaponExpend.ALL,1,Direction,self.engageAltitude,2956984318)
|
||||||
table.insert(DCStasks, task)
|
table.insert(DCStasks, task)
|
||||||
SeadUnitSet:AddUnit(unit)
|
SeadUnitSet:AddUnit(unit)
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user