mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
parent
2adaee8671
commit
c2eb243026
@ -116,6 +116,16 @@ class Conflict:
|
|||||||
position = frontline.position
|
position = frontline.position
|
||||||
return position, _opposite_heading(attack_heading)
|
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(from_cp, to_cp, theater)
|
||||||
|
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
|
@classmethod
|
||||||
def frontline_vector(cls, from_cp: ControlPoint, to_cp: ControlPoint, theater: ConflictTheater) -> Tuple[Point, int, int]:
|
def frontline_vector(cls, from_cp: ControlPoint, to_cp: ControlPoint, theater: ConflictTheater) -> Tuple[Point, int, int]:
|
||||||
|
|||||||
@ -998,7 +998,7 @@ class FlightPlanBuilder:
|
|||||||
if not isinstance(location, FrontLine):
|
if not isinstance(location, FrontLine):
|
||||||
raise InvalidObjectiveLocation(flight.flight_type, location)
|
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],
|
location.control_points[0], location.control_points[1],
|
||||||
self.game.theater
|
self.game.theater
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user