mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Carrier strike group (#863)
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
This commit is contained in:
parent
71914b8a8b
commit
8e51b7fc1d
@ -1389,6 +1389,8 @@ def upgrade_to_supercarrier(unit, name: str):
|
|||||||
return CVN_73_George_Washington
|
return CVN_73_George_Washington
|
||||||
elif name == "CVN-75 Harry S. Truman":
|
elif name == "CVN-75 Harry S. Truman":
|
||||||
return CVN_75_Harry_S__Truman
|
return CVN_75_Harry_S__Truman
|
||||||
|
elif name == "Carrier Strike Group 8":
|
||||||
|
return CVN_75_Harry_S__Truman
|
||||||
else:
|
else:
|
||||||
return CVN_71_Theodore_Roosevelt
|
return CVN_71_Theodore_Roosevelt
|
||||||
elif unit == CV_1143_5_Admiral_Kuznetsov:
|
elif unit == CV_1143_5_Admiral_Kuznetsov:
|
||||||
|
|||||||
@ -2,25 +2,54 @@ import random
|
|||||||
|
|
||||||
from gen.sam.group_generator import ShipGroupGenerator
|
from gen.sam.group_generator import ShipGroupGenerator
|
||||||
|
|
||||||
|
from dcs.ships import (
|
||||||
|
USS_Arleigh_Burke_IIa,
|
||||||
|
Ticonderoga_class
|
||||||
|
)
|
||||||
|
|
||||||
class CarrierGroupGenerator(ShipGroupGenerator):
|
class CarrierGroupGenerator(ShipGroupGenerator):
|
||||||
|
|
||||||
def generate(self):
|
def generate(self):
|
||||||
|
|
||||||
# Add carrier
|
#Carrier Strike Group 8
|
||||||
if len(self.faction.aircraft_carrier) > 0:
|
if self.faction.carrier_names[0] == "Carrier Strike Group 8":
|
||||||
carrier_type = random.choice(self.faction.aircraft_carrier)
|
carrier_type = random.choice(self.faction.aircraft_carrier)
|
||||||
self.add_unit(carrier_type, "Carrier", self.position.x, self.position.y, self.heading)
|
|
||||||
|
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:
|
else:
|
||||||
return
|
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
|
# Add destroyers escort
|
||||||
if len(self.faction.destroyers) > 0:
|
if len(self.faction.destroyers) > 0:
|
||||||
dd_type = random.choice(self.faction.destroyers)
|
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, "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, "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, "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.add_unit(dd_type, "DD4", self.position.x + 4500, self.position.y - 8500, self.heading)
|
||||||
|
|
||||||
self.get_generated_group().points[0].speed = 20
|
self.get_generated_group().points[0].speed = 20
|
||||||
@ -360,18 +360,21 @@ class CarrierGenerator(GenericCarrierGenerator):
|
|||||||
|
|
||||||
def tacan_callsign(self) -> str:
|
def tacan_callsign(self) -> str:
|
||||||
# TODO: Assign these properly.
|
# TODO: Assign these properly.
|
||||||
return random.choice([
|
if self.control_point.name == "Carrier Strike Group 8":
|
||||||
"STE",
|
return "TRU"
|
||||||
"CVN",
|
else:
|
||||||
"CVH",
|
return random.choice([
|
||||||
"CCV",
|
"STE",
|
||||||
"ACC",
|
"CVN",
|
||||||
"ARC",
|
"CVH",
|
||||||
"GER",
|
"CCV",
|
||||||
"ABR",
|
"ACC",
|
||||||
"LIN",
|
"ARC",
|
||||||
"TRU",
|
"GER",
|
||||||
])
|
"ABR",
|
||||||
|
"LIN",
|
||||||
|
"TRU",
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
class LhaGenerator(GenericCarrierGenerator):
|
class LhaGenerator(GenericCarrierGenerator):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user