add vertical takeoff and landing option

This commit is contained in:
Eclipse/Druss99
2025-01-01 14:38:26 -05:00
committed by Raffson
parent dd408f392b
commit dec57fccf9
4 changed files with 19 additions and 1 deletions

View File

@@ -30,6 +30,7 @@ from dcs.task import (
OptNoReportWaypointPass,
OptRadioUsageContact,
OptRadioSilence,
OptVerticalTakeoffLanding,
Tanker,
RecoveryTanker,
ActivateBeaconCommand,
@@ -114,6 +115,7 @@ class AircraftBehavior:
mission_uses_gun: bool = True,
rtb_on_bingo: bool = True,
ai_unlimited_fuel: Optional[bool] = None,
ai_vertical_takoff_landing: Optional[bool] = None,
) -> None:
group.points[0].tasks.clear()
if ai_unlimited_fuel is None:
@@ -121,6 +123,11 @@ class AircraftBehavior:
flight.squadron.coalition.game.settings.ai_unlimited_fuel
)
if ai_vertical_takoff_landing is None:
ai_vertical_takoff_landing = (
flight.squadron.coalition.game.settings.ai_vertical_takoff_landing
)
# at IP, insert waypoint to orient aircraft in correct direction
layout = flight.flight_plan.layout
at_ip_or_combat = flight.state.is_at_ip or flight.state.in_combat
@@ -150,6 +157,9 @@ class AircraftBehavior:
if rtb_winchester is not None:
group.points[0].tasks.append(OptRTBOnOutOfAmmo(rtb_winchester))
if ai_vertical_takoff_landing and flight.is_helo:
group.points[0].tasks.append(OptVerticalTakeoffLanding(True))
# Confiscate the bullets of AI missions that do not rely on the gun. There is no
# "all but gun" RTB winchester option, so air to ground missions with mixed
# weapon types will insist on using all of their bullets after running out of

View File

@@ -332,6 +332,13 @@ class Settings:
default=False,
detail="AI will jettison their fuel tanks as soon as they're empty.",
)
ai_vertical_takoff_landing: bool = boolean_option(
"AI helicopters use vertical takeoff and landing",
page=CAMPAIGN_DOCTRINE_PAGE,
section=GENERAL_SECTION,
default=False,
detail="AI will use vertical takeoff and landing instead of combat takeoff and landing.",
)
max_plane_altitude_offset: int = bounded_int_option(
"Maximum randomized altitude offset (x1000 ft) for airplanes.",
page=CAMPAIGN_DOCTRINE_PAGE,