Cap rework (#48)

- Refactored all CAP classes.
- Improved timing
- Zones are now not tied to MissionStages
  - CAPROUTE_<routeID>_<free>
  - routeID is now what is used in the naming convention.
- Units taxi back to their spawn parking space and rearm there.
  (Units destroyed while in the Rearming or Repairing state are not taken into account)
This commit is contained in:
2025-06-01 18:58:35 +02:00
committed by GitHub
parent 059081890d
commit 0233b9e2d7
21 changed files with 1519 additions and 832 deletions
@@ -159,14 +159,17 @@ function StageBase:SpawnBlueUnits()
end
function StageBase:ActivateRedStage()
if self._initialSide == 2 and self._airbase then
self._airbase:setCoalition(1)
self._logger:debug("Activate red stage for airbase: " .. self._airbase:getName())
if self._airbase and (self._initialSide == 2 or self._initialSide == 1) then
self._airbase:setCoalition(coalition.side.RED)
self._airbase:autoCapture(false)
end
self:SpawnRedUnits()
end
function StageBase:ActivateBlueStage()
self._logger:debug("Activate blue stage for airbase: " .. self._airbase:getName())
self:CleanRedUnits()
if self._buildableMission and self._buildableMission:getState() ~= "COMPLETED" then
@@ -178,7 +181,8 @@ end
function StageBase:FinaliseBlueStage()
if self._initialSide == 2 and self._airbase then
self._airbase:setCoalition(2)
self._airbase:setCoalition(coalition.side.BLUE)
self._airbase:autoCapture(false)
end
self:SpawnBlueUnits()