Configurable tanker on-station time (#69)

This commit is contained in:
MetalStormGhost 2023-01-06 21:11:24 +02:00 committed by GitHub
parent 1deff6fa49
commit 01ee24c8cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 0 deletions

View File

@ -4,6 +4,7 @@
* **[Mission Generation]** Given a CAS flight was planned, delay ground force attack until first CAS flight is on station
* **[Mission Generation]** Add option to switch ATFLIR to LITENING automatically for ground based F-18C flights
* **[Mission Generation]** Add option to configure OPFOR autoplanner aggressiveness and have the AI take risks and plan missions against defended targets
* **[Mission Generation]** Add option to configure the desired tanker on-station time in settings
* **[Cheat Menu]** Option to instantly transfer squadrons across bases.
* **[UI]** Add selectable units in faction overview during campaign generation.
* **[UI]** Add button to rename pilots in Air Wing's Squadron dialog.

View File

@ -23,9 +23,17 @@ class PackageRefuelingFlightPlan(RefuelingFlightPlan):
def patrol_duration(self) -> timedelta:
# TODO: Only consider aircraft that can refuel with this tanker type.
refuel_time_minutes = 5
min_patrol_duration = refuel_time_minutes
for self.flight in self.package.flights:
flight_size = self.flight.roster.max_size
refuel_time_minutes = refuel_time_minutes + 4 * flight_size + 1
min_patrol_duration = (
self.flight.coalition.game.settings.desired_tanker_on_station_time.seconds
// 60
)
if refuel_time_minutes < min_patrol_duration:
refuel_time_minutes = min_patrol_duration
return timedelta(minutes=refuel_time_minutes)

View File

@ -386,6 +386,14 @@ class Settings:
min=30,
max=150,
)
desired_tanker_on_station_time: timedelta = minutes_option(
"Desired tanker on-station time",
page=MISSION_GENERATOR_PAGE,
section=GAMEPLAY_SECTION,
default=timedelta(minutes=60),
min=30,
max=150,
)
# Mission specific
max_frontline_length: int = bounded_int_option(
"Maximum frontline length (km)",