diff --git a/gen/sam/sam_group_generator.py b/gen/sam/sam_group_generator.py index 3db1b70a..4bebcd27 100644 --- a/gen/sam/sam_group_generator.py +++ b/gen/sam/sam_group_generator.py @@ -28,6 +28,7 @@ from gen.sam.sam_gepard import GepardGenerator from gen.sam.sam_hawk import HawkGenerator from gen.sam.sam_hq7 import HQ7Generator from gen.sam.sam_linebacker import LinebackerGenerator +from gen.sam.sam_nasams import NasamBGenerator, NasamCGenerator from gen.sam.sam_patriot import PatriotGenerator from gen.sam.sam_rapier import RapierGenerator from gen.sam.sam_roland import RolandGenerator @@ -100,6 +101,8 @@ SAM_MAP: Dict[str, Type[AirDefenseGroupGenerator]] = { "SA20Generator": SA20Generator, "SA20BGenerator": SA20BGenerator, "SA23Generator": SA23Generator, + "NasamBGenerator": NasamBGenerator, + "NasamCGenerator": NasamCGenerator, } diff --git a/gen/sam/sam_nasams.py b/gen/sam/sam_nasams.py new file mode 100644 index 00000000..62bbf60c --- /dev/null +++ b/gen/sam/sam_nasams.py @@ -0,0 +1,68 @@ +from typing import Type + +from dcs.mapping import Point +from dcs.unittype import VehicleType +from dcs.vehicles import AirDefence + +from game import Game +from game.theater import SamGroundObject +from gen.sam.airdefensegroupgenerator import ( + AirDefenseRange, + AirDefenseGroupGenerator, +) + + +class NasamCGenerator(AirDefenseGroupGenerator): + """ + This generate a Nasams group with AIM-120C missiles + """ + + name = "NASAMS AIM-120C" + + def __init__(self, game: Game, ground_object: SamGroundObject): + super().__init__(game, ground_object) + self.launcherType: Type[VehicleType] = AirDefence.NASAMS_LN_C + + def generate(self) -> None: + # Command Post + self.add_unit( + AirDefence.NASAMS_Command_Post, + "CP", + self.position.x + 30, + self.position.y + 30, + self.heading, + ) + # Radar + self.add_unit( + AirDefence.NASAMS_Radar_MPQ64F1, + "RADAR", + self.position.x - 30, + self.position.y - 30, + self.heading, + ) + + positions = self.get_circular_position(4, launcher_distance=120, coverage=360) + for i, position in enumerate(positions): + self.add_unit( + self.launcherType, + "LN#" + str(i), + position[0], + position[1], + position[2], + ) + + @classmethod + def range(cls) -> AirDefenseRange: + return AirDefenseRange.Medium + + +class NasamBGenerator(NasamCGenerator): + """ + This generate a Nasams group with AIM-120B missiles + """ + + name = "NASAMS AIM-120B" + + def __init__(self, game: Game, ground_object: SamGroundObject): + super().__init__(game, ground_object) + self.launcherType: Type[VehicleType] = AirDefence.NASAMS_LN_B diff --git a/resources/factions/usa_2005.json b/resources/factions/usa_2005.json index a05ede7a..4206d357 100644 --- a/resources/factions/usa_2005.json +++ b/resources/factions/usa_2005.json @@ -68,7 +68,8 @@ "air_defenses": [ "AvengerGenerator", "LinebackerGenerator", - "PatriotGenerator" + "PatriotGenerator", + "NasamCGenerator" ], "ewrs": [ "PatriotEwrGenerator" @@ -126,4 +127,4 @@ "VMFA-323" ] } -} \ No newline at end of file +} diff --git a/resources/units/ground_units/NASAMS_Command_Post.yaml b/resources/units/ground_units/NASAMS_Command_Post.yaml new file mode 100644 index 00000000..1113a8d8 --- /dev/null +++ b/resources/units/ground_units/NASAMS_Command_Post.yaml @@ -0,0 +1,8 @@ +price: 18 +description: "NASAMS (National/Norwegian Advanced Surface to Air Missile System) is a distributed and networked medium to long range air-defence system. + NASAMS was the first surface-based application for the AIM-120 AMRAAM (Advanced Medium Range Air-to-Air Missile)." +introduced: 1995 +manufacturer: Kongsberg Defence & Aerospace, Raytheon +origin: Norway, USA +variants: + SAM NASAMS C2: null diff --git a/resources/units/ground_units/NASAMS_LN_B.yaml b/resources/units/ground_units/NASAMS_LN_B.yaml new file mode 100644 index 00000000..4bfca908 --- /dev/null +++ b/resources/units/ground_units/NASAMS_LN_B.yaml @@ -0,0 +1,8 @@ +price: 15 +description: "NASAMS (National/Norwegian Advanced Surface to Air Missile System) is a distributed and networked medium to long range air-defence system. + NASAMS was the first surface-based application for the AIM-120 AMRAAM (Advanced Medium Range Air-to-Air Missile)." +introduced: 1995 +manufacturer: Kongsberg Defence & Aerospace, Raytheon +origin: Norway, USA +variants: + SAM NASAMS LN AIM-120B: null diff --git a/resources/units/ground_units/NASAMS_LN_C.yaml b/resources/units/ground_units/NASAMS_LN_C.yaml new file mode 100644 index 00000000..2e1ba9d9 --- /dev/null +++ b/resources/units/ground_units/NASAMS_LN_C.yaml @@ -0,0 +1,8 @@ +price: 20 +description: "NASAMS (National/Norwegian Advanced Surface to Air Missile System) is a distributed and networked medium to long range air-defence system. + NASAMS was the first surface-based application for the AIM-120 AMRAAM (Advanced Medium Range Air-to-Air Missile)." +introduced: 1996 +manufacturer: Kongsberg Defence & Aerospace, Raytheon +origin: Norway, USA +variants: + SAM NASAMS LN AIM-120C: null diff --git a/resources/units/ground_units/NASAMS_Radar_MPQ64F1.yaml b/resources/units/ground_units/NASAMS_Radar_MPQ64F1.yaml new file mode 100644 index 00000000..d10f63ca --- /dev/null +++ b/resources/units/ground_units/NASAMS_Radar_MPQ64F1.yaml @@ -0,0 +1,8 @@ +price: 26 +description: "NASAMS (National/Norwegian Advanced Surface to Air Missile System) is a distributed and networked medium to long range air-defence system. + NASAMS was the first surface-based application for the AIM-120 AMRAAM (Advanced Medium Range Air-to-Air Missile)." +introduced: 1995 +manufacturer: Kongsberg Defence & Aerospace, Raytheon +origin: Norway, USA +variants: + SAM NASAMS SR MPQ64F1: null