mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
- Implemented attack nearest target.
- Implemented attack nearest ground target. - Implemented attack nearest air target. - Report all targets. - Report only ground targets. - Report only ground targets with radar. - Report only air targets. - Sort targest from nearest to furthest. - Improved menu system. - Improved detection of ground targets and air targets and reporting. - Added the task TASK_CAPTURE as part of the reporting framework. - Improved the detection of targets. Now targets with specific detection methods are correctly detected. f.e. disabling DLINK will now work correctly! All these fixes are great improvements to the AI_ESCORT framework!
This commit is contained in:
@@ -2798,9 +2798,31 @@ function CONTROLLABLE:GetDetectedTargets( DetectVisual, DetectOptical, DetectRad
|
||||
local DetectionRWR = ( DetectRWR and DetectRWR == true ) and Controller.Detection.RWR or nil
|
||||
local DetectionDLINK = ( DetectDLINK and DetectDLINK == true ) and Controller.Detection.DLINK or nil
|
||||
|
||||
|
||||
local Params = {}
|
||||
if DetectionVisual then
|
||||
Params[#Params+1] = DetectionVisual
|
||||
end
|
||||
if DetectionOptical then
|
||||
Params[#Params+1] = DetectionOptical
|
||||
end
|
||||
if DetectionRadar then
|
||||
Params[#Params+1] = DetectionRadar
|
||||
end
|
||||
if DetectionIRST then
|
||||
Params[#Params+1] = DetectionIRST
|
||||
end
|
||||
if DetectionRWR then
|
||||
Params[#Params+1] = DetectionRWR
|
||||
end
|
||||
if DetectionDLINK then
|
||||
Params[#Params+1] = DetectionDLINK
|
||||
end
|
||||
|
||||
|
||||
self:T2( { DetectionVisual, DetectionOptical, DetectionRadar, DetectionIRST, DetectionRWR, DetectionDLINK } )
|
||||
|
||||
return self:_GetController():getDetectedTargets( DetectionVisual, DetectionOptical, DetectionRadar, DetectionIRST, DetectionRWR, DetectionDLINK )
|
||||
return self:_GetController():getDetectedTargets( Params[1], Params[2], Params[3], Params[4], Params[5], Params[6] )
|
||||
end
|
||||
|
||||
return nil
|
||||
@@ -3447,3 +3469,20 @@ function CONTROLLABLE:IsAirPlane()
|
||||
return nil
|
||||
end
|
||||
|
||||
|
||||
--- Returns if the Controllable contains Helicopters.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @return #boolean true if Controllable contains Helicopters.
|
||||
function CONTROLLABLE:IsHelicopter()
|
||||
self:F2()
|
||||
|
||||
local DCSObject = self:GetDCSObject()
|
||||
|
||||
if DCSObject then
|
||||
local Category = DCSObject:getDesc().category
|
||||
return Category == Unit.Category.HELICOPTER
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user