From 621e4a513c7311ec35d4dc861420865ece8aec39 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Thu, 20 May 2021 23:51:39 -0700 Subject: [PATCH] Fix DEAD flights to use more than just missiles. It doesn't seem like AI pilots are capable of using more than one weapon effectively (see link below), but this at least makes DEAD flights work when the DEAD flight is carrying only one type of weapon and some other flight is performing SEAD. https://forums.eagle.ru/topic/271941-ai-rtbs-after-firing-decoys-despite-full-load-of-bombs/ --- gen/aircraft.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/gen/aircraft.py b/gen/aircraft.py index 84c8c020..a83fcd2a 100644 --- a/gen/aircraft.py +++ b/gen/aircraft.py @@ -1251,7 +1251,7 @@ class AircraftConflictGenerator: group, react_on_threat=OptReactOnThreat.Values.EvadeFire, roe=OptROE.Values.OpenFire, - rtb_winchester=OptRTBOnOutOfAmmo.Values.ASM, + rtb_winchester=OptRTBOnOutOfAmmo.Values.All, restrict_jettison=True, ) @@ -1386,9 +1386,6 @@ class AircraftConflictGenerator: flight: Flight, dynamic_runways: Dict[str, RunwayData], ) -> None: - # Escort groups are actually given the CAP task so they can perform the - # Search Then Engage task, which we have to use instead of the Escort - # task for the reasons explained in JoinPointBuilder. group.task = Transport.name self._setup_group(group, package, flight, dynamic_runways) self.configure_behavior( @@ -1737,7 +1734,7 @@ class DeadIngressBuilder(PydcsWaypointBuilder): if isinstance(target_group, TheaterGroundObject): tgroup = self.mission.find_group(target_group.group_name) if tgroup is not None: - task = AttackGroup(tgroup.id, weapon_type=WeaponType.Guided) + task = AttackGroup(tgroup.id, weapon_type=WeaponType.Auto) task.params["expend"] = "All" task.params["attackQtyLimit"] = False task.params["directionEnabled"] = False @@ -1842,12 +1839,11 @@ class StrikeIngressBuilder(PydcsWaypointBuilder): center.y += target.position.y center.x /= len(targets) center.y /= len(targets) - bombing = Bombing(center) + bombing = Bombing(center, weapon_type=WeaponType.Bombs) bombing.params["expend"] = "All" bombing.params["attackQtyLimit"] = False bombing.params["directionEnabled"] = False bombing.params["altitudeEnabled"] = False - bombing.params["weaponType"] = WeaponType.Bombs.value bombing.params["groupAttack"] = True waypoint.tasks.append(bombing) return waypoint @@ -1855,11 +1851,10 @@ class StrikeIngressBuilder(PydcsWaypointBuilder): def build_strike(self) -> MovingPoint: waypoint = super().build() for target in self.waypoint.targets: - bombing = Bombing(target.position) + bombing = Bombing(target.position, weapon_type=WeaponType.Auto) # If there is only one target, drop all ordnance in one pass. if len(self.waypoint.targets) == 1: bombing.params["expend"] = "All" - bombing.params["weaponType"] = WeaponType.Auto.value bombing.params["groupAttack"] = True waypoint.tasks.append(bombing)