From 18bb8e91f072a5768d700a6481300cd4c53afc05 Mon Sep 17 00:00:00 2001 From: Vasyl Horbachenko Date: Tue, 26 Jun 2018 22:24:07 +0300 Subject: [PATCH] never opt-out of an operation AI setting --- .gitignore | 4 +++- .idea/dcs_pmcliberation.iml | 13 ------------- .idea/misc.xml | 4 ---- gen/aircraft.py | 23 ++++++++++++++++------- gen/settingsgen.py | 1 + 5 files changed, 20 insertions(+), 25 deletions(-) delete mode 100644 .idea/dcs_pmcliberation.iml delete mode 100644 .idea/misc.xml diff --git a/.gitignore b/.gitignore index 82f284b5..86d0f026 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,6 @@ build/* .idea/**/workspace.xml .idea/**/tasks.xml .idea/**/dictionaries -.idea/**/shelf \ No newline at end of file +.idea/**/shelf +.idea/misc.xml +.idea/*.iml diff --git a/.idea/dcs_pmcliberation.iml b/.idea/dcs_pmcliberation.iml deleted file mode 100644 index 9eedabcf..00000000 --- a/.idea/dcs_pmcliberation.iml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index e524f659..00000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/gen/aircraft.py b/gen/aircraft.py index ec909bd6..044c3484 100644 --- a/gen/aircraft.py +++ b/gen/aircraft.py @@ -57,7 +57,7 @@ class AircraftConflictGenerator: count -= group_size client_count -= client_size - def _setup_group(self, group: FlyingGroup, for_task: Task, at: db.StartingPosition, client_count: int): + def _setup_group(self, group: FlyingGroup, for_task: Task, client_count: int): did_load_loadout = False unit_type = group.units[0].unit_type if unit_type in db.PLANE_PAYLOAD_OVERRIDES: @@ -87,6 +87,8 @@ class AircraftConflictGenerator: else: group.units[idx].set_client() + group.points[0].tasks.append(OptReactOnThreat(OptReactOnThreat.Values.ByPassAndEscape)) + def _generate_at_airport(self, name: str, side: Country, unit_type: FlyingType, count: int, client_count: int, airport: Airport = None) -> FlyingGroup: assert count > 0 assert unit is not None @@ -179,7 +181,7 @@ class AircraftConflictGenerator: position = group.position # type: Point wayp = group.add_waypoint(position.point_from_heading(heading, WORKAROUND_WAYP_DIST), CAS_ALTITUDE, WARM_START_AIRSPEED) - self._setup_group(group, CAP, at, client_count) + self._setup_group(group, CAP, client_count) for group in self.escort_targets: wayp.tasks.append(EscortTaskAction(group.id, engagement_max_dist=ESCORT_MAX_DIST)) @@ -202,9 +204,10 @@ class AircraftConflictGenerator: group.add_waypoint(self.conflict.position, CAS_ALTITUDE, WARM_START_AIRSPEED) group.task = CAS.name - self._setup_group(group, CAS, at, client_count) + self._setup_group(group, CAS, client_count) group.add_waypoint(self.conflict.from_cp.position, RTB_ALTITUDE) + group.land_at(self.conflict.from_cp.at) def generate_ship_strikegroup(self, attackers: db.PlaneDict, clients: db.PlaneDict, target_groups: typing.Collection[ShipGroup], at: db.StartingPosition = None): assert len(self.escort_targets) == 0 @@ -224,9 +227,10 @@ class AircraftConflictGenerator: wayp.tasks.append(AttackGroup(target_group.id)) group.task = AntishipStrike.name - self._setup_group(group, AntishipStrike, at, client_count) + self._setup_group(group, AntishipStrike, client_count) group.add_waypoint(self.conflict.from_cp.position, RTB_ALTITUDE) + group.land_at(self.conflict.from_cp.at) def generate_strikegroup_escort(self, attackers: db.PlaneDict, clients: db.PlaneDict, at: db.StartingPosition = None): for g in self._generate_escort( @@ -234,7 +238,9 @@ class AircraftConflictGenerator: units=attackers, clients=clients, at=at and at or self._group_point(self.conflict.air_attackers_location)): + g.add_waypoint(self.conflict.position, WARM_START_ALTITUDE) g.add_waypoint(self.conflict.from_cp.position, RTB_ALTITUDE) + g.land_at(self.conflict.from_cp.at) def generate_transport_escort(self, escort: db.PlaneDict, clients: db.PlaneDict, at: db.StartingPosition = None): for g in self._generate_escort( @@ -243,6 +249,7 @@ class AircraftConflictGenerator: clients=clients, at=at and at or self._group_point(self.conflict.air_defenders_location)): g.add_waypoint(self.conflict.to_cp.position, RTB_ALTITUDE) + g.land_at(self.conflict.to_cp.at) def generate_defense(self, defenders: db.PlaneDict, clients: db.PlaneDict, at: db.StartingPosition = None): for flying_type, count, client_count in self._split_to_groups(defenders, clients): @@ -258,9 +265,10 @@ class AircraftConflictGenerator: wayp = group.add_waypoint(self.conflict.position, CAS_ALTITUDE, WARM_START_AIRSPEED) wayp.tasks.append(dcs.task.EngageTargets(max_distance=INTERCEPT_MAX_DISTANCE)) wayp.tasks.append(dcs.task.OrbitAction()) - self._setup_group(group, CAP, at, client_count) + self._setup_group(group, CAP, client_count) group.add_waypoint(self.conflict.to_cp.position, RTB_ALTITUDE) + group.land_at(self.conflict.to_cp.at) def generate_transport(self, transport: db.PlaneDict, destination: Airport): assert len(self.escort_targets) == 0 @@ -298,9 +306,10 @@ class AircraftConflictGenerator: wayp = group.add_waypoint(self.conflict.position, 0) wayp.tasks.append(EngageTargets(max_distance=INTERCEPT_MAX_DISTANCE)) - self._setup_group(group, CAP, at, client_count) + self._setup_group(group, CAP, client_count) group.add_waypoint(self.conflict.from_cp.position, RTB_ALTITUDE) + group.land_at(self.conflict.from_cp.at) def generate_passenger_transport(self, helis: db.HeliDict, clients: db.HeliDict, at: db.StartingPosition): for heli_type, count, client_count in self._split_to_groups(helis, clients): @@ -318,4 +327,4 @@ class AircraftConflictGenerator: altitude=HELI_ALT, ) - self._setup_group(group, Transport, at, client_count) + self._setup_group(group, Transport, client_count) diff --git a/gen/settingsgen.py b/gen/settingsgen.py index 6cbbba19..bd539b3b 100644 --- a/gen/settingsgen.py +++ b/gen/settingsgen.py @@ -130,6 +130,7 @@ class SettingsGenerator: plane_group.points.insert(1, w1) w1.tasks.append(Silence(True)) + w2.tasks.append(SwitchWaypoint(from_waypoint=3, to_waypoint=2)) plane_group.points[3].tasks.append(Silence(False))