mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
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 <Raffson@users.noreply.github.com>
This commit is contained in:
@@ -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__)
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user