mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Generate ICLS command for carriers
This commit is contained in:
parent
9ae34d474b
commit
7ee880cadc
@ -65,10 +65,9 @@ class BriefingGenerator:
|
|||||||
self.description += "-" * 50 + "\n"
|
self.description += "-" * 50 + "\n"
|
||||||
for name, freq in self.freqs:
|
for name, freq in self.freqs:
|
||||||
self.description += "\n{}: {}".format(name, freq)
|
self.description += "\n{}: {}".format(name, freq)
|
||||||
|
self.description += "\n-" * 50 + "\n"
|
||||||
for cp in self.game.theater.controlpoints:
|
for cp in self.game.theater.controlpoints:
|
||||||
if cp.captured and cp.cptype in [ControlPointType.LHA_GROUP, ControlPointType.AIRCRAFT_CARRIER_GROUP]:
|
if cp.captured and cp.cptype in [ControlPointType.LHA_GROUP, ControlPointType.AIRCRAFT_CARRIER_GROUP]:
|
||||||
self.description += "\n"
|
|
||||||
self.description += cp.name + " TACAN : "
|
self.description += cp.name + " TACAN : "
|
||||||
|
|
||||||
self.description += str(cp.tacanN)
|
self.description += str(cp.tacanN)
|
||||||
@ -78,6 +77,10 @@ class BriefingGenerator:
|
|||||||
self.description += "X"
|
self.description += "X"
|
||||||
self.description += " " + str(cp.tacanI) + "\n"
|
self.description += " " + str(cp.tacanI) + "\n"
|
||||||
|
|
||||||
|
if cp.cptype == ControlPointType.AIRCRAFT_CARRIER_GROUP and hasattr(cp, "icls"):
|
||||||
|
self.description += "ICLS Channel : " + str(cp.icls) + "\n"
|
||||||
|
self.description += "-" * 50 + "\n"
|
||||||
|
|
||||||
self.m.set_description_text(self.description)
|
self.m.set_description_text(self.description)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -103,6 +103,9 @@ class GroundObjectsGenerator:
|
|||||||
modeChannel = "X" if not cp.tacanY else "Y"
|
modeChannel = "X" if not cp.tacanY else "Y"
|
||||||
sg.points[0].tasks.append(ActivateBeaconCommand(channel=cp.tacanN, modechannel=modeChannel, callsign=cp.tacanI, unit_id=sg.units[0].id))
|
sg.points[0].tasks.append(ActivateBeaconCommand(channel=cp.tacanN, modechannel=modeChannel, callsign=cp.tacanI, unit_id=sg.units[0].id))
|
||||||
|
|
||||||
|
if ground_object.dcs_identifier == "CARRIER" and hasattr(cp, "icls"):
|
||||||
|
sg.points[0].tasks.append(ActivateICLSCommand(cp.icls, unit_id=sg.units[0].id))
|
||||||
|
|
||||||
else:
|
else:
|
||||||
if ground_object.dcs_identifier in warehouse_map:
|
if ground_object.dcs_identifier in warehouse_map:
|
||||||
static_type = warehouse_map[ground_object.dcs_identifier]
|
static_type = warehouse_map[ground_object.dcs_identifier]
|
||||||
|
|||||||
@ -27,6 +27,7 @@ class ControlPoint:
|
|||||||
full_name = None # type: str
|
full_name = None # type: str
|
||||||
base = None # type: theater.base.Base
|
base = None # type: theater.base.Base
|
||||||
at = None # type: db.StartPosition
|
at = None # type: db.StartPosition
|
||||||
|
icls = 1
|
||||||
|
|
||||||
connected_points = None # type: typing.List[ControlPoint]
|
connected_points = None # type: typing.List[ControlPoint]
|
||||||
ground_objects = None # type: typing.List[TheaterGroundObject]
|
ground_objects = None # type: typing.List[TheaterGroundObject]
|
||||||
@ -36,6 +37,8 @@ class ControlPoint:
|
|||||||
frontline_offset = 0.0
|
frontline_offset = 0.0
|
||||||
cptype: ControlPointType = None
|
cptype: ControlPointType = None
|
||||||
|
|
||||||
|
ICLS_counter = 1
|
||||||
|
|
||||||
def __init__(self, id: int, name: str, position: Point, at, radials: typing.Collection[int], size: int, importance: float,
|
def __init__(self, id: int, name: str, position: Point, at, radials: typing.Collection[int], size: int, importance: float,
|
||||||
has_frontline=True, cptype=ControlPointType.AIRBASE):
|
has_frontline=True, cptype=ControlPointType.AIRBASE):
|
||||||
import theater.base
|
import theater.base
|
||||||
@ -60,6 +63,7 @@ class ControlPoint:
|
|||||||
self.tacanY = False
|
self.tacanY = False
|
||||||
self.tacanN = None
|
self.tacanN = None
|
||||||
self.tacanI = "TAC"
|
self.tacanI = "TAC"
|
||||||
|
self.icls = 0
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_airport(cls, airport: Airport, radials: typing.Collection[int], size: int, importance: float, has_frontline=True):
|
def from_airport(cls, airport: Airport, radials: typing.Collection[int], size: int, importance: float, has_frontline=True):
|
||||||
@ -74,6 +78,8 @@ class ControlPoint:
|
|||||||
cp.tacanY = random.choice([True, False])
|
cp.tacanY = random.choice([True, False])
|
||||||
cp.tacanN = random.randint(26, 49)
|
cp.tacanN = random.randint(26, 49)
|
||||||
cp.tacanI = random.choice(["STE", "CVN", "CVH", "CCV", "ACC", "ARC", "GER", "ABR", "LIN", "TRU"])
|
cp.tacanI = random.choice(["STE", "CVN", "CVH", "CCV", "ACC", "ARC", "GER", "ABR", "LIN", "TRU"])
|
||||||
|
ControlPoint.ICLS_counter = ControlPoint.ICLS_counter + 1
|
||||||
|
cp.icls = ControlPoint.ICLS_counter
|
||||||
return cp
|
return cp
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user