mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Cleanup
This commit is contained in:
parent
2aee878a40
commit
004a99e080
@ -194,7 +194,7 @@ class FormationAttackBuilder(IBuilder[FlightPlanT, LayoutT], ABC):
|
||||
initial = None
|
||||
if self.package.primary_task == FlightType.STRIKE:
|
||||
ingress = builder.nav(
|
||||
self.package.waypoints.ingress, Distance.from_feet(20000)
|
||||
self.package.waypoints.ingress, self.doctrine.ingress_altitude
|
||||
)
|
||||
initial = builder.ingress(
|
||||
ingress_type, self.package.waypoints.initial, self.package.target
|
||||
|
||||
@ -36,6 +36,7 @@ class PackageWaypoints:
|
||||
).find_best_ip()
|
||||
|
||||
hdg = package.target.position.heading_between_point(ingress_point)
|
||||
# Generate a waypoint randomly between 7 & 9 NM
|
||||
dist = nautical_miles(random.random() * 2 + 7).meters
|
||||
initial_point = package.target.position.point_from_heading(hdg, dist)
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@ from dataclasses import dataclass
|
||||
from datetime import timedelta
|
||||
|
||||
from game.data.units import UnitClass
|
||||
from game.utils import Distance, feet, nautical_miles
|
||||
from game.utils import Distance, feet, nautical_miles, Speed, knots
|
||||
|
||||
|
||||
@dataclass
|
||||
@ -77,6 +77,16 @@ class Doctrine:
|
||||
|
||||
ground_unit_procurement_ratios: GroundUnitProcurementRatios
|
||||
|
||||
rtb_speed: Speed
|
||||
|
||||
sead_escort_spacing: Distance
|
||||
|
||||
escort_spacing: Distance
|
||||
|
||||
sead_escort_engagement_range: Distance
|
||||
|
||||
escort_engagement_range: Distance
|
||||
|
||||
|
||||
MODERN_DOCTRINE = Doctrine(
|
||||
cap=True,
|
||||
@ -113,6 +123,11 @@ MODERN_DOCTRINE = Doctrine(
|
||||
UnitClass.RECON: 1,
|
||||
}
|
||||
),
|
||||
rtb_speed=knots(500),
|
||||
sead_escort_spacing=feet(1000),
|
||||
escort_spacing=feet(2000),
|
||||
sead_escort_engagement_range=nautical_miles(40),
|
||||
escort_engagement_range=nautical_miles(30),
|
||||
)
|
||||
|
||||
COLDWAR_DOCTRINE = Doctrine(
|
||||
@ -150,6 +165,11 @@ COLDWAR_DOCTRINE = Doctrine(
|
||||
UnitClass.RECON: 1,
|
||||
}
|
||||
),
|
||||
rtb_speed=knots(450),
|
||||
sead_escort_spacing=feet(500),
|
||||
escort_spacing=feet(1000),
|
||||
sead_escort_engagement_range=nautical_miles(25),
|
||||
escort_engagement_range=nautical_miles(20),
|
||||
)
|
||||
|
||||
WWII_DOCTRINE = Doctrine(
|
||||
@ -186,4 +206,9 @@ WWII_DOCTRINE = Doctrine(
|
||||
UnitClass.RECON: 1,
|
||||
}
|
||||
),
|
||||
rtb_speed=knots(300),
|
||||
sead_escort_spacing=feet(100),
|
||||
escort_spacing=feet(200),
|
||||
sead_escort_engagement_range=nautical_miles(10),
|
||||
escort_engagement_range=nautical_miles(5),
|
||||
)
|
||||
|
||||
@ -75,11 +75,9 @@ class FlightGroupSpawner:
|
||||
or self.flight.state.spawn_type is not StartType.IN_FLIGHT
|
||||
):
|
||||
grp = self.generate_flight_at_departure()
|
||||
# grp.id = id(self.flight)
|
||||
self.flight.group_id = grp.id
|
||||
return grp
|
||||
grp = self.generate_mid_mission()
|
||||
# grp.id = id(self.flight)
|
||||
self.flight.group_id = grp.id
|
||||
return grp
|
||||
|
||||
|
||||
@ -19,6 +19,8 @@ class JoinPointBuilder(PydcsWaypointBuilder):
|
||||
def add_tasks(self, waypoint: MovingPoint) -> None:
|
||||
waypoint.tasks.append(OptFormation.finger_four_open())
|
||||
|
||||
doctrine = self.flight.coalition.doctrine
|
||||
|
||||
if self.flight.flight_type == FlightType.ESCORT:
|
||||
self.configure_escort_tasks(
|
||||
waypoint,
|
||||
@ -26,6 +28,8 @@ class JoinPointBuilder(PydcsWaypointBuilder):
|
||||
Targets.All.Air.Planes.Fighters.id,
|
||||
Targets.All.Air.Planes.MultiroleFighters.id,
|
||||
],
|
||||
max_dist=doctrine.escort_engagement_range.nautical_miles,
|
||||
vertical_spacing=doctrine.escort_spacing.feet,
|
||||
)
|
||||
elif self.flight.flight_type == FlightType.SEAD_ESCORT:
|
||||
if isinstance(self.flight.package.target, NavalControlPoint):
|
||||
@ -35,15 +39,15 @@ class JoinPointBuilder(PydcsWaypointBuilder):
|
||||
Targets.All.Naval.id,
|
||||
Targets.All.GroundUnits.AirDefence.AAA.SAMRelated.id,
|
||||
],
|
||||
max_dist=40,
|
||||
vertical_spacing=1000,
|
||||
max_dist=doctrine.sead_escort_engagement_range.nautical_miles,
|
||||
vertical_spacing=doctrine.sead_escort_spacing.feet,
|
||||
)
|
||||
else:
|
||||
self.configure_escort_tasks(
|
||||
waypoint,
|
||||
[Targets.All.GroundUnits.AirDefence.AAA.SAMRelated.id],
|
||||
max_dist=40,
|
||||
vertical_spacing=1000,
|
||||
max_dist=doctrine.sead_escort_engagement_range.nautical_miles,
|
||||
vertical_spacing=doctrine.sead_escort_spacing.feet,
|
||||
)
|
||||
|
||||
# Let the AI use ECM to preemptively defend themselves.
|
||||
|
||||
@ -19,7 +19,7 @@ class SplitPointBuilder(PydcsWaypointBuilder):
|
||||
|
||||
waypoint.tasks.append(OptFormation.finger_four_close())
|
||||
waypoint.speed_locked = True
|
||||
waypoint.speed = mach(0.85, Distance.from_feet(20000)).meters_per_second
|
||||
waypoint.speed = self.flight.coalition.doctrine.rtb_speed.meters_per_second
|
||||
waypoint.ETA_locked = False
|
||||
if self.flight is self.package.primary_flight:
|
||||
script = RunScript(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user