mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Threat level report for TASK_CAPTURE_ZONE
This commit is contained in:
parent
0ea5c7fa48
commit
ece7fc3ea9
@ -3467,6 +3467,20 @@ do -- AI_A2G_DISPATCHER
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function Fsm:onafterPatrolRoute( Defender, From, Event, To, AttackSetUnit )
|
||||||
|
self:F({"Defender PatrolRoute", Defender:GetName()})
|
||||||
|
self:GetParent(self).onafterPatrolRoute( self, Defender, From, Event, To, AttackSetUnit )
|
||||||
|
|
||||||
|
local DefenderName = Defender:GetName()
|
||||||
|
local Dispatcher = self:GetDispatcher() -- #AI_A2G_DISPATCHER
|
||||||
|
local Squadron = Dispatcher:GetSquadronFromDefender( Defender )
|
||||||
|
if Squadron then
|
||||||
|
Dispatcher:MessageToPlayers( "Squadron " .. Squadron.Name .. ", " .. DefenderName .. " returning." )
|
||||||
|
end
|
||||||
|
|
||||||
|
Dispatcher:ClearDefenderTaskTarget( Defender )
|
||||||
|
end
|
||||||
|
|
||||||
function Fsm:onafterRTB( Defender, From, Event, To )
|
function Fsm:onafterRTB( Defender, From, Event, To )
|
||||||
self:F({"Defender RTB", Defender:GetName()})
|
self:F({"Defender RTB", Defender:GetName()})
|
||||||
self:GetParent(self).onafterRTB( self, Defender, From, Event, To )
|
self:GetParent(self).onafterRTB( self, Defender, From, Event, To )
|
||||||
@ -3564,15 +3578,15 @@ do -- AI_A2G_DISPATCHER
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function Fsm:OnAfterEngageRoute( Defender, From, Event, To, AttackSetUnit )
|
function Fsm:onafterEngageRoute( Defender, From, Event, To, AttackSetUnit )
|
||||||
self:F({"Engage Route", Defender:GetName()})
|
self:F({"Engage Route", Defender:GetName()})
|
||||||
--self:GetParent(self).onafterBirth( self, Defender, From, Event, To )
|
self:GetParent(self).onafterEngageRoute( self, Defender, From, Event, To, AttackSetUnit )
|
||||||
|
|
||||||
local DefenderName = Defender:GetName()
|
local DefenderName = Defender:GetName()
|
||||||
local Dispatcher = Fsm:GetDispatcher() -- #AI_A2G_DISPATCHER
|
local Dispatcher = Fsm:GetDispatcher() -- #AI_A2G_DISPATCHER
|
||||||
local Squadron = Dispatcher:GetSquadronFromDefender( Defender )
|
local Squadron = Dispatcher:GetSquadronFromDefender( Defender )
|
||||||
|
|
||||||
if FirstUnit then
|
if Squadron then
|
||||||
local FirstUnit = AttackSetUnit:GetFirst()
|
local FirstUnit = AttackSetUnit:GetFirst()
|
||||||
local Coordinate = FirstUnit:GetCoordinate() -- Core.Point#COORDINATE
|
local Coordinate = FirstUnit:GetCoordinate() -- Core.Point#COORDINATE
|
||||||
|
|
||||||
|
|||||||
@ -704,6 +704,20 @@ function ZONE_RADIUS:GetScannedUnits()
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function ZONE_RADIUS:GetScannedSetUnit()
|
||||||
|
|
||||||
|
local SetUnit = SET_UNIT:New()
|
||||||
|
|
||||||
|
if self.ScanData then
|
||||||
|
for ObjectID, UnitObject in pairs( self.ScanData.Units ) do
|
||||||
|
SetUnit:AddUnit( UNIT:FindByName(UnitObject:getName() ) )
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return SetUnit
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
function ZONE_RADIUS:CountScannedCoalitions()
|
function ZONE_RADIUS:CountScannedCoalitions()
|
||||||
|
|
||||||
local Count = 0
|
local Count = 0
|
||||||
|
|||||||
@ -239,6 +239,8 @@ do -- DETECTION MANAGER
|
|||||||
-- @param #string Message The message to be sent.
|
-- @param #string Message The message to be sent.
|
||||||
-- @return #DETECTION_MANGER self
|
-- @return #DETECTION_MANGER self
|
||||||
function DETECTION_MANAGER:MessageToPlayers( Message )
|
function DETECTION_MANAGER:MessageToPlayers( Message )
|
||||||
|
|
||||||
|
self:F( { Message = Message } )
|
||||||
|
|
||||||
if self.CC then
|
if self.CC then
|
||||||
self.CC:MessageToCoalition( Message )
|
self.CC:MessageToCoalition( Message )
|
||||||
|
|||||||
@ -162,7 +162,7 @@ end
|
|||||||
-- @param #boolean Keep (optional) If true, this would indicate that the planned taskinfo would be persistent when the task is completed, so that the original planned task info is used at the completed reports.
|
-- @param #boolean Keep (optional) If true, this would indicate that the planned taskinfo would be persistent when the task is completed, so that the original planned task info is used at the completed reports.
|
||||||
-- @return #TASKINFO self
|
-- @return #TASKINFO self
|
||||||
function TASKINFO:AddThreat( ThreatText, ThreatLevel, Order, Detail, Keep )
|
function TASKINFO:AddThreat( ThreatText, ThreatLevel, Order, Detail, Keep )
|
||||||
self:AddInfo( "Threat", ThreatText .. " [" .. string.rep( "■", ThreatLevel ) .. string.rep( "□", 10 - ThreatLevel ) .. "]", Order, Detail, Keep )
|
self:AddInfo( "Threat", " [" .. string.rep( "■", ThreatLevel ) .. string.rep( "□", 10 - ThreatLevel ) .. "]:" .. ThreatText, Order, Detail, Keep )
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -47,7 +47,7 @@ do -- TASK_ZONE_GOAL
|
|||||||
-- @param Tasking.Mission#MISSION Mission
|
-- @param Tasking.Mission#MISSION Mission
|
||||||
-- @param Core.Set#SET_GROUP SetGroup The set of groups for which the Task can be assigned.
|
-- @param Core.Set#SET_GROUP SetGroup The set of groups for which the Task can be assigned.
|
||||||
-- @param #string TaskName The name of the Task.
|
-- @param #string TaskName The name of the Task.
|
||||||
-- @param Core.ZoneGoal#ZONE_GOAL ZoneGoal
|
-- @param Core.ZoneGoalCoalition#ZONE_GOAL_COALITION ZoneGoal
|
||||||
-- @return #TASK_ZONE_GOAL self
|
-- @return #TASK_ZONE_GOAL self
|
||||||
function TASK_ZONE_GOAL:New( Mission, SetGroup, TaskName, ZoneGoal, TaskType, TaskBriefing )
|
function TASK_ZONE_GOAL:New( Mission, SetGroup, TaskName, ZoneGoal, TaskType, TaskBriefing )
|
||||||
local self = BASE:Inherit( self, TASK:New( Mission, SetGroup, TaskName, TaskType, TaskBriefing ) ) -- #TASK_ZONE_GOAL
|
local self = BASE:Inherit( self, TASK:New( Mission, SetGroup, TaskName, TaskType, TaskBriefing ) ) -- #TASK_ZONE_GOAL
|
||||||
@ -226,8 +226,9 @@ do -- TASK_CAPTURE_ZONE
|
|||||||
self.TaskInfo:AddCoordinate( ZoneCoordinate, 1, "SOD", true )
|
self.TaskInfo:AddCoordinate( ZoneCoordinate, 1, "SOD", true )
|
||||||
self.TaskInfo:AddText( "Zone Name", self.ZoneGoal:GetZoneName(), 10, "MOD", true )
|
self.TaskInfo:AddText( "Zone Name", self.ZoneGoal:GetZoneName(), 10, "MOD", true )
|
||||||
self.TaskInfo:AddText( "Zone Coalition", self.ZoneGoal:GetCoalitionName(), 11, "MOD", true )
|
self.TaskInfo:AddText( "Zone Coalition", self.ZoneGoal:GetCoalitionName(), 11, "MOD", true )
|
||||||
--local ThreatLevel, ThreatText = self.TargetSetUnit:CalculateThreatLevelA2G()
|
local SetUnit = self.ZoneGoal.Zone:GetScannedSetUnit()
|
||||||
--self.TaskInfo:AddThreat( ThreatText, ThreatLevel, 10, "MOD", true )
|
local ThreatLevel, ThreatText = SetUnit:CalculateThreatLevelA2G()
|
||||||
|
self.TaskInfo:AddThreat( ThreatText, ThreatLevel, 20, "MOD", true )
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user