Compare commits

...

15 Commits

Author SHA1 Message Date
Dan Albert
a0e5a707fb Merge pull request #1053 from Khopa/develop_2_5_x
Release 2.5.1.
2021-05-02 13:28:45 -07:00
Dan Albert
4555a4968d Update changelog for 2.5.1. 2021-05-02 13:17:35 -07:00
SnappyComebacks
ae34e4749b Move base EWRs into their own category.
Without this we're sometimes spawning base EWRs at points far outside the base perimeter.
2021-04-28 21:07:22 -07:00
Khopa
635eee9590 Fixed ai_flight_planner for maps lacking frontlines (such as battle of britain on The Channel map) 2021-04-24 00:11:53 +02:00
Khopa
f0558c4c1e Fixed ai_flight_planner for maps lacking frontlines (such as battle of britain on The Channel map) 2021-04-23 23:45:14 +02:00
Dan Albert
637ca8fbca Stop projecting threat zones from front lines.
This is an interim improvement since we should probably be pushing the
BARCAPs into TARCAP roles when the front line is so close. This does
regress flight pathing for anything that should route around the front
(to avoid getting shot at by SHORADS and TARCAPs), but for now it's one
or the other and this is the one everyone's complaining about.

(cherry picked from commit e474748f4d)
2021-04-22 18:23:12 -07:00
Dan Albert
e4e65df976 Generalize commit range display for all patrols.
Fixes https://github.com/Khopa/dcs_liberation/issues/890

(cherry picked from commit 132ba905c7)
2021-04-22 17:55:49 -07:00
Dan Albert
29579a2aec Remove missed merge conflict marker. 2021-04-22 17:49:34 -07:00
Dan Albert
e32b43cffb Show BARCAP commit ranges by default.
BARCAP placement confuses a lot of people but this should make it more
clear.

(cherry picked from commit 208d1b82b5)
2021-04-22 17:46:29 -07:00
C. Perreau
de2e5f861b Merge pull request #1007 from Khopa/develop_2_5_x
Release 2.5.0
2021-04-22 00:08:42 +02:00
Khopa
b27a7fc71b Fixed Lint issue 2021-04-21 22:54:48 +02:00
Khopa
5861ce6146 Fixed error with Ramat David frequency (typo) 2021-04-21 22:38:08 +02:00
Khopa
c732ed556f Fixed airfields frequency on Persian Gulf 2021-04-21 22:30:08 +02:00
Khopa
be1a75e520 Fixed airfields frequency on Syria 2021-04-21 22:14:18 +02:00
Khopa
c41d10c581 Pydcs update to latest version 2021-04-21 12:57:19 +02:00
13 changed files with 129 additions and 99 deletions

1
.gitignore vendored
View File

@@ -11,6 +11,7 @@ a.py
resources/tools/a.miz
# User-specific stuff
.idea/
.env
/kneeboards
/liberation_preferences.json

View File

@@ -1,3 +1,16 @@
# 2.5.1
## Features/Improvements
* **[UI]** Engagement ranges are now displayed by default.
* **[UI]** Engagement range display generalized to work for all patrolling flight plans (BARCAP, TARCAP, and CAS).
* **[Flight Planner]** Front lines no longer project threat zones to avoid pushing BARCAPs back so much. TARCAPs will be forcibly planned but strike packages will not route around front lines even if it is reasonable to do so.
## Fixes
* **[Campaigns]** EWRs associated with a base will now only be generated near the base.
* **[Flight Planner]** Fixed error when generating AEW&C flight plans in campaigns with no front lines.
# 2.5.0
Saves from 2.4 are not compatible with 2.5.

View File

@@ -365,7 +365,7 @@ class MizCampaignLoader:
for group in self.ewrs:
closest, distance = self.objective_info(group)
if distance < self.BASE_DEFENSE_RADIUS:
closest.preset_locations.ewrs.append(
closest.preset_locations.base_ewrs.append(
PointWithHeading.from_point(group.position, group.units[0].heading)
)
else:

View File

@@ -63,6 +63,7 @@ class LocationType(Enum):
BaseAirDefense = "base air defense"
Coastal = "coastal defense"
Ewr = "EWR"
BaseEwr = "Base EWR"
Garrison = "garrison"
MissileSite = "missile site"
OffshoreStrikeTarget = "offshore strike target"
@@ -86,6 +87,9 @@ class PresetLocations:
#: Locations used by EWRs.
ewrs: List[PointWithHeading] = field(default_factory=list)
#: Locations used by Base EWRs.
base_ewrs: List[PointWithHeading] = field(default_factory=list)
#: Locations used by non-carrier ships. Carriers and LHAs are not random.
ships: List[PointWithHeading] = field(default_factory=list)
@@ -131,6 +135,8 @@ class PresetLocations:
return self._random_from(self.coastal_defenses)
if location_type == LocationType.Ewr:
return self._random_from(self.ewrs)
if location_type == LocationType.BaseEwr:
return self._random_from(self.base_ewrs)
if location_type == LocationType.Garrison:
return self._random_from(self.base_garrisons)
if location_type == LocationType.MissileSite:
@@ -392,7 +398,7 @@ class ControlPoint(MissionTarget, ABC):
for base_defense in self.base_defenses:
p = PointWithHeading.from_point(base_defense.position, base_defense.heading)
if isinstance(base_defense, EwrGroundObject):
self.preset_locations.ewrs.append(p)
self.preset_locations.base_ewrs.append(p)
elif isinstance(base_defense, SamGroundObject):
self.preset_locations.base_air_defense.append(p)
elif isinstance(base_defense, VehicleGroupGroundObject):

View File

@@ -455,7 +455,7 @@ class BaseDefenseGenerator:
self.generate_base_defenses()
def generate_ewr(self) -> None:
position = self.location_finder.location_for(LocationType.Ewr)
position = self.location_finder.location_for(LocationType.BaseEwr)
if position is None:
return

View File

@@ -152,23 +152,6 @@ class ThreatZones:
threat_zone = point.buffer(threat_range.meters)
air_defenses.append(threat_zone)
for front_line in game.theater.conflicts(player):
vector = Conflict.frontline_vector(
front_line.control_point_a, front_line.control_point_b, game.theater
)
start = vector[0]
end = vector[0].point_from_heading(vector[1], vector[2])
line = LineString(
[
ShapelyPoint(start.x, start.y),
ShapelyPoint(end.x, end.y),
]
)
doctrine = game.faction_for(player).doctrine
air_threats.append(line.buffer(doctrine.cap_engagement_range.meters))
return cls(
airbases=unary_union(air_threats), air_defenses=unary_union(air_defenses)
)

View File

@@ -402,7 +402,7 @@ AIRFIELD_DATA = {
tacan=TacanChannel(96, TacanBand.X),
tacan_callsign="MA",
vor=("MA", MHz(114, 900)),
atc=AtcData(MHz(4, 250), MHz(39, 400), MHz(126, 500), MHz(251, 000)),
atc=AtcData(MHz(4, 300), MHz(39, 500), MHz(126, 500), MHz(251, 100)),
ils={
"13": ("MMA", MHz(111, 100)),
"31": ("IMA", MHz(109, 100)),
@@ -414,7 +414,7 @@ AIRFIELD_DATA = {
elevation=11,
runway_length=6808,
vor=("ALB", MHz(114, 0)),
atc=AtcData(MHz(4, 25), MHz(38, 950), MHz(119, 900), MHz(250, 550)),
atc=AtcData(MHz(4, 75), MHz(39, 50), MHz(119, 900), MHz(250, 600)),
),
"Sas Al Nakheel": AirfieldData(
theater="Persian Gulf",
@@ -422,7 +422,7 @@ AIRFIELD_DATA = {
elevation=9,
runway_length=5387,
vor=("SAS", MHz(128, 930)),
atc=AtcData(MHz(3, 975), MHz(38, 850), MHz(128, 900), MHz(250, 450)),
atc=AtcData(MHz(4, 0), MHz(38, 900), MHz(128, 900), MHz(250, 450)),
),
"Abu Dhabi Intl": AirfieldData(
theater="Persian Gulf",
@@ -430,7 +430,7 @@ AIRFIELD_DATA = {
elevation=91,
runway_length=12817,
vor=("ADV", MHz(114, 250)),
atc=AtcData(MHz(4, 000), MHz(38, 900), MHz(119, 200), MHz(250, 500)),
atc=AtcData(MHz(4, 50), MHz(39, 0), MHz(119, 200), MHz(250, 550)),
),
"Al Ain Intl": AirfieldData(
theater="Persian Gulf",
@@ -438,14 +438,14 @@ AIRFIELD_DATA = {
elevation=813,
runway_length=11267,
vor=("ALN", MHz(112, 600)),
atc=AtcData(MHz(4, 75), MHz(39, 50), MHz(119, 850), MHz(250, 650)),
atc=AtcData(MHz(4, 125), MHz(39, 150), MHz(119, 850), MHz(250, 700)),
),
"Al Maktoum Intl": AirfieldData(
theater="Persian Gulf",
icao="OMDW",
elevation=123,
runway_length=11500,
atc=AtcData(MHz(4, 300), MHz(39, 500), MHz(118, 650), MHz(251, 100)),
atc=AtcData(MHz(4, 350), MHz(39, 600), MHz(118, 600), MHz(251, 200)),
ils={
"30": ("IJWA", MHz(109, 750)),
"12": ("IMA", MHz(111, 750)),
@@ -458,7 +458,7 @@ AIRFIELD_DATA = {
runway_length=11865,
tacan=TacanChannel(99, TacanBand.X),
tacan_callsign="MIN",
atc=AtcData(MHz(3, 800), MHz(38, 500), MHz(121, 800), MHz(250, 100)),
atc=AtcData(MHz(3, 800), MHz(38, 500), MHz(118, 550), MHz(250, 100)),
ils={
"27": ("IMNR", MHz(110, 750)),
"9": ("IMNW", MHz(110, 700)),
@@ -469,7 +469,7 @@ AIRFIELD_DATA = {
icao="OMDB",
elevation=16,
runway_length=11018,
atc=AtcData(MHz(4, 275), MHz(39, 450), MHz(118, 750), MHz(251, 50)),
atc=AtcData(MHz(4, 325), MHz(39, 550), MHz(118, 750), MHz(251, 150)),
ils={
"30": ("IDBL", MHz(110, 900)),
"12": ("IDBR", MHz(110, 100)),
@@ -480,7 +480,7 @@ AIRFIELD_DATA = {
icao="OMSJ",
elevation=98,
runway_length=10535,
atc=AtcData(MHz(3, 850), MHz(38, 600), MHz(118, 600), MHz(252, 200)),
atc=AtcData(MHz(3, 850), MHz(38, 600), MHz(118, 600), MHz(250, 200)),
ils={
"30": ("ISHW", MHz(111, 950)),
"12": ("ISRE", MHz(108, 550)),
@@ -492,18 +492,18 @@ AIRFIELD_DATA = {
elevation=60,
runway_length=9437,
vor=("FJV", MHz(113, 800)),
atc=AtcData(MHz(4, 325), MHz(39, 550), MHz(124, 600), MHz(251, 150)),
atc=AtcData(MHz(4, 375), MHz(39, 650), MHz(124, 600), MHz(251, 250)),
ils={
"29": ("IFJR", MHz(111, 500)),
},
),
"Ras AL Khaimah Intl": AirfieldData(
"Ras Al Khaimah Intl": AirfieldData(
theater="Persian Gulf",
icao="OMRK",
elevation=70,
runway_length=8406,
vor=("OMRK", MHz(113, 600)),
atc=AtcData(MHz(4, 150), MHz(39, 200), MHz(121, 600), MHz(250, 800)),
atc=AtcData(MHz(4, 200), MHz(39, 300), MHz(121, 600), MHz(250, 900)),
),
"Khasab": AirfieldData(
theater="Persian Gulf",
@@ -516,7 +516,11 @@ AIRFIELD_DATA = {
},
),
"Sir Abu Nuayr": AirfieldData(
theater="Persian Gulf", icao="OMSN", elevation=25, runway_length=2229
theater="Persian Gulf",
icao="OMSN",
elevation=25,
runway_length=2229,
atc=AtcData(MHz(3, 900), MHz(38, 700), MHz(118, 0), MHz(250, 800)),
),
"Sirri Island": AirfieldData(
theater="Persian Gulf",
@@ -561,7 +565,7 @@ AIRFIELD_DATA = {
elevation=26,
runway_length=6842,
vor=("KHM", MHz(116, 300)),
atc=AtcData(MHz(3, 825), MHz(38, 550), MHz(118, 50), MHz(250, 150)),
atc=AtcData(MHz(4, 25), MHz(38, 950), MHz(118, 150), MHz(250, 500)),
),
"Bandar Lengeh": AirfieldData(
theater="Persian Gulf",
@@ -569,7 +573,7 @@ AIRFIELD_DATA = {
elevation=80,
runway_length=7625,
vor=("LEN", MHz(114, 800)),
atc=AtcData(MHz(4, 225), MHz(39, 350), MHz(121, 700), MHz(250, 950)),
atc=AtcData(MHz(4, 275), MHz(39, 450), MHz(121, 700), MHz(251, 50)),
),
"Kish Intl": AirfieldData(
theater="Persian Gulf",
@@ -578,7 +582,7 @@ AIRFIELD_DATA = {
runway_length=10617,
tacan=TacanChannel(112, TacanBand.X),
tacan_callsign="KIH",
atc=AtcData(MHz(4, 50), MHz(39, 000), MHz(121, 650), MHz(250, 600)),
atc=AtcData(MHz(4, 100), MHz(39, 100), MHz(121, 650), MHz(250, 650)),
),
"Lavan Island": AirfieldData(
theater="Persian Gulf",
@@ -586,7 +590,7 @@ AIRFIELD_DATA = {
elevation=75,
runway_length=8234,
vor=("LVA", MHz(116, 850)),
atc=AtcData(MHz(4, 100), MHz(39, 100), MHz(128, 550), MHz(250, 700)),
atc=AtcData(MHz(4, 150), MHz(39, 200), MHz(128, 550), MHz(250, 750)),
),
"Lar": AirfieldData(
theater="Persian Gulf",
@@ -603,7 +607,7 @@ AIRFIELD_DATA = {
runway_length=7300,
tacan=TacanChannel(47, TacanBand.X),
tacan_callsign="HDR",
atc=AtcData(MHz(4, 350), MHz(39, 600), MHz(123, 150), MHz(251, 200)),
atc=AtcData(MHz(4, 400), MHz(39, 700), MHz(123, 150), MHz(251, 300)),
ils={
"8": ("IBHD", MHz(108, 900)),
},
@@ -616,7 +620,7 @@ AIRFIELD_DATA = {
tacan=TacanChannel(78, TacanBand.X),
tacan_callsign="BND",
vor=("BND", MHz(117, 200)),
atc=AtcData(MHz(4, 200), MHz(39, 300), MHz(118, 100), MHz(250, 900)),
atc=AtcData(MHz(4, 250), MHz(39, 401), MHz(118, 100), MHz(251, 0)),
ils={
"21": ("IBND", MHz(333, 800)),
},
@@ -636,7 +640,7 @@ AIRFIELD_DATA = {
tacan=TacanChannel(97, TacanBand.X),
tacan_callsign="KER",
vor=("KER", MHz(112, 0)),
atc=AtcData(MHz(3, 900), MHz(38, 700), MHz(118, 250), MHz(250, 300)),
atc=AtcData(MHz(3, 925), MHz(38, 750), MHz(118, 250), MHz(250, 300)),
),
"Shiraz Intl": AirfieldData(
theater="Persian Gulf",
@@ -646,7 +650,7 @@ AIRFIELD_DATA = {
tacan=TacanChannel(94, TacanBand.X),
tacan_callsign="SYZ1",
vor=("SYZ", MHz(112, 0)),
atc=AtcData(MHz(3, 925), MHz(38, 750), MHz(121, 900), MHz(250, 350)),
atc=AtcData(MHz(3, 950), MHz(38, 800), MHz(121, 900), MHz(250, 350)),
),
# Syria Map
"Adana Sakirpasa": AirfieldData(
@@ -655,7 +659,7 @@ AIRFIELD_DATA = {
elevation=55,
runway_length=8115,
vor=("ADA", MHz(112, 700)),
atc=AtcData(MHz(4, 225), MHz(39, 350), MHz(121, 100), MHz(250, 900)),
atc=AtcData(MHz(4, 275), MHz(39, 450), MHz(121, 100), MHz(251, 0)),
ils={
"05": ("IADA", MHz(108, 700)),
},
@@ -668,7 +672,7 @@ AIRFIELD_DATA = {
tacan=TacanChannel(21, TacanBand.X),
tacan_callsign="DAN",
vor=("DAN", MHz(108, 400)),
atc=AtcData(MHz(3, 850), MHz(38, 600), MHz(129, 400), MHz(360, 100)),
atc=AtcData(MHz(3, 900), MHz(38, 700), MHz(122, 100), MHz(360, 100)),
ils={
"50": ("IDAN", MHz(109, 300)),
"23": ("DANM", MHz(111, 700)),
@@ -679,7 +683,7 @@ AIRFIELD_DATA = {
icao="OS71",
elevation=1614,
runway_length=4648,
atc=AtcData(MHz(4, 125), MHz(39, 150), MHz(120, 600), MHz(250, 700)),
atc=AtcData(MHz(4, 175), MHz(39, 250), MHz(120, 600), MHz(250, 800)),
),
"Hatay": AirfieldData(
theater="Syria",
@@ -687,7 +691,7 @@ AIRFIELD_DATA = {
elevation=253,
runway_length=9052,
vor=("HTY", MHz(112, 500)),
atc=AtcData(MHz(3, 825), MHz(38, 550), MHz(128, 500), MHz(250, 150)),
atc=AtcData(MHz(3, 875), MHz(38, 650), MHz(128, 500), MHz(250, 250)),
ils={
"22": ("IHTY", MHz(108, 150)),
"04": ("IHAT", MHz(108, 900)),
@@ -698,25 +702,21 @@ AIRFIELD_DATA = {
icao="OS66",
elevation=1200,
runway_length=6662,
atc=AtcData(MHz(4, 275), MHz(39, 450), MHz(120, 500), MHz(251)),
atc=AtcData(MHz(4, 325), MHz(39, 550), MHz(120, 500), MHz(251, 100)),
),
"Aleppo": AirfieldData(
theater="Syria",
icao="OSAP",
elevation=1253,
runway_length=8332,
atc=AtcData(MHz(4, 150), MHz(39, 200), MHz(119, 100), MHz(250, 750)),
ils={
"50": ("IDAN", MHz(109, 300)),
"23": ("DANM", MHz(111, 700)),
},
atc=AtcData(MHz(4, 200), MHz(39, 300), MHz(119, 100), MHz(250, 850)),
),
"Jirah": AirfieldData(
theater="Syria",
icao="OS62",
elevation=1170,
runway_length=9090,
atc=AtcData(MHz(3, 875), MHz(38, 650), MHz(118, 100), MHz(250, 200)),
atc=AtcData(MHz(3, 925), MHz(38, 750), MHz(118, 100), MHz(250, 300)),
),
"Taftanaz": AirfieldData(
theater="Syria",
@@ -729,14 +729,14 @@ AIRFIELD_DATA = {
icao="OS59",
elevation=1083,
runway_length=9036,
atc=AtcData(MHz(4, 350), MHz(39, 600), MHz(118, 500), MHz(251, 150)),
atc=AtcData(MHz(4, 500), MHz(39, 900), MHz(122, 800), MHz(251, 450)),
),
"Abu al-Dahur": AirfieldData(
theater="Syria",
icao="OS57",
elevation=820,
runway_length=8728,
atc=AtcData(MHz(3, 950), MHz(38, 800), MHz(122, 200), MHz(250, 350)),
atc=AtcData(MHz(4, 0), MHz(38, 900), MHz(122, 200), MHz(250, 450)),
),
"Bassel Al-Assad": AirfieldData(
theater="Syria",
@@ -744,7 +744,7 @@ AIRFIELD_DATA = {
elevation=93,
runway_length=7305,
vor=("LTK", MHz(114, 800)),
atc=AtcData(MHz(4), MHz(38, 900), MHz(118, 100), MHz(250, 450)),
atc=AtcData(MHz(4, 50), MHz(39, 0), MHz(118, 100), MHz(250, 550)),
ils={
"17": ("IBA", MHz(109, 100)),
},
@@ -754,28 +754,28 @@ AIRFIELD_DATA = {
icao="OS58",
elevation=983,
runway_length=7957,
atc=AtcData(MHz(3, 800), MHz(38, 500), MHz(118, 50), MHz(250, 100)),
atc=AtcData(MHz(3, 850), MHz(38, 600), MHz(118, 50), MHz(250, 200)),
),
"Rene Mouawad": AirfieldData(
theater="Syria",
icao="OLKA",
elevation=14,
runway_length=8614,
atc=AtcData(MHz(4, 325), MHz(39, 550), MHz(129, 500), MHz(251, 100)),
atc=AtcData(MHz(4, 375), MHz(39, 650), MHz(121, 0), MHz(251, 200)),
),
"Al Quasayr": AirfieldData(
theater="Syria",
icao="OS70",
elevation=1729,
runway_length=8585,
atc=AtcData(MHz(4, 400), MHz(39, 700), MHz(119, 200), MHz(251, 250)),
atc=AtcData(MHz(4, 550), MHz(40, 0), MHz(119, 200), MHz(251, 550)),
),
"Palmyra": AirfieldData(
theater="Syria",
icao="OSPR",
elevation=1267,
runway_length=8704,
atc=AtcData(MHz(4, 175), MHz(39, 250), MHz(121, 900), MHz(250, 800)),
atc=AtcData(MHz(4, 225), MHz(39, 350), MHz(121, 900), MHz(250, 900)),
),
"Wujah Al Hajar": AirfieldData(
theater="Syria",
@@ -783,14 +783,14 @@ AIRFIELD_DATA = {
elevation=619,
runway_length=4717,
vor=("CAK", MHz(116, 200)),
atc=AtcData(MHz(4, 425), MHz(39, 750), MHz(121, 500), MHz(251, 300)),
atc=AtcData(MHz(4, 575), MHz(40, 50), MHz(121, 500), MHz(251, 600)),
),
"An Nasiriyah": AirfieldData(
theater="Syria",
icao="OS64",
elevation=2746,
runway_length=8172,
atc=AtcData(MHz(4, 450), MHz(39, 800), MHz(122, 300), MHz(251, 350)),
atc=AtcData(MHz(4, 600), MHz(40, 100), MHz(122, 300), MHz(251, 650)),
),
"Rayak": AirfieldData(
theater="Syria",
@@ -798,7 +798,7 @@ AIRFIELD_DATA = {
elevation=2934,
runway_length=8699,
vor=("HTY", MHz(124, 400)),
atc=AtcData(MHz(4, 300), MHz(39, 500), MHz(124, 400), MHz(251, 50)),
atc=AtcData(MHz(4, 350), MHz(39, 600), MHz(124, 400), MHz(251, 150)),
),
"Beirut-Rafic Hariri": AirfieldData(
theater="Syria",
@@ -806,7 +806,7 @@ AIRFIELD_DATA = {
elevation=39,
runway_length=9463,
vor=("KAD", MHz(112, 600)),
atc=AtcData(MHz(4, 475), MHz(39, 850), MHz(118, 900), MHz(251, 400)),
atc=AtcData(MHz(4, 675), MHz(40, 250), MHz(118, 900), MHz(251, 800)),
ils={
"17": ("BIL", MHz(109, 500)),
},
@@ -816,32 +816,32 @@ AIRFIELD_DATA = {
icao="OS61",
elevation=2066,
runway_length=8902,
atc=AtcData(MHz(4, 550), MHz(40), MHz(120, 300), MHz(251, 550)),
atc=AtcData(MHz(4, 750), MHz(40, 400), MHz(120, 300), MHz(251, 950)),
),
"Marj as Sultan North": AirfieldData(
theater="Syria",
elevation=2007,
runway_length=268,
atc=AtcData(MHz(4, 25), MHz(38, 950), MHz(122, 700), MHz(250, 500)),
atc=AtcData(MHz(4, 75), MHz(38, 50), MHz(122, 700), MHz(250, 600)),
),
"Marj as Sultan South": AirfieldData(
theater="Syria",
elevation=2007,
runway_length=166,
atc=AtcData(MHz(4, 525), MHz(39, 950), MHz(122, 900), MHz(251, 500)),
atc=AtcData(MHz(4, 725), MHz(40, 350), MHz(122, 900), MHz(251, 900)),
),
"Mezzeh": AirfieldData(
theater="Syria",
icao="OS67",
elevation=2355,
runway_length=7522,
atc=AtcData(MHz(4, 100), MHz(39, 100), MHz(120, 700), MHz(250, 650)),
atc=AtcData(MHz(4, 150), MHz(39, 200), MHz(120, 700), MHz(250, 750)),
),
"Qabr as Sitt": AirfieldData(
theater="Syria",
elevation=2134,
runway_length=489,
atc=AtcData(MHz(4, 200), MHz(39, 300), MHz(122, 600), MHz(250, 850)),
atc=AtcData(MHz(4, 250), MHz(39, 400), MHz(122, 600), MHz(250, 950)),
),
"Damascus": AirfieldData(
theater="Syria",
@@ -849,7 +849,7 @@ AIRFIELD_DATA = {
elevation=2007,
runway_length=11423,
vor=("DAM", MHz(116)),
atc=AtcData(MHz(4, 500), MHz(39, 900), MHz(118, 500), MHz(251, 450)),
atc=AtcData(MHz(4, 700), MHz(40, 300), MHz(118, 500), MHz(251, 850)),
ils={
"24": ("IDA", MHz(109, 900)),
},
@@ -859,42 +859,42 @@ AIRFIELD_DATA = {
icao="OS63",
elevation=2160,
runway_length=7576,
atc=AtcData(MHz(4, 50), MHz(39), MHz(120, 800), MHz(250, 550)),
atc=AtcData(MHz(4, 100), MHz(39, 100), MHz(120, 800), MHz(250, 6550)),
),
"Kiryat Shmona": AirfieldData(
theater="Syria",
icao="LLKS",
elevation=328,
runway_length=3258,
atc=AtcData(MHz(3, 975), MHz(38, 850), MHz(118, 400), MHz(250, 400)),
atc=AtcData(MHz(4, 25), MHz(38, 950), MHz(118, 400), MHz(250, 500)),
),
"Khalkhalah": AirfieldData(
theater="Syria",
icao="OS69",
elevation=2337,
runway_length=8248,
atc=AtcData(MHz(3, 900), MHz(38, 700), MHz(122, 500), MHz(250, 250)),
atc=AtcData(MHz(3, 950), MHz(38, 800), MHz(122, 500), MHz(250, 350)),
),
"Haifa": AirfieldData(
theater="Syria",
icao="LLHA",
elevation=19,
runway_length=3253,
atc=AtcData(MHz(3, 775), MHz(38, 450), MHz(127, 800), MHz(250, 50)),
atc=AtcData(MHz(3, 825), MHz(38, 550), MHz(127, 800), MHz(250, 150)),
),
"Ramat David": AirfieldData(
theater="Syria",
icao="LLRD",
elevation=105,
runway_length=7037,
atc=AtcData(MHz(4, 250), MHz(39, 400), MHz(118, 600), MHz(250, 950)),
atc=AtcData(MHz(4, 300), MHz(39, 500), MHz(118, 600), MHz(251, 50)),
),
"Megiddo": AirfieldData(
theater="Syria",
icao="LLMG",
elevation=180,
runway_length=6098,
atc=AtcData(MHz(4, 75), MHz(39, 50), MHz(119, 900), MHz(250, 600)),
atc=AtcData(MHz(4, 125), MHz(39, 150), MHz(119, 900), MHz(250, 700)),
),
"Eyn Shemer": AirfieldData(
theater="Syria",
@@ -908,7 +908,7 @@ AIRFIELD_DATA = {
icao="OJMF",
elevation=2204,
runway_length=8595,
atc=AtcData(MHz(3, 925), MHz(38, 750), MHz(118, 300), MHz(250, 300)),
atc=AtcData(MHz(3, 975), MHz(38, 850), MHz(118, 300), MHz(250, 400)),
),
"Tha'lah": AirfieldData(
theater="Syria",

View File

@@ -450,21 +450,31 @@ class ObjectiveFinder:
c for c in self.game.theater.controlpoints if c.is_friendly(self.is_player)
)
def farthest_friendly_control_point(self) -> ControlPoint:
def farthest_friendly_control_point(self) -> Optional[ControlPoint]:
"""
Iterates over all friendly control points and find the one farthest away from the frontline
BUT! prefer Cvs. Everybody likes CVs!
"""
from_frontline = 0
cp = None
first_friendly_cp = None
for c in self.game.theater.controlpoints:
if c.is_carrier and c.is_friendly(self.is_player):
return c
if c.is_friendly(self.is_player) and c.has_frontline:
if c.distance_to(self.front_lines().__next__()) > from_frontline:
from_frontline = c.distance_to(self.front_lines().__next__())
cp = c
return cp
if c.is_friendly(self.is_player):
if first_friendly_cp is None:
first_friendly_cp = c
if c.is_carrier:
return c
if c.has_active_frontline:
if c.distance_to(self.front_lines().__next__()) > from_frontline:
from_frontline = c.distance_to(self.front_lines().__next__())
cp = c
# If no frontlines on the map, return the first friendly cp
if cp is None:
return first_friendly_cp
else:
return cp
def enemy_control_points(self) -> Iterator[ControlPoint]:
"""Iterates over all enemy control points."""
@@ -546,9 +556,10 @@ class CoalitionMissionPlanner:
# Find farthest, friendly CP for AEWC
cp = self.objective_finder.farthest_friendly_control_point()
yield ProposedMission(
cp, [ProposedFlight(FlightType.AEWC, 1, self.MAX_AWEC_RANGE)]
)
if cp is not None:
yield ProposedMission(
cp, [ProposedFlight(FlightType.AEWC, 1, self.MAX_AWEC_RANGE)]
)
# Find friendly CPs within 100 nmi from an enemy airfield, plan CAP.
for cp in self.objective_finder.vulnerable_control_points():
@@ -579,9 +590,23 @@ class CoalitionMissionPlanner:
front_line,
[
ProposedFlight(FlightType.CAS, 2, self.MAX_CAS_RANGE),
ProposedFlight(
FlightType.TARCAP, 2, self.MAX_CAP_RANGE, EscortType.AirToAir
),
# This is *not* an escort because front lines don't create a threat
# zone. Generating threat zones from front lines causes the front
# line to push back BARCAPs as it gets closer to the base. While
# front lines do have the same problem of potentially pulling
# BARCAPs off bases to engage a front line TARCAP, that's probably
# the one time where we do want that.
#
# TODO: Use intercepts and extra TARCAPs to cover bases near fronts.
# We don't have intercept missions yet so this isn't something we
# can do today, but we should probably return to having the front
# line project a threat zone (so that strike missions will route
# around it) and instead *not plan* a BARCAP at bases near the
# front, since there isn't a place to put a barrier. Instead, the
# aircraft that would have been a BARCAP could be used as additional
# interceptors and TARCAPs which will defend the base but won't be
# trying to avoid front line contacts.
ProposedFlight(FlightType.TARCAP, 2, self.MAX_CAP_RANGE),
],
)

2
pydcs

Submodule pydcs updated: 8c657333af...cd14f0a049

View File

@@ -103,7 +103,9 @@ class DisplayOptions:
waypoint_info = DisplayRule("Waypoint Information", True)
culling = DisplayRule("Display Culling Zones", False)
actual_frontline_pos = DisplayRule("Display Actual Frontline Location", False)
barcap_commit_range = DisplayRule("Display selected BARCAP commit range", False)
patrol_engagement_range = DisplayRule(
"Display selected patrol engagement range", True
)
flight_paths = FlightPathOptions()
blue_threat_zones = ThreatZoneOptions("Blue")
red_threat_zones = ThreatZoneOptions("Red")

View File

@@ -58,6 +58,8 @@ from gen.flights.flightplan import (
FlightPlan,
FlightPlanBuilder,
InvalidObjectiveLocation,
PatrollingFlightPlan,
TarCapFlightPlan,
)
from gen.flights.traveltime import TotEstimator
from qt_ui.displayoptions import DisplayOptions, ThreatZoneOptions
@@ -721,13 +723,11 @@ class QLiberationMap(QGraphicsView):
)
prev_pos = tuple(new_pos)
if selected and DisplayOptions.barcap_commit_range:
self.draw_barcap_commit_range(scene, flight)
if selected and DisplayOptions.patrol_engagement_range:
self.draw_patrol_commit_range(scene, flight)
def draw_barcap_commit_range(self, scene: QGraphicsScene, flight: Flight) -> None:
if flight.flight_type is not FlightType.BARCAP:
return
if not isinstance(flight.flight_plan, BarCapFlightPlan):
def draw_patrol_commit_range(self, scene: QGraphicsScene, flight: Flight) -> None:
if not isinstance(flight.flight_plan, PatrollingFlightPlan):
return
start = flight.flight_plan.patrol_start
end = flight.flight_plan.patrol_end

View File

@@ -223,7 +223,7 @@ class FactionSelection(QtWidgets.QWizardPage):
self.redFactionSelect.activated.connect(self.updateUnitRecap)
def setDefaultFactions(self, campaign: Campaign):
""" Set default faction for selected campaign """
"""Set default faction for selected campaign"""
self.blueFactionSelect.clear()
self.redFactionSelect.clear()