diff --git a/EDPlayerJournal/BGS/TransactionParser.cs b/EDPlayerJournal/BGS/TransactionParser.cs index 7d6b86e..24665ab 100644 --- a/EDPlayerJournal/BGS/TransactionParser.cs +++ b/EDPlayerJournal/BGS/TransactionParser.cs @@ -17,7 +17,10 @@ internal class TransactionParserContext { public ulong? HighestCombatBond { get; set; } - public bool HaveSeenWarzoneNPC { get; set; } = false; + public bool HaveSeenCapShip { get; set; } = false; + public bool HaveSeenCaptain { get; set; } = false; + public bool HaveSeenSpecOps { get; set; } = false; + public bool HaveSeenCorrespondent { get; set; } = false; /// /// How many on foot kills were done. @@ -75,9 +78,22 @@ internal class TransactionParserContext { } else if (ShipKills > 10) { grade = "Medium"; } - if (HaveSeenWarzoneNPC && grade == "Low") { - // We have seen a warzone NPC so we know its at least medium - grade = "Medium"; + + // Cap ship, means a high conflict zone + if (HaveSeenCapShip) { + grade = "High"; + } else { + int warzoneNpcs = new List() { HaveSeenCaptain, HaveSeenCorrespondent, HaveSeenSpecOps } + .Where(x => x == true) + .Count() + ; + + if (warzoneNpcs >= 2 && grade != "High") { + // Only large combat zones have two NPCs + grade = "High"; + } else if (warzoneNpcs >= 1 && grade == "Low") { + grade = "Medium"; + } } cztype = "Ship"; } else { @@ -112,7 +128,10 @@ internal class TransactionParserContext { public void ResetCombatZone() { HighestCombatBond = null; - HaveSeenWarzoneNPC = false; + HaveSeenCapShip = false; + HaveSeenCaptain = false; + HaveSeenCorrespondent = false; + HaveSeenSpecOps = false; LastRecordedAwardingFaction = null; OnFootKills = 0; ShipKills = 0; @@ -290,9 +309,19 @@ internal class ShipTargetedParser : TransactionParserPart { context.NPCFaction.TryAdd(entry.PilotNameLocalised, entry.Faction); } - // We have seen a spec ops, so we know its medium or higher - if (NPCs.IsWarzoneNPC(entry.PilotName)) { - context.HaveSeenWarzoneNPC = true; + // We have seen a captain? + if (NPCs.IsWarzoneCaptain(entry.PilotName)) { + context.HaveSeenCaptain = true; + } + + // Spec ops? + if (NPCs.IsSpecOps(entry.PilotName)) { + context.HaveSeenSpecOps = true; + } + + // Correspondent? + if (NPCs.IsWarzoneCorrespondent(entry.PilotName)) { + context.HaveSeenCorrespondent = true; } } }