672 Commits

Author SHA1 Message Date
walterroach
17fe977b06
Merge pull request #437 from walterroach/operation_refactor
Operation refactor
2020-11-23 22:36:46 -06:00
Dan Albert
e68d2b5deb Plan OCA strikes at heavily populated airfields.
https://github.com/Khopa/dcs_liberation/issues/349
2020-11-23 18:09:05 -08:00
Dan Albert
b0317055e7 Implement OCA strike missions.
https://github.com/Khopa/dcs_liberation/issues/349
2020-11-23 17:58:53 -08:00
Dan Albert
6e0af7c144 Fix names of tasks to not use the enum name. 2020-11-23 17:15:42 -08:00
Dan Albert
9394ed663a Add runway bombing missions.
This allows planning the missions and the missions are functional, but
they will have no effect on future turns yet.
2020-11-23 16:47:58 -08:00
walterroach
967574820f Remove unused conflictgen globals
Remove unused  `Conflict` properties

mypy fixes

Cleanup
2020-11-23 18:14:25 -06:00
walterroach
da17d1e5d1 Change Operation to a static class
Removed always True "event successful"

Add `AirWarEvent` as the primary game `Event` applied to every miz

Cleanup of `FrontLineAttackEvent`

Change `Operation.is_awacs_enabled` to two bools for each side red/blue
Currently controlled by whether an AWACs is available for the faction
(and only ever true for Blue)
2020-11-23 18:14:25 -06:00
Dan Albert
63bdbebcaa Refactor control points into individual classes. 2020-11-23 14:34:58 -08:00
Dan Albert
2484457183 Spawn unused aircraft at airports.
The aircraft that have not been fragged will now be spawned in parking
to provide more targets for OCA strikes. We do this only at airports,
not carriers. The AI has enough trouble taxiing around uncrowded carrier
decks that we probably shouldn't make it harder for them, plus most of
the aircraft will be stored below the flight deck (we allow 90 aircraft
to be stored at the carrier, which certainly will not fit on the flight
deck).

The aircraft are spawned in an uncontrolled state and nothing will
activate them, so aside from the cost of rendering them they shouldn't
affect performance.

Fixes https://github.com/Khopa/dcs_liberation/issues/148
2020-11-23 00:12:42 -08:00
walterroach
c2eb243026 Fix bug #400
arg position
2020-11-22 17:43:19 -06:00
Khopa
2adaee8671 Added Soviet Union 1943 2020-11-23 00:15:44 +01:00
walterroach
57edc5678c Merge branch 'develop' of https://github.com/Khopa/dcs_liberation into develop 2020-11-22 16:41:59 -06:00
walterroach
730130b19e Set AGL altitude on target waypoints 2020-11-22 16:41:53 -06:00
Dan Albert
17b0cee507 Add unrestricted SATNAV support to factions.
Enabled for bluefor modern, since they ought to have GPS but seemingly
don't.

This change does nothing until https://github.com/pydcs/dcs/pull/102
lands and we update to it.
2020-11-22 13:28:05 -08:00
Dan Albert
2557383946 Fix type of default map visibility setting.
The UI sets these to the proper enum types; only the default is wrong.
Fix the default and clean up the associated code.

Note that this does minorly break save compatibility and alters default
behavior, since previously we were ignoring the default option. Ignoring
the default looks unintentional since there is no explicit "don't force
this option" setting in the UI.

Existing saves can be fixed simply by changing this option to something
else and then back.
2020-11-22 13:28:05 -08:00
Dan Albert
f6fad30852 Add unit name -> Liberation object map.
Generated units are added to this during mission generation so we can
map destroyed units back to the data that generated them. Currently only
implemented for aircraft as a proof of concept.
2020-11-21 21:01:46 -08:00
walterroach
b57dd51f86 Merge branch 'develop' into frontline 2020-11-21 18:55:56 -06:00
walterroach
fc6ca162af Merge branch 'develop_2_2_x' into develop 2020-11-21 18:24:36 -06:00
walterroach
f6e0dbbb6a operation refactoring 2020-11-21 17:00:22 -06:00
walterroach
316f73138c Merge branch 'develop' into frontline 2020-11-21 11:19:31 -06:00
walterroach
866ff78518 Merge branch 'develop_2_2_x' into frontline 2020-11-21 11:15:36 -06:00
Dan Albert
0d95716545 Correct type annotations. 2020-11-20 21:40:31 -08:00
walterroach
007dcf548e remove dead code 2020-11-20 21:02:11 -06:00
walterroach
edd02d9dd6 Merge branch 'develop' into frontline 2020-11-20 20:32:50 -06:00
walterroach
2b6227f3b1 remove dead code 2020-11-20 20:29:30 -06:00
Dan Albert
a594f45aae Pick divert airfields when planning.
https://github.com/Khopa/dcs_liberation/issues/342
2020-11-20 17:29:58 -08:00
Dan Albert
ae68a35a1a Remove save compat since it's breaking anyway.
Removal of old paths/names for things that no longer exist.
2020-11-20 17:06:01 -08:00
Dan Albert
a9fcfe60f4 Add arrival/divert airfield selection.
Breaks save compat because it adds new fields to `Flight` that have no
constant default. Removing all of our other save compat at the same
time.

Note that player flights with a divert point will have a nav point for
their actual landing point. This is because we place the divert point
last, and DCS won't let us have a land point anywhere but the final
waypoint. It would allow a LandingReFuAr point, but they're only
generated for player flights anyway so it doesn't really matter.

Fixes https://github.com/Khopa/dcs_liberation/issues/342
2020-11-20 16:16:00 -08:00
Dan Albert
7c22f6e83b Change mach function to take altitude in meters.
All of the callers are passing altitude in meters because that's what
pydcs uses. This still returns knots which makes it extra weird, but
that's what almost all of the callers expect.

It's probably a good idea to introduce some explicit types for the
various distance and speed units to avoid these sorts of mistakes.
2020-11-20 02:19:38 -08:00
Dan Albert
18b6f7b84c Add off-map spawn locations.
The AI isn't making use of these yet, but it's not smart enough to do so
anyway.

Would benefit from an icon to differentiate it on the map.

I'm stretching the definition of "control point" quite a bit. We might
want to put a class above `ControlPoint` for `AirSpawnLocation` to
represent types of spawn locations that can't be captured and don't have
ground objectives.

Fixes https://github.com/Khopa/dcs_liberation/issues/274
2020-11-20 02:19:03 -08:00
Dan Albert
206d09f7f8 Maybe correct fishbed radios.
Maybe fixes https://github.com/Khopa/dcs_liberation/issues/377
2020-11-20 00:20:01 -08:00
Dan Albert
4e910c4b09 Maybe correct fishbed radios.
Maybe fixes https://github.com/Khopa/dcs_liberation/issues/377
2020-11-20 00:18:00 -08:00
Dan Albert
1ee0aafd9a Unify TGO location selection.
We currently have three methods of choosing locations for TGOs:

1. From the campaign miz
2. From the per-CP mizdata files
3. Randomly

Move the selection among these sources into a single place and use it
everywhere that we search for a TGO location.

Longer term methods 2 and 3 will be removed.
2020-11-19 21:09:33 -08:00
walterroach
3eb2529b0b Fix #402 2020-11-19 13:20:05 -06:00
Khopa
e6e4cca076 Made it possible to setup custom liveries in faction files. 2020-11-19 20:18:26 +01:00
Khopa
483db564f9 Added F-14A support 2020-11-19 20:14:21 +01:00
Dan Albert
fd473f0a46 Fix custom waypoints.
Like with deleting waypoints, these will degrade the flight plan to the
2.1 behavior.

Ascend/descend points aren't in use any more, so I removed those.
2020-11-19 00:36:43 -08:00
Dan Albert
94c5ed8bdc Fix custom waypoints.
Like with deleting waypoints, these will degrade the flight plan to the
2.1 behavior.

Ascend/descend points aren't in use any more, so I removed those.
2020-11-19 00:29:05 -08:00
Dan Albert
4b7b4bf110 Allow deleting waypoints.
In almost every case this leaves us with a flight plan we can't reason
about, so it gets degraded to `CustomFlightPlan`. The exception is when
deleting a target point when there are other target points remaining.
This probably gets people using this feature back to what they want
though, which is essentially the 2.1 behavior.

Fixes https://github.com/Khopa/dcs_liberation/issues/393
2020-11-18 23:44:16 -08:00
Dan Albert
a816877d08 Allow deleting waypoints.
In almost every case this leaves us with a flight plan we can't reason
about, so it gets degraded to `CustomFlightPlan`. The exception is when
deleting a target point when there are other target points remaining.
This probably gets people using this feature back to what they want
though, which is essentially the 2.1 behavior.

Fixes https://github.com/Khopa/dcs_liberation/issues/393
2020-11-18 23:43:01 -08:00
Dan Albert
8d485d5fa2 Delay player CV flight when their settings say so.
Fixes https://github.com/Khopa/dcs_liberation/issues/375

This also fixes a problem where we're spawning non-cold start planes in
an uncontrolled state. The ME won't let us do this, so we probably
shouldn't be doing that.
2020-11-18 21:27:18 -08:00
Dan Albert
fa549fcf94 Don't delay player flights with short delays.
Not much point in delaying humans 8 seconds.

Fixes https://github.com/Khopa/dcs_liberation/issues/397
2020-11-18 21:27:18 -08:00
Dan Albert
5928f29f11 Delay player CV flight when their settings say so.
Fixes https://github.com/Khopa/dcs_liberation/issues/375

This also fixes a problem where we're spawning non-cold start planes in
an uncontrolled state. The ME won't let us do this, so we probably
shouldn't be doing that.
2020-11-18 19:34:38 -08:00
Dan Albert
c3ebabbe44 Don't delay player flights with short delays.
Not much point in delaying humans 8 seconds.

Fixes https://github.com/Khopa/dcs_liberation/issues/397
2020-11-18 19:27:03 -08:00
Khopa
29fd094dd0 Added F-14A support 2020-11-19 00:34:24 +01:00
Dan Albert
8345063e84 Move theater into game. 2020-11-17 18:11:33 -08:00
Dan Albert
7d7a334418 Fix mypy. 2020-11-17 02:04:38 -08:00
Dan Albert
69dbe62b70 Plan anti-ship missions automatically. 2020-11-17 01:08:06 -08:00
Dan Albert
2ac92a75a4 Plan BAI missions automatically. 2020-11-17 00:36:41 -08:00
Dan Albert
505af7635f Include EWRs in DEAD targets. 2020-11-16 23:53:25 -08:00