mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
- Remove unnecessary comments from trace.
- Reworked the messaging. The name of the sender is now better modelled. - When a name is given, the name is used, unmodified. - When no name is given, the callign is inspected and used if set. - When no name and callsign, the group name is used. - Reworked the Detection logic. - 2 collections, one for the internal grouping and one for the external indexes. - Reworked the methods. - Reworked the naming of Command Centers. - A name function - A text function, showing Command Center [X] - A short text function, showing CC [X] - Reworked the naming of Missions. - A name function - a text function, showing Mission "X (prio)" - a short text function, showing Mission "X" - Embedded the new namings within the code (where I found them). - There may be some leftovers. Please raise, and I'll fix it immediately. - I've tested where i could.
This commit is contained in:
@@ -573,7 +573,7 @@ do -- DESIGNATE
|
||||
function DESIGNATE:SetLaserCodes( LaserCodes ) --R2.1
|
||||
|
||||
self.LaserCodes = ( type( LaserCodes ) == "table" ) and LaserCodes or { LaserCodes }
|
||||
self:E( { LaserCodes = self.LaserCodes } )
|
||||
self:F( { LaserCodes = self.LaserCodes } )
|
||||
|
||||
self.LaserCodesUsed = {}
|
||||
|
||||
@@ -938,7 +938,7 @@ do -- DESIGNATE
|
||||
|
||||
for DesignateIndex, Designating in pairs( self.Designating ) do
|
||||
|
||||
local DetectedItem = self.Detection:GetDetectedItem( DesignateIndex )
|
||||
local DetectedItem = self.Detection:GetDetectedItemByIndex( DesignateIndex )
|
||||
|
||||
if DetectedItem then
|
||||
|
||||
@@ -987,7 +987,7 @@ do -- DESIGNATE
|
||||
-- @param #DESIGNATE self
|
||||
function DESIGNATE:MenuStatus( AttackGroup )
|
||||
|
||||
self:E("Status")
|
||||
self:F("Status")
|
||||
|
||||
self:SendStatus( AttackGroup )
|
||||
end
|
||||
@@ -996,7 +996,7 @@ do -- DESIGNATE
|
||||
-- @param #DESIGNATE self
|
||||
function DESIGNATE:MenuFlashStatus( AttackGroup, Flash )
|
||||
|
||||
self:E("Flash Status")
|
||||
self:F("Flash Status")
|
||||
|
||||
self.FlashStatusMenu[AttackGroup] = Flash
|
||||
self:SetDesignateMenu()
|
||||
@@ -1007,7 +1007,7 @@ do -- DESIGNATE
|
||||
-- @param #DESIGNATE self
|
||||
function DESIGNATE:MenuForget( Index )
|
||||
|
||||
self:E("Forget")
|
||||
self:F("Forget")
|
||||
|
||||
self.Designating[Index] = ""
|
||||
self:SetDesignateMenu()
|
||||
@@ -1017,7 +1017,7 @@ do -- DESIGNATE
|
||||
-- @param #DESIGNATE self
|
||||
function DESIGNATE:MenuAutoLase( AutoLase )
|
||||
|
||||
self:E("AutoLase")
|
||||
self:F("AutoLase")
|
||||
|
||||
self:SetAutoLase( AutoLase, true )
|
||||
end
|
||||
@@ -1026,7 +1026,7 @@ do -- DESIGNATE
|
||||
-- @param #DESIGNATE self
|
||||
function DESIGNATE:MenuSmoke( Index, Color )
|
||||
|
||||
self:E("Designate through Smoke")
|
||||
self:F("Designate through Smoke")
|
||||
|
||||
if string.find( self.Designating[Index], "S" ) == nil then
|
||||
self.Designating[Index] = self.Designating[Index] .. "S"
|
||||
@@ -1039,7 +1039,7 @@ do -- DESIGNATE
|
||||
-- @param #DESIGNATE self
|
||||
function DESIGNATE:MenuIlluminate( Index )
|
||||
|
||||
self:E("Designate through Illumination")
|
||||
self:F("Designate through Illumination")
|
||||
|
||||
if string.find( self.Designating[Index], "I", 1, true ) == nil then
|
||||
self.Designating[Index] = self.Designating[Index] .. "I"
|
||||
@@ -1053,7 +1053,7 @@ do -- DESIGNATE
|
||||
-- @param #DESIGNATE self
|
||||
function DESIGNATE:MenuLaseOn( Index, Duration )
|
||||
|
||||
self:E("Designate through Lase")
|
||||
self:F("Designate through Lase")
|
||||
|
||||
self:__LaseOn( 1, Index, Duration )
|
||||
self:SetDesignateMenu()
|
||||
@@ -1064,7 +1064,7 @@ do -- DESIGNATE
|
||||
-- @param #DESIGNATE self
|
||||
function DESIGNATE:MenuLaseCode( Index, Duration, LaserCode )
|
||||
|
||||
self:E( "Designate through Lase using " .. LaserCode )
|
||||
self:F( "Designate through Lase using " .. LaserCode )
|
||||
|
||||
self:__LaseOn( 1, Index, Duration, LaserCode )
|
||||
self:SetDesignateMenu()
|
||||
@@ -1075,7 +1075,7 @@ do -- DESIGNATE
|
||||
-- @param #DESIGNATE self
|
||||
function DESIGNATE:MenuLaseOff( Index, Duration )
|
||||
|
||||
self:E("Lasing off")
|
||||
self:F("Lasing off")
|
||||
|
||||
self.Designating[Index] = string.gsub( self.Designating[Index], "L", "" )
|
||||
self:__LaseOff( 1, Index )
|
||||
@@ -1155,7 +1155,7 @@ do -- DESIGNATE
|
||||
|
||||
if not Recce then
|
||||
|
||||
self:E( "Lasing..." )
|
||||
self:F( "Lasing..." )
|
||||
self.RecceSet:Flush()
|
||||
|
||||
for RecceGroupID, RecceGroup in pairs( self.RecceSet:GetSet() ) do
|
||||
@@ -1307,7 +1307,7 @@ do -- DESIGNATE
|
||||
|
||||
MarkedCount = MarkedCount + 1
|
||||
|
||||
self:E( "Smoking ..." )
|
||||
self:F( "Smoking ..." )
|
||||
|
||||
local RecceGroup = self.RecceSet:FindNearestGroupFromPointVec2(SmokeUnit:GetPointVec2())
|
||||
local RecceUnit = RecceGroup:GetUnit( 1 )
|
||||
|
||||
@@ -275,6 +275,7 @@ do -- DETECTION_BASE
|
||||
DetectionRun = 0,
|
||||
DetectedObjectsIdentified = {},
|
||||
DetectedItems = {},
|
||||
DetectedItemsByIndex = {},
|
||||
}
|
||||
|
||||
--- @type DETECTION_BASE.DetectedObjects
|
||||
@@ -515,7 +516,7 @@ do -- DETECTION_BASE
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function DETECTION_BASE:onafterDetect(From,Event,To)
|
||||
self:E( { From, Event, To } )
|
||||
self:F( { From, Event, To } )
|
||||
|
||||
local DetectDelay = 0.1
|
||||
self.DetectionCount = 0
|
||||
@@ -525,7 +526,7 @@ do -- DETECTION_BASE
|
||||
local DetectionTimeStamp = timer.getTime()
|
||||
|
||||
for DetectionGroupID, DetectionGroupData in pairs( self.DetectionSetGroup:GetSet() ) do
|
||||
--self:E( { DetectionGroupData } )
|
||||
--self:F( { DetectionGroupData } )
|
||||
self:__DetectionGroup( DetectDelay, DetectionGroupData, DetectionTimeStamp ) -- Process each detection asynchronously.
|
||||
self.DetectionCount = self.DetectionCount + 1
|
||||
DetectDelay = DetectDelay + 1
|
||||
@@ -538,7 +539,7 @@ do -- DETECTION_BASE
|
||||
-- @param #string To The To State string.
|
||||
-- @param Wrapper.Group#GROUP DetectionGroup The Group detecting.
|
||||
function DETECTION_BASE:onafterDetectionGroup( From, Event, To, DetectionGroup, DetectionTimeStamp )
|
||||
self:E( { From, Event, To } )
|
||||
self:F( { From, Event, To } )
|
||||
|
||||
self.DetectionRun = self.DetectionRun + 1
|
||||
|
||||
@@ -672,7 +673,7 @@ do -- DETECTION_BASE
|
||||
if not self.DetectedObjects[DetectedObjectName] and Detection.visible and self.ZoneProbability then
|
||||
|
||||
for ZoneDataID, ZoneData in pairs( self.ZoneProbability ) do
|
||||
self:E({ZoneData})
|
||||
self:F({ZoneData})
|
||||
local ZoneObject = ZoneData[1] -- Core.Zone#ZONE_BASE
|
||||
local ZoneProbability = ZoneData[2] -- #number
|
||||
ZoneProbability = ZoneProbability * 30 / 300
|
||||
@@ -784,7 +785,7 @@ do -- DETECTION_BASE
|
||||
local DetectedItems = self:GetDetectedItems()
|
||||
|
||||
for DetectedItemIndex, DetectedItem in pairs( DetectedItems ) do
|
||||
local DetectedSet = self:GetDetectedSet( DetectedItemIndex )
|
||||
local DetectedSet = self:GetDetectedSet( DetectedItem )
|
||||
if DetectedSet then
|
||||
DetectedSet:RemoveUnitsByName( UnitName )
|
||||
end
|
||||
@@ -799,7 +800,7 @@ do -- DETECTION_BASE
|
||||
function DETECTION_BASE:CreateDetectionItems()
|
||||
self:F2()
|
||||
|
||||
self:E( "Error, in DETECTION_BASE class..." )
|
||||
self:F( "Error, in DETECTION_BASE class..." )
|
||||
return self
|
||||
end
|
||||
|
||||
@@ -1000,7 +1001,7 @@ do -- DETECTION_BASE
|
||||
self.AcceptZones = AcceptZones
|
||||
end
|
||||
else
|
||||
self:E( { "AcceptZones must be a list of ZONE_BASE derived objects or one ZONE_BASE derived object", AcceptZones } )
|
||||
self:F( { "AcceptZones must be a list of ZONE_BASE derived objects or one ZONE_BASE derived object", AcceptZones } )
|
||||
error()
|
||||
end
|
||||
|
||||
@@ -1021,7 +1022,7 @@ do -- DETECTION_BASE
|
||||
self.RejectZones = RejectZones
|
||||
end
|
||||
else
|
||||
self:E( { "RejectZones must be a list of ZONE_BASE derived objects or one ZONE_BASE derived object", RejectZones } )
|
||||
self:F( { "RejectZones must be a list of ZONE_BASE derived objects or one ZONE_BASE derived object", RejectZones } )
|
||||
error()
|
||||
end
|
||||
|
||||
@@ -1113,7 +1114,7 @@ do -- DETECTION_BASE
|
||||
DetectedItem.Changes[ChangeCode].ID = ID
|
||||
DetectedItem.Changes[ChangeCode].ItemUnitType = ItemUnitType
|
||||
|
||||
self:E( { "Change on Detected Item:", DetectedItemID = DetectedItem.ID, ChangeCode = ChangeCode, ItemUnitType = ItemUnitType } )
|
||||
self:F( { "Change on Detected Item:", DetectedItemID = DetectedItem.ID, ChangeCode = ChangeCode, ItemUnitType = ItemUnitType } )
|
||||
|
||||
return self
|
||||
end
|
||||
@@ -1136,7 +1137,7 @@ do -- DETECTION_BASE
|
||||
DetectedItem.Changes[ChangeCode][ChangeUnitType] = DetectedItem.Changes[ChangeCode][ChangeUnitType] + 1
|
||||
DetectedItem.Changes[ChangeCode].ID = ID
|
||||
|
||||
self:E( { "Change on Detected Unit:", DetectedItemID = DetectedItem.ID, ChangeCode = ChangeCode, ChangeUnitType = ChangeUnitType } )
|
||||
self:F( { "Change on Detected Unit:", DetectedItemID = DetectedItem.ID, ChangeCode = ChangeCode, ChangeUnitType = ChangeUnitType } )
|
||||
|
||||
return self
|
||||
end
|
||||
@@ -1458,23 +1459,26 @@ do -- DETECTION_BASE
|
||||
-- The DetectedItem is a table and contains a SET_UNIT in the field Set.
|
||||
-- @param #DETECTION_BASE self
|
||||
-- @param ItemPrefix
|
||||
-- @param #string DetectedItemIndex The index of the DetectedItem.
|
||||
-- @param DetectedItemKey The key of the DetectedItem.
|
||||
-- @param Core.Set#SET_UNIT Set (optional) The Set of Units to be added.
|
||||
-- @return #DETECTION_BASE.DetectedItem
|
||||
function DETECTION_BASE:AddDetectedItem( ItemPrefix, DetectedItemIndex, Set )
|
||||
function DETECTION_BASE:AddDetectedItem( ItemPrefix, DetectedItemKey, Set )
|
||||
|
||||
local DetectedItem = {}
|
||||
self.DetectedItemCount = self.DetectedItemCount + 1
|
||||
self.DetectedItemMax = self.DetectedItemMax + 1
|
||||
|
||||
if DetectedItemIndex then
|
||||
self.DetectedItems[DetectedItemIndex] = DetectedItem
|
||||
if DetectedItemKey then
|
||||
self.DetectedItems[DetectedItemKey] = DetectedItem
|
||||
else
|
||||
self.DetectedItems[self.DetectedItemMax] = DetectedItem
|
||||
end
|
||||
|
||||
self.DetectedItemsByIndex[self.DetectedItemMax] = DetectedItem
|
||||
|
||||
|
||||
DetectedItem.Set = Set or SET_UNIT:New():FilterDeads():FilterCrashes()
|
||||
DetectedItem.Index = DetectedItemIndex or self.DetectedItemMax
|
||||
DetectedItem.Index = DetectedItemKey or self.DetectedItemMax
|
||||
DetectedItem.ItemID = ItemPrefix .. "." .. self.DetectedItemMax
|
||||
DetectedItem.ID = self.DetectedItemMax
|
||||
DetectedItem.Removed = false
|
||||
@@ -1485,13 +1489,13 @@ do -- DETECTION_BASE
|
||||
--- Adds a new DetectedItem to the DetectedItems list.
|
||||
-- The DetectedItem is a table and contains a SET_UNIT in the field Set.
|
||||
-- @param #DETECTION_BASE self
|
||||
-- @param #string DetectedItemIndex The index of the DetectedItem.
|
||||
-- @param DetectedItemKey The key of the DetectedItem.
|
||||
-- @param Core.Set#SET_UNIT Set (optional) The Set of Units to be added.
|
||||
-- @param Core.Zone#ZONE_UNIT Zone (optional) The Zone to be added where the Units are located.
|
||||
-- @return #DETECTION_BASE.DetectedItem
|
||||
function DETECTION_BASE:AddDetectedItemZone( DetectedItemIndex, Set, Zone )
|
||||
function DETECTION_BASE:AddDetectedItemZone( DetectedItemKey, Set, Zone )
|
||||
|
||||
local DetectedItem = self:AddDetectedItem( "AREA", DetectedItemIndex, Set )
|
||||
local DetectedItem = self:AddDetectedItem( "AREA", DetectedItemKey, Set )
|
||||
|
||||
DetectedItem.Zone = Zone
|
||||
|
||||
@@ -1501,12 +1505,16 @@ do -- DETECTION_BASE
|
||||
--- Removes an existing DetectedItem from the DetectedItems list.
|
||||
-- The DetectedItem is a table and contains a SET_UNIT in the field Set.
|
||||
-- @param #DETECTION_BASE self
|
||||
-- @param #number DetectedItemIndex The index or position in the DetectedItems list where the item needs to be removed.
|
||||
function DETECTION_BASE:RemoveDetectedItem( DetectedItemIndex )
|
||||
-- @param DetectedItemKey The key in the DetectedItems list where the item needs to be removed.
|
||||
function DETECTION_BASE:RemoveDetectedItem( DetectedItemKey )
|
||||
|
||||
if self.DetectedItems[DetectedItemIndex] then
|
||||
local DetectedItem = self.DetectedItems[DetectedItemKey]
|
||||
|
||||
if DetectedItem then
|
||||
self.DetectedItemCount = self.DetectedItemCount - 1
|
||||
self.DetectedItems[DetectedItemIndex] = nil
|
||||
local DetectedItemIndex = DetectedItem.Index
|
||||
self.DetectedItemsByIndex[DetectedItemIndex] = nil
|
||||
self.DetectedItems[DetectedItemKey] = nil
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1528,13 +1536,31 @@ do -- DETECTION_BASE
|
||||
return DetectedCount
|
||||
end
|
||||
|
||||
--- Get a detected item using a given Key.
|
||||
-- @param #DETECTION_BASE self
|
||||
-- @param Key
|
||||
-- @return #DETECTION_BASE.DetectedItem
|
||||
function DETECTION_BASE:GetDetectedItemByKey( Key )
|
||||
|
||||
self:F( { DetectedItems = self.DetectedItems } )
|
||||
|
||||
local DetectedItem = self.DetectedItems[Key]
|
||||
if DetectedItem then
|
||||
return DetectedItem
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
--- Get a detected item using a given numeric index.
|
||||
-- @param #DETECTION_BASE self
|
||||
-- @param #number Index
|
||||
-- @return #DETECTION_BASE.DetectedItem
|
||||
function DETECTION_BASE:GetDetectedItem( Index )
|
||||
function DETECTION_BASE:GetDetectedItemByIndex( Index )
|
||||
|
||||
local DetectedItem = self.DetectedItems[Index]
|
||||
self:F( { DetectedItemsByIndex = self.DetectedItemsByIndex } )
|
||||
|
||||
local DetectedItem = self.DetectedItemsByIndex[Index]
|
||||
if DetectedItem then
|
||||
return DetectedItem
|
||||
end
|
||||
@@ -1544,16 +1570,11 @@ do -- DETECTION_BASE
|
||||
|
||||
--- Get a detected ItemID using a given numeric index.
|
||||
-- @param #DETECTION_BASE self
|
||||
-- @param #number Index
|
||||
-- @param #DETECTION_BASE.DetectedItem DetectedItem The DetectedItem.
|
||||
-- @return #string DetectedItemID
|
||||
function DETECTION_BASE:GetDetectedItemID( Index ) --R2.1
|
||||
function DETECTION_BASE:GetDetectedItemID( DetectedItem ) --R2.1
|
||||
|
||||
local DetectedItem = self.DetectedItems[Index]
|
||||
if DetectedItem then
|
||||
return DetectedItem.ItemID
|
||||
end
|
||||
|
||||
return ""
|
||||
return DetectedItem and DetectedItem.ItemID or ""
|
||||
end
|
||||
|
||||
--- Get a detected ID using a given numeric index.
|
||||
@@ -1562,7 +1583,7 @@ do -- DETECTION_BASE
|
||||
-- @return #string DetectedItemID
|
||||
function DETECTION_BASE:GetDetectedID( Index ) --R2.1
|
||||
|
||||
local DetectedItem = self.DetectedItems[Index]
|
||||
local DetectedItem = self.DetectedItemsByIndex[Index]
|
||||
if DetectedItem then
|
||||
return DetectedItem.ID
|
||||
end
|
||||
@@ -1572,12 +1593,11 @@ do -- DETECTION_BASE
|
||||
|
||||
--- Get the @{Set#SET_UNIT} of a detecttion area using a given numeric index.
|
||||
-- @param #DETECTION_BASE self
|
||||
-- @param #number Index
|
||||
-- @param #DETECTION_BASE.DetectedItem DetectedItem
|
||||
-- @return Core.Set#SET_UNIT DetectedSet
|
||||
function DETECTION_BASE:GetDetectedSet( Index )
|
||||
function DETECTION_BASE:GetDetectedSet( DetectedItem )
|
||||
|
||||
local DetectedItem = self:GetDetectedItem( Index )
|
||||
local DetectedSetUnit = DetectedItem.Set
|
||||
local DetectedSetUnit = DetectedItem and DetectedItem.Set
|
||||
if DetectedSetUnit then
|
||||
return DetectedSetUnit
|
||||
end
|
||||
@@ -1622,11 +1642,11 @@ do -- DETECTION_BASE
|
||||
|
||||
--- Get the @{Zone#ZONE_UNIT} of a detection area using a given numeric index.
|
||||
-- @param #DETECTION_BASE self
|
||||
-- @param #number Index
|
||||
-- @param #DETECTION_BASE.DetectedItem DetectedItem The DetectedItem.
|
||||
-- @return Core.Zone#ZONE_UNIT DetectedZone
|
||||
function DETECTION_BASE:GetDetectedItemZone( Index )
|
||||
function DETECTION_BASE:GetDetectedItemZone( DetectedItem )
|
||||
|
||||
local DetectedZone = self.DetectedItems[Index].Zone
|
||||
local DetectedZone = DetectedItem and DetectedItem.Zone
|
||||
if DetectedZone then
|
||||
return DetectedZone
|
||||
end
|
||||
@@ -1641,7 +1661,7 @@ do -- DETECTION_BASE
|
||||
|
||||
--- Set the detected item coordinate.
|
||||
-- @param #DETECTION_BASE self
|
||||
-- @param #DETECTION_BASE.DetectedItem The DetectedItem to set the coordinate at.
|
||||
-- @param #DETECTION_BASE.DetectedItem DetectedItem The DetectedItem to set the coordinate at.
|
||||
-- @param Core.Point#COORDINATE Coordinate The coordinate to set the last know detected position at.
|
||||
-- @param Wrapper.Unit#UNIT DetectedItemUnit The unit to set the heading and altitude from.
|
||||
-- @return #DETECTION_BASE
|
||||
@@ -1661,13 +1681,11 @@ do -- DETECTION_BASE
|
||||
|
||||
--- Get the detected item coordinate.
|
||||
-- @param #DETECTION_BASE self
|
||||
-- @param #number Index
|
||||
-- @param #DETECTION_BASE.DetectedItem DetectedItem The DetectedItem to set the coordinate at.
|
||||
-- @return Core.Point#COORDINATE
|
||||
function DETECTION_BASE:GetDetectedItemCoordinate( Index )
|
||||
self:F( { Index = Index } )
|
||||
function DETECTION_BASE:GetDetectedItemCoordinate( DetectedItem )
|
||||
self:F( { DetectedItem = DetectedItem } )
|
||||
|
||||
local DetectedItem = self:GetDetectedItem( Index )
|
||||
|
||||
if DetectedItem then
|
||||
return DetectedItem.Coordinate
|
||||
end
|
||||
@@ -1692,42 +1710,27 @@ do -- DETECTION_BASE
|
||||
|
||||
--- Get the detected item coordinate.
|
||||
-- @param #DETECTION_BASE self
|
||||
-- @param #number Index
|
||||
-- @param #DETECTION_BASE.DetectedItem DetectedItem The DetectedItem.
|
||||
-- @return #number ThreatLevel
|
||||
function DETECTION_BASE:GetDetectedItemThreatLevel( Index )
|
||||
self:F( { Index = Index } )
|
||||
function DETECTION_BASE:GetDetectedItemThreatLevel( DetectedItem )
|
||||
self:F( { DetectedItem = DetectedItem } )
|
||||
|
||||
local DetectedItem = self:GetDetectedItem( Index )
|
||||
|
||||
if DetectedItem then
|
||||
self:F( { ThreatLevel = DetectedItem.ThreatLevel, ThreatText = DetectedItem.ThreatText } )
|
||||
return DetectedItem.ThreatLevel or 0, DetectedItem.ThreatText or ""
|
||||
end
|
||||
|
||||
return nil, ""
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
--- Menu of a detected item using a given numeric index.
|
||||
-- @param #DETECTION_BASE self
|
||||
-- @param Index
|
||||
-- @return #string
|
||||
function DETECTION_BASE:DetectedItemMenu( Index, AttackGroup )
|
||||
self:F( Index )
|
||||
return nil
|
||||
end
|
||||
|
||||
|
||||
--- Report summary of a detected item using a given numeric index.
|
||||
-- @param #DETECTION_BASE self
|
||||
-- @param Index
|
||||
-- @param #DETECTION_BASE.DetectedItem DetectedItem The DetectedItem.
|
||||
-- @param Wrapper.Group#GROUP AttackGroup The group to generate the report for.
|
||||
-- @param Core.Settings#SETTINGS Settings Message formatting settings to use.
|
||||
-- @return Core.Report#REPORT
|
||||
function DETECTION_BASE:DetectedItemReportSummary( Index, AttackGroup, Settings )
|
||||
function DETECTION_BASE:DetectedItemReportSummary( DetectedItem, AttackGroup, Settings )
|
||||
self:F( Index )
|
||||
return nil
|
||||
end
|
||||
@@ -1764,7 +1767,7 @@ do -- DETECTION_BASE
|
||||
for RecceUnit, RecceUnit in pairs( RecceGroup:GetUnits() ) do
|
||||
if RecceUnit:IsActive() then
|
||||
local RecceUnitCoord = RecceUnit:GetCoordinate()
|
||||
local Distance = RecceUnitCoord:Get2DDistance( self:GetDetectedItemCoordinate( DetectedItem.Index ) )
|
||||
local Distance = RecceUnitCoord:Get2DDistance( self:GetDetectedItemCoordinate( DetectedItem ) )
|
||||
if Distance < DistanceRecce then
|
||||
DistanceRecce = Distance
|
||||
NearestRecce = RecceUnit
|
||||
@@ -1887,9 +1890,9 @@ do -- DETECTION_UNITS
|
||||
local DetectedUnit = DetectedUnitData -- Wrapper.Unit#UNIT
|
||||
|
||||
local DetectedObject = nil
|
||||
--self:E( DetectedUnit )
|
||||
--self:F( DetectedUnit )
|
||||
if DetectedUnit:IsAlive() then
|
||||
--self:E(DetectedUnit:GetName())
|
||||
--self:F(DetectedUnit:GetName())
|
||||
DetectedObject = self:GetDetectedObject( DetectedUnit:GetName() )
|
||||
end
|
||||
if DetectedObject then
|
||||
@@ -1928,7 +1931,7 @@ do -- DETECTION_UNITS
|
||||
|
||||
if DetectedUnit then
|
||||
local DetectedTypeName = DetectedUnit:GetTypeName()
|
||||
local DetectedItem = self:GetDetectedItem( DetectedUnitName )
|
||||
local DetectedItem = self:GetDetectedItemByKey( DetectedUnitName )
|
||||
if not DetectedItem then
|
||||
self:T( "Added new DetectedItem" )
|
||||
DetectedItem = self:AddDetectedItem( "UNIT", DetectedUnitName )
|
||||
@@ -1960,54 +1963,24 @@ do -- DETECTION_UNITS
|
||||
self:SetDetectedItemCoordinate( DetectedItem, DetectedFirstUnitCoord, DetectedFirstUnit )
|
||||
|
||||
self:ReportFriendliesNearBy( { DetectedItem = DetectedItem, ReportSetGroup = self.DetectionSetGroup } ) -- Fill the Friendlies table
|
||||
self:SetDetectedItemThreatLevel( DetectedItem )
|
||||
self:NearestRecce( DetectedItem )
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
--- Menu of a DetectedItem using a given numeric index.
|
||||
-- @param #DETECTION_UNITS self
|
||||
-- @param Index
|
||||
-- @return #string
|
||||
function DETECTION_UNITS:DetectedItemMenu( Index, AttackGroup )
|
||||
self:F( Index )
|
||||
|
||||
local DetectedItem = self:GetDetectedItem( Index )
|
||||
local DetectedSet = self:GetDetectedSet( Index )
|
||||
local DetectedItemID = self:GetDetectedItemID( Index )
|
||||
|
||||
self:T( DetectedSet )
|
||||
if DetectedSet then
|
||||
local ReportSummary = ""
|
||||
local UnitDistanceText = ""
|
||||
local UnitCategoryText = ""
|
||||
|
||||
local DetectedItemCoordinate = self:GetDetectedItemCoordinate( Index )
|
||||
local DetectedItemCoordText = DetectedItemCoordinate:ToString( AttackGroup )
|
||||
|
||||
ReportSummary = string.format(
|
||||
"%s - %s",
|
||||
DetectedItemID,
|
||||
DetectedItemCoordText
|
||||
)
|
||||
self:T( ReportSummary )
|
||||
|
||||
return ReportSummary
|
||||
end
|
||||
end
|
||||
|
||||
--- Report summary of a DetectedItem using a given numeric index.
|
||||
-- @param #DETECTION_UNITS self
|
||||
-- @param Index
|
||||
-- @param #DETECTION_BASE.DetectedItem DetectedItem The DetectedItem.
|
||||
-- @param Wrapper.Group#GROUP AttackGroup The group to generate the report for.
|
||||
-- @param Core.Settings#SETTINGS Settings Message formatting settings to use.
|
||||
-- @return Core.Report#REPORT The report of the detection items.
|
||||
function DETECTION_UNITS:DetectedItemReportSummary( Index, AttackGroup, Settings )
|
||||
self:F( { Index, self.DetectedItems } )
|
||||
function DETECTION_UNITS:DetectedItemReportSummary( DetectedItem, AttackGroup, Settings )
|
||||
self:F( { DetectedItem = DetectedItem } )
|
||||
|
||||
local DetectedItem = self:GetDetectedItem( Index )
|
||||
local DetectedItemID = self:GetDetectedItemID( Index )
|
||||
local DetectedItemID = self:GetDetectedItemID( DetectedItem )
|
||||
|
||||
if DetectedItem then
|
||||
local ReportSummary = ""
|
||||
@@ -2037,10 +2010,10 @@ do -- DETECTION_UNITS
|
||||
end
|
||||
|
||||
--TODO: solve Index reference
|
||||
local DetectedItemCoordinate = self:GetDetectedItemCoordinate( Index )
|
||||
local DetectedItemCoordinate = self:GetDetectedItemCoordinate( DetectedItem )
|
||||
local DetectedItemCoordText = DetectedItemCoordinate:ToString( AttackGroup, Settings )
|
||||
|
||||
local ThreatLevelA2G = self:GetDetectedItemThreatLevel( Index )
|
||||
local ThreatLevelA2G = self:GetDetectedItemThreatLevel( DetectedItem )
|
||||
|
||||
local Report = REPORT:New()
|
||||
Report:Add(DetectedItemID .. ", " .. DetectedItemCoordText)
|
||||
@@ -2060,9 +2033,9 @@ do -- DETECTION_UNITS
|
||||
self:F()
|
||||
|
||||
local Report = REPORT:New()
|
||||
for DetectedItemID, DetectedItem in pairs( self.DetectedItems ) do
|
||||
for DetectedItemIndex, DetectedItem in pairs( self.DetectedItems ) do
|
||||
local DetectedItem = DetectedItem -- #DETECTION_BASE.DetectedItem
|
||||
local ReportSummary = self:DetectedItemReportSummary( DetectedItemID, AttackGroup )
|
||||
local ReportSummary = self:DetectedItemReportSummary( DetectedItem, AttackGroup )
|
||||
Report:SetTitle( "Detected units:" )
|
||||
Report:Add( ReportSummary:Text() )
|
||||
end
|
||||
@@ -2165,7 +2138,7 @@ do -- DETECTION_TYPES
|
||||
|
||||
local DetectedObject = nil
|
||||
if DetectedUnit:IsAlive() then
|
||||
--self:E(DetectedUnit:GetName())
|
||||
--self:F(DetectedUnit:GetName())
|
||||
DetectedObject = self:GetDetectedObject( DetectedUnit:GetName() )
|
||||
end
|
||||
if DetectedObject then
|
||||
@@ -2192,10 +2165,10 @@ do -- DETECTION_TYPES
|
||||
|
||||
if DetectedUnit then
|
||||
local DetectedTypeName = DetectedUnit:GetTypeName()
|
||||
local DetectedItem = self:GetDetectedItem( DetectedTypeName )
|
||||
local DetectedItem = self:GetDetectedItemByKey( DetectedTypeName )
|
||||
if not DetectedItem then
|
||||
DetectedItem = self:AddDetectedItem( "TYPE", DetectedTypeName )
|
||||
DetectedItem.TypeName = DetectedUnit:GetTypeName()
|
||||
DetectedItem.TypeName = DetectedTypeName
|
||||
end
|
||||
|
||||
DetectedItem.Set:AddUnit( DetectedUnit )
|
||||
@@ -2218,6 +2191,7 @@ do -- DETECTION_TYPES
|
||||
self:SetDetectedItemCoordinate( DetectedItem, DetectedUnitCoord, DetectedFirstUnit )
|
||||
|
||||
self:ReportFriendliesNearBy( { DetectedItem = DetectedItem, ReportSetGroup = self.DetectionSetGroup } ) -- Fill the Friendlies table
|
||||
self:SetDetectedItemThreatLevel( DetectedItem )
|
||||
self:NearestRecce( DetectedItem )
|
||||
end
|
||||
|
||||
@@ -2225,53 +2199,26 @@ do -- DETECTION_TYPES
|
||||
|
||||
end
|
||||
|
||||
--- Menu of a DetectedItem using a given numeric index.
|
||||
-- @param #DETECTION_TYPES self
|
||||
-- @param Index
|
||||
-- @return #string
|
||||
function DETECTION_TYPES:DetectedItemMenu( DetectedTypeName, AttackGroup )
|
||||
self:F( DetectedTypeName )
|
||||
|
||||
local DetectedItem = self:GetDetectedItem( DetectedTypeName )
|
||||
local DetectedItemID = self:GetDetectedItemID( DetectedTypeName )
|
||||
|
||||
if DetectedItem then
|
||||
|
||||
local DetectedItemCoordinate = self:GetDetectedItemCoordinate( DetectedTypeName )
|
||||
local DetectedItemCoordText = DetectedItemCoordinate:ToString( AttackGroup )
|
||||
|
||||
local ReportSummary = string.format(
|
||||
"%s - %s",
|
||||
DetectedItemID,
|
||||
DetectedItemCoordText
|
||||
)
|
||||
self:T( ReportSummary )
|
||||
|
||||
return ReportSummary
|
||||
end
|
||||
end
|
||||
|
||||
--- Report summary of a DetectedItem using a given numeric index.
|
||||
-- @param #DETECTION_TYPES self
|
||||
-- @param Index
|
||||
-- @param #DETECTION_BASE.DetectedItem DetectedItem The DetectedItem.
|
||||
-- @param Wrapper.Group#GROUP AttackGroup The group to generate the report for.
|
||||
-- @param Core.Settings#SETTINGS Settings Message formatting settings to use.
|
||||
-- @return Core.Report#REPORT The report of the detection items.
|
||||
function DETECTION_TYPES:DetectedItemReportSummary( DetectedTypeName, AttackGroup, Settings )
|
||||
self:F( DetectedTypeName )
|
||||
function DETECTION_TYPES:DetectedItemReportSummary( DetectedItem, AttackGroup, Settings )
|
||||
self:F( { DetectedItem = DetectedItem } )
|
||||
|
||||
local DetectedItem = self:GetDetectedItem( DetectedTypeName )
|
||||
local DetectedSet = self:GetDetectedSet( DetectedTypeName )
|
||||
local DetectedItemID = self:GetDetectedItemID( DetectedTypeName )
|
||||
local DetectedSet = self:GetDetectedSet( DetectedItem )
|
||||
local DetectedItemID = self:GetDetectedItemID( DetectedItem )
|
||||
|
||||
self:T( DetectedItem )
|
||||
if DetectedItem then
|
||||
|
||||
local ThreatLevelA2G = self:GetDetectedItemThreatLevel( DetectedTypeName )
|
||||
local ThreatLevelA2G = self:GetDetectedItemThreatLevel( DetectedItem )
|
||||
local DetectedItemsCount = DetectedSet:Count()
|
||||
local DetectedItemType = DetectedItem.TypeName
|
||||
|
||||
local DetectedItemCoordinate = self:GetDetectedItemCoordinate( DetectedTypeName )
|
||||
local DetectedItemCoordinate = self:GetDetectedItemCoordinate( DetectedItem )
|
||||
local DetectedItemCoordText = DetectedItemCoordinate:ToString( AttackGroup, Settings )
|
||||
|
||||
local Report = REPORT:New()
|
||||
@@ -2290,9 +2237,9 @@ do -- DETECTION_TYPES
|
||||
self:F()
|
||||
|
||||
local Report = REPORT:New()
|
||||
for DetectedItemTypeName, DetectedItem in pairs( self.DetectedItems ) do
|
||||
for DetectedItemIndex, DetectedItem in pairs( self.DetectedItems ) do
|
||||
local DetectedItem = DetectedItem -- #DETECTION_BASE.DetectedItem
|
||||
local ReportSummary = self:DetectedItemReportSummary( DetectedItemTypeName, AttackGroup )
|
||||
local ReportSummary = self:DetectedItemReportSummary( DetectedItem, AttackGroup )
|
||||
Report:SetTitle( "Detected types:" )
|
||||
Report:Add( ReportSummary:Text() )
|
||||
end
|
||||
@@ -2371,57 +2318,26 @@ do -- DETECTION_AREAS
|
||||
end
|
||||
|
||||
|
||||
--- Menu of a detected item using a given numeric index.
|
||||
-- @param #DETECTION_AREAS self
|
||||
-- @param Index
|
||||
-- @return #string
|
||||
function DETECTION_AREAS:DetectedItemMenu( Index, AttackGroup )
|
||||
self:F( Index )
|
||||
|
||||
local DetectedItem = self:GetDetectedItem( Index )
|
||||
local DetectedItemID = self:GetDetectedItemID( Index )
|
||||
|
||||
if DetectedItem then
|
||||
local DetectedSet = self:GetDetectedSet( Index )
|
||||
local ReportSummaryItem
|
||||
|
||||
local DetectedZone = self:GetDetectedItemZone( Index )
|
||||
local DetectedItemCoordinate = DetectedZone:GetCoordinate()
|
||||
local DetectedItemCoordText = DetectedItemCoordinate:ToString( AttackGroup )
|
||||
|
||||
local ReportSummary = string.format(
|
||||
"%s - %s",
|
||||
DetectedItemID,
|
||||
DetectedItemCoordText
|
||||
)
|
||||
|
||||
return ReportSummary
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
--- Report summary of a detected item using a given numeric index.
|
||||
-- @param #DETECTION_AREAS self
|
||||
-- @param Index
|
||||
-- @param #DETECTION_BASE.DetectedItem DetectedItem The DetectedItem.
|
||||
-- @param Wrapper.Group#GROUP AttackGroup The group to get the settings for.
|
||||
-- @param Core.Settings#SETTINGS Settings (Optional) Message formatting settings to use.
|
||||
-- @return Core.Report#REPORT The report of the detection items.
|
||||
function DETECTION_AREAS:DetectedItemReportSummary( Index, AttackGroup, Settings )
|
||||
self:F( Index )
|
||||
function DETECTION_AREAS:DetectedItemReportSummary( DetectedItem, AttackGroup, Settings )
|
||||
self:F( { DetectedItem = DetectedItem } )
|
||||
|
||||
local DetectedItem = self:GetDetectedItem( Index )
|
||||
local DetectedItemID = self:GetDetectedItemID( Index )
|
||||
local DetectedItemID = self:GetDetectedItemID( DetectedItem )
|
||||
|
||||
if DetectedItem then
|
||||
local DetectedSet = self:GetDetectedSet( Index )
|
||||
local DetectedSet = self:GetDetectedSet( DetectedItem )
|
||||
local ReportSummaryItem
|
||||
|
||||
local DetectedZone = self:GetDetectedItemZone( Index )
|
||||
local DetectedZone = self:GetDetectedItemZone( DetectedItem )
|
||||
local DetectedItemCoordinate = DetectedZone:GetCoordinate()
|
||||
local DetectedItemCoordText = DetectedItemCoordinate:ToString( AttackGroup, Settings )
|
||||
|
||||
local ThreatLevelA2G = self:GetDetectedItemThreatLevel( Index )
|
||||
local ThreatLevelA2G = self:GetDetectedItemThreatLevel( DetectedItem )
|
||||
local DetectedItemsCount = DetectedSet:Count()
|
||||
local DetectedItemsTypes = DetectedSet:GetTypeNames()
|
||||
|
||||
@@ -2446,7 +2362,7 @@ do -- DETECTION_AREAS
|
||||
local Report = REPORT:New()
|
||||
for DetectedItemIndex, DetectedItem in pairs( self.DetectedItems ) do
|
||||
local DetectedItem = DetectedItem -- #DETECTION_BASE.DetectedItem
|
||||
local ReportSummary = self:DetectedItemReportSummary( DetectedItemIndex, AttackGroup )
|
||||
local ReportSummary = self:DetectedItemReportSummary( DetectedItem, AttackGroup )
|
||||
Report:SetTitle( "Detected areas:" )
|
||||
Report:Add( ReportSummary:Text() )
|
||||
end
|
||||
@@ -2673,7 +2589,7 @@ do -- DETECTION_AREAS
|
||||
|
||||
local DetectedObject = nil
|
||||
if DetectedUnit:IsAlive() then
|
||||
--self:E(DetectedUnit:GetName())
|
||||
--self:F(DetectedUnit:GetName())
|
||||
DetectedObject = self:GetDetectedObject( DetectedUnit:GetName() )
|
||||
end
|
||||
if DetectedObject then
|
||||
@@ -2751,7 +2667,7 @@ do -- DETECTION_AREAS
|
||||
SET_UNIT:New():FilterDeads():FilterCrashes(),
|
||||
ZONE_UNIT:New( DetectedUnitName, DetectedUnit, self.DetectionZoneRange )
|
||||
)
|
||||
--self:E( DetectedItem.Zone.ZoneUNIT.UnitName )
|
||||
--self:F( DetectedItem.Zone.ZoneUNIT.UnitName )
|
||||
DetectedItem.Set:AddUnit( DetectedUnit )
|
||||
self:AddChangeItem( DetectedItem, "AA", DetectedUnitTypeName )
|
||||
end
|
||||
|
||||
@@ -846,11 +846,11 @@ function _Resume( EscortGroup )
|
||||
end
|
||||
|
||||
--- @param #ESCORT self
|
||||
-- @param #number DetectedItemID
|
||||
function ESCORT:_AttackTarget( DetectedItemID )
|
||||
-- @param Functional.Detection#DETECTION_BASE.DetectedItem DetectedItem
|
||||
function ESCORT:_AttackTarget( DetectedItem )
|
||||
|
||||
local EscortGroup = self.EscortGroup -- Wrapper.Group#GROUP
|
||||
self:E( EscortGroup )
|
||||
self:F( EscortGroup )
|
||||
|
||||
local EscortClient = self.EscortClient
|
||||
|
||||
@@ -861,7 +861,7 @@ function ESCORT:_AttackTarget( DetectedItemID )
|
||||
EscortGroup:OptionROTPassiveDefense()
|
||||
EscortGroup:SetState( EscortGroup, "Escort", self )
|
||||
|
||||
local DetectedSet = self.Detection:GetDetectedSet( DetectedItemID )
|
||||
local DetectedSet = self.Detection:GetDetectedSet( DetectedItem )
|
||||
|
||||
local Tasks = {}
|
||||
|
||||
@@ -884,7 +884,7 @@ function ESCORT:_AttackTarget( DetectedItemID )
|
||||
|
||||
else
|
||||
|
||||
local DetectedSet = self.Detection:GetDetectedSet( DetectedItemID )
|
||||
local DetectedSet = self.Detection:GetDetectedSet( DetectedItem )
|
||||
|
||||
local Tasks = {}
|
||||
|
||||
@@ -910,8 +910,9 @@ function ESCORT:_AttackTarget( DetectedItemID )
|
||||
end
|
||||
|
||||
---
|
||||
-- @param #number DetectedItemID
|
||||
function ESCORT:_AssistTarget( EscortGroupAttack, DetectedItemID )
|
||||
--- @param #ESCORT self
|
||||
-- @param Functional.Detection#DETECTION_BASE.DetectedItem DetectedItem
|
||||
function ESCORT:_AssistTarget( EscortGroupAttack, DetectedItem )
|
||||
|
||||
local EscortGroup = self.EscortGroup
|
||||
local EscortClient = self.EscortClient
|
||||
@@ -922,7 +923,7 @@ function ESCORT:_AssistTarget( EscortGroupAttack, DetectedItemID )
|
||||
EscortGroupAttack:OptionROEOpenFire()
|
||||
EscortGroupAttack:OptionROTVertical()
|
||||
|
||||
local DetectedSet = self.Detection:GetDetectedSet( DetectedItemID )
|
||||
local DetectedSet = self.Detection:GetDetectedSet( DetectedItem )
|
||||
|
||||
local Tasks = {}
|
||||
|
||||
@@ -944,7 +945,7 @@ function ESCORT:_AssistTarget( EscortGroupAttack, DetectedItemID )
|
||||
)
|
||||
|
||||
else
|
||||
local DetectedSet = self.Detection:GetDetectedSet( DetectedItemID )
|
||||
local DetectedSet = self.Detection:GetDetectedSet( DetectedItem )
|
||||
|
||||
local Tasks = {}
|
||||
|
||||
@@ -1151,7 +1152,7 @@ function ESCORT:_ReportTargetsScheduler()
|
||||
end
|
||||
|
||||
local DetectedItems = self.Detection:GetDetectedItems()
|
||||
self:E( DetectedItems )
|
||||
self:F( DetectedItems )
|
||||
|
||||
local DetectedTargets = false
|
||||
|
||||
@@ -1162,11 +1163,11 @@ function ESCORT:_ReportTargetsScheduler()
|
||||
local ClientEscortTargets = EscortGroupData.Detection
|
||||
--local EscortUnit = EscortGroupData:GetUnit( 1 )
|
||||
|
||||
for DetectedItemID, DetectedItem in pairs( DetectedItems ) do
|
||||
self:E( { DetectedItemID, DetectedItem } )
|
||||
for DetectedItemIndex, DetectedItem in pairs( DetectedItems ) do
|
||||
self:F( { DetectedItemIndex, DetectedItem } )
|
||||
-- Remove the sub menus of the Attack menu of the Escort for the EscortGroup.
|
||||
|
||||
local DetectedItemReportSummary = self.Detection:DetectedItemReportSummary( DetectedItemID, EscortGroupData.EscortGroup, _DATABASE:GetPlayerSettings( self.EscortClient:GetPlayerName() ) )
|
||||
local DetectedItemReportSummary = self.Detection:DetectedItemReportSummary( DetectedItem, EscortGroupData.EscortGroup, _DATABASE:GetPlayerSettings( self.EscortClient:GetPlayerName() ) )
|
||||
|
||||
if ClientEscortGroupName == EscortGroupName then
|
||||
|
||||
@@ -1180,7 +1181,7 @@ function ESCORT:_ReportTargetsScheduler()
|
||||
self.EscortMenuAttackNearbyTargets,
|
||||
ESCORT._AttackTarget,
|
||||
self,
|
||||
DetectedItemID
|
||||
DetectedItem
|
||||
)
|
||||
else
|
||||
if self.EscortMenuTargetAssistance then
|
||||
@@ -1195,7 +1196,7 @@ function ESCORT:_ReportTargetsScheduler()
|
||||
ESCORT._AssistTarget,
|
||||
self,
|
||||
EscortGroupData.EscortGroup,
|
||||
DetectedItemID
|
||||
DetectedItem
|
||||
)
|
||||
end
|
||||
end
|
||||
@@ -1204,7 +1205,7 @@ function ESCORT:_ReportTargetsScheduler()
|
||||
|
||||
end
|
||||
end
|
||||
self:E( DetectedMsgs )
|
||||
self:F( DetectedMsgs )
|
||||
if DetectedTargets then
|
||||
self.EscortGroup:MessageToClient( "Reporting detected targets:\n" .. table.concat( DetectedMsgs, "\n" ), 20, self.EscortClient )
|
||||
else
|
||||
|
||||
@@ -177,13 +177,13 @@ function MISSILETRAINER:New( Distance, Briefing )
|
||||
|
||||
|
||||
-- for ClientID, Client in pairs( self.DBClients.Database ) do
|
||||
-- self:E( "ForEach:" .. Client.UnitName )
|
||||
-- self:F( "ForEach:" .. Client.UnitName )
|
||||
-- Client:Alive( self._Alive, self )
|
||||
-- end
|
||||
--
|
||||
self.DBClients:ForEachClient(
|
||||
function( Client )
|
||||
self:E( "ForEach:" .. Client.UnitName )
|
||||
self:F( "ForEach:" .. Client.UnitName )
|
||||
Client:Alive( self._Alive, self )
|
||||
end
|
||||
)
|
||||
|
||||
@@ -78,14 +78,14 @@ end
|
||||
function PROTECT:IsGuarded()
|
||||
|
||||
local IsGuarded = self.ProtectZone:IsAllInZoneOfCoalition( self.Coalition )
|
||||
self:E( { IsGuarded = IsGuarded } )
|
||||
self:F( { IsGuarded = IsGuarded } )
|
||||
return IsGuarded
|
||||
end
|
||||
|
||||
function PROTECT:IsCaptured()
|
||||
|
||||
local IsCaptured = self.ProtectZone:IsAllInZoneOfOtherCoalition( self.Coalition )
|
||||
self:E( { IsCaptured = IsCaptured } )
|
||||
self:F( { IsCaptured = IsCaptured } )
|
||||
return IsCaptured
|
||||
end
|
||||
|
||||
@@ -93,7 +93,7 @@ end
|
||||
function PROTECT:IsAttacked()
|
||||
|
||||
local IsAttacked = self.ProtectZone:IsSomeInZoneOfCoalition( self.Coalition )
|
||||
self:E( { IsAttacked = IsAttacked } )
|
||||
self:F( { IsAttacked = IsAttacked } )
|
||||
return IsAttacked
|
||||
end
|
||||
|
||||
@@ -101,7 +101,7 @@ end
|
||||
function PROTECT:IsEmpty()
|
||||
|
||||
local IsEmpty = self.ProtectZone:IsNoneInZone()
|
||||
self:E( { IsEmpty = IsEmpty } )
|
||||
self:F( { IsEmpty = IsEmpty } )
|
||||
return IsEmpty
|
||||
end
|
||||
|
||||
@@ -158,7 +158,7 @@ function PROTECT:IsCaptureUnitInZone()
|
||||
|
||||
local IsInZone = self.CaptureUnitSet:IsPartiallyInZone( self.ProtectZone )
|
||||
|
||||
self:E({IsInZone = IsInZone})
|
||||
self:F({IsInZone = IsInZone})
|
||||
|
||||
return IsInZone
|
||||
end
|
||||
@@ -189,7 +189,7 @@ function PROTECT:Mark()
|
||||
local State = self:GetState()
|
||||
|
||||
if self.MarkRed and self.MarkBlue then
|
||||
self:E( { MarkRed = self.MarkRed, MarkBlue = self.MarkBlue } )
|
||||
self:F( { MarkRed = self.MarkRed, MarkBlue = self.MarkBlue } )
|
||||
Coord:RemoveMark( self.MarkRed )
|
||||
Coord:RemoveMark( self.MarkBlue )
|
||||
end
|
||||
@@ -231,7 +231,7 @@ end
|
||||
function PROTECT:onenterCaptured()
|
||||
|
||||
local NewCoalition = self.ProtectZone:GetCoalition()
|
||||
self:E( { NewCoalition = NewCoalition } )
|
||||
self:F( { NewCoalition = NewCoalition } )
|
||||
self:SetCoalition( NewCoalition )
|
||||
|
||||
self:Mark()
|
||||
@@ -254,7 +254,7 @@ end
|
||||
-- @param #PROTECT self
|
||||
function PROTECT:StatusCoalition()
|
||||
|
||||
self:E( { State = self:GetState() } )
|
||||
self:F( { State = self:GetState() } )
|
||||
|
||||
self.ProtectZone:Scan()
|
||||
|
||||
@@ -271,7 +271,7 @@ end
|
||||
-- @param #PROTECT self
|
||||
function PROTECT:StatusZone()
|
||||
|
||||
self:E( { State = self:GetState() } )
|
||||
self:F( { State = self:GetState() } )
|
||||
|
||||
self.ProtectZone:Scan()
|
||||
|
||||
|
||||
@@ -689,7 +689,7 @@ end
|
||||
-- @param #number Score The score can be both positive or negative ( Penalty ).
|
||||
function SCORING:AddGoalScorePlayer( PlayerName, GoalTag, Text, Score )
|
||||
|
||||
self:E( { PlayerName, PlayerName, GoalTag, Text, Score } )
|
||||
self:F( { PlayerName, PlayerName, GoalTag, Text, Score } )
|
||||
|
||||
-- PlayerName can be nil, if the Unit with the player crashed or due to another reason.
|
||||
if PlayerName then
|
||||
@@ -721,7 +721,7 @@ function SCORING:AddGoalScore( PlayerUnit, GoalTag, Text, Score )
|
||||
|
||||
local PlayerName = PlayerUnit:GetPlayerName()
|
||||
|
||||
self:E( { PlayerUnit.UnitName, PlayerName, GoalTag, Text, Score } )
|
||||
self:F( { PlayerUnit.UnitName, PlayerName, GoalTag, Text, Score } )
|
||||
|
||||
-- PlayerName can be nil, if the Unit with the player crashed or due to another reason.
|
||||
if PlayerName then
|
||||
@@ -749,7 +749,7 @@ function SCORING:_AddMissionTaskScore( Mission, PlayerUnit, Text, Score )
|
||||
local PlayerName = PlayerUnit:GetPlayerName()
|
||||
local MissionName = Mission:GetName()
|
||||
|
||||
self:E( { Mission:GetName(), PlayerUnit.UnitName, PlayerName, Text, Score } )
|
||||
self:F( { Mission:GetName(), PlayerUnit.UnitName, PlayerName, Text, Score } )
|
||||
|
||||
-- PlayerName can be nil, if the Unit with the player crashed or due to another reason.
|
||||
if PlayerName then
|
||||
@@ -767,7 +767,7 @@ function SCORING:_AddMissionTaskScore( Mission, PlayerUnit, Text, Score )
|
||||
PlayerData.Score = self.Players[PlayerName].Score + Score
|
||||
PlayerData.Mission[MissionName].ScoreTask = self.Players[PlayerName].Mission[MissionName].ScoreTask + Score
|
||||
|
||||
MESSAGE:NewType( self.DisplayMessagePrefix .. MissionName .. " : " .. Text .. " Score: " .. Score, MESSAGE.Type.Information ):ToAll()
|
||||
MESSAGE:NewType( self.DisplayMessagePrefix .. Mission:GetText() .. " : " .. Text .. " Score: " .. Score, MESSAGE.Type.Information ):ToAll()
|
||||
|
||||
self:ScoreCSV( PlayerName, "", "TASK_" .. MissionName:gsub( ' ', '_' ), 1, Score, PlayerUnit:GetName() )
|
||||
end
|
||||
@@ -783,7 +783,7 @@ function SCORING:_AddMissionGoalScore( Mission, PlayerName, Text, Score )
|
||||
|
||||
local MissionName = Mission:GetName()
|
||||
|
||||
self:E( { Mission:GetName(), PlayerName, Text, Score } )
|
||||
self:F( { Mission:GetName(), PlayerName, Text, Score } )
|
||||
|
||||
-- PlayerName can be nil, if the Unit with the player crashed or due to another reason.
|
||||
if PlayerName then
|
||||
@@ -801,7 +801,7 @@ function SCORING:_AddMissionGoalScore( Mission, PlayerName, Text, Score )
|
||||
PlayerData.Score = self.Players[PlayerName].Score + Score
|
||||
PlayerData.Mission[MissionName].ScoreTask = self.Players[PlayerName].Mission[MissionName].ScoreTask + Score
|
||||
|
||||
MESSAGE:NewType( string.format( "%s%s: %s! Player %s receives %d score!", self.DisplayMessagePrefix, MissionName, Text, PlayerName, Score ), MESSAGE.Type.Information ):ToAll()
|
||||
MESSAGE:NewType( string.format( "%s%s: %s! Player %s receives %d score!", self.DisplayMessagePrefix, Mission:GetText(), Text, PlayerName, Score ), MESSAGE.Type.Information ):ToAll()
|
||||
|
||||
self:ScoreCSV( PlayerName, "", "TASK_" .. MissionName:gsub( ' ', '_' ), 1, Score )
|
||||
end
|
||||
@@ -817,18 +817,18 @@ function SCORING:_AddMissionScore( Mission, Text, Score )
|
||||
|
||||
local MissionName = Mission:GetName()
|
||||
|
||||
self:E( { Mission, Text, Score } )
|
||||
self:E( self.Players )
|
||||
self:F( { Mission, Text, Score } )
|
||||
self:F( self.Players )
|
||||
|
||||
for PlayerName, PlayerData in pairs( self.Players ) do
|
||||
|
||||
self:E( PlayerData )
|
||||
self:F( PlayerData )
|
||||
if PlayerData.Mission[MissionName] then
|
||||
|
||||
PlayerData.Score = PlayerData.Score + Score
|
||||
PlayerData.Mission[MissionName].ScoreMission = PlayerData.Mission[MissionName].ScoreMission + Score
|
||||
|
||||
MESSAGE:NewType( self.DisplayMessagePrefix .. "Player '" .. PlayerName .. "' has " .. Text .. " in Mission '" .. MissionName .. "'. " ..
|
||||
MESSAGE:NewType( self.DisplayMessagePrefix .. "Player '" .. PlayerName .. "' has " .. Text .. " in " .. Mission:GetText() .. ". " ..
|
||||
Score .. " mission score!",
|
||||
MESSAGE.Type.Information ):ToAll()
|
||||
|
||||
@@ -1232,7 +1232,7 @@ function SCORING:_EventOnDeadOrCrash( Event )
|
||||
local ThreatTypeTarget = TargetThreatType
|
||||
local ThreatLevelPlayer = Player.ThreatLevel / 10 + 1
|
||||
local ThreatPenalty = math.ceil( ( ThreatLevelTarget / ThreatLevelPlayer ) * self.ScaleDestroyPenalty / 10 )
|
||||
self:E( { ThreatLevel = ThreatPenalty, ThreatLevelTarget = ThreatLevelTarget, ThreatTypeTarget = ThreatTypeTarget, ThreatLevelPlayer = ThreatLevelPlayer } )
|
||||
self:F( { ThreatLevel = ThreatPenalty, ThreatLevelTarget = ThreatLevelTarget, ThreatTypeTarget = ThreatTypeTarget, ThreatLevelPlayer = ThreatLevelPlayer } )
|
||||
|
||||
Player.Penalty = Player.Penalty + ThreatPenalty
|
||||
TargetDestroy.Penalty = TargetDestroy.Penalty + ThreatPenalty
|
||||
@@ -1267,7 +1267,7 @@ function SCORING:_EventOnDeadOrCrash( Event )
|
||||
local ThreatLevelPlayer = Player.ThreatLevel / 10 + 1
|
||||
local ThreatScore = math.ceil( ( ThreatLevelTarget / ThreatLevelPlayer ) * self.ScaleDestroyScore / 10 )
|
||||
|
||||
self:E( { ThreatLevel = ThreatScore, ThreatLevelTarget = ThreatLevelTarget, ThreatTypeTarget = ThreatTypeTarget, ThreatLevelPlayer = ThreatLevelPlayer } )
|
||||
self:F( { ThreatLevel = ThreatScore, ThreatLevelTarget = ThreatLevelTarget, ThreatTypeTarget = ThreatTypeTarget, ThreatLevelPlayer = ThreatLevelPlayer } )
|
||||
|
||||
Player.Score = Player.Score + ThreatScore
|
||||
TargetDestroy.Score = TargetDestroy.Score + ThreatScore
|
||||
@@ -1312,7 +1312,7 @@ function SCORING:_EventOnDeadOrCrash( Event )
|
||||
|
||||
-- Check if there are Zones where the destruction happened.
|
||||
for ZoneName, ScoreZoneData in pairs( self.ScoringZones ) do
|
||||
self:E( { ScoringZone = ScoreZoneData } )
|
||||
self:F( { ScoringZone = ScoreZoneData } )
|
||||
local ScoreZone = ScoreZoneData.ScoreZone -- Core.Zone#ZONE_BASE
|
||||
local Score = ScoreZoneData.Score
|
||||
if ScoreZone:IsVec2InZone( TargetUnit:GetVec2() ) then
|
||||
@@ -1334,7 +1334,7 @@ function SCORING:_EventOnDeadOrCrash( Event )
|
||||
else
|
||||
-- Check if there are Zones where the destruction happened.
|
||||
for ZoneName, ScoreZoneData in pairs( self.ScoringZones ) do
|
||||
self:E( { ScoringZone = ScoreZoneData } )
|
||||
self:F( { ScoringZone = ScoreZoneData } )
|
||||
local ScoreZone = ScoreZoneData.ScoreZone -- Core.Zone#ZONE_BASE
|
||||
local Score = ScoreZoneData.Score
|
||||
if ScoreZone:IsVec2InZone( TargetUnit:GetVec2() ) then
|
||||
@@ -1449,7 +1449,7 @@ function SCORING:ReportDetailedPlayerDestroys( PlayerName )
|
||||
local PenaltyDestroy = 0
|
||||
|
||||
for UnitName, UnitData in pairs( PlayerData.Destroy[CategoryID] ) do
|
||||
self:E( { UnitData = UnitData } )
|
||||
self:F( { UnitData = UnitData } )
|
||||
if UnitData ~= {} then
|
||||
Score = Score + UnitData.Score
|
||||
ScoreDestroy = ScoreDestroy + UnitData.ScoreDestroy
|
||||
@@ -1603,23 +1603,23 @@ function SCORING:ReportScoreGroupSummary( PlayerGroup )
|
||||
|
||||
local ReportHits, ScoreHits, PenaltyHits = self:ReportDetailedPlayerHits( PlayerName )
|
||||
ReportHits = ReportHits ~= "" and "\n- " .. ReportHits or ReportHits
|
||||
self:E( { ReportHits, ScoreHits, PenaltyHits } )
|
||||
self:F( { ReportHits, ScoreHits, PenaltyHits } )
|
||||
|
||||
local ReportDestroys, ScoreDestroys, PenaltyDestroys = self:ReportDetailedPlayerDestroys( PlayerName )
|
||||
ReportDestroys = ReportDestroys ~= "" and "\n- " .. ReportDestroys or ReportDestroys
|
||||
self:E( { ReportDestroys, ScoreDestroys, PenaltyDestroys } )
|
||||
self:F( { ReportDestroys, ScoreDestroys, PenaltyDestroys } )
|
||||
|
||||
local ReportCoalitionChanges, ScoreCoalitionChanges, PenaltyCoalitionChanges = self:ReportDetailedPlayerCoalitionChanges( PlayerName )
|
||||
ReportCoalitionChanges = ReportCoalitionChanges ~= "" and "\n- " .. ReportCoalitionChanges or ReportCoalitionChanges
|
||||
self:E( { ReportCoalitionChanges, ScoreCoalitionChanges, PenaltyCoalitionChanges } )
|
||||
self:F( { ReportCoalitionChanges, ScoreCoalitionChanges, PenaltyCoalitionChanges } )
|
||||
|
||||
local ReportGoals, ScoreGoals, PenaltyGoals = self:ReportDetailedPlayerGoals( PlayerName )
|
||||
ReportGoals = ReportGoals ~= "" and "\n- " .. ReportGoals or ReportGoals
|
||||
self:E( { ReportGoals, ScoreGoals, PenaltyGoals } )
|
||||
self:F( { ReportGoals, ScoreGoals, PenaltyGoals } )
|
||||
|
||||
local ReportMissions, ScoreMissions, PenaltyMissions = self:ReportDetailedPlayerMissions( PlayerName )
|
||||
ReportMissions = ReportMissions ~= "" and "\n- " .. ReportMissions or ReportMissions
|
||||
self:E( { ReportMissions, ScoreMissions, PenaltyMissions } )
|
||||
self:F( { ReportMissions, ScoreMissions, PenaltyMissions } )
|
||||
|
||||
local PlayerScore = ScoreHits + ScoreDestroys + ScoreCoalitionChanges + ScoreGoals + ScoreMissions
|
||||
local PlayerPenalty = PenaltyHits + PenaltyDestroys + PenaltyCoalitionChanges + ScoreGoals + PenaltyMissions
|
||||
@@ -1655,23 +1655,23 @@ function SCORING:ReportScoreGroupDetailed( PlayerGroup )
|
||||
|
||||
local ReportHits, ScoreHits, PenaltyHits = self:ReportDetailedPlayerHits( PlayerName )
|
||||
ReportHits = ReportHits ~= "" and "\n- " .. ReportHits or ReportHits
|
||||
self:E( { ReportHits, ScoreHits, PenaltyHits } )
|
||||
self:F( { ReportHits, ScoreHits, PenaltyHits } )
|
||||
|
||||
local ReportDestroys, ScoreDestroys, PenaltyDestroys = self:ReportDetailedPlayerDestroys( PlayerName )
|
||||
ReportDestroys = ReportDestroys ~= "" and "\n- " .. ReportDestroys or ReportDestroys
|
||||
self:E( { ReportDestroys, ScoreDestroys, PenaltyDestroys } )
|
||||
self:F( { ReportDestroys, ScoreDestroys, PenaltyDestroys } )
|
||||
|
||||
local ReportCoalitionChanges, ScoreCoalitionChanges, PenaltyCoalitionChanges = self:ReportDetailedPlayerCoalitionChanges( PlayerName )
|
||||
ReportCoalitionChanges = ReportCoalitionChanges ~= "" and "\n- " .. ReportCoalitionChanges or ReportCoalitionChanges
|
||||
self:E( { ReportCoalitionChanges, ScoreCoalitionChanges, PenaltyCoalitionChanges } )
|
||||
self:F( { ReportCoalitionChanges, ScoreCoalitionChanges, PenaltyCoalitionChanges } )
|
||||
|
||||
local ReportGoals, ScoreGoals, PenaltyGoals = self:ReportDetailedPlayerGoals( PlayerName )
|
||||
ReportGoals = ReportGoals ~= "" and "\n- " .. ReportGoals or ReportGoals
|
||||
self:E( { ReportGoals, ScoreGoals, PenaltyGoals } )
|
||||
self:F( { ReportGoals, ScoreGoals, PenaltyGoals } )
|
||||
|
||||
local ReportMissions, ScoreMissions, PenaltyMissions = self:ReportDetailedPlayerMissions( PlayerName )
|
||||
ReportMissions = ReportMissions ~= "" and "\n- " .. ReportMissions or ReportMissions
|
||||
self:E( { ReportMissions, ScoreMissions, PenaltyMissions } )
|
||||
self:F( { ReportMissions, ScoreMissions, PenaltyMissions } )
|
||||
|
||||
local PlayerScore = ScoreHits + ScoreDestroys + ScoreCoalitionChanges + ScoreGoals + ScoreMissions
|
||||
local PlayerPenalty = PenaltyHits + PenaltyDestroys + PenaltyCoalitionChanges + ScoreGoals + PenaltyMissions
|
||||
@@ -1711,23 +1711,23 @@ function SCORING:ReportScoreAllSummary( PlayerGroup )
|
||||
|
||||
local ReportHits, ScoreHits, PenaltyHits = self:ReportDetailedPlayerHits( PlayerName )
|
||||
ReportHits = ReportHits ~= "" and "\n- " .. ReportHits or ReportHits
|
||||
self:E( { ReportHits, ScoreHits, PenaltyHits } )
|
||||
self:F( { ReportHits, ScoreHits, PenaltyHits } )
|
||||
|
||||
local ReportDestroys, ScoreDestroys, PenaltyDestroys = self:ReportDetailedPlayerDestroys( PlayerName )
|
||||
ReportDestroys = ReportDestroys ~= "" and "\n- " .. ReportDestroys or ReportDestroys
|
||||
self:E( { ReportDestroys, ScoreDestroys, PenaltyDestroys } )
|
||||
self:F( { ReportDestroys, ScoreDestroys, PenaltyDestroys } )
|
||||
|
||||
local ReportCoalitionChanges, ScoreCoalitionChanges, PenaltyCoalitionChanges = self:ReportDetailedPlayerCoalitionChanges( PlayerName )
|
||||
ReportCoalitionChanges = ReportCoalitionChanges ~= "" and "\n- " .. ReportCoalitionChanges or ReportCoalitionChanges
|
||||
self:E( { ReportCoalitionChanges, ScoreCoalitionChanges, PenaltyCoalitionChanges } )
|
||||
self:F( { ReportCoalitionChanges, ScoreCoalitionChanges, PenaltyCoalitionChanges } )
|
||||
|
||||
local ReportGoals, ScoreGoals, PenaltyGoals = self:ReportDetailedPlayerGoals( PlayerName )
|
||||
ReportGoals = ReportGoals ~= "" and "\n- " .. ReportGoals or ReportGoals
|
||||
self:E( { ReportGoals, ScoreGoals, PenaltyGoals } )
|
||||
self:F( { ReportGoals, ScoreGoals, PenaltyGoals } )
|
||||
|
||||
local ReportMissions, ScoreMissions, PenaltyMissions = self:ReportDetailedPlayerMissions( PlayerName )
|
||||
ReportMissions = ReportMissions ~= "" and "\n- " .. ReportMissions or ReportMissions
|
||||
self:E( { ReportMissions, ScoreMissions, PenaltyMissions } )
|
||||
self:F( { ReportMissions, ScoreMissions, PenaltyMissions } )
|
||||
|
||||
local PlayerScore = ScoreHits + ScoreDestroys + ScoreCoalitionChanges + ScoreGoals + ScoreMissions
|
||||
local PlayerPenalty = PenaltyHits + PenaltyDestroys + PenaltyCoalitionChanges + ScoreGoals + PenaltyMissions
|
||||
@@ -1787,7 +1787,7 @@ function SCORING:OpenCSV( ScoringCSV )
|
||||
error( "A string containing the CSV file name must be given." )
|
||||
end
|
||||
else
|
||||
self:E( "The MissionScripting.lua file has not been changed to allow lfs, io and os modules to be used..." )
|
||||
self:F( "The MissionScripting.lua file has not been changed to allow lfs, io and os modules to be used..." )
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
@@ -285,7 +285,7 @@ do -- ZONE_CAPTURE_COALITION
|
||||
function ZONE_CAPTURE_COALITION:IsGuarded()
|
||||
|
||||
local IsGuarded = self.Zone:IsAllInZoneOfCoalition( self.Coalition )
|
||||
self:E( { IsGuarded = IsGuarded } )
|
||||
self:F( { IsGuarded = IsGuarded } )
|
||||
return IsGuarded
|
||||
end
|
||||
|
||||
@@ -293,7 +293,7 @@ do -- ZONE_CAPTURE_COALITION
|
||||
function ZONE_CAPTURE_COALITION:IsEmpty()
|
||||
|
||||
local IsEmpty = self.Zone:IsNoneInZone()
|
||||
self:E( { IsEmpty = IsEmpty } )
|
||||
self:F( { IsEmpty = IsEmpty } )
|
||||
return IsEmpty
|
||||
end
|
||||
|
||||
@@ -301,7 +301,7 @@ do -- ZONE_CAPTURE_COALITION
|
||||
function ZONE_CAPTURE_COALITION:IsCaptured()
|
||||
|
||||
local IsCaptured = self.Zone:IsAllInZoneOfOtherCoalition( self.Coalition )
|
||||
self:E( { IsCaptured = IsCaptured } )
|
||||
self:F( { IsCaptured = IsCaptured } )
|
||||
return IsCaptured
|
||||
end
|
||||
|
||||
@@ -309,7 +309,7 @@ do -- ZONE_CAPTURE_COALITION
|
||||
function ZONE_CAPTURE_COALITION:IsAttacked()
|
||||
|
||||
local IsAttacked = self.Zone:IsSomeInZoneOfCoalition( self.Coalition )
|
||||
self:E( { IsAttacked = IsAttacked } )
|
||||
self:F( { IsAttacked = IsAttacked } )
|
||||
return IsAttacked
|
||||
end
|
||||
|
||||
@@ -324,7 +324,7 @@ do -- ZONE_CAPTURE_COALITION
|
||||
local State = self:GetState()
|
||||
|
||||
if self.MarkRed and self.MarkBlue then
|
||||
self:E( { MarkRed = self.MarkRed, MarkBlue = self.MarkBlue } )
|
||||
self:F( { MarkRed = self.MarkRed, MarkBlue = self.MarkBlue } )
|
||||
Coord:RemoveMark( self.MarkRed )
|
||||
Coord:RemoveMark( self.MarkBlue )
|
||||
end
|
||||
@@ -359,7 +359,7 @@ do -- ZONE_CAPTURE_COALITION
|
||||
--self:GetParent( self ):onenterCaptured()
|
||||
|
||||
local NewCoalition = self.Zone:GetScannedCoalition()
|
||||
self:E( { NewCoalition = NewCoalition } )
|
||||
self:F( { NewCoalition = NewCoalition } )
|
||||
self:SetCoalition( NewCoalition )
|
||||
|
||||
self:Mark()
|
||||
@@ -386,7 +386,7 @@ do -- ZONE_CAPTURE_COALITION
|
||||
-- @param #ZONE_CAPTURE_COALITION self
|
||||
function ZONE_CAPTURE_COALITION:onafterGuard()
|
||||
|
||||
--self:E({BASE:GetParent( self )})
|
||||
--self:F({BASE:GetParent( self )})
|
||||
--BASE:GetParent( self ).onafterGuard( self )
|
||||
|
||||
if not self.SmokeScheduler then
|
||||
@@ -398,7 +398,7 @@ do -- ZONE_CAPTURE_COALITION
|
||||
function ZONE_CAPTURE_COALITION:IsCaptured()
|
||||
|
||||
local IsCaptured = self.Zone:IsAllInZoneOfOtherCoalition( self.Coalition )
|
||||
self:E( { IsCaptured = IsCaptured } )
|
||||
self:F( { IsCaptured = IsCaptured } )
|
||||
return IsCaptured
|
||||
end
|
||||
|
||||
@@ -406,7 +406,7 @@ do -- ZONE_CAPTURE_COALITION
|
||||
function ZONE_CAPTURE_COALITION:IsAttacked()
|
||||
|
||||
local IsAttacked = self.Zone:IsSomeInZoneOfCoalition( self.Coalition )
|
||||
self:E( { IsAttacked = IsAttacked } )
|
||||
self:F( { IsAttacked = IsAttacked } )
|
||||
return IsAttacked
|
||||
end
|
||||
|
||||
@@ -416,7 +416,7 @@ do -- ZONE_CAPTURE_COALITION
|
||||
function ZONE_CAPTURE_COALITION:StatusZone()
|
||||
|
||||
local State = self:GetState()
|
||||
self:E( { State = self:GetState() } )
|
||||
self:F( { State = self:GetState() } )
|
||||
|
||||
self:GetParent( self, ZONE_CAPTURE_COALITION ).StatusZone( self )
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ do -- Zone
|
||||
|
||||
--self:GetParent( self ):onafterStart()
|
||||
|
||||
self:E("Guard")
|
||||
self:F("Guard")
|
||||
|
||||
--self:ScheduleRepeat( 15, 15, 0.1, nil, self.StatusZone, self )
|
||||
if not self.SmokeScheduler then
|
||||
@@ -142,14 +142,14 @@ do -- Zone
|
||||
--- @param #ZONE_GOAL self
|
||||
-- @param Core.Event#EVENTDATA EventData
|
||||
function ZONE_GOAL:__Destroyed( EventData )
|
||||
self:E( { "EventDead", EventData } )
|
||||
self:F( { "EventDead", EventData } )
|
||||
|
||||
self:E( { EventData.IniUnit } )
|
||||
self:F( { EventData.IniUnit } )
|
||||
|
||||
local Vec3 = EventData.IniDCSUnit:getPosition().p
|
||||
self:E( { Vec3 = Vec3 } )
|
||||
self:F( { Vec3 = Vec3 } )
|
||||
local ZoneGoal = self:GetZone()
|
||||
self:E({ZoneGoal})
|
||||
self:F({ZoneGoal})
|
||||
|
||||
if EventData.IniDCSUnit then
|
||||
if ZoneGoal:IsVec3InZone(Vec3) then
|
||||
|
||||
@@ -293,7 +293,7 @@ do -- ZoneGoal
|
||||
function ZONE_GOAL_CARGO:IsGuarded()
|
||||
|
||||
local IsGuarded = self.Zone:IsAllInZoneOfCoalition( self.Coalition )
|
||||
self:E( { IsGuarded = IsGuarded } )
|
||||
self:F( { IsGuarded = IsGuarded } )
|
||||
return IsGuarded
|
||||
end
|
||||
|
||||
@@ -301,7 +301,7 @@ do -- ZoneGoal
|
||||
function ZONE_GOAL_CARGO:IsEmpty()
|
||||
|
||||
local IsEmpty = self.Zone:IsNoneInZone()
|
||||
self:E( { IsEmpty = IsEmpty } )
|
||||
self:F( { IsEmpty = IsEmpty } )
|
||||
return IsEmpty
|
||||
end
|
||||
|
||||
@@ -309,7 +309,7 @@ do -- ZoneGoal
|
||||
function ZONE_GOAL_CARGO:IsCaptured()
|
||||
|
||||
local IsCaptured = self.Zone:IsAllInZoneOfOtherCoalition( self.Coalition )
|
||||
self:E( { IsCaptured = IsCaptured } )
|
||||
self:F( { IsCaptured = IsCaptured } )
|
||||
return IsCaptured
|
||||
end
|
||||
|
||||
@@ -317,7 +317,7 @@ do -- ZoneGoal
|
||||
function ZONE_GOAL_CARGO:IsAttacked()
|
||||
|
||||
local IsAttacked = self.Zone:IsSomeInZoneOfCoalition( self.Coalition )
|
||||
self:E( { IsAttacked = IsAttacked } )
|
||||
self:F( { IsAttacked = IsAttacked } )
|
||||
return IsAttacked
|
||||
end
|
||||
|
||||
@@ -332,7 +332,7 @@ do -- ZoneGoal
|
||||
local State = self:GetState()
|
||||
|
||||
if self.MarkRed and self.MarkBlue then
|
||||
self:E( { MarkRed = self.MarkRed, MarkBlue = self.MarkBlue } )
|
||||
self:F( { MarkRed = self.MarkRed, MarkBlue = self.MarkBlue } )
|
||||
Coord:RemoveMark( self.MarkRed )
|
||||
Coord:RemoveMark( self.MarkBlue )
|
||||
end
|
||||
@@ -367,7 +367,7 @@ do -- ZoneGoal
|
||||
--self:GetParent( self ):onenterCaptured()
|
||||
|
||||
local NewCoalition = self.Zone:GetCoalition()
|
||||
self:E( { NewCoalition = NewCoalition } )
|
||||
self:F( { NewCoalition = NewCoalition } )
|
||||
self:SetCoalition( NewCoalition )
|
||||
|
||||
self:Mark()
|
||||
@@ -394,7 +394,7 @@ do -- ZoneGoal
|
||||
-- @param #ZONE_GOAL_CARGO self
|
||||
function ZONE_GOAL_CARGO:onafterGuard()
|
||||
|
||||
--self:E({BASE:GetParent( self )})
|
||||
--self:F({BASE:GetParent( self )})
|
||||
--BASE:GetParent( self ).onafterGuard( self )
|
||||
|
||||
if not self.SmokeScheduler then
|
||||
@@ -409,7 +409,7 @@ do -- ZoneGoal
|
||||
function ZONE_GOAL_CARGO:IsCaptured()
|
||||
|
||||
local IsCaptured = self.Zone:IsAllInZoneOfOtherCoalition( self.Coalition )
|
||||
self:E( { IsCaptured = IsCaptured } )
|
||||
self:F( { IsCaptured = IsCaptured } )
|
||||
return IsCaptured
|
||||
end
|
||||
|
||||
@@ -417,7 +417,7 @@ do -- ZoneGoal
|
||||
function ZONE_GOAL_CARGO:IsAttacked()
|
||||
|
||||
local IsAttacked = self.Zone:IsSomeInZoneOfCoalition( self.Coalition )
|
||||
self:E( { IsAttacked = IsAttacked } )
|
||||
self:F( { IsAttacked = IsAttacked } )
|
||||
return IsAttacked
|
||||
end
|
||||
|
||||
@@ -426,7 +426,7 @@ do -- ZoneGoal
|
||||
function ZONE_GOAL_CARGO:StatusZone()
|
||||
|
||||
local State = self:GetState()
|
||||
self:E( { State = self:GetState() } )
|
||||
self:F( { State = self:GetState() } )
|
||||
|
||||
self.Zone:Scan()
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ do -- ZoneGoal
|
||||
function ZONE_GOAL_COALITION:StatusZone()
|
||||
|
||||
local State = self:GetState()
|
||||
self:E( { State = self:GetState() } )
|
||||
self:F( { State = self:GetState() } )
|
||||
|
||||
self.Zone:Scan( { Object.Category.UNIT, Object.Category.STATIC } )
|
||||
|
||||
|
||||
Reference in New Issue
Block a user