Generate random TACAN frequency for ships at start.

TACAN infos are displayed in briefing.
This commit is contained in:
Khopa
2020-05-29 03:28:09 +02:00
parent 8afdf5ef65
commit 59986d74f4
4 changed files with 30 additions and 19 deletions

View File

@@ -70,6 +70,18 @@ class BriefingGenerator:
for name, freq in self.freqs:
self.description += "\n{}: {}".format(name, freq)
for cp in self.game.theater.controlpoints:
if cp.captured and cp.cptype in [ControlPointType.LHA_GROUP, ControlPointType.AIRCRAFT_CARRIER_GROUP]:
self.description += "\n"
self.description += cp.name + " TACAN : "
self.description += str(cp.tacanN)
if cp.tacanY:
self.description += "Y"
else:
self.description += "X"
self.description += " " + str(cp.tacanI) + "\n"
self.m.set_description_text(self.description)

View File

@@ -93,8 +93,13 @@ class GroundObjectsGenerator:
ship.heading = u.heading
sg.add_unit(ship)
# TODO : make sure the point is not on Land
sg.add_waypoint(sg.points[0].position.point_from_heading(g.units[0].heading, 100000))
# SET UP TACAN
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))
else:
if ground_object.dcs_identifier in warehouse_map:
static_type = warehouse_map[ground_object.dcs_identifier]