This commit is contained in:
FlightControl
2019-06-17 20:25:50 +03:00
parent 6a1bf50700
commit 9c523cad52
2 changed files with 112 additions and 71 deletions

View File

@@ -143,6 +143,8 @@ AI_FORMATION.__Enum.Formation = {
AI_FORMATION.__Enum.Mode = {
Mission = 0,
Formation = 1,
Attack = 2,
Reconnaissance = 3,
}
@@ -958,11 +960,13 @@ end
function AI_FORMATION:ModeMission( FollowGroup )
if FollowGroup then
FollowGroup:SetState( FollowGroup, "PreviousMode", FollowGroup:GetState( FollowGroup, "Mode" ) )
FollowGroup:SetState( FollowGroup, "Mode", self.__Enum.Mode.Mission )
else
self.EscortGroupSet:ForSomeGroupAlive(
--- @param Core.Group#GROUP EscortGroup
function( FollowGroup )
FollowGroup:SetState( FollowGroup, "PreviousMode", FollowGroup:GetState( FollowGroup, "Mode" ) )
FollowGroup:SetState( FollowGroup, "Mode", self.__Enum.Mode.Mission )
end
)
@@ -973,6 +977,30 @@ function AI_FORMATION:ModeMission( FollowGroup )
end
--- This sets your escorts to execute an attack.
-- @param #AI_FORMATION self
-- @param Wrapper.Group#GROUP FollowGroup FollowGroup.
-- @return #AI_FORMATION
function AI_FORMATION:ModeAttack( FollowGroup )
if FollowGroup then
FollowGroup:SetState( FollowGroup, "PreviousMode", FollowGroup:GetState( FollowGroup, "Mode" ) )
FollowGroup:SetState( FollowGroup, "Mode", self.__Enum.Mode.Attack )
else
self.EscortGroupSet:ForSomeGroupAlive(
--- @param Core.Group#GROUP EscortGroup
function( FollowGroup )
FollowGroup:SetState( FollowGroup, "PreviousMode", FollowGroup:GetState( FollowGroup, "Mode" ) )
FollowGroup:SetState( FollowGroup, "Mode", self.__Enum.Mode.Attack )
end
)
end
return self
end
--- This sets your escorts to fly in a formation.
-- @param #AI_FORMATION self
-- @param Wrapper.Group#GROUP FollowGroup FollowGroup.
@@ -980,11 +1008,13 @@ end
function AI_FORMATION:ModeFormation( FollowGroup )
if FollowGroup then
FollowGroup:SetState( FollowGroup, "PreviousMode", FollowGroup:GetState( FollowGroup, "Mode" ) )
FollowGroup:SetState( FollowGroup, "Mode", self.__Enum.Mode.Formation )
else
self.EscortGroupSet:ForSomeGroupAlive(
--- @param Core.Group#GROUP EscortGroup
function( FollowGroup )
FollowGroup:SetState( FollowGroup, "PreviousMode", FollowGroup:GetState( FollowGroup, "Mode" ) )
FollowGroup:SetState( FollowGroup, "Mode", self.__Enum.Mode.Formation )
end
)
@@ -1047,6 +1077,8 @@ function AI_FORMATION:onenterFollowing( FollowGroupSet ) --R2.1
-- @param Wrapper.Unit#UNIT ClientUnit
function( FollowGroup, Formation, ClientUnit, CT1, CV1, CT2, CV2 )
self:I({Mode=FollowGroup:GetState( FollowGroup, "Mode" )})
if FollowGroup:GetState( FollowGroup, "Mode" ) == self.__Enum.Mode.Formation then
FollowGroup:OptionROTEvadeFire()