mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fine-tune target waypoints for Strike Eagle
This commit is contained in:
parent
a9287809a3
commit
3cd1b2f80a
@ -10,6 +10,7 @@ from dcs import Point
|
|||||||
from dcs.planes import C_101CC, C_101EB, Su_33, FA_18C_hornet
|
from dcs.planes import C_101CC, C_101EB, Su_33, FA_18C_hornet
|
||||||
|
|
||||||
from game.dcs.aircrafttype import AircraftType
|
from game.dcs.aircrafttype import AircraftType
|
||||||
|
from game.theater import ControlPoint, MissionTarget
|
||||||
from pydcs_extensions.hercules.hercules import Hercules
|
from pydcs_extensions.hercules.hercules import Hercules
|
||||||
from .flightmembers import FlightMembers
|
from .flightmembers import FlightMembers
|
||||||
from .flightroster import FlightRoster
|
from .flightroster import FlightRoster
|
||||||
@ -34,7 +35,6 @@ if TYPE_CHECKING:
|
|||||||
from game.sim.gameupdateevents import GameUpdateEvents
|
from game.sim.gameupdateevents import GameUpdateEvents
|
||||||
from game.sim.simulationresults import SimulationResults
|
from game.sim.simulationresults import SimulationResults
|
||||||
from game.squadrons import Squadron, Pilot
|
from game.squadrons import Squadron, Pilot
|
||||||
from game.theater import ControlPoint
|
|
||||||
from game.transfers import TransferOrder
|
from game.transfers import TransferOrder
|
||||||
from game.data.weapons import WeaponType
|
from game.data.weapons import WeaponType
|
||||||
from .flightmember import FlightMember
|
from .flightmember import FlightMember
|
||||||
@ -224,6 +224,13 @@ class Flight(
|
|||||||
def points(self) -> List[FlightWaypoint]:
|
def points(self) -> List[FlightWaypoint]:
|
||||||
return self.flight_plan.waypoints[1:]
|
return self.flight_plan.waypoints[1:]
|
||||||
|
|
||||||
|
@property
|
||||||
|
def custom_targets(self) -> List[MissionTarget]:
|
||||||
|
return [
|
||||||
|
MissionTarget(wpt.name, wpt.position)
|
||||||
|
for wpt in self.flight_plan.layout.custom_waypoints
|
||||||
|
]
|
||||||
|
|
||||||
def position(self) -> Point:
|
def position(self) -> Point:
|
||||||
return self.state.estimate_position()
|
return self.state.estimate_position()
|
||||||
|
|
||||||
|
|||||||
@ -124,7 +124,8 @@ class PydcsWaypointBuilder:
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
def register_special_strike_points(
|
def register_special_strike_points(
|
||||||
self, targets: Iterable[Union[MissionTarget, TheaterUnit]]
|
self, targets: Iterable[Union[MissionTarget, TheaterUnit]],
|
||||||
|
start: int = 1,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Create special strike waypoints for various aircraft"""
|
"""Create special strike waypoints for various aircraft"""
|
||||||
for i, t in enumerate(targets):
|
for i, t in enumerate(targets):
|
||||||
@ -135,7 +136,7 @@ class PydcsWaypointBuilder:
|
|||||||
# Add F-15E mission target points as mission 1 (for JDAM for instance)
|
# Add F-15E mission target points as mission 1 (for JDAM for instance)
|
||||||
if self.group.units[0].unit_type == F_15ESE:
|
if self.group.units[0].unit_type == F_15ESE:
|
||||||
self.group.add_nav_target_point(
|
self.group.add_nav_target_point(
|
||||||
t.position, f"M{(i//8)+1}.{i%8+1}" f"\nH-1" f"\nA0" f"\nV0"
|
t.position, f"M{(i//8)+start}.{i%8+1}\nH-1\nA0\nV0"
|
||||||
)
|
)
|
||||||
|
|
||||||
def register_special_ingress_points(self) -> None:
|
def register_special_ingress_points(self) -> None:
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import copy
|
|||||||
from typing import Union
|
from typing import Union
|
||||||
|
|
||||||
from dcs import Point
|
from dcs import Point
|
||||||
from dcs.planes import B_17G, B_52H, Tu_22M3, B_1B
|
from dcs.planes import B_17G, B_52H, Tu_22M3, B_1B, F_15ESE
|
||||||
from dcs.point import MovingPoint
|
from dcs.point import MovingPoint
|
||||||
from dcs.task import Bombing, Expend, OptFormation, WeaponType, CarpetBombing
|
from dcs.task import Bombing, Expend, OptFormation, WeaponType, CarpetBombing
|
||||||
|
|
||||||
@ -76,4 +76,6 @@ class StrikeIngressBuilder(PydcsWaypointBuilder):
|
|||||||
# Register special waypoints
|
# Register special waypoints
|
||||||
if not self._special_wpts_injected:
|
if not self._special_wpts_injected:
|
||||||
self.register_special_strike_points(self.waypoint.targets)
|
self.register_special_strike_points(self.waypoint.targets)
|
||||||
|
if self.flight.unit_type.dcs_unit_type == F_15ESE:
|
||||||
|
self.register_special_strike_points(self.flight.custom_targets, 2)
|
||||||
self._special_wpts_injected = True
|
self._special_wpts_injected = True
|
||||||
|
|||||||
@ -97,6 +97,7 @@ class QPredefinedWaypointSelectionComboBox(QFilteredComboBox):
|
|||||||
wpt.description = f"Friendly unit: {target.name}"
|
wpt.description = f"Friendly unit: {target.name}"
|
||||||
else:
|
else:
|
||||||
wpt.description = f"Enemy unit: {target.name}"
|
wpt.description = f"Enemy unit: {target.name}"
|
||||||
|
wpt.waypoint_type = FlightWaypointType.TARGET_POINT
|
||||||
i = add_model_item(i, model, wpt.pretty_name, wpt)
|
i = add_model_item(i, model, wpt.pretty_name, wpt)
|
||||||
|
|
||||||
if self.include_airbases:
|
if self.include_airbases:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user