- 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:
FlightControl
2019-08-10 15:41:34 +02:00
parent fbb32a9e45
commit d6b1018700
7 changed files with 355 additions and 118 deletions

View File

@@ -2624,6 +2624,23 @@ do -- SET_UNIT
return GroundUnitCount
end
--- Returns if the @{Set} has air targets.
-- @param #SET_UNIT self
-- @return #number The amount of air targets in the Set.
function SET_UNIT:HasAirUnits()
self:F2()
local AirUnitCount = 0
for UnitID, UnitData in pairs( self:GetSet() ) do
local UnitTest = UnitData -- Wrapper.Unit#UNIT
if UnitTest:IsAir() then
AirUnitCount = AirUnitCount + 1
end
end
return AirUnitCount
end
--- Returns if the @{Set} has friendly ground units.
-- @param #SET_UNIT self
-- @return #number The amount of ground targets in the Set.