From be3bceb880bf800ecc3d0e731252df4192baab6e Mon Sep 17 00:00:00 2001 From: Florian Stinglmayr Date: Thu, 14 Nov 2024 10:51:18 +0100 Subject: [PATCH 01/14] make sure missions read as 0 INF if no INF was generated --- EliteBGS/LogGenerator/MissionFormat.cs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/EliteBGS/LogGenerator/MissionFormat.cs b/EliteBGS/LogGenerator/MissionFormat.cs index c92e539..ea70637 100644 --- a/EliteBGS/LogGenerator/MissionFormat.cs +++ b/EliteBGS/LogGenerator/MissionFormat.cs @@ -64,6 +64,7 @@ public class MissionFormat : LogFormatter { Dictionary passengers = new(); StringBuilder output = new StringBuilder(); long total_influence = 0; + bool hadmissions = false; var missions = objective.EnabledOfType(); var support = objective.EnabledOfType(); @@ -85,6 +86,7 @@ public class MissionFormat : LogFormatter { ++collated[m.MissionName][m.Influence]; + hadmissions = true; total_influence += m.Influence.Length; if (m.AcceptedEntry != null && @@ -121,19 +123,23 @@ public class MissionFormat : LogFormatter { output.Append(failedlog); output.Append("\n"); } + if (failed.Count > 0) { + hadmissions = true; + } total_influence += failed.Sum(x => x.InfluenceAmount); foreach (InfluenceSupport inf in support) { output.Append(inf.ToString()); output.Append("\n"); + hadmissions = true; total_influence += inf.Influence.InfluenceAmount; } - if (support.Count() > 0) { + if (support.Count > 0) { output.Append("\n"); } - if (total_influence != 0) { + if (hadmissions) { output.AppendFormat("Total Influence: {0}", total_influence); } @@ -141,6 +147,10 @@ public class MissionFormat : LogFormatter { } public string GenerateSummary(Objective objective) { + bool hadmissions = objective + .EnabledOfType() + .Count > 0 + ; long influence = objective .EnabledOfType() .Sum(x => x.Influence.Length) @@ -154,7 +164,7 @@ public class MissionFormat : LogFormatter { .Sum(x => x.InfluenceAmount) ; - if (influence == 0 && support == 0 && failed == 0) { + if (influence == 0 && support == 0 && failed == 0 && !hadmissions) { return ""; } From 912e8b602f98687753e1f524c97ea6a31ae2c9a3 Mon Sep 17 00:00:00 2001 From: Florian Stinglmayr Date: Thu, 14 Nov 2024 11:17:43 +0100 Subject: [PATCH 02/14] add support for power combat zones in parsing --- EDPlayerJournal/BGS/CombatZone.cs | 7 +++++ .../BGS/TransactionParserContext.cs | 27 +++++++++++++++---- EDPlayerJournal/CombatZones.cs | 5 ++++ EDPlayerJournal/Instances.cs | 16 ++++++++++- 4 files changed, 49 insertions(+), 6 deletions(-) diff --git a/EDPlayerJournal/BGS/CombatZone.cs b/EDPlayerJournal/BGS/CombatZone.cs index 4f6d8ed..18bb10e 100644 --- a/EDPlayerJournal/BGS/CombatZone.cs +++ b/EDPlayerJournal/BGS/CombatZone.cs @@ -92,6 +92,13 @@ public class CombatZone : Transaction { get { return string.Compare(Type, CombatZones.AXCombatZone) == 0; } } + /// + /// Returns true if it is a power combat zone + /// + public bool IsPower { + get { return string.Compare(Type, CombatZones.PowerCombatZone) == 0; } + } + public override int CompareTo(Transaction? obj) { if (obj == null || obj.GetType() != typeof(CombatZone)) { return -1; diff --git a/EDPlayerJournal/BGS/TransactionParserContext.cs b/EDPlayerJournal/BGS/TransactionParserContext.cs index 22b3e51..49c8cb4 100644 --- a/EDPlayerJournal/BGS/TransactionParserContext.cs +++ b/EDPlayerJournal/BGS/TransactionParserContext.cs @@ -128,16 +128,29 @@ internal class TransactionParserContext { Settlement = null; } + private bool HadCombatZone() { + if (CurrentInstanceType != null && + Instances.IsInstance(CurrentInstanceType, Instances.PowerWarzoneMedium)) { + return true; + } + + if (HighestCombatBond == null && + LastRecordedAwardingFaction == null && + HaveSeenAXWarzoneNPC == false && + CurrentInstanceType == null) { + return false; + } + + return true; + } + public void DiscernCombatZone(TransactionList transactions, Entry e) { string? grade = CombatZones.DifficultyLow; string cztype; ulong highest = HighestCombatBond ?? 0; string? faction = LastRecordedAwardingFaction; - if (HighestCombatBond == null && - LastRecordedAwardingFaction == null && - HaveSeenAXWarzoneNPC == false && - CurrentInstanceType == null) { + if (!HadCombatZone()) { return; } @@ -157,7 +170,8 @@ internal class TransactionParserContext { return; } if (LastRecordedAwardingFaction == null && - Instances.IsHumanWarzone(CurrentInstanceType)) { + (Instances.IsHumanWarzone(CurrentInstanceType) || + Instances.IsPowerWarzone(CurrentInstanceType))) { transactions.AddIncomplete(new CombatZone(), "Could not discern for whom you fought for, " + "as it seems you haven't killed anyone in the ship combat zone.", @@ -187,6 +201,9 @@ internal class TransactionParserContext { } else if (Instances.IsInstance(CurrentInstanceType, Instances.WarzoneThargoidVeryHigh)) { cztype = CombatZones.AXCombatZone; grade = CombatZones.DifficultyVeryHigh; + } else if (Instances.IsInstance(CurrentInstanceType, Instances.PowerWarzoneMedium)) { + cztype = CombatZones.PowerCombatZone; + grade = CombatZones.DifficultyMedium; } else { transactions.AddIncomplete(new CombatZone(), "Unknown conflict zone difficulty", diff --git a/EDPlayerJournal/CombatZones.cs b/EDPlayerJournal/CombatZones.cs index 3c59477..4888f41 100644 --- a/EDPlayerJournal/CombatZones.cs +++ b/EDPlayerJournal/CombatZones.cs @@ -14,6 +14,11 @@ public class CombatZones { /// public static readonly string ShipCombatZone = "Ship"; + /// + /// Power combat zones, new in Ascendancy update. + /// + public static readonly string PowerCombatZone = "Power"; + /// /// AX combat zone /// diff --git a/EDPlayerJournal/Instances.cs b/EDPlayerJournal/Instances.cs index c9068d0..1587425 100644 --- a/EDPlayerJournal/Instances.cs +++ b/EDPlayerJournal/Instances.cs @@ -18,6 +18,11 @@ public class Instances { /// public static readonly string WarzoneHigh = "$Warzone_PointRace_High"; + /// + /// Medium power play conflict zone, new in PP 2.0 Ascendancy update + /// + public static readonly string PowerWarzoneMedium = "$Warzone_Powerplay_Med"; + /// /// Low Thargoid combat zone /// @@ -52,8 +57,17 @@ public class Instances { ; } + public static bool IsPowerWarzone(string type) { + return + IsInstance(type, PowerWarzoneMedium) + ; + } + public static bool IsWarzone(string type) { - return IsHumanWarzone(type) || IsThargoidWarzone(type); + return IsHumanWarzone(type) || + IsThargoidWarzone(type) || + IsPowerWarzone(type) + ; } public static bool IsInstance(string type, string instance) { From 4fe77e6946dc9cd04bf6d72822cc72e34865bb2a Mon Sep 17 00:00:00 2001 From: Florian Stinglmayr Date: Thu, 14 Nov 2024 11:18:01 +0100 Subject: [PATCH 03/14] add support for power combat zones in UI --- EliteBGS/MainWindow.xaml | 1 + EliteBGS/MainWindow.xaml.cs | 11 +++++++++++ EliteBGS/Objective.cs | 4 +++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/EliteBGS/MainWindow.xaml b/EliteBGS/MainWindow.xaml index 4412c87..f6f26e6 100644 --- a/EliteBGS/MainWindow.xaml +++ b/EliteBGS/MainWindow.xaml @@ -121,6 +121,7 @@