Buildable (#36)
- Buildable missions now working. - FARPS and BLUESAM zones are now buildable. - Secondary Logistics missions are created as buildables become available. - Logistic missions can be "marked" with a MAP marker. - Supplies can only be picked up in a SUPPLYHUB zone. - SUPPLYHUB zones are active once their parents are active. A supplyhub parent can be oneof: FARP, AIRBASE, STAGE. - Required supplies for a zone can be configured in kilos. - Crates can be picked up with 1000 or 2000 kilo per crate. - Max load for a helicopter is set based on public data. - TO COME: Sling load options
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
--- @field miscGroups Array<SpearheadGroup>
|
||||
--- @field maxMissions integer
|
||||
--- @field farps Array<FarpZone>
|
||||
--- @field supplyHubs Array<SupplyHub>
|
||||
|
||||
--- @class StageInitData
|
||||
--- @field stageZoneName string
|
||||
@@ -90,7 +91,9 @@ function Stage:superNew(database, stageConfig, logger, initData, missionPriority
|
||||
maxMissions = stageConfig.maxMissionsPerStage,
|
||||
farps = {},
|
||||
missionsByName = {},
|
||||
supplyHubs = {}
|
||||
}
|
||||
|
||||
self._activeStage = -99
|
||||
self._preActivated = false
|
||||
self._stageConfig = stageConfig or {}
|
||||
@@ -110,6 +113,11 @@ function Stage:superNew(database, stageConfig, logger, initData, missionPriority
|
||||
table.insert(self._db.farps, farp)
|
||||
end
|
||||
|
||||
local supplyHubNames = database:getSupplyHubsInStage(self.zoneName)
|
||||
for _, supplyHubName in pairs(supplyHubNames) do
|
||||
local supplyHub = Spearhead.classes.stageClasses.SpecialZones.SupplyHub.new(database, logger, supplyHubName)
|
||||
table.insert(self._db.supplyHubs, supplyHub)
|
||||
end
|
||||
|
||||
self._logger:info("Initiating new Stage with name: " .. self.zoneName)
|
||||
|
||||
@@ -404,6 +412,12 @@ function Stage:ActivateStage()
|
||||
end
|
||||
end
|
||||
|
||||
for _, supplyHub in pairs(self._db.supplyHubs) do
|
||||
if supplyHub:IsActiveFromStart() == true then
|
||||
supplyHub:Activate()
|
||||
end
|
||||
end
|
||||
|
||||
timer.scheduleFunction(self.CheckContinuousAsync, self, timer.getTime() + 3)
|
||||
end
|
||||
|
||||
@@ -476,6 +490,10 @@ function Stage:ActivateBlueGroups()
|
||||
farp:Activate()
|
||||
end
|
||||
end
|
||||
|
||||
for _, supplyHub in pairs(self._db.supplyHubs) do
|
||||
supplyHub:Activate()
|
||||
end
|
||||
end
|
||||
|
||||
---@return number strike
|
||||
|
||||
@@ -18,7 +18,7 @@ function PrimaryStage.New(database, stageConfig, logger, initData)
|
||||
local self = setmetatable({}, { __index = PrimaryStage }) --[[@as PrimaryStage]]
|
||||
self:superNew(database, stageConfig, logger, initData, "primary")
|
||||
return self
|
||||
|
||||
|
||||
end
|
||||
|
||||
if not Spearhead.classes then Spearhead.classes = {} end
|
||||
|
||||
Reference in New Issue
Block a user