mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
- Inherit ZONE_BASE from FSM instead of BASE. Opens a range of possibilities.
- Remove from ZONE_GOAL the Zone field, and make it inherit from ZONE_BASE instead of FSM! - Rework the new inheritance tree in the code. (Remove .Zone fields). - Implement the determination of attack and defense zones. - Reworked the TaskInfo to include Type and ShowKey. - Flash A2G Tasking Details. Added menu option.
This commit is contained in:
@@ -230,9 +230,11 @@ do -- TASK_CAPTURE_ZONE
|
||||
self.TaskInfo:AddCoordinate( ZoneCoordinate, 1, "SOD", Persist )
|
||||
-- self.TaskInfo:AddText( "Zone Name", self.ZoneGoal:GetZoneName(), 10, "MOD", Persist )
|
||||
-- self.TaskInfo:AddText( "Zone Coalition", self.ZoneGoal:GetCoalitionName(), 11, "MOD", Persist )
|
||||
local SetUnit = self.ZoneGoal.Zone:GetScannedSetUnit()
|
||||
local SetUnit = self.ZoneGoal:GetScannedSetUnit()
|
||||
local ThreatLevel, ThreatText = SetUnit:CalculateThreatLevelA2G()
|
||||
local ThreatCount = SetUnit:Count()
|
||||
self.TaskInfo:AddThreat( ThreatText, ThreatLevel, 20, "MOD", Persist )
|
||||
self.TaskInfo:AddInfo( "Remaining Units", ThreatCount, 21, "MOD", Persist, true)
|
||||
|
||||
if self.Dispatcher then
|
||||
local DefenseTaskCaptureDispatcher = self.Dispatcher:GetDefenseTaskCaptureDispatcher() -- Tasking.Task_Capture_Dispatcher#TASK_CAPTURE_DISPATCHER
|
||||
@@ -242,8 +244,22 @@ do -- TASK_CAPTURE_ZONE
|
||||
for TaskName, CaptureZone in pairs( DefenseTaskCaptureDispatcher.Zones or {} ) do
|
||||
local Task = CaptureZone.Task -- Tasking.Task_Capture_Zone#TASK_CAPTURE_ZONE
|
||||
if Task then
|
||||
if Task:IsStateAssigned() then
|
||||
self.TaskInfo:AddInfo( "Defense", Task.ZoneGoal:GetName() .. ", " .. Task.ZoneGoal:GetZone():GetCoordinate(), 30, "MOD", Persist )
|
||||
self.TaskInfo:AddInfo( "Defense Player Zone", Task.ZoneGoal:GetName(), 30, "MOD", Persist )
|
||||
self.TaskInfo:AddCoordinate( Task.ZoneGoal:GetZone():GetCoordinate(), 31, "MOD", Persist, false, "Defense Player Coordinate" )
|
||||
end
|
||||
end
|
||||
end
|
||||
local DefenseAIA2GDispatcher = self.Dispatcher:GetDefenseAIA2GDispatcher() -- AI.AI_A2G_Dispatcher#AI_A2G_DISPATCHER
|
||||
|
||||
if DefenseAIA2GDispatcher then
|
||||
-- Loop through all zones of the Defenses, and check which zone has an assigned task!
|
||||
for Defender, Task in pairs( DefenseAIA2GDispatcher:GetDefenderTasks() or {} ) do
|
||||
local DetectedItem = DefenseAIA2GDispatcher:GetDefenderTaskTarget( Defender )
|
||||
if DetectedItem then
|
||||
local DetectedZone = DefenseAIA2GDispatcher.Detection:GetDetectedItemZone( DetectedItem )
|
||||
if DetectedZone then
|
||||
self.TaskInfo:AddInfo( "Defense AI Zone", DetectedZone:GetName(), 40, "MOD", Persist )
|
||||
self.TaskInfo:AddCoordinate( DetectedZone:GetCoordinate(), 41, "MOD", Persist, false, "Defense AI Coordinate" )
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -291,7 +307,7 @@ do -- TASK_CAPTURE_ZONE
|
||||
-- @param #number AutoAssignMethod The method to be applied to the task.
|
||||
-- @param Tasking.CommandCenter#COMMANDCENTER CommandCenter The command center.
|
||||
-- @param Wrapper.Group#GROUP TaskGroup The player group.
|
||||
function TASK_CAPTURE_ZONE:GetAutoAssignPriority( AutoAssignMethod, CommandCenter, TaskGroup )
|
||||
function TASK_CAPTURE_ZONE:GetAutoAssignPriority( AutoAssignMethod, CommandCenter, TaskGroup, AutoAssignReference )
|
||||
|
||||
if AutoAssignMethod == COMMANDCENTER.AutoAssignMethods.Random then
|
||||
return math.random( 1, 9 )
|
||||
|
||||
Reference in New Issue
Block a user