mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Add AirAssault and Airlift mission types with CTLD support
- Add the new airassault mission type and special flightplans for it - Add the mission type to airbase and FOB - Add Layout for the UH-1H - Add mission type to capable squadrons - Allow the auto planner to task air assault missions when preconditions are met - Improve Airlift mission type and improve the flightplan (Stopover and Helo landing) - Allow Slingload and spawnable crates for airlift - Rework airsupport to a general missiondata class - Added Carrier Information to mission data - Allow to define CTLD specific capabilities in the unit yaml - Allow inflight preload and fixed wing support for air assault
This commit is contained in:
@@ -98,6 +98,8 @@ class TransferOrder:
|
||||
|
||||
transport: Optional[Transport] = field(default=None)
|
||||
|
||||
request_airflift: bool = field(default=False)
|
||||
|
||||
def __str__(self) -> str:
|
||||
"""Returns the text that should be displayed for the transfer."""
|
||||
count = self.size
|
||||
@@ -317,6 +319,7 @@ class AirliftPlanner:
|
||||
):
|
||||
self.create_airlift_flight(squadron)
|
||||
if self.package.flights:
|
||||
self.package.set_tot_asap()
|
||||
self.game.ato_for(self.for_player).add_package(self.package)
|
||||
|
||||
def create_airlift_flight(self, squadron: Squadron) -> int:
|
||||
@@ -585,15 +588,18 @@ class PendingTransfers:
|
||||
network = self.network_for(transfer.position)
|
||||
path = network.shortest_path_between(transfer.position, transfer.destination)
|
||||
next_stop = path[0]
|
||||
if network.link_type(transfer.position, next_stop) == TransitConnection.Road:
|
||||
self.convoys.add(transfer, next_stop)
|
||||
elif (
|
||||
network.link_type(transfer.position, next_stop)
|
||||
== TransitConnection.Shipping
|
||||
):
|
||||
self.cargo_ships.add(transfer, next_stop)
|
||||
else:
|
||||
AirliftPlanner(self.game, transfer, next_stop).create_package_for_airlift()
|
||||
if not transfer.request_airflift:
|
||||
if (
|
||||
network.link_type(transfer.position, next_stop)
|
||||
== TransitConnection.Road
|
||||
):
|
||||
return self.convoys.add(transfer, next_stop)
|
||||
elif (
|
||||
network.link_type(transfer.position, next_stop)
|
||||
== TransitConnection.Shipping
|
||||
):
|
||||
return self.cargo_ships.add(transfer, next_stop)
|
||||
AirliftPlanner(self.game, transfer, next_stop).create_package_for_airlift()
|
||||
|
||||
def new_transfer(self, transfer: TransferOrder) -> None:
|
||||
transfer.origin.base.commit_losses(transfer.units)
|
||||
@@ -774,3 +780,13 @@ class PendingTransfers:
|
||||
self.game.coalition_for(self.player).add_procurement_request(
|
||||
AircraftProcurementRequest(control_point, FlightType.TRANSPORT, gap)
|
||||
)
|
||||
|
||||
def transfer_for_flight(self, flight: Flight) -> Optional[TransferOrder]:
|
||||
for transfer in self.pending_transfers:
|
||||
if transfer.transport is None or not isinstance(
|
||||
transfer.transport, Airlift
|
||||
):
|
||||
continue
|
||||
if transfer.transport.flight == flight:
|
||||
return transfer
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user