mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
20 lines
657 B
Python
20 lines
657 B
Python
import random
|
|
|
|
from dcs.vehicles import AirDefence, Unarmed
|
|
|
|
from gen.sam.group_generator import AntiAirGroupGenerator
|
|
|
|
|
|
class ChaparralGenerator(AntiAirGroupGenerator):
|
|
"""
|
|
This generate a Chaparral group
|
|
"""
|
|
|
|
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)
|
|
for i, position in enumerate(positions):
|
|
self.add_unit(AirDefence.SAM_Chaparral_M48, "SPAA#" + str(i), position[0], position[1], position[2])
|