mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
OPS
- CHIEF: fixed bug in LEGION.RecruitCohortAssets() function call - COMMANDER: added total weight to LEGION.RecruitCohortAssets() function call - POSITIONABLE: fixed bug in relFuel calculation for cargo bay size
This commit is contained in:
parent
ff1ebf9775
commit
5dae9a197a
@ -180,7 +180,7 @@ CHIEF.Strategy = {
|
|||||||
|
|
||||||
--- CHIEF class version.
|
--- CHIEF class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
CHIEF.version="0.1.0"
|
CHIEF.version="0.1.1"
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
-- TODO list
|
-- TODO list
|
||||||
@ -2209,7 +2209,7 @@ function CHIEF:RecruitAssetsForZone(StratZone, MissionType, NassetsMin, NassetsM
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Recruite infantry assets.
|
-- Recruite infantry assets.
|
||||||
local recruited, assets, legions=LEGION.RecruitCohortAssets(Cohorts, MissionType, nil, NassetsMin, NassetsMax, TargetVec2, nil, RangeMax, nil, nil, Categories, Attributes)
|
local recruited, assets, legions=LEGION.RecruitCohortAssets(Cohorts, MissionType, nil, NassetsMin, NassetsMax, TargetVec2, nil, RangeMax, nil, nil, nil, Categories, Attributes)
|
||||||
|
|
||||||
if recruited then
|
if recruited then
|
||||||
|
|
||||||
|
|||||||
@ -132,7 +132,7 @@ COMMANDER = {
|
|||||||
|
|
||||||
--- COMMANDER class version.
|
--- COMMANDER class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
COMMANDER.version="0.1.0"
|
COMMANDER.version="0.1.1"
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
-- TODO list
|
-- TODO list
|
||||||
@ -1190,7 +1190,7 @@ function COMMANDER:RecruitAssetsForMission(Mission)
|
|||||||
local Payloads=Mission.payloads
|
local Payloads=Mission.payloads
|
||||||
|
|
||||||
-- Recruite assets.
|
-- Recruite assets.
|
||||||
local recruited, assets, legions=LEGION.RecruitCohortAssets(Cohorts, Mission.type, Mission.alert5MissionType, NreqMin, NreqMax, TargetVec2, Payloads, Mission.engageRange, Mission.refuelSystem, nil)
|
local recruited, assets, legions=LEGION.RecruitCohortAssets(Cohorts, Mission.type, Mission.alert5MissionType, NreqMin, NreqMax, TargetVec2, Payloads, Mission.engageRange, Mission.refuelSystem)
|
||||||
|
|
||||||
return recruited, assets, legions
|
return recruited, assets, legions
|
||||||
end
|
end
|
||||||
@ -1292,6 +1292,7 @@ function COMMANDER:CheckTransportQueue()
|
|||||||
|
|
||||||
-- Weight of the heaviest cargo group. Necessary condition that this fits into on carrier unit!
|
-- Weight of the heaviest cargo group. Necessary condition that this fits into on carrier unit!
|
||||||
local weightGroup=0
|
local weightGroup=0
|
||||||
|
local TotalWeight=0
|
||||||
|
|
||||||
-- Calculate the max weight so we know which cohorts can provide carriers.
|
-- Calculate the max weight so we know which cohorts can provide carriers.
|
||||||
if #cargoOpsGroups>0 then
|
if #cargoOpsGroups>0 then
|
||||||
@ -1301,13 +1302,14 @@ function COMMANDER:CheckTransportQueue()
|
|||||||
if weight>weightGroup then
|
if weight>weightGroup then
|
||||||
weightGroup=weight
|
weightGroup=weight
|
||||||
end
|
end
|
||||||
|
TotalWeight=TotalWeight+weight
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if weightGroup>0 then
|
if weightGroup>0 then
|
||||||
|
|
||||||
-- Recruite assets from legions.
|
-- Recruite assets from legions.
|
||||||
local recruited, assets, legions=self:RecruitAssetsForTransport(transport, weightGroup)
|
local recruited, assets, legions=self:RecruitAssetsForTransport(transport, weightGroup, TotalWeight)
|
||||||
|
|
||||||
if recruited then
|
if recruited then
|
||||||
|
|
||||||
@ -1344,10 +1346,12 @@ end
|
|||||||
--- Recruit assets for a given OPS transport.
|
--- Recruit assets for a given OPS transport.
|
||||||
-- @param #COMMANDER self
|
-- @param #COMMANDER self
|
||||||
-- @param Ops.OpsTransport#OPSTRANSPORT Transport The OPS transport.
|
-- @param Ops.OpsTransport#OPSTRANSPORT Transport The OPS transport.
|
||||||
|
-- @param #number CargoWeight Weight of the heaviest cargo group.
|
||||||
|
-- @param #number TotalWeight Total weight of all cargo groups.
|
||||||
-- @return #boolean If `true`, enough assets could be recruited.
|
-- @return #boolean If `true`, enough assets could be recruited.
|
||||||
-- @return #table Recruited assets.
|
-- @return #table Recruited assets.
|
||||||
-- @return #table Legions that have recruited assets.
|
-- @return #table Legions that have recruited assets.
|
||||||
function COMMANDER:RecruitAssetsForTransport(Transport, CargoWeight)
|
function COMMANDER:RecruitAssetsForTransport(Transport, CargoWeight, TotalWeight)
|
||||||
|
|
||||||
if CargoWeight==0 then
|
if CargoWeight==0 then
|
||||||
-- No cargo groups!
|
-- No cargo groups!
|
||||||
@ -1381,7 +1385,7 @@ function COMMANDER:RecruitAssetsForTransport(Transport, CargoWeight)
|
|||||||
local NreqMin,NreqMax=Transport:GetRequiredCarriers()
|
local NreqMin,NreqMax=Transport:GetRequiredCarriers()
|
||||||
|
|
||||||
-- Recruit assets and legions.
|
-- Recruit assets and legions.
|
||||||
local recruited, assets, legions=LEGION.RecruitCohortAssets(Cohorts, AUFTRAG.Type.OPSTRANSPORT, nil, NreqMin, NreqMax, TargetVec2, nil, nil, nil, CargoWeight)
|
local recruited, assets, legions=LEGION.RecruitCohortAssets(Cohorts, AUFTRAG.Type.OPSTRANSPORT, nil, NreqMin, NreqMax, TargetVec2, nil, nil, nil, CargoWeight, TotalWeight)
|
||||||
|
|
||||||
return recruited, assets, legions
|
return recruited, assets, legions
|
||||||
end
|
end
|
||||||
|
|||||||
@ -541,6 +541,9 @@ function OPSGROUP:New(group)
|
|||||||
else
|
else
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Set gen attribute.
|
||||||
|
self.attribute=self.group:GetAttribute()
|
||||||
|
|
||||||
local units=self.group:GetUnits()
|
local units=self.group:GetUnits()
|
||||||
|
|
||||||
@ -864,6 +867,12 @@ function OPSGROUP:GetLifePoints(Element)
|
|||||||
return life, life0
|
return life, life0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Get generalized attribute.
|
||||||
|
-- @param #OPSGROUP self
|
||||||
|
-- @return #string Generalized attribute.
|
||||||
|
function OPSGROUP:GetAttribute()
|
||||||
|
return self.attribute
|
||||||
|
end
|
||||||
|
|
||||||
--- Set verbosity level.
|
--- Set verbosity level.
|
||||||
-- @param #OPSGROUP self
|
-- @param #OPSGROUP self
|
||||||
|
|||||||
@ -1494,7 +1494,7 @@ do -- Cargo
|
|||||||
|
|
||||||
-- Fuel. The descriptor provides the max fuel mass in kg. This needs to be multiplied by the relative fuel amount to calculate the actual fuel mass on board.
|
-- Fuel. The descriptor provides the max fuel mass in kg. This needs to be multiplied by the relative fuel amount to calculate the actual fuel mass on board.
|
||||||
local massFuelMax=Desc.fuelMassMax or 0
|
local massFuelMax=Desc.fuelMassMax or 0
|
||||||
local relFuel=math.max(self:GetFuel() or 1.0, 1.0) -- We take 1.0 as max in case of external fuel tanks.
|
local relFuel=math.min(self:GetFuel() or 1.0, 1.0) -- We take 1.0 as max in case of external fuel tanks.
|
||||||
local massFuel=massFuelMax*relFuel
|
local massFuel=massFuelMax*relFuel
|
||||||
|
|
||||||
-- Number of soldiers according to DCS function
|
-- Number of soldiers according to DCS function
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user