885 Commits

Author SHA1 Message Date
Dan Albert
81c2bd6c76 Correct int/float confusion in Point APIs.
The heading and distance calculations always return floats.

(cherry picked from commit 6ce02282e74fd3455c3a63880330c05b63a35bff)
2021-08-08 12:52:04 -07:00
Dan Albert
fb964648a8 Use Pillow types from typeshed.
(cherry picked from commit a19a0b678974632549b418764c86b4714354cee1)
2021-08-08 12:52:04 -07:00
Dan Albert
93c6cb34fb Update to latest pydcs.
This includes the basics that we need to get type checking for pydcs
calls.

Type checking has been disabled in a few monkey-patching cases. Patches
ought to be sent upstream (or in the case of dead unit tracking,
replaced with a better model).

(cherry picked from commit 9de08dc83ff1ed30b15f5c7acc21da316fce9b6b)
2021-08-08 12:52:04 -07:00
Dan Albert
be13d8c0a6 More adaptation for pydcs updates.
This is as much as we can do until pydcs actually adds the py.typed
file. Once that's added there are a few ugly monkey patching corners
that will just need `# type: ignore` for now, but we can't pre-add those
since we have mypy warning us about superfluous ignore comments.

(cherry picked from commit 96c7b87ac7ef9382ffad9c3b5846fd8c0df8b0a2)
2021-08-08 12:52:04 -07:00
Brock Greman
6a8a9ef7e9 Fixing broken group generation.
(cherry picked from commit 469dd49defabf7f7c607f6dc5f9c6a82beb04c29)
2021-08-08 12:52:04 -07:00
Dan Albert
c0f6974d07 Fix some typing in preparation for pydcs types.
Not complete, but progress.

(cherry picked from commit 53f6a0b32b922110ccc163e3221a0f6cfd445ef9)
2021-08-08 12:52:04 -07:00
Dan Albert
4e9d661c0c Flesh out typing information, enforce.
(cherry picked from commit fb9a0fe833198d41a911f22d5efc4e3c4829c316)
2021-08-08 12:52:04 -07:00
Dan Albert
7cfd6b7151 Disallow partially specified generics.
(cherry picked from commit 69c3d41a8ad967db27e99235c2f7b9196d29e6b9)
2021-08-08 12:52:04 -07:00
Dan Albert
65dfa8e209 Type check the contents of untyped functions.
By default mypy doesn't type check the code within an untyped function.
This enables that and fixes typing errors to accomodate it.

This did uncover a very old bug:
https://github.com/dcs-liberation/dcs_liberation/issues/1417

(cherry picked from commit fc32b983413dd741a23d33db6da89ddcba7bed64)
2021-08-08 12:52:04 -07:00
Dan Albert
7015b3a40d Fix unreachable code issues, enable checking.
The loadout case actually could (and previously did) hide bugs from the
type checker, since mypy was smart enough to see that we were removing
None from the input it assumed that the member was non-optional, but
later modifications could cause null values, and since those came from
the UI mypy couldn't reason about this. This meant that mypy assumed the
type could not be optional and wouldn't check that case.

(cherry picked from commit 299ed88f09d506df1a10e5454b237263e5cbeeab)
2021-08-08 12:52:04 -07:00
bgreman
4b526e2b90 Adds Marianas Islands support (#1406)
* Implements #1399

* Reverting accidental change in generate_landmap.py

* Changelog update

* Import beacon data for Marianas.

Co-authored-by: Dan Albert <dan@gingerhq.net>
(cherry picked from commit aa328d3ef715bd86180b29d8784ae9040d51aec6)
2021-08-08 12:52:04 -07:00
Dan Albert
8efe66bb45 Fixup None loadouts for aircraft with no loadouts.
Aircraft that have no loadouts at all (such as the IL-78M) will have no
loadouts and thus no values in the dropdown menu. If the player toggles
the custom layout box we reset the flight's loadout to the selected
loadout, and with no loadouts in the combo box that is None, and
`Flight.loadout` isn't supposed to be optional.

Check for that case in the loadout selector and replace with an empty
loadout if that happens.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1402

(cherry picked from commit 727facfb90dac06c3eb74b90e0296a097fae79a3)
2021-08-08 12:52:04 -07:00
Dan Albert
d9dadfb43c Fix the legacy tanker.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1379

(cherry picked from commit 4add8534735c75865955ec7a00a45c43bcf78cde)
2021-08-08 12:52:04 -07:00
RndName
f250be97c7 remove prices from sam generators
The prices are only estimations due to randomization. the real price will be only known when the generator was used and the final units are known

(cherry picked from commit b2db27f9aa06ddbeb6c9e87686abb04cd2f2bb16)
2021-08-08 12:52:04 -07:00
RndName
c8d22925ee correct prices for ewr and sams
prices will now be calculated for the whole group by the generator by
looking up the price using the  GroundUnitType wrapper

fixes #1163

(cherry picked from commit 96be6c0efe4b6b0f3af38bf5c43a9818e1eed4e6)
2021-08-08 12:52:04 -07:00
Mustang-25
55e5aee75a Corrected Silkworm launcher name
(cherry picked from commit bab8384803eb0bcf16f1a3e599c6555a060ac304)
2021-08-08 12:52:04 -07:00
Florian
e550ca29e8 Remove the randomness from SAM group size.
(cherry picked from commit 3f65928e9d1012cff95029ce03bec08db682ea92)
2021-08-08 12:52:04 -07:00
RndName
201fe121ff reworked the skynet group name generation
- added information about the role of the aa site
- moved handling of ground name from tgo to the sam generator to make the tgo cleaner
- adjusted the skynet-config lua to the changes

(cherry picked from commit de443fa3f0ac7ab2d450ec097cf7ac94f17f3506)
2021-08-08 12:52:04 -07:00
Chris Seagraves
a58d3febcb Notes to kneeboard (#1375)
Adds global-level kneeboard notes.  Explicit save compatability with 4.0.0

(cherry picked from commit e94d48c265024b511190fb4d0db7c9bb5144c9c5)
2021-08-08 12:52:04 -07:00
Dan Albert
b7626c10da Fix targeting of carrier groups with TGOs.
The assumption that the first group is the carrier group is wrong.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1346

(cherry picked from commit 80cf8f484df3e2ff5a28bfe681ea68c6d9abfd95)
2021-06-25 16:47:39 -07:00
docofmur
666b389821 Fixes #1337 by making ground location search look in both directions (#1338)
(cherry picked from commit a31432ad9ed89bc9fc2c2f67431b4106aec35b19)
2021-06-24 13:25:41 -04:00
Dan Albert
b03d1599e1 Add a feature flag for pilot limits.
This doesn't currently interact very well with the auto purchase since
the procurer might by aircraft that don't have pilots available. That
should be fixed, but for the short term we should just default to not
enabling this new feature.

(cherry picked from commit 3ddfc47d3a0cbf9688c0fecbdbdf70bab6adeb9e)
2021-06-23 18:47:47 -07:00
Mike Jones
52aff8bc30 Use pydcs has_tacan attribute to check if tankers support TACAN.
(cherry picked from commit bd1618e41d43761b4ef55bb98cfd2a254dfc5d46)
2021-06-22 14:35:47 -07:00
Mike Jones
5c81ac06ac Add gunfighter flag to aircraft data files.
(cherry picked from commit 08b7aff0d89f187609f938d807ce8996b75a176d)
2021-06-22 14:35:46 -07:00
Mike Jones
8364148305 Add patrol configuration to unit data files.
This allows altitude/speed of AEW&C and tankers to be configured.

(cherry picked from commit a75688f89cd19e6ad6bd4bcf202fb53ac2a5fdc3)
2021-06-22 14:35:45 -07:00
Mike Jones
2bcff5a5c2 Fix unit type comparisons.
When comparing UnitType against a pydcs type, use .dcs_unit_type.

(cherry picked from commit 30763b5401228d87207993ca38bc20064581f262)
2021-06-22 14:35:43 -07:00
Dan Albert
0d99fc3d36 Don't order transports for incapable factions.
If these orders can't be fulfilled for the faction it will prevent the
faction from ordering any non-reserve aircraft since transports are
given priority after reserve missions, and they'll never be fulfillable.
As such, no non-reserve aircraft will ever be purchased for factions
without transport aircraft.

Factions without transport aircraft are screwed in other ways, but this
will fix their air planning for campaigns that aren't dependent on
airlift.

(cherry picked from commit e96210f48cd88fcdd9e33e077430653b56fd0941)
2021-06-20 23:44:16 -07:00
Simon Clark
ef3f7125b3 Make mod selection nicer and deprecate MB-339.
Mod selection is now done via checkbox in the new game wizard.

The MB-339 is being turned into a paid module, and the free mod no longer works, so it's been removed.
2021-06-21 00:03:22 +01:00
Dan Albert
4558088412 Revert "Don't propose missions the air wing can't plan."
This is redundant because plan_mission already checks this.

This reverts commit 3338df9836878714f8b72aeb176bed16a33eb65b.

(cherry picked from commit d0745001094d01e1bb49cb7cb6ecdf11eac7e9f8)
2021-06-20 15:59:09 -07:00
Dan Albert
b1a63db1fc Correct some ILS/VOR frequencies in Syria.
`MHz(110, 30)` is 110.03 MHz, not 110.30 MHz.
2021-06-19 15:07:45 -07:00
Dan Albert
3338df9836 Don't propose missions the air wing can't plan.
We were doignt his for escorts, but now that we quit planning as soon as
we find an unplannable mission (to save money for higher priority
missions), if we hit an early unplannable mission like BARCAP no other
missions wil be planned.

Maybe fixes https://github.com/dcs-liberation/dcs_liberation/issues/1228
2021-06-19 11:47:43 -07:00
SnappyComebacks
dc4794b246
Add kneeboard data for new Syria Cyprus airfields. (#1277)
* Add kneeboard data for new Syria Cyprus airfields.
2021-06-19 12:29:21 -06:00
Dan Albert
b130c9882a Remove max distance for AEW&C auto planning.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1259
2021-06-19 11:27:52 -07:00
jsjlewis96
6cd711a1e2 Added option to disable AI pilot levelling 2021-06-19 03:03:50 -07:00
Dan Albert
1ec72d3e94 Fix mission generation when infantry is disabled.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1256
2021-06-18 16:52:03 -07:00
Dan Albert
5c3bb75786 Fix EPLRS for aircraft.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1237
2021-06-18 16:48:59 -07:00
UKayeF
6d2310f59d add Mi-24P as CAS capable aircraft - unsure which other tasks it could be useful for? 2021-06-19 00:54:20 +02:00
C. Perreau
cea970f065
Merge pull request #1248 from jsjlewis96/dot-neutral
#987 Neutral dot labels in options
2021-06-18 18:13:09 +02:00
Khopa
d8511fab1d Fixed pydcs error with missiles units 2021-06-18 18:08:03 +02:00
Dan Albert
4c3ac0af91 Adapt to DCS update. 2021-06-17 22:58:46 -07:00
Dan Albert
09704b6f37 Add a wrapper type for ground unit info. 2021-06-17 22:09:17 -07:00
jsjlewis96
62f6b57948 Added neutral dot option 2021-06-17 23:12:30 +01:00
Dan Albert
ace42019fb Cap squadron size, limit replenishment rate.
This caps squadrons to 12 pilots and limits their replenishment rate to
1 pilot per turn. Should probably make those values configurable, but
they aren't currently.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1136
2021-06-13 14:40:15 -07:00
Dan Albert
4a3ef42e67 Wrap the pydcs FlyingType in our own AircraftType.
This is an attempt to remove a lot of our supposedly unnecessary error
handling. Every aircraft should have a price, a description, a name,
etc; and none of those should require carrying around the faction's
country as context.

This moves all the data for aircraft into yaml files (only one converted
here as an example). Most of the "extended unit info" isn't actually
being read yet.

To replace the renaming of units based on the county, we instead
generate multiple types of each unit when necessary. The CF-18 is just
as much a first-class type as the F/A-18 is.

This doesn't work in its current state because it does break all the
existing names for aircraft that are used in the faction and squadron
files, and we no longer let those errors go as a warning. It will be an
annoying one time switch, but it allows us to define the names that get
used in these files instead of being sensitive to changes as they happen
in pydcs, and allows faction designers to specifically choose, for
example, the Su-22 instead of the Su-17.

One thing not handled by this is aircraft task capability. This is
because the lists in ai_flight_planner_db.py are a priority list, and to
move it out to a yaml file we'd need to assign a weight to it that would
be used to stack rank each aircraft. That's doable, but it makes it much
more difficult to see the ordering of aircraft at a glance, and much
more annoying to move aircraft around in the priority list. I don't
think this is worth doing, and the priority lists will remain in their
own separate lists.

This includes the converted I used to convert all the old unit info and
factions to the new format. This doesn't need to live long, but we may
want to reuse it in the future so we want it in the version history.
2021-06-12 20:13:45 -07:00
Dan Albert
c51c8aae5c Clarify the docs/name of the task type list. 2021-06-09 21:53:45 -07:00
SnappyComebacks
a53a648a63 Add plannable tankers.
This Pull Request lets users plan Tanker flights.

Features:

- Introduction of `Refueling` flight type.
- Tankers can be purchased at airbases and carriers.
- Tankers get planned by AI.
- Tankers are planned from airbases and at aircraft carriers.
- Tankers aim to be at high, fast, and 70 miles from the nearest threat.
  (A10s won't be able to tank)
- Tankers racetrack orbit for one hour.
- Optional Tickbox to enable legacy tankers.
- S-3B Tanker added to factions.
- KC-130 MPRS added to factions.
- Kneeboard shows planned tankers, their tacans, and radios.

Limitations:

- AI doesn't know whether to plan probe and drogue or boom refueling
  tankers.
- User can't choose tanker speed.  Heavily loaded aircraft may have
  trouble.
- User can't choose tanker altitude.  A-10s will not make it to high
  altitude.

Problems:

- Tanker callsigns do not increment, see attached image.  (Investigated:
  Need to use `FlyingType.callsign_dict`, instead of just
  `FlyingType.callsign`.  This seems like it might be significant work
  to do.).
- Having a flight of two or more tankers only spawns one tanker.
- Let me know if you have a solution, or feel free to commit one.

https://user-images.githubusercontent.com/74509817/120909602-d7bc3680-c633-11eb-80d7-eccd4e095770.png
2021-06-09 21:14:10 -07:00
Dan Albert
725b5083c7 Fix typo in Incirlik runway data.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1188
2021-06-08 21:14:36 -07:00
bgreman
3188994261 Gripen mod support.
(cherry picked from commit 0220fa4ff6c0f99216b5d74724d341908290cf36)
2021-06-08 20:49:24 -07:00
Schneefl0cke
e4c9d8799e
Add Recon combat role. 2021-06-08 19:48:56 -07:00
Dan Albert
07cdfc16d0 Move support tanker off find_unittype. 2021-06-07 19:12:30 -07:00