mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
parent
824312e19d
commit
4ca0137a24
@ -249,6 +249,22 @@ class WaypointBuilder:
|
|||||||
objective: MissionTarget,
|
objective: MissionTarget,
|
||||||
) -> FlightWaypoint:
|
) -> FlightWaypoint:
|
||||||
alt = self.get_combat_altitude
|
alt = self.get_combat_altitude
|
||||||
|
if ingress_type in [
|
||||||
|
FlightWaypointType.INGRESS_CAS,
|
||||||
|
FlightWaypointType.INGRESS_OCA_AIRCRAFT,
|
||||||
|
]:
|
||||||
|
weather = self.flight.coalition.game.conditions.weather
|
||||||
|
max_alt = feet(30000)
|
||||||
|
if weather.clouds and (
|
||||||
|
weather.clouds.preset
|
||||||
|
and "overcast" in weather.clouds.preset.description.lower()
|
||||||
|
or weather.clouds.density > 5
|
||||||
|
):
|
||||||
|
max_alt = meters(
|
||||||
|
max(feet(500).meters, weather.clouds.base - feet(500).meters)
|
||||||
|
)
|
||||||
|
alt = min(alt, max_alt)
|
||||||
|
|
||||||
alt_type: AltitudeReference = "BARO"
|
alt_type: AltitudeReference = "BARO"
|
||||||
if self.is_helo or self.flight.is_hercules:
|
if self.is_helo or self.flight.is_hercules:
|
||||||
alt_type = "RADIO"
|
alt_type = "RADIO"
|
||||||
@ -381,13 +397,23 @@ class WaypointBuilder:
|
|||||||
return waypoint
|
return waypoint
|
||||||
|
|
||||||
def cas(self, position: Point) -> FlightWaypoint:
|
def cas(self, position: Point) -> FlightWaypoint:
|
||||||
|
weather = self.flight.coalition.game.conditions.weather
|
||||||
|
max_alt = feet(30000)
|
||||||
|
if weather.clouds and (
|
||||||
|
weather.clouds.preset
|
||||||
|
and "overcast" in weather.clouds.preset.description.lower()
|
||||||
|
or weather.clouds.density > 5
|
||||||
|
):
|
||||||
|
max_alt = meters(
|
||||||
|
max(feet(500).meters, weather.clouds.base - feet(500).meters)
|
||||||
|
)
|
||||||
return FlightWaypoint(
|
return FlightWaypoint(
|
||||||
"CAS",
|
"CAS",
|
||||||
FlightWaypointType.CAS,
|
FlightWaypointType.CAS,
|
||||||
position,
|
position,
|
||||||
feet(self.flight.coalition.game.settings.heli_combat_alt_agl)
|
feet(self.flight.coalition.game.settings.heli_combat_alt_agl)
|
||||||
if self.is_helo
|
if self.is_helo
|
||||||
else meters(1000),
|
else min(meters(1000), max_alt),
|
||||||
"RADIO",
|
"RADIO",
|
||||||
description="Provide CAS",
|
description="Provide CAS",
|
||||||
pretty_name="CAS",
|
pretty_name="CAS",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user