mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge branch 'FF/Ops' into FF/OpsDev
This commit is contained in:
@@ -700,7 +700,7 @@ ATIS.Messages = {
|
||||
EN =
|
||||
{
|
||||
HOURS = "hours",
|
||||
TIME = "hours",
|
||||
TIME = "Hours",
|
||||
NOCLOUDINFO = "Cloud coverage information not available",
|
||||
OVERCAST = "Overcast",
|
||||
BROKEN = "Broken clouds",
|
||||
|
||||
@@ -56,6 +56,8 @@
|
||||
-- @field #boolean despawnAfterHolding Aircraft are despawned after holding.
|
||||
-- @field #boolean capOptionPatrolRaceTrack Use closer patrol race track or standard orbit auftrag.
|
||||
-- @field #number capFormation If capOptionPatrolRaceTrack is true, set the formation, also.
|
||||
-- @field #number capOptionVaryStartTime If set, vary mission start time for CAP missions generated random between capOptionVaryStartTime and capOptionVaryEndTime
|
||||
-- @field #number capOptionVaryEndTime If set, vary mission start time for CAP missions generated random between capOptionVaryStartTime and capOptionVaryEndTime
|
||||
--
|
||||
-- @extends Ops.Legion#LEGION
|
||||
|
||||
@@ -132,6 +134,8 @@ AIRWING = {
|
||||
markpoints = false,
|
||||
capOptionPatrolRaceTrack = false,
|
||||
capFormation = nil,
|
||||
capOptionVaryStartTime = nil,
|
||||
capOptionVaryEndTime = nil,
|
||||
}
|
||||
|
||||
--- Payload data.
|
||||
@@ -183,7 +187,7 @@ AIRWING = {
|
||||
|
||||
--- AIRWING class version.
|
||||
-- @field #string version
|
||||
AIRWING.version="0.9.4"
|
||||
AIRWING.version="0.9.5"
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-- ToDo list
|
||||
@@ -721,6 +725,17 @@ function AIRWING:SetCapCloseRaceTrack(OnOff)
|
||||
return self
|
||||
end
|
||||
|
||||
--- Set CAP mission start to vary randomly between Start end End seconds.
|
||||
-- @param #AIRWING self
|
||||
-- @param #number Start
|
||||
-- @param #number End
|
||||
-- @return #AIRWING self
|
||||
function AIRWING:SetCapStartTimeVariation(Start, End)
|
||||
self.capOptionVaryStartTime = Start or 5
|
||||
self.capOptionVaryEndTime = End or 60
|
||||
return self
|
||||
end
|
||||
|
||||
--- Set number of TANKER flights with Boom constantly in the air.
|
||||
-- @param #AIRWING self
|
||||
-- @param #number Nboom Number of flights. Default 1.
|
||||
@@ -1165,6 +1180,14 @@ function AIRWING:CheckCAP()
|
||||
|
||||
end
|
||||
|
||||
if self.capOptionVaryStartTime then
|
||||
|
||||
local ClockStart = math.random(self.capOptionVaryStartTime, self.capOptionVaryEndTime)
|
||||
|
||||
missionCAP:SetTime(ClockStart)
|
||||
|
||||
end
|
||||
|
||||
missionCAP.patroldata=patrol
|
||||
|
||||
patrol.noccupied=patrol.noccupied+1
|
||||
|
||||
@@ -121,6 +121,7 @@ do
|
||||
-- @field #number TacticalIncrFreq
|
||||
-- @field #number TacticalModulation
|
||||
-- @field #number TacticalInterval
|
||||
-- @field Core.Set#SET_GROUP DetectionSet
|
||||
-- @extends Core.Fsm#FSM
|
||||
|
||||
|
||||
@@ -603,6 +604,7 @@ AWACS = {
|
||||
TacticalIncrFreq = 0.5,
|
||||
TacticalModulation = radio.modulation.AM,
|
||||
TacticalInterval = 120,
|
||||
DetectionSet = nil,
|
||||
}
|
||||
|
||||
---
|
||||
|
||||
@@ -458,6 +458,17 @@ function EASYGCICAP:SetDefaultOverhead(Overhead)
|
||||
return self
|
||||
end
|
||||
|
||||
--- Set CAP mission start to vary randomly between Start end End seconds.
|
||||
-- @param #EASYGCICAP self
|
||||
-- @param #number Start
|
||||
-- @param #number End
|
||||
-- @return #EASYGCICAP self
|
||||
function EASYGCICAP:SetCapStartTimeVariation(Start, End)
|
||||
self.capOptionVaryStartTime = Start or 5
|
||||
self.capOptionVaryEndTime = End or 60
|
||||
return self
|
||||
end
|
||||
|
||||
--- Add an AirWing to the manager
|
||||
-- @param #EASYGCICAP self
|
||||
-- @param #string Airbasename
|
||||
@@ -511,6 +522,11 @@ function EASYGCICAP:_AddAirwing(Airbasename, Alias)
|
||||
CAP_Wing:SetRespawnAfterDestroyed()
|
||||
CAP_Wing:SetNumberCAP(self.capgrouping)
|
||||
CAP_Wing:SetCapCloseRaceTrack(true)
|
||||
|
||||
if self.capOptionVaryStartTime then
|
||||
CAP_Wing:SetCapStartTimeVariation(self.capOptionVaryStartTime,self.capOptionVaryEndTime)
|
||||
end
|
||||
|
||||
if CapFormation then
|
||||
CAP_Wing:SetCAPFormation(CapFormation)
|
||||
end
|
||||
|
||||
@@ -2359,9 +2359,10 @@ function FLIGHTGROUP:onafterCruise(From, Event, To)
|
||||
---
|
||||
-- CLIENT
|
||||
---
|
||||
|
||||
--self:_UpdateMenu(0.1)
|
||||
|
||||
|
||||
-- Had this commented out (forgot why, probably because it was not necessary) but re-enabling it because of carrier launch.
|
||||
self:_UpdateMenu(0.1)
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -578,7 +578,7 @@ function INTEL:AddAgent(AgentGroup)
|
||||
end
|
||||
|
||||
-- Add to detection set.
|
||||
self.detectionset:AddGroup(AgentGroup)
|
||||
self.detectionset:AddGroup(AgentGroup,true)
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ PLAYERTASK = {
|
||||
|
||||
--- PLAYERTASK class version.
|
||||
-- @field #string version
|
||||
PLAYERTASK.version="0.1.23"
|
||||
PLAYERTASK.version="0.1.24"
|
||||
|
||||
--- Generic task condition.
|
||||
-- @type PLAYERTASK.Condition
|
||||
@@ -1966,6 +1966,8 @@ end
|
||||
-- Can optionally be handed as Ops.ArmyGroup#ARMYGROUP - **Note** might not find an LOS spot or get lost on the way. Cannot island-hop.
|
||||
-- @param #number LaserCode The lasercode to be used. Defaults to 1688.
|
||||
-- @param Core.Point#COORDINATE HoldingPoint (Optional) Point where the drone should initially circle. If not set, defaults to BullsEye of the coalition.
|
||||
-- @param #number Alt (Optional) Altitude in feet. Only applies if using a FLIGHTGROUP object! Defaults to 10000.
|
||||
-- @param #number Speed (Optional) Speed in knots. Only applies if using a FLIGHTGROUP object! Defaults to 120.
|
||||
-- @return #PLAYERTASKCONTROLLER self
|
||||
-- @usage
|
||||
-- -- Set up precision bombing, FlightGroup as lasing unit
|
||||
@@ -1980,7 +1982,7 @@ end
|
||||
-- ArmyGroup:Activate()
|
||||
-- taskmanager:EnablePrecisionBombing(ArmyGroup,1688)
|
||||
--
|
||||
function PLAYERTASKCONTROLLER:EnablePrecisionBombing(FlightGroup,LaserCode,HoldingPoint)
|
||||
function PLAYERTASKCONTROLLER:EnablePrecisionBombing(FlightGroup,LaserCode,HoldingPoint, Alt, Speed)
|
||||
self:T(self.lid.."EnablePrecisionBombing")
|
||||
if FlightGroup then
|
||||
if FlightGroup.ClassName and (FlightGroup.ClassName == "FLIGHTGROUP" or FlightGroup.ClassName == "ARMYGROUP")then
|
||||
@@ -1993,11 +1995,20 @@ function PLAYERTASKCONTROLLER:EnablePrecisionBombing(FlightGroup,LaserCode,Holdi
|
||||
self.LasingDrone:SetLaser(LaserCode)
|
||||
self.LaserCode = LaserCode or 1688
|
||||
self.LasingDroneTemplate = self.LasingDrone:_GetTemplate(true)
|
||||
self.LasingDroneAlt = Alt or 10000
|
||||
self.LasingDroneSpeed = Speed or 120
|
||||
-- let it orbit the BullsEye if FG
|
||||
if self.LasingDrone:IsFlightgroup() then
|
||||
self.LasingDroneIsFlightgroup = true
|
||||
local BullsCoordinate = COORDINATE:NewFromVec3( coalition.getMainRefPoint( self.Coalition ))
|
||||
if HoldingPoint then BullsCoordinate = HoldingPoint end
|
||||
local Orbit = AUFTRAG:NewORBIT_CIRCLE(BullsCoordinate,10000,120)
|
||||
local Orbit = AUFTRAG:NewORBIT_CIRCLE(BullsCoordinate,self.LasingDroneAlt,self.LasingDroneSpeed)
|
||||
self.LasingDrone:AddMission(Orbit)
|
||||
elseif self.LasingDrone:IsArmygroup() then
|
||||
self.LasingDroneIsArmygroup = true
|
||||
local BullsCoordinate = COORDINATE:NewFromVec3( coalition.getMainRefPoint( self.Coalition ))
|
||||
if HoldingPoint then BullsCoordinate = HoldingPoint end
|
||||
local Orbit = AUFTRAG:NewONGUARD(BullsCoordinate)
|
||||
self.LasingDrone:AddMission(Orbit)
|
||||
end
|
||||
else
|
||||
@@ -2536,10 +2547,16 @@ function PLAYERTASKCONTROLLER:_CheckPrecisionTasks()
|
||||
if self.LasingDrone then
|
||||
self.LasingDrone:_Respawn(1,nil,true)
|
||||
else
|
||||
-- TODO: Handle ArmyGroup
|
||||
local FG = FLIGHTGROUP:New(self.LasingDroneTemplate)
|
||||
FG:Activate()
|
||||
self:EnablePrecisionBombing(FG,self.LaserCode or 1688)
|
||||
-- DONE: Handle ArmyGroup
|
||||
if self.LasingDroneIsFlightgroup then
|
||||
local FG = FLIGHTGROUP:New(self.LasingDroneTemplate)
|
||||
FG:Activate()
|
||||
self:EnablePrecisionBombing(FG,self.LaserCode or 1688)
|
||||
else
|
||||
local FG = ARMYGROUP:New(self.LasingDroneTemplate)
|
||||
FG:Activate()
|
||||
self:EnablePrecisionBombing(FG,self.LaserCode or 1688)
|
||||
end
|
||||
end
|
||||
return self
|
||||
end
|
||||
@@ -2554,13 +2571,11 @@ function PLAYERTASKCONTROLLER:_CheckPrecisionTasks()
|
||||
self.LasingDrone.playertask.inreach = false
|
||||
self.LasingDrone.playertask.reachmessage = false
|
||||
-- move the drone to target
|
||||
if self.LasingDrone:IsFlightgroup() then
|
||||
if self.LasingDroneIsFlightgroup then
|
||||
self.LasingDrone:CancelAllMissions()
|
||||
local auftrag = AUFTRAG:NewORBIT_CIRCLE(task.Target:GetCoordinate(),10000,120)
|
||||
--local currmission = self.LasingDrone:GetMissionCurrent()
|
||||
self.LasingDrone:AddMission(auftrag)
|
||||
--currmission:__Cancel(-2)
|
||||
elseif self.LasingDrone:IsArmygroup() then
|
||||
local auftrag = AUFTRAG:NewORBIT_CIRCLE(task.Target:GetCoordinate(),self.LasingDroneAlt,self.LasingDroneSpeed)
|
||||
self.LasingDrone:AddMission(auftrag)
|
||||
elseif self.LasingDroneIsArmygroup then
|
||||
local tgtcoord = task.Target:GetCoordinate()
|
||||
local tgtzone = ZONE_RADIUS:New("ArmyGroup-"..math.random(1,10000),tgtcoord:GetVec2(),3000)
|
||||
local finalpos=nil -- Core.Point#COORDINATE
|
||||
@@ -2573,11 +2588,10 @@ function PLAYERTASKCONTROLLER:_CheckPrecisionTasks()
|
||||
end
|
||||
end
|
||||
if finalpos then
|
||||
self.LasingDrone:CancelAllMissions()
|
||||
-- yeah we got one
|
||||
local auftrag = AUFTRAG:NewARMOREDGUARD(finalpos,"Off road")
|
||||
local currmission = self.LasingDrone:GetMissionCurrent()
|
||||
self.LasingDrone:AddMission(auftrag)
|
||||
if currmission then currmission:__Cancel(-2) end
|
||||
else
|
||||
-- could not find LOS position!
|
||||
self:E("***Could not find LOS position to post ArmyGroup for lasing!")
|
||||
@@ -3193,7 +3207,7 @@ function PLAYERTASKCONTROLLER:_ActiveTaskInfo(Task, Group, Client)
|
||||
local islasing = self.LasingDrone:IsLasing() == true and yes or no
|
||||
local prectext = self.gettext:GetEntry("POINTERTARGETREPORT",self.locale)
|
||||
prectext = string.format(prectext,inreach,islasing)
|
||||
text = text .. prectext.."("..self.LaserCode..")"
|
||||
text = text .. prectext.." ("..self.LaserCode..")"
|
||||
end
|
||||
end
|
||||
-- Buddylasing
|
||||
|
||||
@@ -1107,7 +1107,7 @@ function TARGET:GetTargetLife(Target)
|
||||
|
||||
elseif Target.Type==TARGET.ObjectType.SCENERY then
|
||||
|
||||
if Target.Object and Target.Object:IsAlive() then
|
||||
if Target.Object and Target.Object:IsAlive(25) then
|
||||
local life = Target.Object:GetLife()
|
||||
return life
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user