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