mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge branch 'develop'
This commit is contained in:
commit
5bccd2c6c9
@ -796,10 +796,17 @@ do -- AI_A2A_DISPATCHER
|
|||||||
--
|
--
|
||||||
-- Use the method @{#AI_A2A_DISPATCHER.SetDisengageRadius}() to modify the default Disengage Radius to another distance setting.
|
-- Use the method @{#AI_A2A_DISPATCHER.SetDisengageRadius}() to modify the default Disengage Radius to another distance setting.
|
||||||
--
|
--
|
||||||
|
-- ## 11. Airbase capture:
|
||||||
--
|
--
|
||||||
-- ## 11. Q & A:
|
-- Different squadrons can be located at one airbase.
|
||||||
|
-- If the airbase gets captured, that is, when there is an enemy unit near the airbase, and there aren't anymore friendlies at the airbase, the airbase will change coalition ownership.
|
||||||
|
-- As a result, the GCI and CAP will stop!
|
||||||
|
-- However, the squadron will still stay alive. Any airplane that is airborne will continue its operations until all airborne airplanes
|
||||||
|
-- of the squadron will be destroyed. This to keep consistency of air operations not to confuse the players.
|
||||||
--
|
--
|
||||||
-- ### 11.1. Which countries will be selected for each coalition?
|
-- ## 12. Q & A:
|
||||||
|
--
|
||||||
|
-- ### 12.1. Which countries will be selected for each coalition?
|
||||||
--
|
--
|
||||||
-- Which countries are assigned to a coalition influences which units are available to the coalition.
|
-- Which countries are assigned to a coalition influences which units are available to the coalition.
|
||||||
-- For example because the mission calls for a EWR radar on the blue side the Ukraine might be chosen as a blue country
|
-- For example because the mission calls for a EWR radar on the blue side the Ukraine might be chosen as a blue country
|
||||||
@ -807,7 +814,7 @@ do -- AI_A2A_DISPATCHER
|
|||||||
-- Some countries assign different tasking to aircraft, for example Germany assigns the CAP task to F-4E Phantoms but the USA does not.
|
-- Some countries assign different tasking to aircraft, for example Germany assigns the CAP task to F-4E Phantoms but the USA does not.
|
||||||
-- Therefore if F4s are wanted as a coalition's CAP or GCI aircraft Germany will need to be assigned to that coalition.
|
-- Therefore if F4s are wanted as a coalition's CAP or GCI aircraft Germany will need to be assigned to that coalition.
|
||||||
--
|
--
|
||||||
-- ### 11.2. Country, type, load out, skill and skins for CAP and GCI aircraft?
|
-- ### 12.2. Country, type, load out, skill and skins for CAP and GCI aircraft?
|
||||||
--
|
--
|
||||||
-- * Note these can be from any countries within the coalition but must be an aircraft with one of the main tasks being "CAP".
|
-- * Note these can be from any countries within the coalition but must be an aircraft with one of the main tasks being "CAP".
|
||||||
-- * Obviously skins which are selected must be available to all players that join the mission otherwise they will see a default skin.
|
-- * Obviously skins which are selected must be available to all players that join the mission otherwise they will see a default skin.
|
||||||
@ -995,9 +1002,13 @@ do -- AI_A2A_DISPATCHER
|
|||||||
self:HandleEvent( EVENTS.Dead, self.OnEventCrashOrDead )
|
self:HandleEvent( EVENTS.Dead, self.OnEventCrashOrDead )
|
||||||
--self:HandleEvent( EVENTS.RemoveUnit, self.OnEventCrashOrDead )
|
--self:HandleEvent( EVENTS.RemoveUnit, self.OnEventCrashOrDead )
|
||||||
|
|
||||||
|
|
||||||
self:HandleEvent( EVENTS.Land )
|
self:HandleEvent( EVENTS.Land )
|
||||||
self:HandleEvent( EVENTS.EngineShutdown )
|
self:HandleEvent( EVENTS.EngineShutdown )
|
||||||
|
|
||||||
|
-- Handle the situation where the airbases are captured.
|
||||||
|
self:HandleEvent( EVENTS.BaseCaptured )
|
||||||
|
|
||||||
self:SetTacticalDisplay( false )
|
self:SetTacticalDisplay( false )
|
||||||
|
|
||||||
self:__Start( 5 )
|
self:__Start( 5 )
|
||||||
@ -1005,6 +1016,22 @@ do -- AI_A2A_DISPATCHER
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
--- @param #AI_A2A_DISPATCHER self
|
||||||
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
|
function AI_A2A_DISPATCHER:OnEventBaseCaptured( EventData )
|
||||||
|
|
||||||
|
local AirbaseName = EventData.PlaceName -- The name of the airbase that was captured.
|
||||||
|
|
||||||
|
-- Now search for all squadrons located at the airbase, and sanatize them.
|
||||||
|
for SquadronName, Squadron in pairs( self.DefenderSquadrons ) do
|
||||||
|
if Squadron.AirbaseName == AirbaseName then
|
||||||
|
Squadron.Resources = -999 -- The base has been captured, and the resources are eliminated. No more spawning.
|
||||||
|
Squadron.Captured = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
--- @param #AI_A2A_DISPATCHER self
|
--- @param #AI_A2A_DISPATCHER self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
function AI_A2A_DISPATCHER:OnEventCrashOrDead( EventData )
|
function AI_A2A_DISPATCHER:OnEventCrashOrDead( EventData )
|
||||||
@ -1497,6 +1524,7 @@ do -- AI_A2A_DISPATCHER
|
|||||||
end
|
end
|
||||||
DefenderSquadron.Resources = Resources
|
DefenderSquadron.Resources = Resources
|
||||||
DefenderSquadron.TemplatePrefixes = TemplatePrefixes
|
DefenderSquadron.TemplatePrefixes = TemplatePrefixes
|
||||||
|
DefenderSquadron.Captured = false -- Not captured. This flag will be set to true, when the airbase where the squadron is located, is captured.
|
||||||
|
|
||||||
self:F( { Squadron = {SquadronName, AirbaseName, TemplatePrefixes, Resources } } )
|
self:F( { Squadron = {SquadronName, AirbaseName, TemplatePrefixes, Resources } } )
|
||||||
|
|
||||||
@ -1663,7 +1691,9 @@ do -- AI_A2A_DISPATCHER
|
|||||||
|
|
||||||
local DefenderSquadron = self:GetSquadron( SquadronName )
|
local DefenderSquadron = self:GetSquadron( SquadronName )
|
||||||
|
|
||||||
if ( not DefenderSquadron.Resources ) or ( DefenderSquadron.Resources and DefenderSquadron.Resources > 0 ) then
|
if DefenderSquadron.Captured == false then -- We can only spawn new CAP if the base has not been captured.
|
||||||
|
|
||||||
|
if ( not DefenderSquadron.Resources ) or ( DefenderSquadron.Resources and DefenderSquadron.Resources > 0 ) then -- And, if there are sufficient resources.
|
||||||
|
|
||||||
local Cap = DefenderSquadron.Cap
|
local Cap = DefenderSquadron.Cap
|
||||||
if Cap then
|
if Cap then
|
||||||
@ -1677,6 +1707,7 @@ do -- AI_A2A_DISPATCHER
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1693,12 +1724,15 @@ do -- AI_A2A_DISPATCHER
|
|||||||
|
|
||||||
local DefenderSquadron = self:GetSquadron( SquadronName )
|
local DefenderSquadron = self:GetSquadron( SquadronName )
|
||||||
|
|
||||||
if ( not DefenderSquadron.Resources ) or ( DefenderSquadron.Resources and DefenderSquadron.Resources > 0 ) then
|
if DefenderSquadron.Captured == false then -- We can only spawn new CAP if the base has not been captured.
|
||||||
|
|
||||||
|
if ( not DefenderSquadron.Resources ) or ( DefenderSquadron.Resources and DefenderSquadron.Resources > 0 ) then -- And, if there are sufficient resources.
|
||||||
local Gci = DefenderSquadron.Gci
|
local Gci = DefenderSquadron.Gci
|
||||||
if Gci then
|
if Gci then
|
||||||
return DefenderSquadron
|
return DefenderSquadron
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user