diff --git a/gen/airsupportgen.py b/gen/airsupportgen.py index fef24cc6..ed13d830 100644 --- a/gen/airsupportgen.py +++ b/gen/airsupportgen.py @@ -1,9 +1,10 @@ import logging from dataclasses import dataclass, field -from typing import List, Type +from typing import List, Type, Tuple from dcs.mission import Mission, StartType -from dcs.planes import IL_78M +from dcs.planes import IL_78M, KC130, KC135MPRS, KC_135 +from dcs.unittype import UnitType from dcs.task import ( AWACS, ActivateBeaconCommand, @@ -68,13 +69,24 @@ class AirSupportConflictGenerator: def support_tasks(cls) -> List[Type[MainTask]]: return [Refueling, AWACS] + @staticmethod + def _get_tanker_params(unit_type: Type[UnitType]) -> Tuple[int, int]: + if unit_type is KC130: + return (TANKER_ALT - 500, 596) + elif unit_type is KC_135: + return (TANKER_ALT, 770) + elif unit_type is KC135MPRS: + return (TANKER_ALT + 500, 596) + return (TANKER_ALT, 574) + def generate(self): player_cp = self.conflict.from_cp if self.conflict.from_cp.captured else self.conflict.to_cp fallback_tanker_number = 0 for i, tanker_unit_type in enumerate(db.find_unittype(Refueling, self.conflict.attackers_side)): - variant = db.unit_type_name(tanker_unit_type) + alt, airspeed = self._get_tanker_params(tanker_unit_type) + variant = db.unit_type_name(tanker_unit_type) freq = self.radio_registry.alloc_uhf() tacan = self.tacan_registry.alloc_for_band(TacanBand.Y) tanker_heading = self.conflict.to_cp.position.heading_between_point(self.conflict.from_cp.position) + TANKER_HEADING_OFFSET * i @@ -85,11 +97,11 @@ class AirSupportConflictGenerator: airport=None, plane_type=tanker_unit_type, position=tanker_position, - altitude=TANKER_ALT, + altitude=alt, race_distance=58000, frequency=freq.mhz, start_type=StartType.Warm, - speed=574, + speed=airspeed, tacanchannel=str(tacan), ) tanker_group.set_frequency(freq.mhz)