806 Commits

Author SHA1 Message Date
Simon Clark
f2e35c185b Displays the default loadout in the payload UI.
The default loadout is now displayed whenever the custom loadout checkbox is unchecked.

The custom loadout is reset when the custom loadout is checked, to force the user to be prescriptive about the loadout.

Contributes-to: Khopa/dcs_liberation#725
2021-01-07 01:45:45 -08:00
Simon Clark
042be9da6d Carrier group threat rings move with the carrier.
Previously, the individual units in the group were moved, but the ground_unit object was not.

Fixes: Khopa/dcs_liberation#735
2021-01-06 18:58:20 +00:00
Khopa
81b0ea1eef Updated AIM-7 config to account for the Belly and Shoulder versions of the AIM-7 used on the F-14. Also Downgrade AIM-54C to AIM-54A before 86 on the Tomcat. 2021-01-06 01:27:53 +01:00
Khopa
52289d1283 More fallbacks weapons for popular precision air to ground weapons 2021-01-06 00:56:20 +01:00
Khopa
1843d23203 Merge remote-tracking branch 'khopa/develop' into develop 2021-01-06 00:54:42 +01:00
Khopa
1a32fef987 More fallbacks weapons for popular precision air to ground weapons 2021-01-06 00:53:55 +01:00
Simon Clark
c740c8304b
Adds prettier user-facing aircraft names. (#726)
This makes the names of the aircraft displayed to the player in the UI more verbose and readable.

It allows allows specific countries to display an aircraft's name differently. An example of this would be the JF-17 Thunder, which is known in China as the FC-1 Fierce Dragon - this now displays correctly in the Liberation UI.
2021-01-05 13:21:38 -08:00
Khopa
c3401d478b Added R-73 -> R60 to weapons fallback data 2021-01-05 21:40:20 +01:00
Khopa
cf583bcd55 Merge branch 'master' into develop
# Conflicts:
#	changelog.md
#	game/db.py
#	game/game.py
#	game/income.py
#	game/theater/theatergroundobject.py
#	game/version.py
#	qt_ui/windows/finances/QFinancesMenu.py
2021-01-05 19:50:29 +01:00
Simon Clark
3b0466d7cb
Adds a 2010-ish Poland faction. (#713)
The SU-17M4 represents the remaining Su-22s that Poland still flies.
I've used the Stryker as a replacement for the KTO Rosomak, which was in service as far back as 2007.
There were a few Molniyas still in service as of 2010, namely the Metalowiec and Rolnik, as well as a singular Kilo class.
2021-01-05 02:31:49 -08:00
Dan Albert
8a9177b459
Merge pull request #716 from SimonC6R/sold-aircraft-state
Adds a buffer for sold aircraft/vehicles.
2021-01-05 02:12:49 -08:00
Simon Clark
7c3f7d4b8e Addresses review comments. 2021-01-05 09:42:05 +00:00
Dan Albert
2bd5ab06a7 More weapon data.
https://github.com/Khopa/dcs_liberation/issues/490
2021-01-05 00:43:59 -08:00
Dan Albert
7ef191be2a Add more weapon data.
Finishes AIM-120 and AIM-9X.

https://github.com/Khopa/dcs_liberation/issues/490
2021-01-05 00:25:37 -08:00
SimonC6R
03a29aeedf Type annotations. 2021-01-05 00:31:54 +00:00
SimonC6R
ab2046a2c2 Refactor the sell unit changes as requested.
It works more simply now, and also doesn't immediately sell the unit.

Also adds a matching UI dialog popup for selling too many ground units.
2021-01-05 00:26:40 +00:00
Dan Albert
34945e7eba Add date-based loadout restriction.
Follow up work:

* Data entry. I plan to do the air-to-air missiles in the near term. I
  covered some variants of the AIM-120, AIM-7, and AIM-9 here, but there
  are variants of those weapons for each mounting rack that need to be
  done still, as well as all the non-US weapons.
* Arbitrary start dates.

https://github.com/Khopa/dcs_liberation/issues/490
2021-01-04 15:13:40 -08:00
Dan Albert
507b217065 Clean up custom loadout interface.
Wraps the pydcs data in a real type so we don't need to spread the
reflection all over.
2021-01-04 15:13:40 -08:00
Simon Clark
144cfecc0f
Adds the E-2C Hawkeye to the game. (#714)
* Adds the E-2C Hawkeye to the game.

It wasn't being imported from pydcs, and thus wasn't in the list of AWACS aircraft or prices.

Also adds it to the 1985 US Navy list, as that makes sense to do.

Updates .gitignore to ignore my VS Code settings file.

Addresses Khopa/dcs_liberation#709
2021-01-04 13:04:11 -08:00
Simon Clark
64066bfc90 Merge branch 'develop' of https://github.com/Khopa/dcs_liberation into develop 2021-01-04 19:27:36 +00:00
Simon Clark
366ac4ee14 Adds a buffer for sold aircraft/vehicles.
This feature allows you to cancel the sales of aircraft or ground vehicles if needed.

Upon clicking the minus button, a count of sold units will be appended to the unit count. This count responds to both further presses of the minus button, and also to presses of the plus button. No further units will be requested for the next turn until all sold units have been re-bought.

I've tested a bunch of different scenarios with this:

- Selling and rebuying a unit - the budget increases and decreases as expected.

- Selling one unit, buying a unit worth the new player budget, and then trying to rebuy the old unit - the old unit cannot be rebought until the budget has been freed up for it.

- Closing the base window and re-opening it - the sold unit count is retained.

- Ending the turn - the sold unit count is reset back to 0 as expected.

Contributes to Khopa/dcs_liberation#365
2021-01-04 19:27:29 +00:00
walterroach
851984ee66 Revert TGO ID reset - fixes #708 2021-01-04 11:36:40 -06:00
Dan Albert
34bdc0e80b Fix new game creation. 2021-01-01 16:15:43 -08:00
Dan Albert
b5278550e7 Retreat air units from captured bases.
If there are not airbases withing ferry range with available parking for
the aircraft then the aircraft will be captured and sold. Otherwise the
aircraft will retreat to the closest available airbase.

Fixes https://github.com/Khopa/dcs_liberation/issues/693
2021-01-01 15:19:16 -08:00
Dan Albert
fcb1d8e104 Retreat ground forces from captured bases.
If the captured base has no connection to other friendly objectives (the
base was encircled) then the enemy equipment will be captured and sold.
Otherwise the units will retreat toward connected bases.

Partial fix for https://github.com/Khopa/dcs_liberation/issues/693.
Still need to fix this for air units.
2021-01-01 14:45:43 -08:00
Dan Albert
6cbc2b707a Fix type of Game.budget.
This *is* a float, since the income multiplier is a float. The type
annotations were wrong.
2021-01-01 13:56:33 -08:00
Dan Albert
9671542bdf Decouple unit deliveries and conflict events.
Fixes https://github.com/Khopa/dcs_liberation/issues/692 and lets us
clean up the interface quite a bit.
2021-01-01 13:48:23 -08:00
Dan Albert
de325c1208 Refunding unfulfilled orders on capture.
Fixes https://github.com/Khopa/dcs_liberation/issues/682
2021-01-01 13:23:58 -08:00
Khopa
900cf0a9d0 Update preview version number 2020-12-31 13:16:09 +01:00
Dan Albert
5734c29312 Remove wrong precondition in aircraft procurement.
Those task types aren't correct here (that whole dict probably serves
little purpose now), and the actual unit pool is handled in
_affordable_aircraft_of_types.
2020-12-28 16:06:54 -08:00
walterroach
daba4ef09e Fix aircraft group IDs not being reproducible. 2020-12-28 14:04:19 -06:00
walterroach
aa7825d4aa Reproducible unit naming
Splits infantry and other unit IDs.

Resets IDs to start from zero at each press of "Takeoff"

Direct access to the the `Game` class IDs is done on the `Operation` class to
preserve save compat
2020-12-28 09:27:33 -06:00
Dan Albert
436725b38e Don't award base capture bonuses.
If anything we should be granting the loser extra income so they can
recover. For now just remove.
2020-12-27 19:52:42 -08:00
Dan Albert
922d935bc1 Tweak default budget and turn 0 allocation.
AI wasn't buying many ground vehicles. Keep the turn 0 air budget about
where it was but bump up the ground budget from ~120M to ~600M.
2020-12-27 19:48:03 -08:00
Dan Albert
3a9f585b6b Plan multiple CAP rounds per turn.
On station time for CAP is only 30 minutes, so plan three cycles to give
~90 minutes of CAP coverage.

Default starting budget has increased significantly to account for the
greatly increased aircraft needs on turn 1.

Fixes https://github.com/Khopa/dcs_liberation/issues/673
2020-12-26 17:26:07 -08:00
Dan Albert
7bbb1c0822 Don't show repaired TGOs as dead.
We were never resetting the dead state for repaired SAMs. Rather than
tracking that manually, determine liveness from the number of units left
alive.

For building objectives where the group is not assigned to the TGO until
*mission* generation time we still need manual tracking.

(cherry picked from commit d3b1f6110f23b72c67d2ab86585087115004390d)
2020-12-26 16:21:31 -08:00
Dan Albert
d3b1f6110f Don't show repaired TGOs as dead.
We were never resetting the dead state for repaired SAMs. Rather than
tracking that manually, determine liveness from the number of units left
alive.

For building objectives where the group is not assigned to the TGO until
*mission* generation time we still need manual tracking.
2020-12-26 16:19:41 -08:00
Dan Albert
a6dc3d2aff Handle threat/detection per group.
Some SAMs have multiple groups (such as an SA-10 group with its
accompanying SA-15 and SA-19 groups). This shows each group's threat and
detection separately on the map, and also makes it so that an SA-10 with
dead radars will no longer contribute to the threat zone just because
the shilka next to it still has a functioning radar.

https://github.com/Khopa/dcs_liberation/issues/647
Fixes https://github.com/Khopa/dcs_liberation/issues/672
2020-12-26 15:52:36 -08:00
Dan Albert
d946a9e526 Don't count blind SAMs as threats.
https://github.com/Khopa/dcs_liberation/issues/647
2020-12-26 15:40:38 -08:00
Dan Albert
17dd1b193e Remove aa_ranges in favor of using the TGO data. 2020-12-26 15:25:23 -08:00
Dan Albert
d634fd3236 Adjust income based on control point type.
* Navies and off map spawns generate no income
* FOBs generate 10 instead of 20

Fixes https://github.com/Khopa/dcs_liberation/issues/662
2020-12-26 15:08:57 -08:00
Dan Albert
e861e5b3d6 Even out player and opfor income rules.
Should help fix the anemic enemy forces after the first few turns.
2020-12-26 14:35:57 -08:00
Dan Albert
6045f4dd91 Fix New Package for naval control points.
Also reordered the tasks so ship-specific tasks appear first.

Fixes https://github.com/Khopa/dcs_liberation/issues/628

(cherry picked from commit 8be2841bdfcf420996db5f15de4c00bc9227ef58)
2020-12-26 14:30:34 -08:00
Dan Albert
8be2841bdf Fix New Package for naval control points.
Also reordered the tasks so ship-specific tasks appear first.

Fixes https://github.com/Khopa/dcs_liberation/issues/628
2020-12-26 14:30:26 -08:00
Dan Albert
b6e37b9e67 Exclude non-AA groups from SAM threat zones.
Fixes https://github.com/Khopa/dcs_liberation/issues/666
2020-12-26 14:00:31 -08:00
Dan Albert
c7f9bfbb43 Sell off incomplete opfor squadrons.
Short term fix for https://github.com/Khopa/dcs_liberation/issues/41.
2020-12-25 18:45:58 -08:00
Dan Albert
b5f8e6925b Rank aircraft purchase preferences.
Rather than randomly selecting compatible aircraft for missions, perfer
the *best* aircraft for the job. This removes the "preferred" lists in
favor of sorting the capable lists in priority order. To maintain some
amount of variety the procurer has a 50/50 chance of buying when it
finds a match.

Fixes https://github.com/Khopa/dcs_liberation/issues/510
2020-12-25 18:22:50 -08:00
Dan Albert
993e59413a Add pretty-print for AircraftProcurementRequest. 2020-12-25 17:31:26 -08:00
Dan Albert
17c40234e9 Add basic intel window.
Currently only shows the enemy's economic information.

https://github.com/Khopa/dcs_liberation/issues/658
(cherry picked from commit 1d76ee4871fef779ea96bd39a4b568f40607d4cf)
2020-12-25 16:04:54 -08:00
Dan Albert
1d76ee4871 Add basic intel window.
Currently only shows the enemy's economic information.

https://github.com/Khopa/dcs_liberation/issues/658
2020-12-25 03:24:33 -08:00