diff --git a/gen/conflictgen.py b/gen/conflictgen.py index 3c9eecfe..7525648d 100644 --- a/gen/conflictgen.py +++ b/gen/conflictgen.py @@ -144,6 +144,16 @@ class Conflict: position = middle_point.point_from_heading(attack_heading, strength_delta * attack_distance / 2 - FRONTLINE_MIN_CP_DISTANCE) return position, _opposite_heading(attack_heading) + @classmethod + def flight_frontline_vector(cls, from_cp: ControlPoint, to_cp: ControlPoint, theater: ConflictTheater) -> Tuple[Point, int, int]: + """Returns the frontline vector without regard for exclusion zones, used in CAS flight plan""" + frontline = cls.frontline_position(theater, from_cp, to_cp) + center_position, heading = frontline + left_position = center_position.point_from_heading(_heading_sum(heading, -90), int(FRONTLINE_LENGTH/2)) + right_position = center_position.point_from_heading(_heading_sum(heading, 90), int(FRONTLINE_LENGTH/2)) + + return left_position, _heading_sum(heading, 90), int(right_position.distance_to_point(left_position)) + @classmethod def frontline_vector(cls, from_cp: ControlPoint, to_cp: ControlPoint, theater: ConflictTheater) -> Tuple[Point, int, int]: diff --git a/gen/flights/flightplan.py b/gen/flights/flightplan.py index 430a8c11..77f11ba4 100644 --- a/gen/flights/flightplan.py +++ b/gen/flights/flightplan.py @@ -803,7 +803,7 @@ class FlightPlanBuilder: if not isinstance(location, FrontLine): raise InvalidObjectiveLocation(flight.flight_type, location) - ingress, heading, distance = Conflict.frontline_vector( + ingress, heading, distance = Conflict.flight_frontline_vector( location.control_points[0], location.control_points[1], self.game.theater )