mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Progress
This commit is contained in:
@@ -175,28 +175,34 @@ function TASK:New( Mission, SetGroupAssign, TaskName, TaskType, TaskBriefing )
|
||||
--- Goal Handler OnBefore for TASK
|
||||
-- @function [parent=#TASK] OnBeforeGoal
|
||||
-- @param #TASK self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable
|
||||
-- @param #string From
|
||||
-- @param #string Event
|
||||
-- @param #string To
|
||||
-- @param Wrapper.Unit#UNIT PlayerUnit The @{Unit} of the player.
|
||||
-- @param #string PlayerName The name of the player.
|
||||
-- @return #boolean
|
||||
|
||||
--- Goal Handler OnAfter for TASK
|
||||
-- @function [parent=#TASK] OnAfterGoal
|
||||
-- @param #TASK self
|
||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable
|
||||
-- @param #string From
|
||||
-- @param #string Event
|
||||
-- @param #string To
|
||||
-- @param Wrapper.Unit#UNIT PlayerUnit The @{Unit} of the player.
|
||||
-- @param #string PlayerName The name of the player.
|
||||
|
||||
--- Goal Trigger for TASK
|
||||
-- @function [parent=#TASK] Goal
|
||||
-- @param #TASK self
|
||||
-- @param Wrapper.Unit#UNIT PlayerUnit The @{Unit} of the player.
|
||||
-- @param #string PlayerName The name of the player.
|
||||
|
||||
--- Goal Asynchronous Trigger for TASK
|
||||
-- @function [parent=#TASK] __Goal
|
||||
-- @param #TASK self
|
||||
-- @param #number Delay
|
||||
-- @param Wrapper.Unit#UNIT PlayerUnit The @{Unit} of the player.
|
||||
-- @param #string PlayerName The name of the player.
|
||||
|
||||
|
||||
|
||||
@@ -1274,7 +1280,7 @@ function TASK:onenterAssigned( From, Event, To, PlayerUnit, PlayerName )
|
||||
self:GetMission():__Start( 1 )
|
||||
|
||||
-- When the task is assigned, the task goal needs to be checked of the derived classes.
|
||||
self:__Goal( -10 ) -- Polymorphic
|
||||
self:__Goal( -10, PlayerUnit, PlayerName ) -- Polymorphic
|
||||
|
||||
self:SetMenu()
|
||||
end
|
||||
|
||||
@@ -193,10 +193,16 @@ do -- TASK_CAPTURE_ZONE
|
||||
|
||||
Mission:AddTask( self )
|
||||
|
||||
self.TaskCoalition = Protect:GetCoalition()
|
||||
self.TaskCoalitionName = Protect:GetCoalitionName()
|
||||
self.TaskZoneName = self.Protect:GetProtectZoneName()
|
||||
|
||||
self:SetBriefing(
|
||||
TaskBriefing or
|
||||
"Capture zone " .. self.Protect:GetProtectZoneName() .. "."
|
||||
"Capture zone " .. self.TaskZoneName .. "."
|
||||
)
|
||||
|
||||
self:UpdateTaskInfo()
|
||||
|
||||
return self
|
||||
end
|
||||
@@ -208,7 +214,8 @@ do -- TASK_CAPTURE_ZONE
|
||||
|
||||
local ZoneCoordinate = self.Protect:GetProtectZone():GetCoordinate()
|
||||
self:SetInfo( "Coordinates", ZoneCoordinate, 0 )
|
||||
|
||||
self:SetInfo( "Zone Name", self.TaskZoneName, 10 )
|
||||
self:SetInfo( "Zone Coalition", self.TaskCoalitionName, 11 )
|
||||
end
|
||||
|
||||
function TASK_CAPTURE_ZONE:ReportOrder( ReportGroup )
|
||||
@@ -221,13 +228,23 @@ do -- TASK_CAPTURE_ZONE
|
||||
|
||||
|
||||
--- @param #TASK_CAPTURE_ZONE self
|
||||
function TASK_CAPTURE_ZONE:onafterGoal( TaskUnit, From, Event, To )
|
||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||
function TASK_CAPTURE_ZONE:OnAfterGoal( From, Event, To, PlayerUnit, PlayerName )
|
||||
|
||||
self:E( { PlayerUnit = PlayerUnit } )
|
||||
|
||||
if self.Protect:IsState( "Captured" ) then
|
||||
self:Success()
|
||||
if self.Protect then
|
||||
local ProtectCoalition = self.Protect:GetCoalition()
|
||||
local TaskCoalition = self.Coalition
|
||||
|
||||
self:E( { ProtectCoalition = ProtectCoalition, TaskCoalition = TaskCoalition } )
|
||||
|
||||
if ProtectCoalition ~= TaskCoalition then
|
||||
self:Success()
|
||||
end
|
||||
end
|
||||
|
||||
self:__Goal( -10 )
|
||||
self:__Goal( -10, PlayerUnit, PlayerName )
|
||||
end
|
||||
|
||||
--- Set a score when a target in scope of the A2G attack, has been destroyed .
|
||||
@@ -277,7 +294,6 @@ do -- TASK_CAPTURE_ZONE
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user