From f81a3d03c0f059c15f829f435fb71d85c4dabd10 Mon Sep 17 00:00:00 2001 From: walterroach <37820425+walterroach@users.noreply.github.com> Date: Thu, 29 Oct 2020 23:57:56 -0500 Subject: [PATCH] working briefinggen refactor --- game/operation/operation.py | 20 ++++++++++---------- gen/briefinggen.py | 13 +++++++++---- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/game/operation/operation.py b/game/operation/operation.py index e1463c97..664572ec 100644 --- a/game/operation/operation.py +++ b/game/operation/operation.py @@ -300,12 +300,12 @@ class Operation: airsupportgen.air_support) kneeboard_generator = KneeboardGenerator(self.current_mission) - for dynamic_runway in groundobjectgen.runways.values(): - self.briefinggen.add_dynamic_runway(dynamic_runway) + # for dynamic_runway in groundobjectgen.runways.values(): + # self.briefinggen.add_dynamic_runway(dynamic_runway) for tanker in airsupportgen.air_support.tankers: - self.briefinggen.add_tanker(tanker) - kneeboard_generator.add_tanker(tanker) + # self.briefinggen.add_tanker(tanker) + # kneeboard_generator.add_tanker(tanker) luaData["Tankers"][tanker.callsign] = { "dcsGroupName": tanker.dcsGroupName, "callsign": tanker.callsign, @@ -316,8 +316,8 @@ class Operation: if self.is_awacs_enabled: for awacs in airsupportgen.air_support.awacs: - self.briefinggen.add_awacs(awacs) - kneeboard_generator.add_awacs(awacs) + # self.briefinggen.add_awacs(awacs) + # kneeboard_generator.add_awacs(awacs) luaData["AWACs"][awacs.callsign] = { "dcsGroupName": awacs.dcsGroupName, "callsign": awacs.callsign, @@ -325,8 +325,8 @@ class Operation: } for jtac in jtacs: - self.briefinggen.add_jtac(jtac) - kneeboard_generator.add_jtac(jtac) + # self.briefinggen.add_jtac(jtac) + # kneeboard_generator.add_jtac(jtac) luaData["JTACs"][jtac.callsign] = { "dcsGroupName": jtac.dcsGroupName, "callsign": jtac.callsign, @@ -336,8 +336,8 @@ class Operation: } for flight in airgen.flights: - self.briefinggen.add_flight(flight) - kneeboard_generator.add_flight(flight) + # self.briefinggen.add_flight(flight) + # kneeboard_generator.add_flight(flight) if flight.friendly and flight.flight_type in [FlightType.ANTISHIP, FlightType.DEAD, FlightType.SEAD, FlightType.STRIKE]: flightType = flight.flight_type.name flightTarget = flight.package.target diff --git a/gen/briefinggen.py b/gen/briefinggen.py index 98e82fa5..66ce36ff 100644 --- a/gen/briefinggen.py +++ b/gen/briefinggen.py @@ -1,3 +1,6 @@ +''' +Briefing generation logic +''' import os import random import logging @@ -58,7 +61,7 @@ class FrontLineInfo: "critical, and we will lose ground inevitably.") elif self.enemy_zero: return ("The enemy forces have been crushed, we will be able to make significant progress" - f" toward {enemy_base.name}.") + f" toward {self.enemy_base.name}.") return None @property @@ -73,14 +76,14 @@ class FrontLineInfo: elif self.stance == CombatStance.ELIMINATION: return ( "On this location, our ground forces will focus on the destruction of enemy" - f"assets, before attempting to make progress toward {enemy_base.name}. " + f"assets, before attempting to make progress toward {self.enemy_base.name}. " "The enemy is already outnumbered, and this maneuver might draw a final " "blow to their forces." ) elif self.stance == CombatStance.BREAKTHROUGH: return ( "On this location, our ground forces will focus on progression toward " - f"{enemy_base.name}." + f"{self.enemy_base.name}." ) elif self.stance in [CombatStance.DEFENSIVE, CombatStance.AMBUSH]: return ( @@ -109,7 +112,7 @@ class FrontLineInfo: elif self.stance == CombatStance.BREAKTHROUGH: return ( "On this location, our ground forces have been ordered to rush toward " - f"{enemy_base.name}. Wish them luck... We are also expecting a counter attack." + f"{self.enemy_base.name}. Wish them luck... We are also expecting a counter attack." ) elif self.stance in [CombatStance.DEFENSIVE, CombatStance.AMBUSH]: return ( @@ -131,6 +134,8 @@ class FrontLineInfo: situation += self._advantage_description else: situation += self._disadvantage_description + return situation + class MissionInfoGenerator: """Base type for generators of mission information for the player.