mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-08-23 02:08:17 +00:00
Ops
This commit is contained in:
@@ -6704,8 +6704,8 @@ function WAREHOUSE:_CheckRequestValid(request)
|
|||||||
-- TODO: maybe only check if spots > 0 for the necessary terminal type? At least for FARPS.
|
-- TODO: maybe only check if spots > 0 for the necessary terminal type? At least for FARPS.
|
||||||
|
|
||||||
-- Get necessary terminal type.
|
-- Get necessary terminal type.
|
||||||
local termtype_dep=self:_GetTerminal(asset.attribute, self:GetAirbaseCategory())
|
local termtype_dep=asset.terminalType or self:_GetTerminal(asset.attribute, self:GetAirbaseCategory())
|
||||||
local termtype_des=self:_GetTerminal(asset.attribute, request.warehouse:GetAirbaseCategory())
|
local termtype_des=asset.terminalType or self:_GetTerminal(asset.attribute, request.warehouse:GetAirbaseCategory())
|
||||||
|
|
||||||
-- Get number of parking spots.
|
-- Get number of parking spots.
|
||||||
local np_departure=self.airbase:GetParkingSpotsNumber(termtype_dep)
|
local np_departure=self.airbase:GetParkingSpotsNumber(termtype_dep)
|
||||||
@@ -7495,7 +7495,7 @@ function WAREHOUSE:_FindParkingForAssets(airbase, assets)
|
|||||||
local _asset=asset --#WAREHOUSE.Assetitem
|
local _asset=asset --#WAREHOUSE.Assetitem
|
||||||
|
|
||||||
-- Get terminal type of this asset
|
-- Get terminal type of this asset
|
||||||
local terminaltype=self:_GetTerminal(asset.attribute, self:GetAirbaseCategory())
|
local terminaltype=asset.terminalType or self:_GetTerminal(asset.attribute, self:GetAirbaseCategory())
|
||||||
|
|
||||||
-- Asset specific parking.
|
-- Asset specific parking.
|
||||||
parking[_asset.uid]={}
|
parking[_asset.uid]={}
|
||||||
|
|||||||
@@ -879,7 +879,7 @@ function AIRWING:onafterNewAsset(From, Event, To, asset, assignment)
|
|||||||
|
|
||||||
-- Debug text.
|
-- Debug text.
|
||||||
local text=string.format("New asset %s with assignment %s and request assignment %s", asset.spawngroupname, tostring(asset.assignment), tostring(assignment))
|
local text=string.format("New asset %s with assignment %s and request assignment %s", asset.spawngroupname, tostring(asset.assignment), tostring(assignment))
|
||||||
self:I(self.lid..text)
|
self:T3(self.lid..text)
|
||||||
|
|
||||||
-- Get squadron.
|
-- Get squadron.
|
||||||
local squad=self:GetSquadron(asset.assignment)
|
local squad=self:GetSquadron(asset.assignment)
|
||||||
@@ -893,6 +893,8 @@ function AIRWING:onafterNewAsset(From, Event, To, asset, assignment)
|
|||||||
local text=string.format("Adding asset to squadron %s: assignment=%s, type=%s, attribute=%s", squad.name, assignment, asset.unittype, asset.attribute)
|
local text=string.format("Adding asset to squadron %s: assignment=%s, type=%s, attribute=%s", squad.name, assignment, asset.unittype, asset.attribute)
|
||||||
self:I(self.lid..text)
|
self:I(self.lid..text)
|
||||||
|
|
||||||
|
asset.terminalType=AIRBASE.TerminalType.OpenBig
|
||||||
|
|
||||||
-- Add asset to squadron.
|
-- Add asset to squadron.
|
||||||
table.insert(squad.assets, asset)
|
table.insert(squad.assets, asset)
|
||||||
|
|
||||||
@@ -929,6 +931,8 @@ function AIRWING:onafterAssetSpawned(From, Event, To, group, asset, request)
|
|||||||
-- Set RTB on fuel critical.
|
-- Set RTB on fuel critical.
|
||||||
flightgroup:SetFuelCriticalThreshold(nil, true)
|
flightgroup:SetFuelCriticalThreshold(nil, true)
|
||||||
|
|
||||||
|
--flightgroup.group:OptionProhibitAfterburner(true)
|
||||||
|
|
||||||
-- Set asset flightgroup.
|
-- Set asset flightgroup.
|
||||||
asset.flightgroup=flightgroup
|
asset.flightgroup=flightgroup
|
||||||
|
|
||||||
|
|||||||
@@ -479,10 +479,13 @@ function AUFTRAG:NewBAI(TargetGroupSet)
|
|||||||
mission.engageTargetGroupset=TargetGroupSet
|
mission.engageTargetGroupset=TargetGroupSet
|
||||||
mission.engageTargetGroupset:FilterDeads():FilterCrashes()
|
mission.engageTargetGroupset:FilterDeads():FilterCrashes()
|
||||||
|
|
||||||
mission.DCStask=mission:GetDCSMissionTask()
|
|
||||||
|
|
||||||
mission.missionTask=ENUMS.MissionTask.GROUNDATTACK
|
mission.missionTask=ENUMS.MissionTask.GROUNDATTACK
|
||||||
|
|
||||||
|
mission.engageWeaponType=2956984318
|
||||||
|
mission.engageWeaponExpend=AI.Task.WeaponExpend.ALL
|
||||||
|
|
||||||
|
mission.DCStask=mission:GetDCSMissionTask()
|
||||||
|
|
||||||
return mission
|
return mission
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -498,10 +501,14 @@ function AUFTRAG:NewSTRIKE(TargetCoordinate, Altitude)
|
|||||||
mission.engageCoord=TargetCoordinate
|
mission.engageCoord=TargetCoordinate
|
||||||
mission.engageAltitude=UTILS.FeetToMeters(Altitude or 1000)
|
mission.engageAltitude=UTILS.FeetToMeters(Altitude or 1000)
|
||||||
|
|
||||||
mission.DCStask=mission:GetDCSMissionTask()
|
|
||||||
|
|
||||||
mission.missionTask=ENUMS.MissionTask.GROUNDATTACK
|
mission.missionTask=ENUMS.MissionTask.GROUNDATTACK
|
||||||
|
|
||||||
|
mission.engageWeaponType=2956984318
|
||||||
|
mission.engageWeaponExpend=AI.Task.WeaponExpend.ALL
|
||||||
|
|
||||||
|
mission.DCStask=mission:GetDCSMissionTask()
|
||||||
|
|
||||||
return mission
|
return mission
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1430,6 +1437,8 @@ function AUFTRAG:GetTargetCoordinate()
|
|||||||
return self.engageCoord
|
return self.engageCoord
|
||||||
elseif self.orbitCoord then
|
elseif self.orbitCoord then
|
||||||
return self.orbitCoord
|
return self.orbitCoord
|
||||||
|
elseif self.escortGroup then
|
||||||
|
return self.escortGroup:GetCoordinate()
|
||||||
end
|
end
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
@@ -3476,8 +3476,76 @@ function CONTROLLABLE:OptionKeepWeaponsOnThreat()
|
|||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Prohibit Afterburner.
|
||||||
|
-- @param #CONTROLLABLE self
|
||||||
|
-- @param #boolean Prohibit If true or nil, prohibit. If false, do not prohibit.
|
||||||
|
-- @return #CONTROLLABLE self
|
||||||
|
function CONTROLLABLE:OptionProhibitAfterburner(Prohibit)
|
||||||
|
self:F2( { self.ControllableName } )
|
||||||
|
|
||||||
|
if Prohibit==nil then
|
||||||
|
Prohibit=true
|
||||||
|
end
|
||||||
|
|
||||||
|
if self:IsAir() then
|
||||||
|
self:SetOption(AI.Option.Air.id.PROHIBIT_AB, Prohibit)
|
||||||
|
end
|
||||||
|
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Defines the usage of Electronic Counter Measures by airborne forces. Disables the ability for AI to use their ECM.
|
||||||
|
-- @param #CONTROLLABLE self
|
||||||
|
-- @return #CONTROLLABLE self
|
||||||
|
function CONTROLLABLE:OptionECM_Never()
|
||||||
|
self:F2( { self.ControllableName } )
|
||||||
|
|
||||||
|
if self:IsAir() then
|
||||||
|
self:SetOption(AI.Option.Air.id.ECM_USING, 0)
|
||||||
|
end
|
||||||
|
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Defines the usage of Electronic Counter Measures by airborne forces. If the AI is actively being locked by an enemy radar they will enable their ECM jammer.
|
||||||
|
-- @param #CONTROLLABLE self
|
||||||
|
-- @return #CONTROLLABLE self
|
||||||
|
function CONTROLLABLE:OptionECM_OnlyLockByRadar()
|
||||||
|
self:F2( { self.ControllableName } )
|
||||||
|
|
||||||
|
if self:IsAir() then
|
||||||
|
self:SetOption(AI.Option.Air.id.ECM_USING, 1)
|
||||||
|
end
|
||||||
|
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
--- Defines the usage of Electronic Counter Measures by airborne forces. If the AI is being detected by a radar they will enable their ECM.
|
||||||
|
-- @param #CONTROLLABLE self
|
||||||
|
-- @return #CONTROLLABLE self
|
||||||
|
function CONTROLLABLE:OptionECM_DetectedLockByRadar()
|
||||||
|
self:F2( { self.ControllableName } )
|
||||||
|
|
||||||
|
if self:IsAir() then
|
||||||
|
self:SetOption(AI.Option.Air.id.ECM_USING, 2)
|
||||||
|
end
|
||||||
|
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Defines the usage of Electronic Counter Measures by airborne forces. AI will leave their ECM on all the time.
|
||||||
|
-- @param #CONTROLLABLE self
|
||||||
|
-- @return #CONTROLLABLE self
|
||||||
|
function CONTROLLABLE:OptionECM_AlwaysOn()
|
||||||
|
self:F2( { self.ControllableName } )
|
||||||
|
|
||||||
|
if self:IsAir() then
|
||||||
|
self:SetOption(AI.Option.Air.id.ECM_USING, 3)
|
||||||
|
end
|
||||||
|
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
--- Retrieve the controllable mission and allow to place function hooks within the mission waypoint plan.
|
--- Retrieve the controllable mission and allow to place function hooks within the mission waypoint plan.
|
||||||
-- Use the method @{Wrapper.Controllable#CONTROLLABLE:WayPointFunction} to define the hook functions for specific waypoints.
|
-- Use the method @{Wrapper.Controllable#CONTROLLABLE:WayPointFunction} to define the hook functions for specific waypoints.
|
||||||
|
|||||||
Reference in New Issue
Block a user