mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Clarify cargo waypoints for AirLift and AirAssault
This commit is contained in:
parent
123db516ad
commit
624ca3c308
@ -83,12 +83,12 @@ class Builder(IBuilder[AirAssaultFlightPlan, AirAssaultLayout]):
|
||||
|
||||
builder = WaypointBuilder(self.flight, self.coalition)
|
||||
|
||||
if not self.flight.is_helo or self.flight.departure.cptype in [
|
||||
if self.flight.departure.cptype in [
|
||||
ControlPointType.AIRCRAFT_CARRIER_GROUP,
|
||||
ControlPointType.LHA_GROUP,
|
||||
ControlPointType.OFF_MAP,
|
||||
]:
|
||||
# Non-Helo flights or Off_Map will be preloaded
|
||||
# Off_Map spawns will be preloaded
|
||||
# Carrier operations load the logistics directly from the carrier
|
||||
pickup = None
|
||||
pickup_position = self.flight.departure.position
|
||||
@ -99,12 +99,11 @@ class Builder(IBuilder[AirAssaultFlightPlan, AirAssaultLayout]):
|
||||
# be autoplanned. In the current state the User has to check the created
|
||||
# Waypoints for the Pickup and Dropoff LZs are free of obstacles.
|
||||
# Create a special pickup zone for Helos from Airbase / FOB
|
||||
pickup = builder.cargo_pickup(
|
||||
pickup = builder.pickup_zone(
|
||||
MissionTarget(
|
||||
"Pickup Zone",
|
||||
self.flight.departure.position.random_point_within(1200, 600),
|
||||
),
|
||||
self.flight.is_helo,
|
||||
)
|
||||
)
|
||||
pickup_position = pickup.position
|
||||
assault_area = builder.assault_area(self.package.target)
|
||||
@ -130,7 +129,7 @@ class Builder(IBuilder[AirAssaultFlightPlan, AirAssaultLayout]):
|
||||
self.package.waypoints.ingress,
|
||||
self.package.target,
|
||||
),
|
||||
drop_off=builder.cargo_dropoff(drop_off_zone, is_helo=True),
|
||||
drop_off=builder.dropoff_zone(drop_off_zone),
|
||||
target=assault_area,
|
||||
nav_to_home=builder.nav_path(
|
||||
drop_off_zone.position,
|
||||
|
||||
@ -99,24 +99,22 @@ class Builder(IBuilder[AirliftFlightPlan, AirliftLayout]):
|
||||
drop_off_zone = None
|
||||
|
||||
if cargo.origin != self.flight.departure:
|
||||
pickup = builder.cargo_pickup(cargo.origin, False)
|
||||
pickup = builder.cargo_stop(cargo.origin)
|
||||
if cargo.next_stop != self.flight.arrival:
|
||||
drop_off = builder.cargo_dropoff(cargo.next_stop, False)
|
||||
drop_off = builder.cargo_stop(cargo.next_stop)
|
||||
|
||||
if self.flight.is_helo:
|
||||
# Create CTLD Zones for Helo flights
|
||||
pickup_zone = builder.cargo_pickup(
|
||||
pickup_zone = builder.pickup_zone(
|
||||
MissionTarget(
|
||||
"Pickup Zone", cargo.origin.position.random_point_within(1000, 200)
|
||||
),
|
||||
True,
|
||||
)
|
||||
drop_off_zone = builder.cargo_dropoff(
|
||||
)
|
||||
drop_off_zone = builder.dropoff_zone(
|
||||
MissionTarget(
|
||||
"Dropoff zone",
|
||||
cargo.next_stop.position.random_point_within(1000, 200),
|
||||
),
|
||||
True,
|
||||
)
|
||||
)
|
||||
# Show the zone waypoints only to the player
|
||||
pickup_zone.only_for_player = True
|
||||
|
||||
@ -501,14 +501,11 @@ class WaypointBuilder:
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def cargo_pickup(pick_up: MissionTarget, is_helo: bool) -> FlightWaypoint:
|
||||
"""Creates a cargo pickup waypoint.
|
||||
|
||||
Args:
|
||||
control_point: Pick up location.
|
||||
def pickup_zone(pick_up: MissionTarget) -> FlightWaypoint:
|
||||
"""Creates a pickup landing zone waypoint
|
||||
This waypoint is used to generate the Trigger Zone used for AirAssault and
|
||||
AirLift using the CTLD plugin (see LogisticsGenerator)
|
||||
"""
|
||||
control_point = pick_up if isinstance(pick_up, ControlPoint) else None
|
||||
if is_helo:
|
||||
return FlightWaypoint(
|
||||
"PICKUPZONE",
|
||||
FlightWaypointType.PICKUP_ZONE,
|
||||
@ -517,34 +514,14 @@ class WaypointBuilder:
|
||||
"RADIO",
|
||||
description=f"Pick up cargo from {pick_up.name}",
|
||||
pretty_name="Pick-up zone",
|
||||
control_point=control_point,
|
||||
)
|
||||
return FlightWaypoint(
|
||||
"PICKUP",
|
||||
FlightWaypointType.LAND_REFUEL,
|
||||
pick_up.position,
|
||||
meters(0),
|
||||
"RADIO",
|
||||
description=f"Pick up cargo from {pick_up.name}",
|
||||
pretty_name="Cargo pick-up",
|
||||
control_point=control_point,
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def cargo_dropoff(drop_off: MissionTarget, is_helo: bool) -> FlightWaypoint:
|
||||
"""Creates a cargo drop-off waypoint.
|
||||
This waypoint is used by AirLift and AirAssault to drop cargo or troops
|
||||
at the given location
|
||||
|
||||
Args:
|
||||
control_point: Drop-off location.
|
||||
is_helo: Differentiate behaviour between plane and helo
|
||||
def dropoff_zone(drop_off: MissionTarget) -> FlightWaypoint:
|
||||
"""Creates a dropoff landing zone waypoint
|
||||
This waypoint is used to generate the Trigger Zone used for AirAssault and
|
||||
AirLift using the CTLD plugin (see LogisticsGenerator)
|
||||
"""
|
||||
if is_helo:
|
||||
if isinstance(drop_off, ControlPoint):
|
||||
raise ValueError(
|
||||
"Helicopter airlift drop-off targets should not be control points"
|
||||
)
|
||||
return FlightWaypoint(
|
||||
"DROPOFFZONE",
|
||||
FlightWaypointType.DROPOFF_ZONE,
|
||||
@ -555,20 +532,20 @@ class WaypointBuilder:
|
||||
pretty_name="Drop-off zone",
|
||||
)
|
||||
|
||||
if not isinstance(drop_off, ControlPoint):
|
||||
raise ValueError(
|
||||
f"Plane airlift drop-off targets must be control points, but was given "
|
||||
f"{drop_off.__class__.__name__}"
|
||||
)
|
||||
@staticmethod
|
||||
def cargo_stop(control_point: ControlPoint) -> FlightWaypoint:
|
||||
"""Creates a cargo stop waypoint.
|
||||
This waypoint is used by AirLift as a landing and stopover waypoint
|
||||
"""
|
||||
return FlightWaypoint(
|
||||
"DROPOFF",
|
||||
FlightWaypointType.LAND_REFUEL,
|
||||
drop_off.position,
|
||||
"CARGOSTOP",
|
||||
FlightWaypointType.CARGO_STOP,
|
||||
control_point.position,
|
||||
meters(0),
|
||||
"RADIO",
|
||||
description=f"Drop off cargo at {drop_off.name}",
|
||||
pretty_name="Cargo drop-off",
|
||||
control_point=drop_off,
|
||||
description=f"Stop for cargo at {control_point.name}",
|
||||
pretty_name="Cargo stop",
|
||||
control_point=control_point,
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user