**LEGION**
- Added `Captured` event

**COMMANDER**
- Improved behaviour when legion/warehouse is captured
- Added `LegionLost` event
- Added `RemoveLegion` function

**CHIEF**
- Improved behaviour when legion/warehouse is captured
- Added `LegionLost` event
- Added `RemoveLegion` function
This commit is contained in:
Frank
2022-11-18 19:56:30 +01:00
parent 1256cc3bd1
commit 4124b6d084
3 changed files with 124 additions and 0 deletions

View File

@@ -413,6 +413,8 @@ function CHIEF:New(Coalition, AgentSet, Alias)
self:AddTransition("*", "DefconChange", "*") -- Change defence condition.
self:AddTransition("*", "StrategyChange", "*") -- Change strategy condition.
self:AddTransition("*", "LegionLost", "*") -- Out of our legions was lost to the enemy.
------------------------
--- Pseudo Functions ---
------------------------
@@ -647,6 +649,33 @@ function CHIEF:New(Coalition, AgentSet, Alias)
-- @param #string To To state.
-- @param Ops.OpsZone#OPSZONE OpsZone Zone that is being attacked.
--- Triggers the FSM event "LegionLost".
-- @function [parent=#CHIEF] LegionLost
-- @param #CHIEF self
-- @param Ops.Legion#LEGION Legion The legion that was lost.
-- @param DCS#coalition.side Coalition which captured the warehouse.
-- @param DCS#country.id Country which has captured the warehouse.
--- Triggers the FSM event "LegionLost".
-- @function [parent=#CHIEF] __LegionLost
-- @param #CHIEF self
-- @param #number delay Delay in seconds.
-- @param Ops.Legion#LEGION Legion The legion that was lost.
-- @param DCS#coalition.side Coalition which captured the warehouse.
-- @param DCS#country.id Country which has captured the warehouse.
--- On after "LegionLost" event.
-- @function [parent=#CHIEF] OnAfterLegionLost
-- @param #CHIEF self
-- @param #string From From state.
-- @param #string Event Event.
-- @param #string To To state.
-- @param Ops.Legion#LEGION Legion The legion that was lost.
-- @param DCS#coalition.side Coalition which captured the warehouse.
-- @param DCS#country.id Country which has captured the warehouse.
return self
end
@@ -1115,6 +1144,21 @@ function CHIEF:AddLegion(Legion)
return self
end
--- Remove a LEGION to the chief's commander.
-- @param #CHIEF self
-- @param Ops.Legion#LEGION Legion The legion to add.
-- @return #CHIEF self
function CHIEF:RemoveLegion(Legion)
-- Set chief of the legion.
Legion.chief=nil
-- Add legion to the commander.
self.commander:RemoveLegion(Legion)
return self
end
--- Add mission to mission queue of the COMMANDER.
-- @param #CHIEF self