Remove the randomness from SAM group size.

This commit is contained in:
Florian
2021-06-24 00:42:13 +02:00
committed by Dan Albert
parent 4e6659e7e8
commit 3f65928e9d
30 changed files with 164 additions and 165 deletions

View File

@@ -17,22 +17,19 @@ class BoforsGenerator(AirDefenseGroupGenerator):
price = 75
def generate(self):
grid_x = random.randint(2, 3)
grid_y = random.randint(2, 3)
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.Bofors40,
"AAA#" + str(index),
self.position.x + spacing * i,
self.position.y + spacing * j,
self.heading,
)
for i in range(4):
spacing_x = random.randint(10, 40)
spacing_y = random.randint(10, 40)
index = index + 1
self.add_unit(
AirDefence.Bofors40,
"AAA#" + str(index),
self.position.x + spacing_x * i,
self.position.y + spacing_y * i,
self.heading,
)
@classmethod
def range(cls) -> AirDefenseRange: