Added a new setting: "Maximum frontline length (km)"

It replaces the FRONTLINE_LENGTH constant, which was used previously. The default setting for the frontline length has been set to match the FRONTLINE_LENGTH value (80 km), but I feel the default should be a bit shorter. Discussion on the topic would be welcome.
This commit is contained in:
MetalStormGhost
2022-04-16 11:26:21 +03:00
committed by Raffson
parent 96a5a8e2ef
commit e1bf0ed47a
9 changed files with 36 additions and 19 deletions

View File

@@ -52,9 +52,8 @@ class CasFlightPlan(PatrollingFlightPlan[CasLayout]):
@property
def engagement_distance(self) -> Distance:
from game.missiongenerator.frontlineconflictdescription import FRONTLINE_LENGTH
return meters(FRONTLINE_LENGTH) / 2
max_length = self.flight.coalition.game.settings.max_frontline_length * 1000
return meters(max_length) / 2
@property
def combat_speed_waypoints(self) -> set[FlightWaypoint]:
@@ -79,7 +78,7 @@ class Builder(IBuilder[CasFlightPlan, CasLayout]):
)
ingress, heading, distance = FrontLineConflictDescription.frontline_vector(
location, self.theater
location, self.theater, self.coalition.game.settings
)
center = ingress.point_from_heading(heading.degrees, distance / 2)
egress = ingress.point_from_heading(heading.degrees, distance)