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:
RndName
2022-04-12 12:42:17 +02:00
parent de148dbb61
commit aa77cfe4b9
73 changed files with 996 additions and 212 deletions

View File

@@ -47,7 +47,7 @@ from game.utils import (
if TYPE_CHECKING:
from game.missiongenerator.aircraft.flightdata import FlightData
from game.missiongenerator.airsupport import AirSupport
from game.missiongenerator.missiondata import MissionData
from game.radio.radios import Radio, RadioFrequency, RadioRegistry
@@ -182,6 +182,14 @@ class AircraftType(UnitType[Type[FlyingType]]):
channel_allocator: Optional[RadioChannelAllocator]
channel_namer: Type[ChannelNamer]
# Logisitcs info
# cabin_size defines how many troops can be loaded. 0 means the aircraft can not
# transport any troops. Default for helos is 10, non helos will have 0.
cabin_size: int
# If the aircraft can carry crates can_carry_crates should be set to true which
# will be set to true for helos by default
can_carry_crates: bool
@property
def flyable(self) -> bool:
return self.dcs_unit_type.flyable
@@ -281,10 +289,10 @@ class AircraftType(UnitType[Type[FlyingType]]):
return freq
def assign_channels_for_flight(
self, flight: FlightData, air_support: AirSupport
self, flight: FlightData, mission_data: MissionData
) -> None:
if self.channel_allocator is not None:
self.channel_allocator.assign_channels_for_flight(flight, air_support)
self.channel_allocator.assign_channels_for_flight(flight, mission_data)
def channel_name(self, radio_id: int, channel_id: int) -> str:
return self.channel_namer.channel_name(radio_id, channel_id)
@@ -387,6 +395,9 @@ class AircraftType(UnitType[Type[FlyingType]]):
if units_data == "metric":
units = MetricUnits()
class_name = data.get("class")
unit_class = UnitClass.PLANE if class_name is None else UnitClass(class_name)
prop_overrides = data.get("default_overrides")
if prop_overrides is not None:
cls._set_props_overrides(prop_overrides, aircraft, data_path)
@@ -419,5 +430,7 @@ class AircraftType(UnitType[Type[FlyingType]]):
channel_namer=radio_config.channel_namer,
kneeboard_units=units,
utc_kneeboard=data.get("utc_kneeboard", False),
unit_class=UnitClass.PLANE,
unit_class=unit_class,
cabin_size=data.get("cabin_size", 10 if aircraft.helicopter else 0),
can_carry_crates=data.get("can_carry_crates", aircraft.helicopter),
)