mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Generate a Carrier Group which comes close the the real Carrier Strike Group 8. Under carrier_names in the faction simply add "Carrier Strike Group 8" as the first and only entry and enable super carrier. * TRU as TACAN name * Harry S. Truman CV * 4x Arleigh Burke * 1x Ticonderoga * CV in the middle, Ticonderoga in a radius of 2 miles, Arleigh Burkes forming a rectangle
55 lines
2.5 KiB
Python
55 lines
2.5 KiB
Python
import random
|
|
|
|
from gen.sam.group_generator import ShipGroupGenerator
|
|
|
|
from dcs.ships import (
|
|
USS_Arleigh_Burke_IIa,
|
|
Ticonderoga_class
|
|
)
|
|
|
|
class CarrierGroupGenerator(ShipGroupGenerator):
|
|
|
|
def generate(self):
|
|
|
|
#Carrier Strike Group 8
|
|
if self.faction.carrier_names[0] == "Carrier Strike Group 8":
|
|
carrier_type = random.choice(self.faction.aircraft_carrier)
|
|
|
|
self.add_unit(carrier_type, "CVN-75 Harry S. Truman", self.position.x, self.position.y, self.heading)
|
|
|
|
# Add Arleigh Burke escort
|
|
self.add_unit(USS_Arleigh_Burke_IIa, "USS Ramage", self.position.x + 6482, self.position.y + 6667, self.heading)
|
|
|
|
self.add_unit(USS_Arleigh_Burke_IIa, "USS Mitscher", self.position.x - 7963, self.position.y + 7037, self.heading)
|
|
|
|
self.add_unit(USS_Arleigh_Burke_IIa, "USS Forrest Sherman", self.position.x - 7408, self.position.y - 7408, self.heading)
|
|
|
|
self.add_unit(USS_Arleigh_Burke_IIa, "USS Lassen", self.position.x + 8704, self.position.y - 6296, self.heading)
|
|
|
|
# Add Ticonderoga escort
|
|
if self.heading >= 180:
|
|
self.add_unit(Ticonderoga_class, "USS Hué City", self.position.x + 2222, self.position.y - 3333, self.heading)
|
|
else:
|
|
self.add_unit(Ticonderoga_class, "USS Hué City", self.position.x - 3333, self.position.y + 2222, self.heading)
|
|
|
|
|
|
self.get_generated_group().points[0].speed = 20
|
|
##################################################################################################
|
|
# Add carrier for normal generation
|
|
else:
|
|
if len(self.faction.aircraft_carrier) > 0:
|
|
carrier_type = random.choice(self.faction.aircraft_carrier)
|
|
self.add_unit(carrier_type, "Carrier", self.position.x, self.position.y, self.heading)
|
|
else:
|
|
return
|
|
|
|
# Add destroyers escort
|
|
if len(self.faction.destroyers) > 0:
|
|
dd_type = random.choice(self.faction.destroyers)
|
|
self.add_unit(dd_type, "DD1", self.position.x + 2500, self.position.y + 4500, self.heading)
|
|
self.add_unit(dd_type, "DD2", self.position.x + 2500, self.position.y - 4500, self.heading)
|
|
|
|
self.add_unit(dd_type, "DD3", self.position.x + 4500, self.position.y + 8500, self.heading)
|
|
self.add_unit(dd_type, "DD4", self.position.x + 4500, self.position.y - 8500, self.heading)
|
|
|
|
self.get_generated_group().points[0].speed = 20 |