From ca98183e943baaf25584b7c3e198fc073dd70eeb Mon Sep 17 00:00:00 2001 From: MetalStormGhost <89945461+MetalStormGhost@users.noreply.github.com> Date: Sun, 28 Jan 2024 19:35:24 +0200 Subject: [PATCH] IDF Assets Pack support v1.1 (#233) * Updated Irondome support to IDF Assets Pack V1.1, which includes the David's Sling. * Added an Israel 2017 faction with the David's Sling. * IDF Assets Pack air defence presets and assets are now correctly removed from the faction when the mod is disabled. * Removed the Iron Dome mod rocket launchers: - "9M22U - 122mm Grad" - "9M27F - 229mm Uragan" - "9M55F - 300mm Smerch" These were added to the Iron Dome Mod V1.2 in order for the radar to recognize them and be able to intercept them (these are limitations of DCS), so new rockets were added. However, they don't exist in the IDF Assets Pack. * IronDome to IDF-Assets migration --------- Co-authored-by: Raffson --- changelog.md | 1 + game/dcs/groundunittype.py | 10 ++ game/factions/faction.py | 13 ++- game/persistency.py | 8 ++ pydcs_extensions/irondome/irondome.py | 77 +++++++------ .../newgame/WizardPages/QGeneratorSettings.py | 2 +- resources/factions/israel_1973.json | 2 +- resources/factions/israel_1982.json | 4 +- resources/factions/israel_2012.json | 5 +- resources/factions/israel_2017.json | 102 ++++++++++++++++++ resources/groups/DavidSling.yaml | 10 ++ resources/groups/DavidSling_Semicircle.yaml | 10 ++ resources/groups/IronDome.yaml | 3 +- resources/groups/IronDome_Semicircle.yaml | 10 ++ .../units/ground_units/DAVID_SLING_LN.yaml | 4 + .../units/ground_units/ELM2084_MMR_AD_RT.yaml | 11 ++ .../units/ground_units/ELM2084_MMR_AD_SC.yaml | 11 ++ ...{ELM2048_MMR.yaml => ELM2084_MMR_WLR.yaml} | 2 +- resources/units/ground_units/I9K51_GRAD.yaml | 10 -- .../units/ground_units/I9K57_URAGAN.yaml | 11 -- .../units/ground_units/I9K58_SMERCH.yaml | 12 --- ..._CP.yaml => Iron_Dome_David_Sling_CP.yaml} | 1 + 22 files changed, 231 insertions(+), 88 deletions(-) create mode 100644 resources/factions/israel_2017.json create mode 100644 resources/groups/DavidSling.yaml create mode 100644 resources/groups/DavidSling_Semicircle.yaml create mode 100644 resources/groups/IronDome_Semicircle.yaml create mode 100644 resources/units/ground_units/DAVID_SLING_LN.yaml create mode 100644 resources/units/ground_units/ELM2084_MMR_AD_RT.yaml create mode 100644 resources/units/ground_units/ELM2084_MMR_AD_SC.yaml rename resources/units/ground_units/{ELM2048_MMR.yaml => ELM2084_MMR_WLR.yaml} (94%) delete mode 100644 resources/units/ground_units/I9K51_GRAD.yaml delete mode 100644 resources/units/ground_units/I9K57_URAGAN.yaml delete mode 100644 resources/units/ground_units/I9K58_SMERCH.yaml rename resources/units/ground_units/{IRON_DOME_CP.yaml => Iron_Dome_David_Sling_CP.yaml} (70%) diff --git a/changelog.md b/changelog.md index e173a05a..b55d5aaa 100644 --- a/changelog.md +++ b/changelog.md @@ -13,6 +13,7 @@ * **[Modding]** Updated support for F-4B/C Phantom mod to 2.8.7.204 * **[Modding]** Updated Community A-4E-C mod version support to 2.2.0 release. * **[Modding]** Added F/A-18E/F Super Hornet AI Tanker mod support (Chiller Juice Studios SuperBug Tanker AI version 1.4) +* **[Modding]** Updated Irondome support to IDF Assets Pack V1.1, adding support for the David's Sling * **[Radios]** Added HF-FM band for AN/ARC-222 * **[Radios]** Ability to define preset channels for radios on squadron level (for human pilots only) * **[Mission Planning]** Avoid helicopters being assigned as escort to planes and vice-versa diff --git a/game/dcs/groundunittype.py b/game/dcs/groundunittype.py index 3f795544..39b33f22 100644 --- a/game/dcs/groundunittype.py +++ b/game/dcs/groundunittype.py @@ -69,6 +69,16 @@ class GroundUnitType(UnitType[Type[VehicleType]]): if "name" in state: state["variant_id"] = state.pop("name") + # iron-dome migration to IDF assets + if state["variant_id"] in [ + "(IDF Mods Project) BM-21 Grad 122mm", + "(IDF Mods Project) Urgan BM-27 220mm", + "(IDF Mods Project) 9A52 Smerch CM 300mm", + ]: + state["variant_id"] = "M109A6 Paladin" + elif state["variant_id"] == "Iron Dome ELM-2048 MMR": + state["variant_id"] = "ELM-2084MMR AD Rotating Mode" + # Update any existing models with new data on load. updated = GroundUnitType.named(state["variant_id"]) state.update(updated.__dict__) diff --git a/game/factions/faction.py b/game/factions/faction.py index f29ec975..2dc4bd0e 100644 --- a/game/factions/faction.py +++ b/game/factions/faction.py @@ -458,13 +458,16 @@ class Faction: self.remove_ship("L02") self.remove_ship("DDG39") if not mod_settings.irondome: - self.remove_vehicle("I9K51_GRAD") - self.remove_vehicle("I9K57_URAGAN") - self.remove_vehicle("I9K58_SMERCH") - self.remove_vehicle("IRON_DOME_CP") + self.remove_vehicle("Iron_Dome_David_Sling_CP") self.remove_vehicle("IRON_DOME_LN") - self.remove_vehicle("ELM2048_MMR") + self.remove_vehicle("DAVID_SLING_LN") + self.remove_vehicle("ELM2084_MMR_AD_RT") + self.remove_vehicle("ELM2084_MMR_AD_SC") + self.remove_vehicle("ELM2084_MMR_WLR") self.remove_preset("Iron Dome") + self.remove_preset("Iron Dome (Semicircle)") + self.remove_preset("David's Sling") + self.remove_preset("David's Sling (Semicircle)") # swedish military assets pack if not mod_settings.swedishmilitaryassetspack: self.remove_vehicle("BV410_RBS70") diff --git a/game/persistency.py b/game/persistency.py index 3e24e97d..548d26be 100644 --- a/game/persistency.py +++ b/game/persistency.py @@ -10,6 +10,7 @@ import dcs.terrain.falklands.airports import pydcs_extensions from game.profiling import logged_duration +from pydcs_extensions import ELM2084_MMR_AD_RT, Iron_Dome_David_Sling_CP if TYPE_CHECKING: from game import Game @@ -62,6 +63,13 @@ class MigrationUnpickler(pickle.Unpickler): return DummyObject if module == "pydcs_extensions.f4b.f4b": return pydcs_extensions.f4 + if module == "pydcs_extensions.irondome.irondome": + if name in ["I9K57_URAGAN", "I9K51_GRAD", "I9K58_SMERCH"]: + return None + elif name == "ELM2048_MMR": + return ELM2084_MMR_AD_RT + elif name == "IRON_DOME_CP": + return Iron_Dome_David_Sling_CP return super().find_class(module, name) # fmt: on diff --git a/pydcs_extensions/irondome/irondome.py b/pydcs_extensions/irondome/irondome.py index 4b2cdd70..e4ecb966 100644 --- a/pydcs_extensions/irondome/irondome.py +++ b/pydcs_extensions/irondome/irondome.py @@ -4,39 +4,9 @@ from game.modsupport import vehiclemod @vehiclemod -class I9K51_GRAD(VehicleType): - id = "I9K51_GRAD" - name = "(IDF Mods Project) BM-21 Grad 122mm" - detection_range = 0 - threat_range = 19000 - air_weapon_dist = 19000 - eplrs = True - - -@vehiclemod -class I9K57_URAGAN(VehicleType): - id = "I9K57_URAGAN" - name = "(IDF Mods Project) Urgan BM-27 220mm" - detection_range = 0 - threat_range = 35800 - air_weapon_dist = 35800 - eplrs = True - - -@vehiclemod -class I9K58_SMERCH(VehicleType): - id = "I9K58_SMERCH" - name = "(IDF Mods Project) 9A52 Smerch CM 300mm" - detection_range = 0 - threat_range = 70000 - air_weapon_dist = 70000 - eplrs = True - - -@vehiclemod -class IRON_DOME_CP(VehicleType): - id = "IRON_DOME_CP" - name = "Iron Dome CP" +class Iron_Dome_David_Sling_CP(VehicleType): + id = "Iron_Dome_David_Sling_CP" + name = "[IDF Mods] Iron Dome-David Sling CP" detection_range = 0 threat_range = 0 air_weapon_dist = 0 @@ -46,16 +16,43 @@ class IRON_DOME_CP(VehicleType): @vehiclemod class IRON_DOME_LN(VehicleType): id = "IRON_DOME_LN" - name = "Iron Dome LN" + name = "[IDF Mods] Iron Dome" detection_range = 0 - threat_range = 25000 - air_weapon_dist = 25000 + threat_range = 20000 + air_weapon_dist = 20000 @vehiclemod -class ELM2048_MMR(VehicleType): - id = "ELM2048_MMR" - name = "Iron Dome ELM-2048 MMR" - detection_range = 412000 +class DAVID_SLING_LN(VehicleType): + id = "DAVID_SLING_LN" + name = "[IDF Mods] David Sling" + detection_range = 0 + threat_range = 250000 + air_weapon_dist = 250000 + + +@vehiclemod +class ELM2084_MMR_AD_RT(VehicleType): + id = "ELM2084_MMR_AD_RT" + name = "[IDF Mods] ELM-2084MMR AD Rotating Mode" + detection_range = 475000 + threat_range = 0 + air_weapon_dist = 0 + + +@vehiclemod +class ELM2084_MMR_AD_SC(VehicleType): + id = "ELM2084_MMR_AD_SC" + name = "[IDF Mods] ELM-2084MMR AD Sector Mode" + detection_range = 650000 + threat_range = 0 + air_weapon_dist = 0 + + +@vehiclemod +class ELM2084_MMR_WLR(VehicleType): + id = "ELM2084_MMR_WLR" + name = "[IDF Mods] ELM-2084MMR WLR Mode" + detection_range = 160000 threat_range = 0 air_weapon_dist = 0 diff --git a/qt_ui/windows/newgame/WizardPages/QGeneratorSettings.py b/qt_ui/windows/newgame/WizardPages/QGeneratorSettings.py index 6b2ccf0f..d5ae847b 100644 --- a/qt_ui/windows/newgame/WizardPages/QGeneratorSettings.py +++ b/qt_ui/windows/newgame/WizardPages/QGeneratorSettings.py @@ -175,7 +175,7 @@ class GeneratorOptions(QtWidgets.QWizardPage): ("UH-60L Black Hawk (v1.3.1)", self.uh_60l), ("Star Wars Modpack 2.54+", self.SWPack), ("Spanish Naval Assets pack (desdemicabina 3.2.0)", self.spanishnavypack), - ("Iron Dome (v1.2 by IDF Mods Project)", self.irondome), + ("IDF Assets Pack (v1.1 by IDF Mods Project)", self.irondome), ] for i in range(len(mod_pairs)): diff --git a/resources/factions/israel_1973.json b/resources/factions/israel_1973.json index 02e05c21..60e1cdd6 100644 --- a/resources/factions/israel_1973.json +++ b/resources/factions/israel_1973.json @@ -26,7 +26,7 @@ "M60A3 \"Patton\"" ], "artillery_units": [ - "(IDF Mods Project) BM-21 Grad 122mm" + "M109A6 Paladin" ], "logistics_units": [ "Truck M818 6x6" diff --git a/resources/factions/israel_1982.json b/resources/factions/israel_1982.json index 60e9fa36..c84231a9 100644 --- a/resources/factions/israel_1982.json +++ b/resources/factions/israel_1982.json @@ -28,8 +28,8 @@ "M60A3 \"Patton\"" ], "artillery_units": [ - "(IDF Mods Project) BM-21 Grad 122mm", - "(IDF Mods Project) Urgan BM-27 220mm" + "M109A6 Paladin", + "M270 Multiple Launch Rocket System" ], "logistics_units": [ "Truck M818 6x6" diff --git a/resources/factions/israel_2012.json b/resources/factions/israel_2012.json index 485711a9..41d0524a 100644 --- a/resources/factions/israel_2012.json +++ b/resources/factions/israel_2012.json @@ -41,10 +41,7 @@ ], "artillery_units": [ "M109A6 Paladin", - "M270 Multiple Launch Rocket System", - "(IDF Mods Project) BM-21 Grad 122mm", - "(IDF Mods Project) Urgan BM-27 220mm", - "(IDF Mods Project) 9A52 Smerch CM 300mm" + "M270 Multiple Launch Rocket System" ], "logistics_units": [ "Truck M818 6x6" diff --git a/resources/factions/israel_2017.json b/resources/factions/israel_2017.json new file mode 100644 index 00000000..c1b86d36 --- /dev/null +++ b/resources/factions/israel_2017.json @@ -0,0 +1,102 @@ +{ + "country": "Israel", + "name": "Israel 2017", + "authors": "Ghosti", + "description": "

Israel Defence Forces after the introduction of the David's Sling.

", + "locales": [ + "he_IL" + ], + "aircrafts": [ + "AH-64D Apache Longbow", + "AH-64D Apache Longbow (AI)", + "C-130", + "C-130J-30 Super Hercules", + "F-15C Eagle", + "F-15D Baz", + "F-15E Strike Eagle (AI)", + "F-15E Strike Eagle (Suite 4+)", + "F-16CM Fighting Falcon (Block 50)", + "F-16D Barak (Block 30)", + "F-16D Barak (Block 40)", + "F-16I Sufa", + "UH-1H Iroquois", + "UH-60L" + ], + "awacs": [ + "E-2C Hawkeye" + ], + "tankers": [ + "KC-130", + "KC-135 Stratotanker" + ], + "frontline_units": [ + "M1043 HMMWV (M2 HMG)", + "M1045 HMMWV (BGM-71 TOW)", + "M113", + "M163 Vulcan Air Defense System", + "Merkava Mk IV" + ], + "artillery_units": [ + "M109A6 Paladin", + "M270 Multiple Launch Rocket System" + ], + "logistics_units": [ + "Truck M818 6x6" + ], + "infantry_units": [ + "Infantry M249", + "Infantry M4", + "MANPADS Stinger" + ], + "preset_groups": [ + "Hawk", + "Iron Dome", + "Iron Dome (Semicircle)", + "David's Sling", + "David's Sling (Semicircle)", + "Patriot" + ], + "naval_units": [ + "DDG Arleigh Burke IIa" + ], + "missiles": [], + "air_defense_units": [ + "ELM-2084MMR AD Rotating Mode", + "SAM Hawk SR (AN/MPQ-50)", + "M163 Vulcan Air Defense System", + "HEMTT C-RAM Phalanx", + "M48 Chaparral" + ], + "requirements": {}, + "carrier_names": [], + "helicopter_carrier_names": [], + "has_jtac": true, + "jtac_unit": "MQ-9 Reaper", + "liveries_overrides": { + "F-15C Eagle": [ + "390th Fighter SQN" + ], + "F-15E Strike Eagle": [ + "IDF No 69 Hammers Squadron" + ], + "F-16CM Fighting Falcon (Block 50)": [ + "IAF_101st_squadron", + "IAF_110th_Squadron", + "IAF_115th_Aggressors_Squadron", + "IAF_117th_Squadron" + ], + "UH-1H Iroquois": [ + "Israel Army" + ], + "AH-64D Apache Longbow": [ + "ah-64_d_isr" + ], + "Mirage 2000C": [ + "UAE Air Force" + ], + "UH-60L": [ + "Israeli Air Force" + ] + }, + "unrestricted_satnav": true +} \ No newline at end of file diff --git a/resources/groups/DavidSling.yaml b/resources/groups/DavidSling.yaml new file mode 100644 index 00000000..3e511df3 --- /dev/null +++ b/resources/groups/DavidSling.yaml @@ -0,0 +1,10 @@ +name: David's Sling +tasks: + - LORAD +units: + - ELM-2084MMR AD Rotating Mode + - ELM-2084MMR AD Sector Mode + - David's Sling CP + - David's Sling LN +layouts: + - 4 Launcher Site (Circle) \ No newline at end of file diff --git a/resources/groups/DavidSling_Semicircle.yaml b/resources/groups/DavidSling_Semicircle.yaml new file mode 100644 index 00000000..1f8da754 --- /dev/null +++ b/resources/groups/DavidSling_Semicircle.yaml @@ -0,0 +1,10 @@ +name: David's Sling (Semicircle) +tasks: + - LORAD +units: + - ELM-2084MMR AD Rotating Mode + - ELM-2084MMR AD Sector Mode + - David's Sling CP + - David's Sling LN +layouts: + - 4 Launcher Site (Semicircle) \ No newline at end of file diff --git a/resources/groups/IronDome.yaml b/resources/groups/IronDome.yaml index e16f25dd..fc00f4fc 100644 --- a/resources/groups/IronDome.yaml +++ b/resources/groups/IronDome.yaml @@ -2,7 +2,8 @@ name: Iron Dome tasks: - MERAD units: - - Iron Dome ELM-2048 MMR + - ELM-2084MMR AD Rotating Mode + - ELM-2084MMR AD Sector Mode - Iron Dome CP - Iron Dome LN layouts: diff --git a/resources/groups/IronDome_Semicircle.yaml b/resources/groups/IronDome_Semicircle.yaml new file mode 100644 index 00000000..db772399 --- /dev/null +++ b/resources/groups/IronDome_Semicircle.yaml @@ -0,0 +1,10 @@ +name: Iron Dome (Semicircle) +tasks: + - MERAD +units: + - ELM-2084MMR AD Rotating Mode + - ELM-2084MMR AD Sector Mode + - Iron Dome CP + - Iron Dome LN +layouts: + - 4 Launcher Site (Semicircle) \ No newline at end of file diff --git a/resources/units/ground_units/DAVID_SLING_LN.yaml b/resources/units/ground_units/DAVID_SLING_LN.yaml new file mode 100644 index 00000000..cdc5861d --- /dev/null +++ b/resources/units/ground_units/DAVID_SLING_LN.yaml @@ -0,0 +1,4 @@ +class: Launcher +price: 23 +variants: + David's Sling LN: null diff --git a/resources/units/ground_units/ELM2084_MMR_AD_RT.yaml b/resources/units/ground_units/ELM2084_MMR_AD_RT.yaml new file mode 100644 index 00000000..950f4a50 --- /dev/null +++ b/resources/units/ground_units/ELM2084_MMR_AD_RT.yaml @@ -0,0 +1,11 @@ +class: SearchRadar +price: 25 +variants: + ELM-2084MMR AD Rotating Mode: null +skynet_properties: # Override skynet default properties + can_engage_harm: true + # can_engage_air_weapon: true # https://github.com/walder/Skynet-IADS/tree/develop#engage-air-weapons + go_live_range_in_percent: 100 + harm_detection_chance: 90 + engagement_zone: SkynetIADSAbstractRadarElement.GO_LIVE_WHEN_IN_KILL_ZONE # https://github.com/walder/Skynet-IADS/tree/develop#engagement-zone + autonomous_behaviour: SkynetIADSAbstractRadarElement.AUTONOMOUS_STATE_DCS_AI # https://github.com/walder/Skynet-IADS/tree/develop#autonomous-mode-behaviour diff --git a/resources/units/ground_units/ELM2084_MMR_AD_SC.yaml b/resources/units/ground_units/ELM2084_MMR_AD_SC.yaml new file mode 100644 index 00000000..c545750a --- /dev/null +++ b/resources/units/ground_units/ELM2084_MMR_AD_SC.yaml @@ -0,0 +1,11 @@ +class: TrackRadar +price: 25 +variants: + ELM-2084MMR AD Sector Mode: null +skynet_properties: # Override skynet default properties + can_engage_harm: true + # can_engage_air_weapon: true # https://github.com/walder/Skynet-IADS/tree/develop#engage-air-weapons + go_live_range_in_percent: 100 + harm_detection_chance: 90 + engagement_zone: SkynetIADSAbstractRadarElement.GO_LIVE_WHEN_IN_KILL_ZONE # https://github.com/walder/Skynet-IADS/tree/develop#engagement-zone + autonomous_behaviour: SkynetIADSAbstractRadarElement.AUTONOMOUS_STATE_DCS_AI # https://github.com/walder/Skynet-IADS/tree/develop#autonomous-mode-behaviour diff --git a/resources/units/ground_units/ELM2048_MMR.yaml b/resources/units/ground_units/ELM2084_MMR_WLR.yaml similarity index 94% rename from resources/units/ground_units/ELM2048_MMR.yaml rename to resources/units/ground_units/ELM2084_MMR_WLR.yaml index 472dd100..bbc2dfac 100644 --- a/resources/units/ground_units/ELM2048_MMR.yaml +++ b/resources/units/ground_units/ELM2084_MMR_WLR.yaml @@ -1,7 +1,7 @@ class: SearchRadar price: 25 variants: - Iron Dome ELM-2048 MMR: null + ELM-2084MMR WLR Mode: null skynet_properties: # Override skynet default properties can_engage_harm: true # can_engage_air_weapon: true # https://github.com/walder/Skynet-IADS/tree/develop#engage-air-weapons diff --git a/resources/units/ground_units/I9K51_GRAD.yaml b/resources/units/ground_units/I9K51_GRAD.yaml deleted file mode 100644 index cec19e22..00000000 --- a/resources/units/ground_units/I9K51_GRAD.yaml +++ /dev/null @@ -1,10 +0,0 @@ -class: Artillery -description: "The BM-21 \"Grad\" (Russian: \u0411\u041C-21 \"\u0413\u0440\u0430\u0434\ - \", lit.\u2009'hail') is a Soviet truck-mounted 122 mm multiple rocket launcher." -introduced: 1963 -manufacturer: Splav -origin: USSR/Russia -price: 15 -role: Multiple-Launch Rocket System -variants: - (IDF Mods Project) BM-21 Grad 122mm: {} diff --git a/resources/units/ground_units/I9K57_URAGAN.yaml b/resources/units/ground_units/I9K57_URAGAN.yaml deleted file mode 100644 index 4f8dbc6d..00000000 --- a/resources/units/ground_units/I9K57_URAGAN.yaml +++ /dev/null @@ -1,11 +0,0 @@ -class: Artillery -description: "The BM-27 Uragan (Russian: \u0423\u0440\u0430\u0433\u0430\u043D, lit.\u2009\ - 'Hurricane'; GRAU index 9P140) is a self-propelled multiple rocket launcher system\ - \ designed in the Soviet Union." -introduced: 1975 -manufacturer: Splav -origin: USSR/Russia -price: 40 -role: Multiple-Launch Rocket System -variants: - (IDF Mods Project) Urgan BM-27 220mm: {} diff --git a/resources/units/ground_units/I9K58_SMERCH.yaml b/resources/units/ground_units/I9K58_SMERCH.yaml deleted file mode 100644 index 2f280a14..00000000 --- a/resources/units/ground_units/I9K58_SMERCH.yaml +++ /dev/null @@ -1,12 +0,0 @@ -class: Artillery -description: "The BM-30 Smerch (Russian: \u0421\u043C\u0435\u0440\u0447, \"tornado\"\ - , \"whirlwind\"), 9K58 Smerch or 9A52-2 Smerch-M is a Soviet heavy multiple rocket\ - \ launcher. The system is intended to defeat personnel, armored, and soft targets\ - \ in concentration areas, artillery batteries, command posts and ammunition depots." -introduced: 1989 -manufacturer: Splav -origin: USSR/Russia -price: 50 -role: Multiple-Launch Rocket System -variants: - (IDF Mods Project) 9A52 Smerch CM 300mm: {} diff --git a/resources/units/ground_units/IRON_DOME_CP.yaml b/resources/units/ground_units/Iron_Dome_David_Sling_CP.yaml similarity index 70% rename from resources/units/ground_units/IRON_DOME_CP.yaml rename to resources/units/ground_units/Iron_Dome_David_Sling_CP.yaml index 3b71bc1e..0d889006 100644 --- a/resources/units/ground_units/IRON_DOME_CP.yaml +++ b/resources/units/ground_units/Iron_Dome_David_Sling_CP.yaml @@ -2,3 +2,4 @@ class: CommandPost price: 18 variants: Iron Dome CP: null + David's Sling CP: null