mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
High Digit SAM mod support added with an example factions (Russia 2010 High Digit SAM)
This commit is contained in:
34
gen/sam/aaa_ks19.py
Normal file
34
gen/sam/aaa_ks19.py
Normal file
@@ -0,0 +1,34 @@
|
||||
import random
|
||||
|
||||
from gen.sam.airdefensegroupgenerator import (
|
||||
AirDefenseRange,
|
||||
AirDefenseGroupGenerator,
|
||||
)
|
||||
from pydcs_extensions.highdigitsams import highdigitsams
|
||||
|
||||
|
||||
class KS19Generator(AirDefenseGroupGenerator):
|
||||
"""
|
||||
This generate a KS 19 flak artillery group (KS-19 from the High Digit SAM mod)
|
||||
"""
|
||||
|
||||
name = "KS-19 AAA Site"
|
||||
price = 98
|
||||
|
||||
def generate(self):
|
||||
|
||||
spacing = random.randint(10, 40)
|
||||
|
||||
self.add_unit(highdigitsams.AAA_SON_9_Fire_Can, "TR", self.position.x - 20, self.position.y - 20, self.heading)
|
||||
|
||||
index = 0
|
||||
for i in range(3):
|
||||
for j in range(3):
|
||||
index = index + 1
|
||||
self.add_unit(highdigitsams.AAA_100mm_KS_19, "AAA#" + str(index),
|
||||
self.position.x + spacing * i,
|
||||
self.position.y + spacing * j, self.heading)
|
||||
|
||||
@classmethod
|
||||
def range(cls) -> AirDefenseRange:
|
||||
return AirDefenseRange.Short
|
||||
@@ -11,6 +11,7 @@ from game.theater.theatergroundobject import SamGroundObject
|
||||
from gen.sam.aaa_bofors import BoforsGenerator
|
||||
from gen.sam.aaa_flak import FlakGenerator
|
||||
from gen.sam.aaa_flak18 import Flak18Generator
|
||||
from gen.sam.aaa_ks19 import KS19Generator
|
||||
from gen.sam.aaa_ww2_ally_flak import AllyWW2FlakGenerator
|
||||
from gen.sam.aaa_zsu57 import ZSU57Generator
|
||||
from gen.sam.aaa_zu23_insurgent import ZU23InsurgentGenerator
|
||||
@@ -48,11 +49,12 @@ from gen.sam.sam_roland import RolandGenerator
|
||||
from gen.sam.sam_sa10 import (
|
||||
SA10Generator,
|
||||
Tier2SA10Generator,
|
||||
Tier3SA10Generator,
|
||||
Tier3SA10Generator, SA10BGenerator, SA12Generator, SA20Generator, SA20BGenerator, SA23Generator,
|
||||
)
|
||||
from gen.sam.sam_sa11 import SA11Generator
|
||||
from gen.sam.sam_sa13 import SA13Generator
|
||||
from gen.sam.sam_sa15 import SA15Generator
|
||||
from gen.sam.sam_sa17 import SA17Generator
|
||||
from gen.sam.sam_sa19 import SA19Generator
|
||||
from gen.sam.sam_sa2 import SA2Generator
|
||||
from gen.sam.sam_sa3 import SA3Generator
|
||||
@@ -100,7 +102,15 @@ SAM_MAP: Dict[str, Type[AirDefenseGroupGenerator]] = {
|
||||
"EarlyColdWarFlakGenerator": EarlyColdWarFlakGenerator,
|
||||
"FreyaGenerator": FreyaGenerator,
|
||||
"AllyWW2FlakGenerator": AllyWW2FlakGenerator,
|
||||
"ZSU57Generator": ZSU57Generator
|
||||
"ZSU57Generator": ZSU57Generator,
|
||||
|
||||
"KS19Generator": KS19Generator,
|
||||
"SA10BGenerator": SA10BGenerator,
|
||||
"SA12Generator": SA12Generator,
|
||||
"SA17Generator": SA17Generator,
|
||||
"SA20Generator": SA20Generator,
|
||||
"SA20BGenerator": SA20BGenerator,
|
||||
"SA23Generator": SA23Generator,
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
import random
|
||||
|
||||
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,
|
||||
)
|
||||
from pydcs_extensions.highdigitsams import highdigitsams
|
||||
|
||||
|
||||
class SA10Generator(AirDefenseGroupGenerator):
|
||||
@@ -17,20 +21,30 @@ class SA10Generator(AirDefenseGroupGenerator):
|
||||
name = "SA-10/S-300PS Battery"
|
||||
price = 550
|
||||
|
||||
def __init__(self, game: Game, ground_object: SamGroundObject):
|
||||
super().__init__(game, ground_object)
|
||||
self.sr1 = AirDefence.SAM_SA_10_S_300PS_SR_5N66M
|
||||
self.sr2 = AirDefence.SAM_SA_10_S_300PS_SR_64H6E
|
||||
self.cp = AirDefence.SAM_SA_10_S_300PS_CP_54K6
|
||||
self.tr1 = AirDefence.SAM_SA_10_S_300PS_TR_30N6
|
||||
self.tr2 = AirDefence.SAM_SA_10_S_300PS_TR_30N6
|
||||
self.ln1 = AirDefence.SAM_SA_10_S_300PS_LN_5P85C
|
||||
self.ln2 = AirDefence.SAM_SA_10_S_300PS_LN_5P85D
|
||||
|
||||
def generate(self):
|
||||
# Search Radar
|
||||
self.add_unit(AirDefence.SAM_SA_10_S_300PS_SR_5N66M, "SR1", self.position.x, self.position.y + 40, self.heading)
|
||||
self.add_unit(self.sr1, "SR1", self.position.x, self.position.y + 40, self.heading)
|
||||
|
||||
# Search radar for missiles (optionnal)
|
||||
self.add_unit(AirDefence.SAM_SA_10_S_300PS_SR_64H6E, "SR2", self.position.x - 40, self.position.y, self.heading)
|
||||
self.add_unit(self.sr2, "SR2", self.position.x - 40, self.position.y, self.heading)
|
||||
|
||||
# Command Post
|
||||
self.add_unit(AirDefence.SAM_SA_10_S_300PS_CP_54K6, "CP", self.position.x, self.position.y, self.heading)
|
||||
self.add_unit(self.cp, "CP", self.position.x, self.position.y, self.heading)
|
||||
|
||||
# 2 Tracking radars
|
||||
self.add_unit(AirDefence.SAM_SA_10_S_300PS_TR_30N6, "TR1", self.position.x - 40, self.position.y - 40, self.heading)
|
||||
self.add_unit(self.tr1, "TR1", self.position.x - 40, self.position.y - 40, self.heading)
|
||||
|
||||
self.add_unit(AirDefence.SAM_SA_10_S_300PS_TR_30N6, "TR2", self.position.x + 40, self.position.y - 40,
|
||||
self.add_unit(self.tr2, "TR2", self.position.x + 40, self.position.y - 40,
|
||||
self.heading)
|
||||
|
||||
# 2 different launcher type (C & D)
|
||||
@@ -38,9 +52,9 @@ class SA10Generator(AirDefenseGroupGenerator):
|
||||
positions = self.get_circular_position(num_launchers, launcher_distance=100, coverage=360)
|
||||
for i, position in enumerate(positions):
|
||||
if i%2 == 0:
|
||||
self.add_unit(AirDefence.SAM_SA_10_S_300PS_LN_5P85C, "LN#" + str(i), position[0], position[1], position[2])
|
||||
self.add_unit(self.ln1, "LN#" + str(i), position[0], position[1], position[2])
|
||||
else:
|
||||
self.add_unit(AirDefence.SAM_SA_10_S_300PS_LN_5P85D, "LN#" + str(i), position[0], position[1], position[2])
|
||||
self.add_unit(self.ln2, "LN#" + str(i), position[0], position[1], position[2])
|
||||
|
||||
self.generate_defensive_groups()
|
||||
|
||||
@@ -93,3 +107,83 @@ class Tier3SA10Generator(SA10Generator):
|
||||
for i, (x, y, heading) in enumerate(positions):
|
||||
self.add_unit_to_group(pd_group, AirDefence.SAM_SA_15_Tor_9A331,
|
||||
f"PD#{i}", Point(x, y), heading)
|
||||
|
||||
|
||||
class SA10BGenerator(Tier3SA10Generator):
|
||||
|
||||
price = 700
|
||||
name = "SA-10B/S-300PS Battery"
|
||||
|
||||
def __init__(self, game: Game, ground_object: SamGroundObject):
|
||||
super().__init__(game, ground_object)
|
||||
self.sr1 = highdigitsams.SAM_SA_10B_S_300PS_40B6MD_SR
|
||||
self.sr2 = highdigitsams.SAM_SA_10B_S_300PS_64H6E_SR
|
||||
self.cp = highdigitsams.SAM_SA_10B_S_300PS_54K6_CP
|
||||
self.tr1 = highdigitsams.SAM_SA_10B_S_300PS_30N6_TR
|
||||
self.tr2 = highdigitsams.SAM_SA_10B_S_300PS_40B6M_TR
|
||||
self.ln1 = highdigitsams.SAM_SA_10B_S_300PS_5P85SE_LN
|
||||
self.ln2 = highdigitsams.SAM_SA_10B_S_300PS_5P85SU_LN
|
||||
|
||||
|
||||
class SA12Generator(Tier3SA10Generator):
|
||||
|
||||
price = 750
|
||||
name = "SA-12/S-300V Battery"
|
||||
|
||||
def __init__(self, game: Game, ground_object: SamGroundObject):
|
||||
super().__init__(game, ground_object)
|
||||
self.sr1 = highdigitsams.SAM_SA_12_S_300V_9S15_SR
|
||||
self.sr2 = highdigitsams.SAM_SA_12_S_300V_9S19_SR
|
||||
self.cp = highdigitsams.SAM_SA_12_S_300V_9S457_CP
|
||||
self.tr1 = highdigitsams.SAM_SA_12_S_300V_9S32_TR
|
||||
self.tr2 = highdigitsams.SAM_SA_12_S_300V_9S32_TR
|
||||
self.ln1 = highdigitsams.SAM_SA_12_S_300V_9A82_LN
|
||||
self.ln2 = highdigitsams.SAM_SA_12_S_300V_9A83_LN
|
||||
|
||||
|
||||
class SA20Generator(Tier3SA10Generator):
|
||||
|
||||
price = 800
|
||||
name = "SA-20/S-300PMU-1 Battery"
|
||||
|
||||
def __init__(self, game: Game, ground_object: SamGroundObject):
|
||||
super().__init__(game, ground_object)
|
||||
self.sr1 = highdigitsams.SAM_SA_20_S_300PMU1_SR_5N66E
|
||||
self.sr2 = highdigitsams.SAM_SA_20_S_300PMU1_SR_64N6E
|
||||
self.cp = highdigitsams.SAM_SA_20_S_300PMU1_CP_54K6
|
||||
self.tr1 = highdigitsams.SAM_SA_20_S_300PMU1_TR_30N6E
|
||||
self.tr2 = highdigitsams.SAM_SA_20_S_300PMU1_TR_30N6E_truck
|
||||
self.ln1 = highdigitsams.SAM_SA_20_S_300PMU1_LN_5P85CE
|
||||
self.ln2 = highdigitsams.SAM_SA_20_S_300PMU1_LN_5P85DE
|
||||
|
||||
|
||||
class SA20BGenerator(Tier3SA10Generator):
|
||||
|
||||
price = 850
|
||||
name = "SA-20B/S-300PMU-2 Battery"
|
||||
|
||||
def __init__(self, game: Game, ground_object: SamGroundObject):
|
||||
super().__init__(game, ground_object)
|
||||
self.sr1 = highdigitsams.SAM_SA_20_S_300PMU1_SR_5N66E
|
||||
self.sr2 = highdigitsams.SAM_SA_20_S_300PMU1_SR_64N6E
|
||||
self.cp = highdigitsams.SAM_SA_20B_S_300PMU2_CP_54K6E2
|
||||
self.tr1 = highdigitsams.SAM_SA_20B_S_300PMU2_TR_92H6E_truck
|
||||
self.tr2 = highdigitsams.SAM_SA_20B_S_300PMU2_TR_92H6E_truck
|
||||
self.ln1 = highdigitsams.SAM_SA_20B_S_300PMU2_LN_5P85SE2
|
||||
self.ln2 = highdigitsams.SAM_SA_20B_S_300PMU2_LN_5P85SE2
|
||||
|
||||
|
||||
class SA23Generator(Tier3SA10Generator):
|
||||
|
||||
price = 950
|
||||
name = "SA-23/S-300VM Battery"
|
||||
|
||||
def __init__(self, game: Game, ground_object: SamGroundObject):
|
||||
super().__init__(game, ground_object)
|
||||
self.sr1 = highdigitsams.SAM_SA_23_S_300VM_9S15M2_SR
|
||||
self.sr2 = highdigitsams.SAM_SA_23_S_300VM_9S19M2_SR
|
||||
self.cp = highdigitsams.SAM_SA_23_S_300VM_9S457ME_CP
|
||||
self.tr1 = highdigitsams.SAM_SA_23_S_300VM_9S32ME_TR
|
||||
self.tr2 = highdigitsams.SAM_SA_23_S_300VM_9S32ME_TR
|
||||
self.ln1 = highdigitsams.SAM_SA_23_S_300VM_9A82ME_LN
|
||||
self.ln2 = highdigitsams.SAM_SA_23_S_300VM_9A83ME_LN
|
||||
30
gen/sam/sam_sa17.py
Normal file
30
gen/sam/sam_sa17.py
Normal file
@@ -0,0 +1,30 @@
|
||||
from dcs.vehicles import AirDefence
|
||||
|
||||
from gen.sam.airdefensegroupgenerator import (
|
||||
AirDefenseRange,
|
||||
AirDefenseGroupGenerator,
|
||||
)
|
||||
from pydcs_extensions.highdigitsams import highdigitsams
|
||||
|
||||
|
||||
class SA17Generator(AirDefenseGroupGenerator):
|
||||
"""
|
||||
This generate a SA-17 group
|
||||
"""
|
||||
|
||||
name = "SA-17 Grizzly Battery"
|
||||
price = 180
|
||||
|
||||
def generate(self):
|
||||
self.add_unit(AirDefence.SAM_SA_11_Buk_SR_9S18M1, "SR", self.position.x + 20, self.position.y, self.heading)
|
||||
self.add_unit(AirDefence.SAM_SA_11_Buk_CC_9S470M1, "CC", self.position.x, self.position.y, self.heading)
|
||||
|
||||
positions = self.get_circular_position(3, launcher_distance=140, coverage=180)
|
||||
|
||||
for i, position in enumerate(positions):
|
||||
self.add_unit(highdigitsams.SAM_SA_17_Buk_M1_2_LN_9A310M1_2, "LN#" + str(i), position[0], position[1],
|
||||
position[2])
|
||||
|
||||
@classmethod
|
||||
def range(cls) -> AirDefenseRange:
|
||||
return AirDefenseRange.Medium
|
||||
Reference in New Issue
Block a user