mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
The prices are only estimations due to randomization. the real price will be only known when the generator was used and the final units are known
46 lines
1.1 KiB
Python
46 lines
1.1 KiB
Python
import random
|
|
|
|
from dcs.vehicles import AirDefence, Unarmed
|
|
|
|
from gen.sam.airdefensegroupgenerator import (
|
|
AirDefenseRange,
|
|
AirDefenseGroupGenerator,
|
|
)
|
|
|
|
|
|
class Flak18Generator(AirDefenseGroupGenerator):
|
|
"""
|
|
This generate a German flak artillery group using only free units, thus not requiring the WW2 asset pack
|
|
"""
|
|
|
|
name = "WW2 Flak Site"
|
|
|
|
def generate(self):
|
|
|
|
spacing = random.randint(30, 60)
|
|
index = 0
|
|
|
|
for i in range(3):
|
|
for j in range(2):
|
|
index = index + 1
|
|
self.add_unit(
|
|
AirDefence.Flak18,
|
|
"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_36_6700A,
|
|
"Blitz#",
|
|
self.position.x - 35,
|
|
self.position.y - 20,
|
|
self.heading,
|
|
)
|
|
|
|
@classmethod
|
|
def range(cls) -> AirDefenseRange:
|
|
return AirDefenseRange.AAA
|