mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Briefing generation changed to match new flight. Include info for all flight containing client slots;
This commit is contained in:
parent
bba51c6a23
commit
6598e034c1
@ -18,6 +18,7 @@ class BriefingGenerator:
|
|||||||
self.m = mission
|
self.m = mission
|
||||||
self.conflict = conflict
|
self.conflict = conflict
|
||||||
self.game = game
|
self.game = game
|
||||||
|
self.description = ""
|
||||||
|
|
||||||
self.freqs = []
|
self.freqs = []
|
||||||
self.targets = []
|
self.targets = []
|
||||||
@ -32,32 +33,44 @@ class BriefingGenerator:
|
|||||||
def append_waypoint(self, description: str):
|
def append_waypoint(self, description: str):
|
||||||
self.waypoints.append(description)
|
self.waypoints.append(description)
|
||||||
|
|
||||||
|
def add_flight_description(self, flight):
|
||||||
|
|
||||||
|
if flight.client_count <= 0:
|
||||||
|
return
|
||||||
|
|
||||||
|
flight_unit_name = db.unit_type_name(flight.unit_type)
|
||||||
|
self.description += 2 * "\n" + "-" * 50 + "\n"
|
||||||
|
self.description += flight_unit_name + " x " + str(flight.count) + 2 * "\n"
|
||||||
|
|
||||||
|
self.description += "# 0 -- TAKEOFF : Take off"
|
||||||
|
for i, wpt in enumerate(flight.points):
|
||||||
|
self.description += "#" + str(1+i) + " -- " + wpt.name + " : " + wpt.description + "\n"
|
||||||
|
self.description += "# " + str(len(flight.points)) + " -- RTB"
|
||||||
|
|
||||||
|
self.description += "-" * 50 + "\n"
|
||||||
|
|
||||||
def generate(self):
|
def generate(self):
|
||||||
self.waypoints.insert(0, "INITIAL")
|
|
||||||
self.waypoints.append("RTB")
|
|
||||||
self.waypoints.append("RTB Landing")
|
|
||||||
|
|
||||||
description = ""
|
self.description = ""
|
||||||
|
|
||||||
if self.title:
|
self.description += "DCS Liberation turn #" + str(self.game.turn) + "\n"
|
||||||
description += self.title
|
self.description += "-"*50 + "\n"
|
||||||
|
|
||||||
if self.description:
|
for planner in self.game.planners.values():
|
||||||
description += "\n\n" + self.description
|
for flight in planner.cap_flights:
|
||||||
|
self.add_flight_description(flight)
|
||||||
|
for flight in planner.cas_flights:
|
||||||
|
self.add_flight_description(flight)
|
||||||
|
for flight in planner.sead_flights:
|
||||||
|
self.add_flight_description(flight)
|
||||||
|
|
||||||
if self.freqs:
|
if self.freqs:
|
||||||
description += "\n\nCOMMS:"
|
self.description += "\n\nComms Frequencies:\n"
|
||||||
|
self.description += "-" * 50 + "\n"
|
||||||
for name, freq in self.freqs:
|
for name, freq in self.freqs:
|
||||||
description += "\n{}: {}".format(name, freq)
|
self.description += "\n{}: {}".format(name, freq)
|
||||||
|
|
||||||
if self.targets:
|
|
||||||
description += "\n\nTARGETS:"
|
|
||||||
for i, (name, tp) in enumerate(self.targets):
|
|
||||||
description += "\n#{} {} {}".format(i+1, name, "(TP {})".format(tp) if tp else "")
|
|
||||||
|
|
||||||
if self.waypoints:
|
self.m.set_description_text(self.description)
|
||||||
description += "\n\nWAYPOINTS:"
|
|
||||||
for i, descr in enumerate(self.waypoints):
|
|
||||||
description += "\n#{}: {}".format(i, descr)
|
|
||||||
|
|
||||||
self.m.set_description_text(description)
|
|
||||||
|
|||||||
@ -134,6 +134,7 @@ class FlightPlanner:
|
|||||||
for ground_object in self.from_cp.ground_objects:
|
for ground_object in self.from_cp.ground_objects:
|
||||||
if ground_object.group_id not in patrolled and not ground_object.airbase_group:
|
if ground_object.group_id not in patrolled and not ground_object.airbase_group:
|
||||||
point = FlightWaypoint(ground_object.position.x, ground_object.position.y, patrol_alt)
|
point = FlightWaypoint(ground_object.position.x, ground_object.position.y, patrol_alt)
|
||||||
|
point.name = "Patrol point"
|
||||||
point.description = "Patrol #" + str(len(flight.points))
|
point.description = "Patrol #" + str(len(flight.points))
|
||||||
flight.points.append(point)
|
flight.points.append(point)
|
||||||
patrolled.append(ground_object.group_id)
|
patrolled.append(ground_object.group_id)
|
||||||
@ -178,15 +179,18 @@ class FlightPlanner:
|
|||||||
flight.targets.append(center)
|
flight.targets.append(center)
|
||||||
|
|
||||||
ingress_point = FlightWaypoint(ingress.x, ingress.y, 1000)
|
ingress_point = FlightWaypoint(ingress.x, ingress.y, 1000)
|
||||||
ingress_point.description = "INGRESS CAS"
|
ingress_point.name = "INGRESS"
|
||||||
|
ingress_point.description = "Ingress into CAS area"
|
||||||
flight.points.append(ingress_point)
|
flight.points.append(ingress_point)
|
||||||
|
|
||||||
center_point = FlightWaypoint(center.x, center.y, 1000)
|
center_point = FlightWaypoint(center.x, center.y, 1000)
|
||||||
center_point.description = "PROVIDE CAS"
|
center_point.description = "Provide CAS"
|
||||||
|
center_point.name = "CAS"
|
||||||
flight.points.append(center_point)
|
flight.points.append(center_point)
|
||||||
|
|
||||||
egress_point = FlightWaypoint(egress.x, egress.y, 1000)
|
egress_point = FlightWaypoint(egress.x, egress.y, 1000)
|
||||||
egress_point.description = "EGRESS FROM CAS AREA"
|
egress_point.description = "Egress from CAS area"
|
||||||
|
egress_point.name = "EGRESS"
|
||||||
flight.points.append(egress_point)
|
flight.points.append(egress_point)
|
||||||
|
|
||||||
self.cas_flights.append(flight)
|
self.cas_flights.append(flight)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user