mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Progress
This commit is contained in:
parent
cafcbfde90
commit
c6e86c494d
@ -167,6 +167,7 @@ function PROTECT:IsEmpty()
|
|||||||
return IsEmpty
|
return IsEmpty
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Check if the units are still alive.
|
--- Check if the units are still alive.
|
||||||
-- @param #PROTECT self
|
-- @param #PROTECT self
|
||||||
function PROTECT:AreProtectUnitsAlive()
|
function PROTECT:AreProtectUnitsAlive()
|
||||||
@ -241,18 +242,37 @@ function PROTECT:Flare( FlareColor )
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
--- Mark.
|
||||||
|
-- @param #PROTECT self
|
||||||
|
function PROTECT:Mark()
|
||||||
|
|
||||||
|
local Coord = self.ProtectZone:GetCoordinate()
|
||||||
|
local ZoneName = self:GetProtectZoneName()
|
||||||
|
local State = self:GetState()
|
||||||
|
|
||||||
|
if self.MarkRed and self.MarkBlue then
|
||||||
|
self:E( { MarkRed = self.MarkRed, MarkBlue = self.MarkBlue } )
|
||||||
|
Coord:RemoveMark( self.MarkRed )
|
||||||
|
Coord:RemoveMark( self.MarkBlue )
|
||||||
|
end
|
||||||
|
|
||||||
|
if self.Coalition == coalition.side.BLUE then
|
||||||
|
self.MarkBlue = Coord:MarkToCoalitionBlue( "Protect Zone: " .. ZoneName .. "\nStatus: " .. State )
|
||||||
|
self.MarkRed = Coord:MarkToCoalitionRed( "Capture Zone: " .. ZoneName .. "\nStatus: " .. State )
|
||||||
|
else
|
||||||
|
self.MarkRed = Coord:MarkToCoalitionRed( "Protect Zone: " .. ZoneName .. "\nStatus: " .. State )
|
||||||
|
self.MarkBlue = Coord:MarkToCoalitionBlue( "Capture Zone: " .. ZoneName .. "\nStatus: " .. State )
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Bound.
|
--- Bound.
|
||||||
-- @param #PROTECT self
|
-- @param #PROTECT self
|
||||||
function PROTECT:onafterStart()
|
function PROTECT:onafterStart()
|
||||||
|
|
||||||
self:E()
|
|
||||||
|
|
||||||
self:ScheduleRepeat( 5, 15, 0.1, nil, self.StatusCoalition, self )
|
self:ScheduleRepeat( 5, 15, 0.1, nil, self.StatusCoalition, self )
|
||||||
|
|
||||||
self:ScheduleRepeat( 5, 15, 0.1, nil, self.StatusZone, self )
|
self:ScheduleRepeat( 5, 15, 0.1, nil, self.StatusZone, self )
|
||||||
|
|
||||||
self:ScheduleRepeat( 10, 15, 0, nil, self.StatusSmoke, self )
|
self:ScheduleRepeat( 10, 15, 0, nil, self.StatusSmoke, self )
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Bound.
|
--- Bound.
|
||||||
@ -265,6 +285,9 @@ function PROTECT:onenterProtected()
|
|||||||
else
|
else
|
||||||
--self.ProtectZone:BoundZone( 12, country.id.RUSSIA )
|
--self.ProtectZone:BoundZone( 12, country.id.RUSSIA )
|
||||||
end
|
end
|
||||||
|
|
||||||
|
self:Mark()
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function PROTECT:onenterCaptured()
|
function PROTECT:onenterCaptured()
|
||||||
@ -272,8 +295,23 @@ function PROTECT:onenterCaptured()
|
|||||||
local NewCoalition = self.ProtectZone:GetCoalition()
|
local NewCoalition = self.ProtectZone:GetCoalition()
|
||||||
self:E( { NewCoalition = NewCoalition } )
|
self:E( { NewCoalition = NewCoalition } )
|
||||||
self:SetCoalition( NewCoalition )
|
self:SetCoalition( NewCoalition )
|
||||||
|
|
||||||
|
self:Mark()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function PROTECT:onenterEmpty()
|
||||||
|
|
||||||
|
self:Mark()
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function PROTECT:onenterAttacked()
|
||||||
|
|
||||||
|
self:Mark()
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Check status Coalition ownership.
|
--- Check status Coalition ownership.
|
||||||
-- @param #PROTECT self
|
-- @param #PROTECT self
|
||||||
function PROTECT:StatusCoalition()
|
function PROTECT:StatusCoalition()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user