dcs_liberation/gen/sam/aaa_bofors.py
RndName b2db27f9aa remove prices from sam generators
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
2021-07-02 16:46:16 -07:00

36 lines
822 B
Python

import random
from dcs.vehicles import AirDefence
from gen.sam.airdefensegroupgenerator import (
AirDefenseRange,
AirDefenseGroupGenerator,
)
class BoforsGenerator(AirDefenseGroupGenerator):
"""
This generate a Bofors flak artillery group
"""
name = "Bofors AAA"
def generate(self):
index = 0
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:
return AirDefenseRange.AAA