From dac2271084d278ebde0585e52ddd6063928a33c2 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Fri, 23 Apr 2021 21:37:01 -0700 Subject: [PATCH] Add transport aircraft to US factions. --- game/db.py | 89 ++++++++++++------- game/theater/base.py | 3 +- gen/flights/ai_flight_planner_db.py | 24 ++++- .../airfield/QAircraftRecruitmentMenu.py | 4 +- resources/factions/usa_1955.json | 5 +- resources/factions/usa_1960.json | 3 +- resources/factions/usa_1965.json | 6 +- resources/factions/usa_1975.json | 11 ++- resources/factions/usa_1990.json | 27 +++--- resources/factions/usa_2005.json | 30 ++++--- resources/factions/usa_2005_c130.json | 30 ++++--- 11 files changed, 152 insertions(+), 80 deletions(-) diff --git a/game/db.py b/game/db.py index 9cc81055..ffeecd8c 100644 --- a/game/db.py +++ b/game/db.py @@ -9,9 +9,12 @@ from dcs.helicopters import ( AH_1W, AH_64A, AH_64D, + CH_47D, + CH_53E, HelicopterType, Ka_50, Mi_24V, + Mi_26, Mi_28N, Mi_8MT, OH_58D, @@ -43,6 +46,7 @@ from dcs.planes import ( Bf_109K_4, C_101CC, C_130, + C_17A, E_3A, E_2C, FA_18C_hornet, @@ -441,6 +445,10 @@ PRICES = { AH_64D: 30, OH_58D: 6, SH_60B: 6, + CH_47D: 4, + CH_53E: 4, + UH_60A: 4, + Mi_26: 4, # Bombers B_52H: 35, B_1B: 50, @@ -464,6 +472,7 @@ PRICES = { E_2C: 50, C_130: 25, Hercules: 25, + C_17A: 20, # WW2 P_51D_30_NA: 18, P_51D: 16, @@ -729,42 +738,42 @@ Following tasks are present: """ UNIT_BY_TASK = { CAP: [ + A_4E_C, + Bf_109K_4, + C_101CC, + FA_18C_hornet, + FW_190A8, + FW_190D9, + F_14A_135_GR, + F_14B, + F_15C, + F_16A, + F_16C_50, + F_22A, + F_4E, F_5E_3, - Su_27, - Su_33, - Su_57, + I_16, + JF_17, + J_11A, + M_2000C, MiG_19P, MiG_21Bis, MiG_23MLD, MiG_25PD, MiG_29A, + MiG_29G, MiG_29S, MiG_31, - FA_18C_hornet, - F_15C, - F_22A, - F_14A_135_GR, - F_14B, - F_16A, - F_16C_50, - M_2000C, Mirage_2000_5, - P_51D_30_NA, P_51D, - MiG_29G, - Su_30, - J_11A, - JF_17, - F_4E, - C_101CC, - I_16, - Bf_109K_4, - FW_190D9, - FW_190A8, - SpitfireLFMkIXCW, - SpitfireLFMkIX, - A_4E_C, + P_51D_30_NA, SA342Mistral, + SpitfireLFMkIX, + SpitfireLFMkIXCW, + Su_27, + Su_30, + Su_33, + Su_57, ], CAS: [ AH_1W, @@ -782,6 +791,7 @@ UNIT_BY_TASK = { F_117A, F_15E, F_86F_Sabre, + Hercules, Ju_88A4, Ka_50, L_39ZA, @@ -797,10 +807,11 @@ UNIT_BY_TASK = { P_47D_30bl1, P_47D_40, RQ_1A_Predator, - S_3B, SA342L, SA342M, SA342Minigun, + SH_60B, + S_3B, Su_17M4, Su_24M, Su_24MR, @@ -813,19 +824,33 @@ UNIT_BY_TASK = { Tu_22M3, Tu_95MS, UH_1H, - SH_60B, WingLoong_I, - Hercules, ], - Transport: [IL_76MD, An_26B, An_30M, Yak_40, C_130], + Transport: [ + An_26B, + An_30M, + CH_47D, + CH_53E, + C_130, + C_17A, + IL_76MD, + Mi_26, + UH_60A, + Yak_40, + ], Refueling: [ IL_78M, - KC_135, KC130, - S_3B_Tanker, KC135MPRS, + KC_135, + S_3B_Tanker, + ], + AWACS: [ + A_50, + E_2C, + E_3A, + KJ_2000, ], - AWACS: [E_3A, E_2C, A_50, KJ_2000], PinpointStrike: [ Armor.APC_MTLB, Armor.APC_MTLB, diff --git a/game/theater/base.py b/game/theater/base.py index 5db7bba7..fa329531 100644 --- a/game/theater/base.py +++ b/game/theater/base.py @@ -4,7 +4,7 @@ import math import typing from typing import Dict, Type -from dcs.task import AWACS, CAP, CAS, Embarking, PinpointStrike, Task +from dcs.task import AWACS, CAP, CAS, Embarking, PinpointStrike, Task, Transport from dcs.unittype import FlyingType, UnitType, VehicleType from dcs.vehicles import AirDefence, Armor @@ -152,6 +152,7 @@ class Base: or for_task == CAS or for_task == CAP or for_task == Embarking + or for_task == Transport ): target_dict = self.aircraft elif for_task == PinpointStrike: diff --git a/gen/flights/ai_flight_planner_db.py b/gen/flights/ai_flight_planner_db.py index a0dd3c73..c5d7c977 100644 --- a/gen/flights/ai_flight_planner_db.py +++ b/gen/flights/ai_flight_planner_db.py @@ -5,8 +5,11 @@ from dcs.helicopters import ( AH_1W, AH_64A, AH_64D, + CH_47D, + CH_53E, Ka_50, Mi_24V, + Mi_26, Mi_28N, Mi_8MT, OH_58D, @@ -14,6 +17,7 @@ from dcs.helicopters import ( SA342M, SH_60B, UH_1H, + UH_60A, ) from dcs.planes import ( AJS37, @@ -23,11 +27,14 @@ from dcs.planes import ( A_10C_2, A_20G, A_50, + An_26B, B_17G, B_1B, B_52H, Bf_109K_4, C_101CC, + C_130, + C_17A, E_2C, E_3A, FA_18C_hornet, @@ -43,6 +50,7 @@ from dcs.planes import ( F_4E, F_5E_3, F_86F_Sabre, + IL_76MD, I_16, JF_17, J_11A, @@ -88,6 +96,7 @@ from dcs.planes import ( Tu_95MS, WingLoong_I, I_16, + Yak_40, ) from dcs.unittype import FlyingType @@ -355,9 +364,20 @@ RUNWAY_ATTACK_CAPABLE = [ # For any aircraft that isn't necessarily directly involved in strike # missions in a direct combat sense, but can transport objects and infantry. TRANSPORT_CAPABLE = [ + C_17A, Hercules, - Mi_8MT, + C_130, + IL_76MD, + An_26B, + Yak_40, + CH_53E, + CH_47D, + SH_60B, + UH_60A, UH_1H, + Mi_8MT, + Mi_8MT, + Mi_26, ] DRONES = [MQ_9_Reaper, RQ_1A_Predator, WingLoong_I] @@ -394,6 +414,8 @@ def aircraft_for_task(task: FlightType) -> List[Type[FlyingType]]: return CAP_CAPABLE elif task == FlightType.AEWC: return AEWC_CAPABLE + elif task == FlightType.TRANSPORT: + return TRANSPORT_CAPABLE else: logging.error(f"Unplannable flight type: {task}") return [] diff --git a/qt_ui/windows/basemenu/airfield/QAircraftRecruitmentMenu.py b/qt_ui/windows/basemenu/airfield/QAircraftRecruitmentMenu.py index 97058d83..d6c3fa6b 100644 --- a/qt_ui/windows/basemenu/airfield/QAircraftRecruitmentMenu.py +++ b/qt_ui/windows/basemenu/airfield/QAircraftRecruitmentMenu.py @@ -13,7 +13,7 @@ from PySide2.QtWidgets import ( QWidget, ) from dcs.helicopters import helicopter_map -from dcs.task import CAP, CAS, AWACS +from dcs.task import CAP, CAS, AWACS, Transport from dcs.unittype import FlyingType, UnitType from game import db @@ -45,7 +45,7 @@ class QAircraftRecruitmentMenu(QFrame, QRecruitBehaviour): def init_ui(self): main_layout = QVBoxLayout() - tasks = [CAP, CAS, AWACS] + tasks = [CAP, CAS, AWACS, Transport] scroll_content = QWidget() task_box_layout = QGridLayout() diff --git a/resources/factions/usa_1955.json b/resources/factions/usa_1955.json index df202d6a..0dd8262b 100644 --- a/resources/factions/usa_1955.json +++ b/resources/factions/usa_1955.json @@ -4,10 +4,11 @@ "authors": "Khopa", "description": "

US army in the 50s, circa Korean War.

", "aircrafts": [ + "B_52H", + "C_130", "F_86F_Sabre", "P_51D", - "P_51D_30_NA", - "B_52H" + "P_51D_30_NA" ], "frontline_units": [ "MT_M4_Sherman", diff --git a/resources/factions/usa_1960.json b/resources/factions/usa_1960.json index 0548300f..9ae7cc8f 100644 --- a/resources/factions/usa_1960.json +++ b/resources/factions/usa_1960.json @@ -4,10 +4,11 @@ "authors": "Khopa", "description": "

US army in the 60s, pre-Vietnam war.

", "aircrafts": [ + "B_52H", + "C_130", "F_86F_Sabre", "P_51D", "P_51D_30_NA", - "B_52H", "UH_1H" ], "frontline_units": [ diff --git a/resources/factions/usa_1965.json b/resources/factions/usa_1965.json index e252c371..6af26fe7 100644 --- a/resources/factions/usa_1965.json +++ b/resources/factions/usa_1965.json @@ -4,9 +4,11 @@ "authors": "Khopa", "description": "

US army in the late 60s, during Vietnam war.

", "aircrafts": [ - "F_5E_3", - "F_4E", "B_52H", + "CH_47D", + "C_130", + "F_4E", + "F_5E_3", "UH_1H" ], "awacs": [ diff --git a/resources/factions/usa_1975.json b/resources/factions/usa_1975.json index c1e894bb..10830133 100644 --- a/resources/factions/usa_1975.json +++ b/resources/factions/usa_1975.json @@ -4,11 +4,14 @@ "authors": "Khopa", "description": "

US army in the 70s at the end of the war in Vietnam.

", "aircrafts": [ - "F_5E_3", - "F_4E", - "F_14A_135_GR", - "S_3B", "B_52H", + "CH_47D", + "CH_53E", + "C_130", + "F_14A_135_GR", + "F_4E", + "F_5E_3", + "S_3B", "UH_1H" ], "awacs": [ diff --git a/resources/factions/usa_1990.json b/resources/factions/usa_1990.json index b9c203ea..18d18849 100644 --- a/resources/factions/usa_1990.json +++ b/resources/factions/usa_1990.json @@ -4,21 +4,26 @@ "authors": "Khopa", "description": "

US army in the 90s, Gulf War/Desert Storm.

", "aircrafts": [ - "F_15C", - "F_15E", + "AH_64A", + "AV8BNA", + "A_10A", + "B_1B", + "B_52H", + "CH_47D", + "CH_53E", + "C_130", + "FA_18C_hornet", + "F_117A", "F_14A_135_GR", "F_14B", - "FA_18C_hornet", + "F_15C", + "F_15E", "F_16C_50", - "A_10A", - "AV8BNA", - "UH_1H", - "S_3B", "SH_60B", - "AH_64A", - "B_52H", - "B_1B", - "F_117A" + "SH_60B", + "S_3B", + "UH_1H", + "UH_60A" ], "awacs": [ "E_3A", diff --git a/resources/factions/usa_2005.json b/resources/factions/usa_2005.json index 50255813..e8af8e95 100644 --- a/resources/factions/usa_2005.json +++ b/resources/factions/usa_2005.json @@ -4,21 +4,27 @@ "authors": "Khopa", "description": "

USA in the 2000s.

", "aircrafts": [ - "F_15C", - "F_15E", - "F_14B", - "F_117A", - "FA_18C_hornet", - "F_16C_50", + "AH_64D", + "AV8BNA", "A_10C", "A_10C_2", - "AV8BNA", - "UH_1H", - "S_3B", - "SH_60B", - "AH_64D", + "B_1B", "B_52H", - "B_1B" + "CH_47D", + "CH_53E", + "C_130", + "C_17A", + "FA_18C_hornet", + "F_117A", + "F_14B", + "F_15C", + "F_15E", + "F_16C_50", + "SH_60B", + "SH_60B", + "S_3B", + "UH_1H", + "UH_60A" ], "awacs": [ "E_3A", diff --git a/resources/factions/usa_2005_c130.json b/resources/factions/usa_2005_c130.json index 9546bd55..d2ceeaf0 100644 --- a/resources/factions/usa_2005_c130.json +++ b/resources/factions/usa_2005_c130.json @@ -4,22 +4,28 @@ "authors": "Khopa", "description": "

USA in the 2000s.

", "aircrafts": [ - "F_15C", - "F_15E", - "F_14B", - "FA_18C_hornet", - "F_16C_50", + "AH_64D", + "AV8BNA", "A_10C", "A_10C_2", - "AV8BNA", - "UH_1H", - "S_3B", - "SH_60B", - "AH_64D", - "B_52H", "B_1B", + "B_52H", + "CH_47D", + "CH_53E", + "C_130", + "C_17A", + "FA_18C_hornet", "F_117A", - "Hercules" + "F_14B", + "F_15C", + "F_15E", + "F_16C_50", + "Hercules", + "SH_60B", + "SH_60B", + "S_3B", + "UH_1H", + "UH_60A" ], "awacs": [ "E_3A",