mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Blacken.
This commit is contained in:
@@ -20,15 +20,19 @@ class BoforsGenerator(AirDefenseGroupGenerator):
|
||||
grid_x = random.randint(2, 3)
|
||||
grid_y = random.randint(2, 3)
|
||||
|
||||
spacing = random.randint(10,40)
|
||||
spacing = random.randint(10, 40)
|
||||
|
||||
index = 0
|
||||
for i in range(grid_x):
|
||||
for j in range(grid_y):
|
||||
index = index+1
|
||||
self.add_unit(AirDefence.AAA_Bofors_40mm, "AAA#" + str(index),
|
||||
self.position.x + spacing*i,
|
||||
self.position.y + spacing*j, self.heading)
|
||||
index = index + 1
|
||||
self.add_unit(
|
||||
AirDefence.AAA_Bofors_40mm,
|
||||
"AAA#" + str(index),
|
||||
self.position.x + spacing * i,
|
||||
self.position.y + spacing * j,
|
||||
self.heading,
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def range(cls) -> AirDefenseRange:
|
||||
|
||||
@@ -37,34 +37,64 @@ class FlakGenerator(AirDefenseGroupGenerator):
|
||||
|
||||
for i in range(grid_x):
|
||||
for j in range(grid_y):
|
||||
index = index+1
|
||||
self.add_unit(unit_type, "AAA#" + str(index),
|
||||
self.position.x + spacing*i + random.randint(1,5),
|
||||
self.position.y + spacing*j + random.randint(1,5), self.heading)
|
||||
index = index + 1
|
||||
self.add_unit(
|
||||
unit_type,
|
||||
"AAA#" + str(index),
|
||||
self.position.x + spacing * i + random.randint(1, 5),
|
||||
self.position.y + spacing * j + random.randint(1, 5),
|
||||
self.heading,
|
||||
)
|
||||
|
||||
if(mixed):
|
||||
if mixed:
|
||||
unit_type = random.choice(GFLAK)
|
||||
|
||||
# Search lights
|
||||
search_pos = self.get_circular_position(random.randint(2,3), 80)
|
||||
search_pos = self.get_circular_position(random.randint(2, 3), 80)
|
||||
for index, pos in enumerate(search_pos):
|
||||
self.add_unit(AirDefence.Flak_Searchlight_37, "SearchLight#" + str(index), pos[0], pos[1], self.heading)
|
||||
self.add_unit(
|
||||
AirDefence.Flak_Searchlight_37,
|
||||
"SearchLight#" + str(index),
|
||||
pos[0],
|
||||
pos[1],
|
||||
self.heading,
|
||||
)
|
||||
|
||||
# Support
|
||||
self.add_unit(AirDefence.Maschinensatz_33, "MC33#", self.position.x-20, self.position.y-20, self.heading)
|
||||
self.add_unit(AirDefence.AAA_Kdo_G_40, "KDO#", self.position.x - 25, self.position.y - 20,
|
||||
self.heading)
|
||||
self.add_unit(
|
||||
AirDefence.Maschinensatz_33,
|
||||
"MC33#",
|
||||
self.position.x - 20,
|
||||
self.position.y - 20,
|
||||
self.heading,
|
||||
)
|
||||
self.add_unit(
|
||||
AirDefence.AAA_Kdo_G_40,
|
||||
"KDO#",
|
||||
self.position.x - 25,
|
||||
self.position.y - 20,
|
||||
self.heading,
|
||||
)
|
||||
|
||||
# Commander
|
||||
self.add_unit(Unarmed.Kübelwagen_82, "Kubel#", self.position.x - 35, self.position.y - 20,
|
||||
self.heading)
|
||||
self.add_unit(
|
||||
Unarmed.Kübelwagen_82,
|
||||
"Kubel#",
|
||||
self.position.x - 35,
|
||||
self.position.y - 20,
|
||||
self.heading,
|
||||
)
|
||||
|
||||
# Some Opel Blitz trucks
|
||||
for i in range(int(max(1,grid_x/2))):
|
||||
for j in range(int(max(1,grid_x/2))):
|
||||
self.add_unit(Unarmed.Blitz_3_6_6700A, "BLITZ#" + str(index),
|
||||
self.position.x + 125 + 15*i + random.randint(1,5),
|
||||
self.position.y + 15*j + random.randint(1,5), 75)
|
||||
for i in range(int(max(1, grid_x / 2))):
|
||||
for j in range(int(max(1, grid_x / 2))):
|
||||
self.add_unit(
|
||||
Unarmed.Blitz_3_6_6700A,
|
||||
"BLITZ#" + str(index),
|
||||
self.position.x + 125 + 15 * i + random.randint(1, 5),
|
||||
self.position.y + 15 * j + random.randint(1, 5),
|
||||
75,
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def range(cls) -> AirDefenseRange:
|
||||
|
||||
@@ -24,12 +24,22 @@ class Flak18Generator(AirDefenseGroupGenerator):
|
||||
for i in range(3):
|
||||
for j in range(2):
|
||||
index = index + 1
|
||||
self.add_unit(AirDefence.AAA_8_8cm_Flak_18, "AAA#" + str(index),
|
||||
self.position.x + spacing * i + random.randint(1, 5),
|
||||
self.position.y + spacing * j + random.randint(1, 5), self.heading)
|
||||
self.add_unit(
|
||||
AirDefence.AAA_8_8cm_Flak_18,
|
||||
"AAA#" + str(index),
|
||||
self.position.x + spacing * i + random.randint(1, 5),
|
||||
self.position.y + spacing * j + random.randint(1, 5),
|
||||
self.heading,
|
||||
)
|
||||
|
||||
# Add a commander truck
|
||||
self.add_unit(Unarmed.Blitz_3_6_6700A, "Blitz#", self.position.x - 35, self.position.y - 20, self.heading)
|
||||
self.add_unit(
|
||||
Unarmed.Blitz_3_6_6700A,
|
||||
"Blitz#",
|
||||
self.position.x - 35,
|
||||
self.position.y - 20,
|
||||
self.heading,
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def range(cls) -> AirDefenseRange:
|
||||
|
||||
@@ -19,15 +19,25 @@ class KS19Generator(AirDefenseGroupGenerator):
|
||||
|
||||
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)
|
||||
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)
|
||||
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:
|
||||
|
||||
@@ -20,21 +20,63 @@ class AllyWW2FlakGenerator(AirDefenseGroupGenerator):
|
||||
|
||||
positions = self.get_circular_position(4, launcher_distance=30, coverage=360)
|
||||
for i, position in enumerate(positions):
|
||||
self.add_unit(AirDefence.AA_gun_QF_3_7, "AA#" + str(i), position[0], position[1], position[2])
|
||||
self.add_unit(
|
||||
AirDefence.AA_gun_QF_3_7,
|
||||
"AA#" + str(i),
|
||||
position[0],
|
||||
position[1],
|
||||
position[2],
|
||||
)
|
||||
|
||||
positions = self.get_circular_position(8, launcher_distance=60, coverage=360)
|
||||
for i, position in enumerate(positions):
|
||||
self.add_unit(AirDefence.AAA_M1_37mm, "AA#" + str(4 + i), position[0], position[1], position[2])
|
||||
self.add_unit(
|
||||
AirDefence.AAA_M1_37mm,
|
||||
"AA#" + str(4 + i),
|
||||
position[0],
|
||||
position[1],
|
||||
position[2],
|
||||
)
|
||||
|
||||
positions = self.get_circular_position(8, launcher_distance=90, coverage=360)
|
||||
for i, position in enumerate(positions):
|
||||
self.add_unit(AirDefence.AAA_M45_Quadmount, "AA#" + str(12 + i), position[0], position[1], position[2])
|
||||
self.add_unit(
|
||||
AirDefence.AAA_M45_Quadmount,
|
||||
"AA#" + str(12 + i),
|
||||
position[0],
|
||||
position[1],
|
||||
position[2],
|
||||
)
|
||||
|
||||
# Add a commander truck
|
||||
self.add_unit(Unarmed.Willys_MB, "CMD#1", self.position.x, self.position.y - 20, random.randint(0, 360))
|
||||
self.add_unit(Armor.M30_Cargo_Carrier, "LOG#1", self.position.x, self.position.y + 20, random.randint(0, 360))
|
||||
self.add_unit(Armor.M4_Tractor, "LOG#2", self.position.x + 20, self.position.y, random.randint(0, 360))
|
||||
self.add_unit(Unarmed.Bedford_MWD, "LOG#3", self.position.x - 20, self.position.y, random.randint(0, 360))
|
||||
self.add_unit(
|
||||
Unarmed.Willys_MB,
|
||||
"CMD#1",
|
||||
self.position.x,
|
||||
self.position.y - 20,
|
||||
random.randint(0, 360),
|
||||
)
|
||||
self.add_unit(
|
||||
Armor.M30_Cargo_Carrier,
|
||||
"LOG#1",
|
||||
self.position.x,
|
||||
self.position.y + 20,
|
||||
random.randint(0, 360),
|
||||
)
|
||||
self.add_unit(
|
||||
Armor.M4_Tractor,
|
||||
"LOG#2",
|
||||
self.position.x + 20,
|
||||
self.position.y,
|
||||
random.randint(0, 360),
|
||||
)
|
||||
self.add_unit(
|
||||
Unarmed.Bedford_MWD,
|
||||
"LOG#3",
|
||||
self.position.x - 20,
|
||||
self.position.y,
|
||||
random.randint(0, 360),
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def range(cls) -> AirDefenseRange:
|
||||
|
||||
@@ -16,9 +16,17 @@ class ZSU57Generator(AirDefenseGroupGenerator):
|
||||
|
||||
def generate(self):
|
||||
num_launchers = 5
|
||||
positions = self.get_circular_position(num_launchers, launcher_distance=110, coverage=360)
|
||||
positions = self.get_circular_position(
|
||||
num_launchers, launcher_distance=110, coverage=360
|
||||
)
|
||||
for i, position in enumerate(positions):
|
||||
self.add_unit(AirDefence.AAA_ZSU_57_2, "SPAA#" + str(i), position[0], position[1], position[2])
|
||||
self.add_unit(
|
||||
AirDefence.AAA_ZSU_57_2,
|
||||
"SPAA#" + str(i),
|
||||
position[0],
|
||||
position[1],
|
||||
position[2],
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def range(cls) -> AirDefenseRange:
|
||||
|
||||
@@ -20,15 +20,19 @@ class ZU23InsurgentGenerator(AirDefenseGroupGenerator):
|
||||
grid_x = random.randint(2, 3)
|
||||
grid_y = random.randint(2, 3)
|
||||
|
||||
spacing = random.randint(10,40)
|
||||
spacing = random.randint(10, 40)
|
||||
|
||||
index = 0
|
||||
for i in range(grid_x):
|
||||
for j in range(grid_y):
|
||||
index = index+1
|
||||
self.add_unit(AirDefence.AAA_ZU_23_Insurgent_Closed, "AAA#" + str(index),
|
||||
self.position.x + spacing*i,
|
||||
self.position.y + spacing*j, self.heading)
|
||||
index = index + 1
|
||||
self.add_unit(
|
||||
AirDefence.AAA_ZU_23_Insurgent_Closed,
|
||||
"AAA#" + str(index),
|
||||
self.position.x + spacing * i,
|
||||
self.position.y + spacing * j,
|
||||
self.heading,
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def range(cls) -> AirDefenseRange:
|
||||
|
||||
@@ -28,8 +28,9 @@ class AirDefenseGroupGenerator(GroupGenerator, ABC):
|
||||
self.auxiliary_groups: List[VehicleGroup] = []
|
||||
|
||||
def add_auxiliary_group(self, name_suffix: str) -> VehicleGroup:
|
||||
group = VehicleGroup(self.game.next_group_id(),
|
||||
"|".join([self.go.group_name, name_suffix]))
|
||||
group = VehicleGroup(
|
||||
self.game.next_group_id(), "|".join([self.go.group_name, name_suffix])
|
||||
)
|
||||
self.auxiliary_groups.append(group)
|
||||
return group
|
||||
|
||||
@@ -37,7 +38,8 @@ class AirDefenseGroupGenerator(GroupGenerator, ABC):
|
||||
raise RuntimeError(
|
||||
"Deprecated call to AirDefenseGroupGenerator.get_generated_group "
|
||||
"misses auxiliary groups. Use AirDefenseGroupGenerator.groups "
|
||||
"instead.")
|
||||
"instead."
|
||||
)
|
||||
|
||||
@property
|
||||
def groups(self) -> Iterator[VehicleGroup]:
|
||||
|
||||
@@ -29,18 +29,38 @@ class EarlyColdWarFlakGenerator(AirDefenseGroupGenerator):
|
||||
for i in range(3):
|
||||
for j in range(2):
|
||||
index = index + 1
|
||||
self.add_unit(AirDefence.AAA_8_8cm_Flak_18, "AAA#" + str(index),
|
||||
self.position.x + spacing * i + random.randint(1, 5),
|
||||
self.position.y + spacing * j + random.randint(1, 5), self.heading)
|
||||
self.add_unit(
|
||||
AirDefence.AAA_8_8cm_Flak_18,
|
||||
"AAA#" + str(index),
|
||||
self.position.x + spacing * i + random.randint(1, 5),
|
||||
self.position.y + spacing * j + random.randint(1, 5),
|
||||
self.heading,
|
||||
)
|
||||
|
||||
# Short range guns
|
||||
self.add_unit(AirDefence.AAA_Bofors_40mm, "SHO#1",
|
||||
self.position.x - 40, self.position.y - 40, self.heading + 180),
|
||||
self.add_unit(AirDefence.AAA_Bofors_40mm, "SHO#2",
|
||||
self.position.x + spacing * 2 + 40, self.position.y + spacing + 40, self.heading),
|
||||
self.add_unit(
|
||||
AirDefence.AAA_Bofors_40mm,
|
||||
"SHO#1",
|
||||
self.position.x - 40,
|
||||
self.position.y - 40,
|
||||
self.heading + 180,
|
||||
),
|
||||
self.add_unit(
|
||||
AirDefence.AAA_Bofors_40mm,
|
||||
"SHO#2",
|
||||
self.position.x + spacing * 2 + 40,
|
||||
self.position.y + spacing + 40,
|
||||
self.heading,
|
||||
),
|
||||
|
||||
# Add a truck
|
||||
self.add_unit(Unarmed.Transport_KAMAZ_43101, "Truck#", self.position.x - 60, self.position.y - 20, self.heading)
|
||||
self.add_unit(
|
||||
Unarmed.Transport_KAMAZ_43101,
|
||||
"Truck#",
|
||||
self.position.x - 60,
|
||||
self.position.y - 20,
|
||||
self.heading,
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def range(cls) -> AirDefenseRange:
|
||||
@@ -66,18 +86,38 @@ class ColdWarFlakGenerator(AirDefenseGroupGenerator):
|
||||
for i in range(3):
|
||||
for j in range(2):
|
||||
index = index + 1
|
||||
self.add_unit(AirDefence.AAA_8_8cm_Flak_18, "AAA#" + str(index),
|
||||
self.position.x + spacing * i + random.randint(1, 5),
|
||||
self.position.y + spacing * j + random.randint(1, 5), self.heading)
|
||||
self.add_unit(
|
||||
AirDefence.AAA_8_8cm_Flak_18,
|
||||
"AAA#" + str(index),
|
||||
self.position.x + spacing * i + random.randint(1, 5),
|
||||
self.position.y + spacing * j + random.randint(1, 5),
|
||||
self.heading,
|
||||
)
|
||||
|
||||
# Short range guns
|
||||
self.add_unit(AirDefence.AAA_ZU_23_Closed, "SHO#1",
|
||||
self.position.x - 40, self.position.y - 40, self.heading + 180),
|
||||
self.add_unit(AirDefence.AAA_ZU_23_Closed, "SHO#2",
|
||||
self.position.x + spacing * 2 + 40, self.position.y + spacing + 40, self.heading),
|
||||
self.add_unit(
|
||||
AirDefence.AAA_ZU_23_Closed,
|
||||
"SHO#1",
|
||||
self.position.x - 40,
|
||||
self.position.y - 40,
|
||||
self.heading + 180,
|
||||
),
|
||||
self.add_unit(
|
||||
AirDefence.AAA_ZU_23_Closed,
|
||||
"SHO#2",
|
||||
self.position.x + spacing * 2 + 40,
|
||||
self.position.y + spacing + 40,
|
||||
self.heading,
|
||||
),
|
||||
|
||||
# Add a P19 Radar for EWR
|
||||
self.add_unit(AirDefence.SAM_SR_P_19, "SR#0", self.position.x - 60, self.position.y - 20, self.heading)
|
||||
self.add_unit(
|
||||
AirDefence.SAM_SR_P_19,
|
||||
"SR#0",
|
||||
self.position.x - 60,
|
||||
self.position.y - 20,
|
||||
self.heading,
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def range(cls) -> AirDefenseRange:
|
||||
|
||||
@@ -10,8 +10,9 @@ class EwrGenerator(GroupGenerator):
|
||||
raise NotImplementedError
|
||||
|
||||
def generate(self) -> None:
|
||||
self.add_unit(self.unit_type, "EWR", self.position.x, self.position.y,
|
||||
self.heading)
|
||||
self.add_unit(
|
||||
self.unit_type, "EWR", self.position.x, self.position.y, self.heading
|
||||
)
|
||||
|
||||
|
||||
class BoxSpringGenerator(EwrGenerator):
|
||||
|
||||
@@ -17,27 +17,93 @@ class FreyaGenerator(AirDefenseGroupGenerator):
|
||||
def generate(self):
|
||||
|
||||
# TODO : would be better with the Concrete structure that is supposed to protect it
|
||||
self.add_unit(AirDefence.EWR_FuMG_401_Freya_LZ, "EWR#1", self.position.x, self.position.y, self.heading)
|
||||
self.add_unit(
|
||||
AirDefence.EWR_FuMG_401_Freya_LZ,
|
||||
"EWR#1",
|
||||
self.position.x,
|
||||
self.position.y,
|
||||
self.heading,
|
||||
)
|
||||
|
||||
positions = self.get_circular_position(4, launcher_distance=50, coverage=360)
|
||||
for i, position in enumerate(positions):
|
||||
self.add_unit(AirDefence.AAA_Flak_Vierling_38, "AA#" + str(i), position[0], position[1], position[2])
|
||||
self.add_unit(
|
||||
AirDefence.AAA_Flak_Vierling_38,
|
||||
"AA#" + str(i),
|
||||
position[0],
|
||||
position[1],
|
||||
position[2],
|
||||
)
|
||||
|
||||
positions = self.get_circular_position(4, launcher_distance=100, coverage=360)
|
||||
for i, position in enumerate(positions):
|
||||
self.add_unit(AirDefence.AAA_8_8cm_Flak_18, "AA#" + str(4+i), position[0], position[1], position[2])
|
||||
self.add_unit(
|
||||
AirDefence.AAA_8_8cm_Flak_18,
|
||||
"AA#" + str(4 + i),
|
||||
position[0],
|
||||
position[1],
|
||||
position[2],
|
||||
)
|
||||
|
||||
# Command/Logi
|
||||
self.add_unit(Unarmed.Kübelwagen_82, "Kubel#1", self.position.x - 20, self.position.y - 20, self.heading)
|
||||
self.add_unit(Unarmed.Sd_Kfz_7, "Sdkfz#1", self.position.x + 20, self.position.y + 22, self.heading)
|
||||
self.add_unit(Unarmed.Sd_Kfz_2, "Sdkfz#2", self.position.x - 22, self.position.y + 20, self.heading)
|
||||
self.add_unit(
|
||||
Unarmed.Kübelwagen_82,
|
||||
"Kubel#1",
|
||||
self.position.x - 20,
|
||||
self.position.y - 20,
|
||||
self.heading,
|
||||
)
|
||||
self.add_unit(
|
||||
Unarmed.Sd_Kfz_7,
|
||||
"Sdkfz#1",
|
||||
self.position.x + 20,
|
||||
self.position.y + 22,
|
||||
self.heading,
|
||||
)
|
||||
self.add_unit(
|
||||
Unarmed.Sd_Kfz_2,
|
||||
"Sdkfz#2",
|
||||
self.position.x - 22,
|
||||
self.position.y + 20,
|
||||
self.heading,
|
||||
)
|
||||
|
||||
# Maschinensatz_33 and Kdo.g 40 Telemeter
|
||||
self.add_unit(AirDefence.Maschinensatz_33, "Energy#1", self.position.x + 20, self.position.y - 20, self.heading)
|
||||
self.add_unit(AirDefence.AAA_Kdo_G_40, "Telemeter#1", self.position.x + 20, self.position.y - 10, self.heading)
|
||||
self.add_unit(Infantry.Infantry_Mauser_98, "Inf#1", self.position.x + 20, self.position.y - 14, self.heading)
|
||||
self.add_unit(Infantry.Infantry_Mauser_98, "Inf#2", self.position.x + 20, self.position.y - 22, self.heading)
|
||||
self.add_unit(Infantry.Infantry_Mauser_98, "Inf#3", self.position.x + 20, self.position.y - 24, self.heading + 45)
|
||||
self.add_unit(
|
||||
AirDefence.Maschinensatz_33,
|
||||
"Energy#1",
|
||||
self.position.x + 20,
|
||||
self.position.y - 20,
|
||||
self.heading,
|
||||
)
|
||||
self.add_unit(
|
||||
AirDefence.AAA_Kdo_G_40,
|
||||
"Telemeter#1",
|
||||
self.position.x + 20,
|
||||
self.position.y - 10,
|
||||
self.heading,
|
||||
)
|
||||
self.add_unit(
|
||||
Infantry.Infantry_Mauser_98,
|
||||
"Inf#1",
|
||||
self.position.x + 20,
|
||||
self.position.y - 14,
|
||||
self.heading,
|
||||
)
|
||||
self.add_unit(
|
||||
Infantry.Infantry_Mauser_98,
|
||||
"Inf#2",
|
||||
self.position.x + 20,
|
||||
self.position.y - 22,
|
||||
self.heading,
|
||||
)
|
||||
self.add_unit(
|
||||
Infantry.Infantry_Mauser_98,
|
||||
"Inf#3",
|
||||
self.position.x + 20,
|
||||
self.position.y - 24,
|
||||
self.heading + 45,
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def range(cls) -> AirDefenseRange:
|
||||
|
||||
@@ -23,14 +23,12 @@ if TYPE_CHECKING:
|
||||
# care about in the format we want if we just generate our own group description
|
||||
# types rather than pydcs groups.
|
||||
class GroupGenerator:
|
||||
|
||||
def __init__(self, game: Game, ground_object: TheaterGroundObject) -> None:
|
||||
self.game = game
|
||||
self.go = ground_object
|
||||
self.position = ground_object.position
|
||||
self.heading = random.randint(0, 359)
|
||||
self.vg = unitgroup.VehicleGroup(self.game.next_group_id(),
|
||||
self.go.group_name)
|
||||
self.vg = unitgroup.VehicleGroup(self.game.next_group_id(), self.go.group_name)
|
||||
wp = self.vg.add_waypoint(self.position, PointAction.OffRoad, 0)
|
||||
wp.ETA_locked = True
|
||||
|
||||
@@ -40,16 +38,27 @@ class GroupGenerator:
|
||||
def get_generated_group(self) -> unitgroup.VehicleGroup:
|
||||
return self.vg
|
||||
|
||||
def add_unit(self, unit_type: Type[VehicleType], name: str, pos_x: float,
|
||||
pos_y: float, heading: int) -> Vehicle:
|
||||
return self.add_unit_to_group(self.vg, unit_type, name,
|
||||
Point(pos_x, pos_y), heading)
|
||||
def add_unit(
|
||||
self,
|
||||
unit_type: Type[VehicleType],
|
||||
name: str,
|
||||
pos_x: float,
|
||||
pos_y: float,
|
||||
heading: int,
|
||||
) -> Vehicle:
|
||||
return self.add_unit_to_group(
|
||||
self.vg, unit_type, name, Point(pos_x, pos_y), heading
|
||||
)
|
||||
|
||||
def add_unit_to_group(self, group: unitgroup.VehicleGroup,
|
||||
unit_type: Type[VehicleType], name: str,
|
||||
position: Point, heading: int) -> Vehicle:
|
||||
unit = Vehicle(self.game.next_unit_id(),
|
||||
f"{group.name}|{name}", unit_type.id)
|
||||
def add_unit_to_group(
|
||||
self,
|
||||
group: unitgroup.VehicleGroup,
|
||||
unit_type: Type[VehicleType],
|
||||
name: str,
|
||||
position: Point,
|
||||
heading: int,
|
||||
) -> Vehicle:
|
||||
unit = Vehicle(self.game.next_unit_id(), f"{group.name}|{name}", unit_type.id)
|
||||
unit.position = position
|
||||
unit.heading = heading
|
||||
group.add_unit(unit)
|
||||
@@ -82,31 +91,36 @@ class GroupGenerator:
|
||||
current_offset = self.heading
|
||||
current_offset -= outer_offset * (math.ceil(num_units / 2) - 1)
|
||||
for x in range(1, num_units + 1):
|
||||
positions.append((
|
||||
self.position.x + launcher_distance * math.cos(math.radians(current_offset)),
|
||||
self.position.y + launcher_distance * math.sin(math.radians(current_offset)),
|
||||
current_offset,
|
||||
))
|
||||
positions.append(
|
||||
(
|
||||
self.position.x
|
||||
+ launcher_distance * math.cos(math.radians(current_offset)),
|
||||
self.position.y
|
||||
+ launcher_distance * math.sin(math.radians(current_offset)),
|
||||
current_offset,
|
||||
)
|
||||
)
|
||||
current_offset += outer_offset
|
||||
return positions
|
||||
|
||||
|
||||
class ShipGroupGenerator(GroupGenerator):
|
||||
"""Abstract class for other ship generator classes"""
|
||||
def __init__(self, game: Game, ground_object: TheaterGroundObject, faction: Faction):
|
||||
|
||||
def __init__(
|
||||
self, game: Game, ground_object: TheaterGroundObject, faction: Faction
|
||||
):
|
||||
self.game = game
|
||||
self.go = ground_object
|
||||
self.position = ground_object.position
|
||||
self.heading = random.randint(0, 359)
|
||||
self.faction = faction
|
||||
self.vg = unitgroup.ShipGroup(self.game.next_group_id(),
|
||||
self.go.group_name)
|
||||
self.vg = unitgroup.ShipGroup(self.game.next_group_id(), self.go.group_name)
|
||||
wp = self.vg.add_waypoint(self.position, 0)
|
||||
wp.ETA_locked = True
|
||||
|
||||
|
||||
def add_unit(self, unit_type, name, pos_x, pos_y, heading) -> Ship:
|
||||
unit = Ship(self.game.next_unit_id(),
|
||||
f"{self.go.group_name}|{name}", unit_type)
|
||||
unit = Ship(self.game.next_unit_id(), f"{self.go.group_name}|{name}", unit_type)
|
||||
unit.position.x = pos_x
|
||||
unit.position.y = pos_y
|
||||
unit.heading = heading
|
||||
|
||||
@@ -19,10 +19,24 @@ class AvengerGenerator(AirDefenseGroupGenerator):
|
||||
def generate(self):
|
||||
num_launchers = random.randint(2, 3)
|
||||
|
||||
self.add_unit(Unarmed.Transport_M818, "TRUCK", self.position.x, self.position.y, self.heading)
|
||||
positions = self.get_circular_position(num_launchers, launcher_distance=110, coverage=180)
|
||||
self.add_unit(
|
||||
Unarmed.Transport_M818,
|
||||
"TRUCK",
|
||||
self.position.x,
|
||||
self.position.y,
|
||||
self.heading,
|
||||
)
|
||||
positions = self.get_circular_position(
|
||||
num_launchers, launcher_distance=110, coverage=180
|
||||
)
|
||||
for i, position in enumerate(positions):
|
||||
self.add_unit(AirDefence.SAM_Avenger_M1097, "SPAA#" + str(i), position[0], position[1], position[2])
|
||||
self.add_unit(
|
||||
AirDefence.SAM_Avenger_M1097,
|
||||
"SPAA#" + str(i),
|
||||
position[0],
|
||||
position[1],
|
||||
position[2],
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def range(cls) -> AirDefenseRange:
|
||||
|
||||
@@ -19,10 +19,24 @@ class ChaparralGenerator(AirDefenseGroupGenerator):
|
||||
def generate(self):
|
||||
num_launchers = random.randint(2, 4)
|
||||
|
||||
self.add_unit(Unarmed.Transport_M818, "TRUCK", self.position.x, self.position.y, self.heading)
|
||||
positions = self.get_circular_position(num_launchers, launcher_distance=110, coverage=180)
|
||||
self.add_unit(
|
||||
Unarmed.Transport_M818,
|
||||
"TRUCK",
|
||||
self.position.x,
|
||||
self.position.y,
|
||||
self.heading,
|
||||
)
|
||||
positions = self.get_circular_position(
|
||||
num_launchers, launcher_distance=110, coverage=180
|
||||
)
|
||||
for i, position in enumerate(positions):
|
||||
self.add_unit(AirDefence.SAM_Chaparral_M48, "SPAA#" + str(i), position[0], position[1], position[2])
|
||||
self.add_unit(
|
||||
AirDefence.SAM_Chaparral_M48,
|
||||
"SPAA#" + str(i),
|
||||
position[0],
|
||||
position[1],
|
||||
position[2],
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def range(cls) -> AirDefenseRange:
|
||||
|
||||
@@ -17,10 +17,28 @@ class GepardGenerator(AirDefenseGroupGenerator):
|
||||
price = 50
|
||||
|
||||
def generate(self):
|
||||
self.add_unit(AirDefence.SPAAA_Gepard, "SPAAA", self.position.x, self.position.y, self.heading)
|
||||
self.add_unit(
|
||||
AirDefence.SPAAA_Gepard,
|
||||
"SPAAA",
|
||||
self.position.x,
|
||||
self.position.y,
|
||||
self.heading,
|
||||
)
|
||||
if random.randint(0, 1) == 1:
|
||||
self.add_unit(AirDefence.SPAAA_Gepard, "SPAAA2", self.position.x, self.position.y, self.heading)
|
||||
self.add_unit(Unarmed.Transport_M818, "TRUCK", self.position.x + 80, self.position.y, self.heading)
|
||||
self.add_unit(
|
||||
AirDefence.SPAAA_Gepard,
|
||||
"SPAAA2",
|
||||
self.position.x,
|
||||
self.position.y,
|
||||
self.heading,
|
||||
)
|
||||
self.add_unit(
|
||||
Unarmed.Transport_M818,
|
||||
"TRUCK",
|
||||
self.position.x + 80,
|
||||
self.position.y,
|
||||
self.heading,
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def range(cls) -> AirDefenseRange:
|
||||
|
||||
@@ -49,7 +49,12 @@ from gen.sam.sam_roland import RolandGenerator
|
||||
from gen.sam.sam_sa10 import (
|
||||
SA10Generator,
|
||||
Tier2SA10Generator,
|
||||
Tier3SA10Generator, SA10BGenerator, SA12Generator, SA20Generator, SA20BGenerator, SA23Generator,
|
||||
Tier3SA10Generator,
|
||||
SA10BGenerator,
|
||||
SA12Generator,
|
||||
SA20Generator,
|
||||
SA20BGenerator,
|
||||
SA23Generator,
|
||||
)
|
||||
from gen.sam.sam_sa11 import SA11Generator
|
||||
from gen.sam.sam_sa13 import SA13Generator
|
||||
@@ -103,7 +108,6 @@ SAM_MAP: Dict[str, Type[AirDefenseGroupGenerator]] = {
|
||||
"FreyaGenerator": FreyaGenerator,
|
||||
"AllyWW2FlakGenerator": AllyWW2FlakGenerator,
|
||||
"ZSU57Generator": ZSU57Generator,
|
||||
|
||||
"KS19Generator": KS19Generator,
|
||||
"SA10BGenerator": SA10BGenerator,
|
||||
"SA12Generator": SA12Generator,
|
||||
@@ -145,7 +149,7 @@ SAM_PRICES = {
|
||||
AirDefence.SAM_SA_13_Strela_10M3_9A35M3: 30,
|
||||
AirDefence.SAM_SA_15_Tor_9A331: 40,
|
||||
AirDefence.SAM_SA_19_Tunguska_2S6: 35,
|
||||
AirDefence.HQ_7_Self_Propelled_LN: 35
|
||||
AirDefence.HQ_7_Self_Propelled_LN: 35,
|
||||
}
|
||||
|
||||
EWR_MAP = {
|
||||
@@ -163,7 +167,8 @@ EWR_MAP = {
|
||||
|
||||
|
||||
def get_faction_possible_sams_generator(
|
||||
faction: Faction) -> List[Type[AirDefenseGroupGenerator]]:
|
||||
faction: Faction,
|
||||
) -> List[Type[AirDefenseGroupGenerator]]:
|
||||
"""
|
||||
Return the list of possible SAM generator for the given faction
|
||||
:param faction: Faction name to search units for
|
||||
@@ -180,8 +185,10 @@ def get_faction_possible_ewrs_generator(faction: Faction) -> List[Type[GroupGene
|
||||
|
||||
|
||||
def _generate_anti_air_from(
|
||||
generators: Sequence[Type[AirDefenseGroupGenerator]], game: Game,
|
||||
ground_object: SamGroundObject) -> List[VehicleGroup]:
|
||||
generators: Sequence[Type[AirDefenseGroupGenerator]],
|
||||
game: Game,
|
||||
ground_object: SamGroundObject,
|
||||
) -> List[VehicleGroup]:
|
||||
if not generators:
|
||||
return []
|
||||
sam_generator_class = random.choice(generators)
|
||||
@@ -191,8 +198,10 @@ def _generate_anti_air_from(
|
||||
|
||||
|
||||
def generate_anti_air_group(
|
||||
game: Game, ground_object: SamGroundObject, faction: Faction,
|
||||
ranges: Optional[Iterable[Set[AirDefenseRange]]] = None
|
||||
game: Game,
|
||||
ground_object: SamGroundObject,
|
||||
faction: Faction,
|
||||
ranges: Optional[Iterable[Set[AirDefenseRange]]] = None,
|
||||
) -> List[VehicleGroup]:
|
||||
"""
|
||||
This generate a SAM group
|
||||
@@ -213,24 +222,25 @@ def generate_anti_air_group(
|
||||
"""
|
||||
generators = get_faction_possible_sams_generator(faction)
|
||||
if ranges is None:
|
||||
ranges = [{
|
||||
AirDefenseRange.Long,
|
||||
AirDefenseRange.Medium,
|
||||
AirDefenseRange.Short,
|
||||
}]
|
||||
ranges = [
|
||||
{
|
||||
AirDefenseRange.Long,
|
||||
AirDefenseRange.Medium,
|
||||
AirDefenseRange.Short,
|
||||
}
|
||||
]
|
||||
|
||||
for range_options in ranges:
|
||||
generators_for_range = [g for g in generators if
|
||||
g.range() in range_options]
|
||||
groups = _generate_anti_air_from(generators_for_range, game,
|
||||
ground_object)
|
||||
generators_for_range = [g for g in generators if g.range() in range_options]
|
||||
groups = _generate_anti_air_from(generators_for_range, game, ground_object)
|
||||
if groups:
|
||||
return groups
|
||||
return []
|
||||
|
||||
|
||||
def generate_ewr_group(game: Game, ground_object: TheaterGroundObject,
|
||||
faction: Faction) -> Optional[VehicleGroup]:
|
||||
def generate_ewr_group(
|
||||
game: Game, ground_object: TheaterGroundObject, faction: Faction
|
||||
) -> Optional[VehicleGroup]:
|
||||
"""Generates an early warning radar group.
|
||||
|
||||
:param game: The Game.
|
||||
|
||||
@@ -18,20 +18,51 @@ class HawkGenerator(AirDefenseGroupGenerator):
|
||||
price = 115
|
||||
|
||||
def generate(self):
|
||||
self.add_unit(AirDefence.SAM_Hawk_SR_AN_MPQ_50, "SR", self.position.x + 20, self.position.y, self.heading)
|
||||
self.add_unit(AirDefence.SAM_Hawk_PCP, "PCP", self.position.x, self.position.y, self.heading)
|
||||
self.add_unit(AirDefence.SAM_Hawk_TR_AN_MPQ_46, "TR", self.position.x + 40, self.position.y, self.heading)
|
||||
self.add_unit(
|
||||
AirDefence.SAM_Hawk_SR_AN_MPQ_50,
|
||||
"SR",
|
||||
self.position.x + 20,
|
||||
self.position.y,
|
||||
self.heading,
|
||||
)
|
||||
self.add_unit(
|
||||
AirDefence.SAM_Hawk_PCP,
|
||||
"PCP",
|
||||
self.position.x,
|
||||
self.position.y,
|
||||
self.heading,
|
||||
)
|
||||
self.add_unit(
|
||||
AirDefence.SAM_Hawk_TR_AN_MPQ_46,
|
||||
"TR",
|
||||
self.position.x + 40,
|
||||
self.position.y,
|
||||
self.heading,
|
||||
)
|
||||
|
||||
# Triple A for close range defense
|
||||
aa_group = self.add_auxiliary_group("AA")
|
||||
self.add_unit_to_group(aa_group, AirDefence.AAA_Vulcan_M163, "AAA",
|
||||
self.position + Point(20, 30), self.heading)
|
||||
self.add_unit_to_group(
|
||||
aa_group,
|
||||
AirDefence.AAA_Vulcan_M163,
|
||||
"AAA",
|
||||
self.position + Point(20, 30),
|
||||
self.heading,
|
||||
)
|
||||
|
||||
num_launchers = random.randint(3, 6)
|
||||
positions = self.get_circular_position(num_launchers, launcher_distance=120, coverage=180)
|
||||
positions = self.get_circular_position(
|
||||
num_launchers, launcher_distance=120, coverage=180
|
||||
)
|
||||
|
||||
for i, position in enumerate(positions):
|
||||
self.add_unit(AirDefence.SAM_Hawk_LN_M192, "LN#" + str(i), position[0], position[1], position[2])
|
||||
self.add_unit(
|
||||
AirDefence.SAM_Hawk_LN_M192,
|
||||
"LN#" + str(i),
|
||||
position[0],
|
||||
position[1],
|
||||
position[2],
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def range(cls) -> AirDefenseRange:
|
||||
|
||||
@@ -18,23 +18,51 @@ class HQ7Generator(AirDefenseGroupGenerator):
|
||||
price = 120
|
||||
|
||||
def generate(self):
|
||||
self.add_unit(AirDefence.HQ_7_Self_Propelled_STR, "STR", self.position.x, self.position.y, self.heading)
|
||||
self.add_unit(AirDefence.HQ_7_Self_Propelled_LN, "LN", self.position.x + 20, self.position.y, self.heading)
|
||||
self.add_unit(
|
||||
AirDefence.HQ_7_Self_Propelled_STR,
|
||||
"STR",
|
||||
self.position.x,
|
||||
self.position.y,
|
||||
self.heading,
|
||||
)
|
||||
self.add_unit(
|
||||
AirDefence.HQ_7_Self_Propelled_LN,
|
||||
"LN",
|
||||
self.position.x + 20,
|
||||
self.position.y,
|
||||
self.heading,
|
||||
)
|
||||
|
||||
# Triple A for close range defense
|
||||
aa_group = self.add_auxiliary_group("AA")
|
||||
self.add_unit_to_group(aa_group, AirDefence.AAA_ZU_23_on_Ural_375,
|
||||
"AAA1", self.position + Point(20, 30),
|
||||
self.heading)
|
||||
self.add_unit_to_group(aa_group, AirDefence.AAA_ZU_23_on_Ural_375,
|
||||
"AAA2", self.position - Point(20, 30),
|
||||
self.heading)
|
||||
self.add_unit_to_group(
|
||||
aa_group,
|
||||
AirDefence.AAA_ZU_23_on_Ural_375,
|
||||
"AAA1",
|
||||
self.position + Point(20, 30),
|
||||
self.heading,
|
||||
)
|
||||
self.add_unit_to_group(
|
||||
aa_group,
|
||||
AirDefence.AAA_ZU_23_on_Ural_375,
|
||||
"AAA2",
|
||||
self.position - Point(20, 30),
|
||||
self.heading,
|
||||
)
|
||||
|
||||
num_launchers = random.randint(0, 3)
|
||||
if num_launchers > 0:
|
||||
positions = self.get_circular_position(num_launchers, launcher_distance=120, coverage=360)
|
||||
positions = self.get_circular_position(
|
||||
num_launchers, launcher_distance=120, coverage=360
|
||||
)
|
||||
for i, position in enumerate(positions):
|
||||
self.add_unit(AirDefence.HQ_7_Self_Propelled_LN, "LN#" + str(i), position[0], position[1], position[2])
|
||||
self.add_unit(
|
||||
AirDefence.HQ_7_Self_Propelled_LN,
|
||||
"LN#" + str(i),
|
||||
position[0],
|
||||
position[1],
|
||||
position[2],
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def range(cls) -> AirDefenseRange:
|
||||
|
||||
@@ -19,10 +19,24 @@ class LinebackerGenerator(AirDefenseGroupGenerator):
|
||||
def generate(self):
|
||||
num_launchers = random.randint(2, 4)
|
||||
|
||||
self.add_unit(Unarmed.Transport_M818, "TRUCK", self.position.x, self.position.y, self.heading)
|
||||
positions = self.get_circular_position(num_launchers, launcher_distance=110, coverage=180)
|
||||
self.add_unit(
|
||||
Unarmed.Transport_M818,
|
||||
"TRUCK",
|
||||
self.position.x,
|
||||
self.position.y,
|
||||
self.heading,
|
||||
)
|
||||
positions = self.get_circular_position(
|
||||
num_launchers, launcher_distance=110, coverage=180
|
||||
)
|
||||
for i, position in enumerate(positions):
|
||||
self.add_unit(AirDefence.SAM_Linebacker_M6, "M6#" + str(i), position[0], position[1], position[2])
|
||||
self.add_unit(
|
||||
AirDefence.SAM_Linebacker_M6,
|
||||
"M6#" + str(i),
|
||||
position[0],
|
||||
position[1],
|
||||
position[2],
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def range(cls) -> AirDefenseRange:
|
||||
|
||||
@@ -19,24 +19,65 @@ class PatriotGenerator(AirDefenseGroupGenerator):
|
||||
|
||||
def generate(self):
|
||||
# Command Post
|
||||
self.add_unit(AirDefence.SAM_Patriot_STR_AN_MPQ_53, "STR", self.position.x + 30, self.position.y + 30, self.heading)
|
||||
self.add_unit(AirDefence.SAM_Patriot_AMG_AN_MRC_137, "MRC", self.position.x, self.position.y, self.heading)
|
||||
self.add_unit(AirDefence.SAM_Patriot_ECS_AN_MSQ_104, "MSQ", self.position.x + 30, self.position.y, self.heading)
|
||||
self.add_unit(AirDefence.SAM_Patriot_ICC, "ICC", self.position.x + 60, self.position.y, self.heading)
|
||||
self.add_unit(AirDefence.SAM_Patriot_EPP_III, "EPP", self.position.x, self.position.y + 30, self.heading)
|
||||
self.add_unit(
|
||||
AirDefence.SAM_Patriot_STR_AN_MPQ_53,
|
||||
"STR",
|
||||
self.position.x + 30,
|
||||
self.position.y + 30,
|
||||
self.heading,
|
||||
)
|
||||
self.add_unit(
|
||||
AirDefence.SAM_Patriot_AMG_AN_MRC_137,
|
||||
"MRC",
|
||||
self.position.x,
|
||||
self.position.y,
|
||||
self.heading,
|
||||
)
|
||||
self.add_unit(
|
||||
AirDefence.SAM_Patriot_ECS_AN_MSQ_104,
|
||||
"MSQ",
|
||||
self.position.x + 30,
|
||||
self.position.y,
|
||||
self.heading,
|
||||
)
|
||||
self.add_unit(
|
||||
AirDefence.SAM_Patriot_ICC,
|
||||
"ICC",
|
||||
self.position.x + 60,
|
||||
self.position.y,
|
||||
self.heading,
|
||||
)
|
||||
self.add_unit(
|
||||
AirDefence.SAM_Patriot_EPP_III,
|
||||
"EPP",
|
||||
self.position.x,
|
||||
self.position.y + 30,
|
||||
self.heading,
|
||||
)
|
||||
|
||||
num_launchers = random.randint(3, 4)
|
||||
positions = self.get_circular_position(num_launchers, launcher_distance=120, coverage=360)
|
||||
positions = self.get_circular_position(
|
||||
num_launchers, launcher_distance=120, coverage=360
|
||||
)
|
||||
for i, position in enumerate(positions):
|
||||
self.add_unit(AirDefence.SAM_Patriot_LN_M901, "LN#" + str(i), position[0], position[1], position[2])
|
||||
self.add_unit(
|
||||
AirDefence.SAM_Patriot_LN_M901,
|
||||
"LN#" + str(i),
|
||||
position[0],
|
||||
position[1],
|
||||
position[2],
|
||||
)
|
||||
|
||||
# Short range protection for high value site
|
||||
aa_group = self.add_auxiliary_group("AA")
|
||||
num_launchers = random.randint(3, 4)
|
||||
positions = self.get_circular_position(num_launchers, launcher_distance=200, coverage=360)
|
||||
positions = self.get_circular_position(
|
||||
num_launchers, launcher_distance=200, coverage=360
|
||||
)
|
||||
for i, (x, y, heading) in enumerate(positions):
|
||||
self.add_unit_to_group(aa_group, AirDefence.AAA_Vulcan_M163,
|
||||
f"SPAAA#{i}", Point(x, y), heading)
|
||||
self.add_unit_to_group(
|
||||
aa_group, AirDefence.AAA_Vulcan_M163, f"SPAAA#{i}", Point(x, y), heading
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def range(cls) -> AirDefenseRange:
|
||||
|
||||
@@ -17,14 +17,34 @@ class RapierGenerator(AirDefenseGroupGenerator):
|
||||
price = 50
|
||||
|
||||
def generate(self):
|
||||
self.add_unit(AirDefence.Rapier_FSA_Blindfire_Tracker, "BT", self.position.x, self.position.y, self.heading)
|
||||
self.add_unit(AirDefence.Rapier_FSA_Optical_Tracker, "OT", self.position.x + 20, self.position.y, self.heading)
|
||||
self.add_unit(
|
||||
AirDefence.Rapier_FSA_Blindfire_Tracker,
|
||||
"BT",
|
||||
self.position.x,
|
||||
self.position.y,
|
||||
self.heading,
|
||||
)
|
||||
self.add_unit(
|
||||
AirDefence.Rapier_FSA_Optical_Tracker,
|
||||
"OT",
|
||||
self.position.x + 20,
|
||||
self.position.y,
|
||||
self.heading,
|
||||
)
|
||||
|
||||
num_launchers = random.randint(3, 6)
|
||||
positions = self.get_circular_position(num_launchers, launcher_distance=80, coverage=240)
|
||||
positions = self.get_circular_position(
|
||||
num_launchers, launcher_distance=80, coverage=240
|
||||
)
|
||||
|
||||
for i, position in enumerate(positions):
|
||||
self.add_unit(AirDefence.Rapier_FSA_Launcher, "LN#" + str(i), position[0], position[1], position[2])
|
||||
self.add_unit(
|
||||
AirDefence.Rapier_FSA_Launcher,
|
||||
"LN#" + str(i),
|
||||
position[0],
|
||||
position[1],
|
||||
position[2],
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def range(cls) -> AirDefenseRange:
|
||||
|
||||
@@ -15,9 +15,27 @@ class RolandGenerator(AirDefenseGroupGenerator):
|
||||
price = 40
|
||||
|
||||
def generate(self):
|
||||
self.add_unit(AirDefence.SAM_Roland_EWR, "EWR", self.position.x + 40, self.position.y, self.heading)
|
||||
self.add_unit(AirDefence.SAM_Roland_ADS, "ADS", self.position.x, self.position.y, self.heading)
|
||||
self.add_unit(Unarmed.Transport_M818, "TRUCK", self.position.x + 80, self.position.y, self.heading)
|
||||
self.add_unit(
|
||||
AirDefence.SAM_Roland_EWR,
|
||||
"EWR",
|
||||
self.position.x + 40,
|
||||
self.position.y,
|
||||
self.heading,
|
||||
)
|
||||
self.add_unit(
|
||||
AirDefence.SAM_Roland_ADS,
|
||||
"ADS",
|
||||
self.position.x,
|
||||
self.position.y,
|
||||
self.heading,
|
||||
)
|
||||
self.add_unit(
|
||||
Unarmed.Transport_M818,
|
||||
"TRUCK",
|
||||
self.position.x + 80,
|
||||
self.position.y,
|
||||
self.heading,
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def range(cls) -> AirDefenseRange:
|
||||
|
||||
@@ -33,28 +33,41 @@ class SA10Generator(AirDefenseGroupGenerator):
|
||||
|
||||
def generate(self):
|
||||
# Search Radar
|
||||
self.add_unit(self.sr1, "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(self.sr2, "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(self.cp, "CP", self.position.x, self.position.y, self.heading)
|
||||
|
||||
# 2 Tracking radars
|
||||
self.add_unit(self.tr1, "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(self.tr2, "TR2", self.position.x + 40, self.position.y - 40,
|
||||
self.heading)
|
||||
self.add_unit(
|
||||
self.tr2, "TR2", self.position.x + 40, self.position.y - 40, self.heading
|
||||
)
|
||||
|
||||
# 2 different launcher type (C & D)
|
||||
num_launchers = random.randint(6, 8)
|
||||
positions = self.get_circular_position(num_launchers, launcher_distance=100, coverage=360)
|
||||
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(self.ln1, "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(self.ln2, "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()
|
||||
|
||||
@@ -67,10 +80,16 @@ class SA10Generator(AirDefenseGroupGenerator):
|
||||
aa_group = self.add_auxiliary_group("AA")
|
||||
num_launchers = random.randint(6, 8)
|
||||
positions = self.get_circular_position(
|
||||
num_launchers, launcher_distance=210, coverage=360)
|
||||
num_launchers, launcher_distance=210, coverage=360
|
||||
)
|
||||
for i, (x, y, heading) in enumerate(positions):
|
||||
self.add_unit_to_group(aa_group, AirDefence.SPAAA_ZSU_23_4_Shilka,
|
||||
f"AA#{i}", Point(x, y), heading)
|
||||
self.add_unit_to_group(
|
||||
aa_group,
|
||||
AirDefence.SPAAA_ZSU_23_4_Shilka,
|
||||
f"AA#{i}",
|
||||
Point(x, y),
|
||||
heading,
|
||||
)
|
||||
|
||||
|
||||
class Tier2SA10Generator(SA10Generator):
|
||||
@@ -86,10 +105,16 @@ class Tier2SA10Generator(SA10Generator):
|
||||
pd_group = self.add_auxiliary_group("PD")
|
||||
num_launchers = random.randint(2, 4)
|
||||
positions = self.get_circular_position(
|
||||
num_launchers, launcher_distance=140, coverage=360)
|
||||
num_launchers, launcher_distance=140, coverage=360
|
||||
)
|
||||
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)
|
||||
self.add_unit_to_group(
|
||||
pd_group,
|
||||
AirDefence.SAM_SA_15_Tor_9A331,
|
||||
f"PD#{i}",
|
||||
Point(x, y),
|
||||
heading,
|
||||
)
|
||||
|
||||
|
||||
class Tier3SA10Generator(SA10Generator):
|
||||
@@ -102,19 +127,31 @@ class Tier3SA10Generator(SA10Generator):
|
||||
aa_group = self.add_auxiliary_group("AA")
|
||||
num_launchers = random.randint(6, 8)
|
||||
positions = self.get_circular_position(
|
||||
num_launchers, launcher_distance=210, coverage=360)
|
||||
num_launchers, launcher_distance=210, coverage=360
|
||||
)
|
||||
for i, (x, y, heading) in enumerate(positions):
|
||||
self.add_unit_to_group(aa_group, AirDefence.SAM_SA_19_Tunguska_2S6,
|
||||
f"AA#{i}", Point(x, y), heading)
|
||||
self.add_unit_to_group(
|
||||
aa_group,
|
||||
AirDefence.SAM_SA_19_Tunguska_2S6,
|
||||
f"AA#{i}",
|
||||
Point(x, y),
|
||||
heading,
|
||||
)
|
||||
|
||||
# SA-15 for both shorter range targets and point defense.
|
||||
pd_group = self.add_auxiliary_group("PD")
|
||||
num_launchers = random.randint(2, 4)
|
||||
positions = self.get_circular_position(
|
||||
num_launchers, launcher_distance=140, coverage=360)
|
||||
num_launchers, launcher_distance=140, coverage=360
|
||||
)
|
||||
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)
|
||||
self.add_unit_to_group(
|
||||
pd_group,
|
||||
AirDefence.SAM_SA_15_Tor_9A331,
|
||||
f"PD#{i}",
|
||||
Point(x, y),
|
||||
heading,
|
||||
)
|
||||
|
||||
|
||||
class SA10BGenerator(Tier3SA10Generator):
|
||||
@@ -194,4 +231,4 @@ class SA23Generator(Tier3SA10Generator):
|
||||
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
|
||||
self.ln2 = highdigitsams.SAM_SA_23_S_300VM_9A83ME_LN
|
||||
|
||||
@@ -17,14 +17,34 @@ class SA11Generator(AirDefenseGroupGenerator):
|
||||
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)
|
||||
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,
|
||||
)
|
||||
|
||||
num_launchers = random.randint(2, 4)
|
||||
positions = self.get_circular_position(num_launchers, launcher_distance=140, coverage=180)
|
||||
positions = self.get_circular_position(
|
||||
num_launchers, launcher_distance=140, coverage=180
|
||||
)
|
||||
|
||||
for i, position in enumerate(positions):
|
||||
self.add_unit(AirDefence.SAM_SA_11_Buk_LN_9A310M1, "LN#" + str(i), position[0], position[1], position[2])
|
||||
self.add_unit(
|
||||
AirDefence.SAM_SA_11_Buk_LN_9A310M1,
|
||||
"LN#" + str(i),
|
||||
position[0],
|
||||
position[1],
|
||||
position[2],
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def range(cls) -> AirDefenseRange:
|
||||
|
||||
@@ -17,13 +17,33 @@ class SA13Generator(AirDefenseGroupGenerator):
|
||||
price = 50
|
||||
|
||||
def generate(self):
|
||||
self.add_unit(Unarmed.Transport_UAZ_469, "UAZ", self.position.x, self.position.y, self.heading)
|
||||
self.add_unit(Unarmed.Transport_KAMAZ_43101, "TRUCK", self.position.x+40, self.position.y, self.heading)
|
||||
self.add_unit(
|
||||
Unarmed.Transport_UAZ_469,
|
||||
"UAZ",
|
||||
self.position.x,
|
||||
self.position.y,
|
||||
self.heading,
|
||||
)
|
||||
self.add_unit(
|
||||
Unarmed.Transport_KAMAZ_43101,
|
||||
"TRUCK",
|
||||
self.position.x + 40,
|
||||
self.position.y,
|
||||
self.heading,
|
||||
)
|
||||
|
||||
num_launchers = random.randint(2, 3)
|
||||
positions = self.get_circular_position(num_launchers, launcher_distance=120, coverage=360)
|
||||
positions = self.get_circular_position(
|
||||
num_launchers, launcher_distance=120, coverage=360
|
||||
)
|
||||
for i, position in enumerate(positions):
|
||||
self.add_unit(AirDefence.SAM_SA_13_Strela_10M3_9A35M3, "LN#" + str(i), position[0], position[1], position[2])
|
||||
self.add_unit(
|
||||
AirDefence.SAM_SA_13_Strela_10M3_9A35M3,
|
||||
"LN#" + str(i),
|
||||
position[0],
|
||||
position[1],
|
||||
position[2],
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def range(cls) -> AirDefenseRange:
|
||||
|
||||
@@ -15,10 +15,28 @@ class SA15Generator(AirDefenseGroupGenerator):
|
||||
price = 55
|
||||
|
||||
def generate(self):
|
||||
self.add_unit(AirDefence.SAM_SA_15_Tor_9A331, "ADS", self.position.x, self.position.y, self.heading)
|
||||
self.add_unit(Unarmed.Transport_UAZ_469, "EWR", self.position.x + 40, self.position.y, self.heading)
|
||||
self.add_unit(Unarmed.Transport_KAMAZ_43101, "TRUCK", self.position.x + 80, self.position.y, self.heading)
|
||||
self.add_unit(
|
||||
AirDefence.SAM_SA_15_Tor_9A331,
|
||||
"ADS",
|
||||
self.position.x,
|
||||
self.position.y,
|
||||
self.heading,
|
||||
)
|
||||
self.add_unit(
|
||||
Unarmed.Transport_UAZ_469,
|
||||
"EWR",
|
||||
self.position.x + 40,
|
||||
self.position.y,
|
||||
self.heading,
|
||||
)
|
||||
self.add_unit(
|
||||
Unarmed.Transport_KAMAZ_43101,
|
||||
"TRUCK",
|
||||
self.position.x + 80,
|
||||
self.position.y,
|
||||
self.heading,
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def range(cls) -> AirDefenseRange:
|
||||
return AirDefenseRange.Medium
|
||||
return AirDefenseRange.Medium
|
||||
|
||||
@@ -16,14 +16,31 @@ class SA17Generator(AirDefenseGroupGenerator):
|
||||
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)
|
||||
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])
|
||||
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:
|
||||
|
||||
@@ -20,11 +20,25 @@ class SA19Generator(AirDefenseGroupGenerator):
|
||||
num_launchers = random.randint(1, 3)
|
||||
|
||||
if num_launchers == 1:
|
||||
self.add_unit(AirDefence.SAM_SA_19_Tunguska_2S6, "LN#0", self.position.x, self.position.y, self.heading)
|
||||
self.add_unit(
|
||||
AirDefence.SAM_SA_19_Tunguska_2S6,
|
||||
"LN#0",
|
||||
self.position.x,
|
||||
self.position.y,
|
||||
self.heading,
|
||||
)
|
||||
else:
|
||||
positions = self.get_circular_position(num_launchers, launcher_distance=120, coverage=180)
|
||||
positions = self.get_circular_position(
|
||||
num_launchers, launcher_distance=120, coverage=180
|
||||
)
|
||||
for i, position in enumerate(positions):
|
||||
self.add_unit(AirDefence.SAM_SA_19_Tunguska_2S6, "LN#" + str(i), position[0], position[1], position[2])
|
||||
self.add_unit(
|
||||
AirDefence.SAM_SA_19_Tunguska_2S6,
|
||||
"LN#" + str(i),
|
||||
position[0],
|
||||
position[1],
|
||||
position[2],
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def range(cls) -> AirDefenseRange:
|
||||
|
||||
@@ -17,14 +17,30 @@ class SA2Generator(AirDefenseGroupGenerator):
|
||||
price = 74
|
||||
|
||||
def generate(self):
|
||||
self.add_unit(AirDefence.SAM_SR_P_19, "SR", self.position.x, self.position.y, self.heading)
|
||||
self.add_unit(AirDefence.SAM_SA_2_TR_SNR_75_Fan_Song, "TR", self.position.x + 20, self.position.y, self.heading)
|
||||
self.add_unit(
|
||||
AirDefence.SAM_SR_P_19, "SR", self.position.x, self.position.y, self.heading
|
||||
)
|
||||
self.add_unit(
|
||||
AirDefence.SAM_SA_2_TR_SNR_75_Fan_Song,
|
||||
"TR",
|
||||
self.position.x + 20,
|
||||
self.position.y,
|
||||
self.heading,
|
||||
)
|
||||
|
||||
num_launchers = random.randint(3, 6)
|
||||
positions = self.get_circular_position(num_launchers, launcher_distance=120, coverage=180)
|
||||
positions = self.get_circular_position(
|
||||
num_launchers, launcher_distance=120, coverage=180
|
||||
)
|
||||
|
||||
for i, position in enumerate(positions):
|
||||
self.add_unit(AirDefence.SAM_SA_2_LN_SM_90, "LN#" + str(i), position[0], position[1], position[2])
|
||||
self.add_unit(
|
||||
AirDefence.SAM_SA_2_LN_SM_90,
|
||||
"LN#" + str(i),
|
||||
position[0],
|
||||
position[1],
|
||||
position[2],
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def range(cls) -> AirDefenseRange:
|
||||
|
||||
@@ -17,14 +17,30 @@ class SA3Generator(AirDefenseGroupGenerator):
|
||||
price = 80
|
||||
|
||||
def generate(self):
|
||||
self.add_unit(AirDefence.SAM_SR_P_19, "SR", self.position.x, self.position.y, self.heading)
|
||||
self.add_unit(AirDefence.SAM_SA_3_S_125_TR_SNR, "TR", self.position.x + 20, self.position.y, self.heading)
|
||||
self.add_unit(
|
||||
AirDefence.SAM_SR_P_19, "SR", self.position.x, self.position.y, self.heading
|
||||
)
|
||||
self.add_unit(
|
||||
AirDefence.SAM_SA_3_S_125_TR_SNR,
|
||||
"TR",
|
||||
self.position.x + 20,
|
||||
self.position.y,
|
||||
self.heading,
|
||||
)
|
||||
|
||||
num_launchers = random.randint(3, 6)
|
||||
positions = self.get_circular_position(num_launchers, launcher_distance=120, coverage=180)
|
||||
positions = self.get_circular_position(
|
||||
num_launchers, launcher_distance=120, coverage=180
|
||||
)
|
||||
|
||||
for i, position in enumerate(positions):
|
||||
self.add_unit(AirDefence.SAM_SA_3_S_125_LN_5P73, "LN#" + str(i), position[0], position[1], position[2])
|
||||
self.add_unit(
|
||||
AirDefence.SAM_SA_3_S_125_LN_5P73,
|
||||
"LN#" + str(i),
|
||||
position[0],
|
||||
position[1],
|
||||
position[2],
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def range(cls) -> AirDefenseRange:
|
||||
|
||||
@@ -17,13 +17,27 @@ class SA6Generator(AirDefenseGroupGenerator):
|
||||
price = 102
|
||||
|
||||
def generate(self):
|
||||
self.add_unit(AirDefence.SAM_SA_6_Kub_STR_9S91, "STR", self.position.x, self.position.y, self.heading)
|
||||
self.add_unit(
|
||||
AirDefence.SAM_SA_6_Kub_STR_9S91,
|
||||
"STR",
|
||||
self.position.x,
|
||||
self.position.y,
|
||||
self.heading,
|
||||
)
|
||||
|
||||
num_launchers = random.randint(2, 4)
|
||||
positions = self.get_circular_position(num_launchers, launcher_distance=120, coverage=360)
|
||||
positions = self.get_circular_position(
|
||||
num_launchers, launcher_distance=120, coverage=360
|
||||
)
|
||||
|
||||
for i, position in enumerate(positions):
|
||||
self.add_unit(AirDefence.SAM_SA_6_Kub_LN_2P25, "LN#" + str(i), position[0], position[1], position[2])
|
||||
self.add_unit(
|
||||
AirDefence.SAM_SA_6_Kub_LN_2P25,
|
||||
"LN#" + str(i),
|
||||
position[0],
|
||||
position[1],
|
||||
position[2],
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def range(cls) -> AirDefenseRange:
|
||||
|
||||
@@ -15,8 +15,20 @@ class SA8Generator(AirDefenseGroupGenerator):
|
||||
price = 55
|
||||
|
||||
def generate(self):
|
||||
self.add_unit(AirDefence.SAM_SA_8_Osa_9A33, "OSA", self.position.x, self.position.y, self.heading)
|
||||
self.add_unit(AirDefence.SAM_SA_8_Osa_LD_9T217, "LD", self.position.x + 20, self.position.y, self.heading)
|
||||
self.add_unit(
|
||||
AirDefence.SAM_SA_8_Osa_9A33,
|
||||
"OSA",
|
||||
self.position.x,
|
||||
self.position.y,
|
||||
self.heading,
|
||||
)
|
||||
self.add_unit(
|
||||
AirDefence.SAM_SA_8_Osa_LD_9T217,
|
||||
"LD",
|
||||
self.position.x + 20,
|
||||
self.position.y,
|
||||
self.heading,
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def range(cls) -> AirDefenseRange:
|
||||
|
||||
@@ -17,13 +17,33 @@ class SA9Generator(AirDefenseGroupGenerator):
|
||||
price = 40
|
||||
|
||||
def generate(self):
|
||||
self.add_unit(Unarmed.Transport_UAZ_469, "UAZ", self.position.x, self.position.y, self.heading)
|
||||
self.add_unit(Unarmed.Transport_KAMAZ_43101, "TRUCK", self.position.x+40, self.position.y, self.heading)
|
||||
self.add_unit(
|
||||
Unarmed.Transport_UAZ_469,
|
||||
"UAZ",
|
||||
self.position.x,
|
||||
self.position.y,
|
||||
self.heading,
|
||||
)
|
||||
self.add_unit(
|
||||
Unarmed.Transport_KAMAZ_43101,
|
||||
"TRUCK",
|
||||
self.position.x + 40,
|
||||
self.position.y,
|
||||
self.heading,
|
||||
)
|
||||
|
||||
num_launchers = random.randint(2, 3)
|
||||
positions = self.get_circular_position(num_launchers, launcher_distance=120, coverage=360)
|
||||
positions = self.get_circular_position(
|
||||
num_launchers, launcher_distance=120, coverage=360
|
||||
)
|
||||
for i, position in enumerate(positions):
|
||||
self.add_unit(AirDefence.SAM_SA_9_Strela_1_9P31, "LN#" + str(i), position[0], position[1], position[2])
|
||||
self.add_unit(
|
||||
AirDefence.SAM_SA_9_Strela_1_9P31,
|
||||
"LN#" + str(i),
|
||||
position[0],
|
||||
position[1],
|
||||
position[2],
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def range(cls) -> AirDefenseRange:
|
||||
|
||||
@@ -17,12 +17,29 @@ class VulcanGenerator(AirDefenseGroupGenerator):
|
||||
price = 25
|
||||
|
||||
def generate(self):
|
||||
self.add_unit(AirDefence.AAA_Vulcan_M163, "SPAAA", self.position.x, self.position.y, self.heading)
|
||||
self.add_unit(
|
||||
AirDefence.AAA_Vulcan_M163,
|
||||
"SPAAA",
|
||||
self.position.x,
|
||||
self.position.y,
|
||||
self.heading,
|
||||
)
|
||||
if random.randint(0, 1) == 1:
|
||||
self.add_unit(AirDefence.AAA_Vulcan_M163, "SPAAA2", self.position.x, self.position.y, self.heading)
|
||||
self.add_unit(Unarmed.Transport_M818, "TRUCK", self.position.x + 80, self.position.y, self.heading)
|
||||
self.add_unit(
|
||||
AirDefence.AAA_Vulcan_M163,
|
||||
"SPAAA2",
|
||||
self.position.x,
|
||||
self.position.y,
|
||||
self.heading,
|
||||
)
|
||||
self.add_unit(
|
||||
Unarmed.Transport_M818,
|
||||
"TRUCK",
|
||||
self.position.x + 80,
|
||||
self.position.y,
|
||||
self.heading,
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def range(cls) -> AirDefenseRange:
|
||||
return AirDefenseRange.Short
|
||||
|
||||
|
||||
@@ -19,9 +19,17 @@ class ZSU23Generator(AirDefenseGroupGenerator):
|
||||
def generate(self):
|
||||
num_launchers = random.randint(4, 5)
|
||||
|
||||
positions = self.get_circular_position(num_launchers, launcher_distance=120, coverage=180)
|
||||
positions = self.get_circular_position(
|
||||
num_launchers, launcher_distance=120, coverage=180
|
||||
)
|
||||
for i, position in enumerate(positions):
|
||||
self.add_unit(AirDefence.SPAAA_ZSU_23_4_Shilka, "SPAA#" + str(i), position[0], position[1], position[2])
|
||||
self.add_unit(
|
||||
AirDefence.SPAAA_ZSU_23_4_Shilka,
|
||||
"SPAA#" + str(i),
|
||||
position[0],
|
||||
position[1],
|
||||
position[2],
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def range(cls) -> AirDefenseRange:
|
||||
|
||||
@@ -20,15 +20,19 @@ class ZU23Generator(AirDefenseGroupGenerator):
|
||||
grid_x = random.randint(2, 3)
|
||||
grid_y = random.randint(2, 3)
|
||||
|
||||
spacing = random.randint(10,40)
|
||||
spacing = random.randint(10, 40)
|
||||
|
||||
index = 0
|
||||
for i in range(grid_x):
|
||||
for j in range(grid_y):
|
||||
index = index+1
|
||||
self.add_unit(AirDefence.AAA_ZU_23_Closed, "AAA#" + str(index),
|
||||
self.position.x + spacing*i,
|
||||
self.position.y + spacing*j, self.heading)
|
||||
index = index + 1
|
||||
self.add_unit(
|
||||
AirDefence.AAA_ZU_23_Closed,
|
||||
"AAA#" + str(index),
|
||||
self.position.x + spacing * i,
|
||||
self.position.y + spacing * j,
|
||||
self.heading,
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def range(cls) -> AirDefenseRange:
|
||||
|
||||
@@ -19,9 +19,17 @@ class ZU23UralGenerator(AirDefenseGroupGenerator):
|
||||
def generate(self):
|
||||
num_launchers = random.randint(2, 8)
|
||||
|
||||
positions = self.get_circular_position(num_launchers, launcher_distance=80, coverage=360)
|
||||
positions = self.get_circular_position(
|
||||
num_launchers, launcher_distance=80, coverage=360
|
||||
)
|
||||
for i, position in enumerate(positions):
|
||||
self.add_unit(AirDefence.AAA_ZU_23_on_Ural_375, "SPAA#" + str(i), position[0], position[1], position[2])
|
||||
self.add_unit(
|
||||
AirDefence.AAA_ZU_23_on_Ural_375,
|
||||
"SPAA#" + str(i),
|
||||
position[0],
|
||||
position[1],
|
||||
position[2],
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def range(cls) -> AirDefenseRange:
|
||||
|
||||
@@ -19,11 +19,18 @@ class ZU23UralInsurgentGenerator(AirDefenseGroupGenerator):
|
||||
def generate(self):
|
||||
num_launchers = random.randint(2, 8)
|
||||
|
||||
positions = self.get_circular_position(num_launchers, launcher_distance=80, coverage=360)
|
||||
positions = self.get_circular_position(
|
||||
num_launchers, launcher_distance=80, coverage=360
|
||||
)
|
||||
for i, position in enumerate(positions):
|
||||
self.add_unit(AirDefence.AAA_ZU_23_Insurgent_on_Ural_375, "SPAA#" + str(i), position[0], position[1], position[2])
|
||||
self.add_unit(
|
||||
AirDefence.AAA_ZU_23_Insurgent_on_Ural_375,
|
||||
"SPAA#" + str(i),
|
||||
position[0],
|
||||
position[1],
|
||||
position[2],
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def range(cls) -> AirDefenseRange:
|
||||
return AirDefenseRange.Short
|
||||
|
||||
|
||||
Reference in New Issue
Block a user