diff --git a/EDPlayerJournal/BGS/TransactionParser.cs b/EDPlayerJournal/BGS/TransactionParser.cs index f8d0c1d..32c7bb6 100644 --- a/EDPlayerJournal/BGS/TransactionParser.cs +++ b/EDPlayerJournal/BGS/TransactionParser.cs @@ -581,14 +581,25 @@ internal class ReceiveTextParser : ITransactionParserPart { } } +internal class SelfDestructParser : ITransactionParserPart { + public void Parse(Entry entry, TransactionParserContext context, TransactionParserOptions options, TransactionList transactions) { + context.SelfDestruct = true; + } +} + internal class DiedParser : ITransactionParserPart { public void Parse(Entry entry, TransactionParserContext context, TransactionParserOptions options, TransactionList transactions) { // Death only matters in ship. On foot you can just redeploy with the dropship. if (context.IsOnFoot) { return; } - // You can't complete a combat zone if you die in it. Others might keep it open - // for you, but still you will not have completed it unless you jump back in. + if (context.SelfDestruct != null && context.SelfDestruct == true) { + // Some people just suicide to fast track back to stations after a CZ, + // especially since combat bonds don't disappear on death. So count the CZ + // on self destruct + context.DiscernCombatZone(transactions, entry); + context.SelfDestruct = null; + } context.ResetCombatZone(); // Dying also moves you back to another instance context.LeftInstance(); @@ -630,6 +641,7 @@ public class TransactionParser { { Events.ReceiveText, new ReceiveTextParser() }, { Events.RedeemVoucher, new RedeemVoucherParser() }, { Events.SearchAndRescue, new SearchAndRescueParser() }, + { Events.SelfDestruct, new SelfDestructParser() }, { Events.SellExplorationData, new SellExplorationDataParser() }, { Events.SellMicroResources, new SellMicroResourcesParser() }, { Events.SellOrganicData, new SellOrganicDataParser() }, diff --git a/EDPlayerJournal/BGS/TransactionParserContext.cs b/EDPlayerJournal/BGS/TransactionParserContext.cs index 49c8cb4..94647fa 100644 --- a/EDPlayerJournal/BGS/TransactionParserContext.cs +++ b/EDPlayerJournal/BGS/TransactionParserContext.cs @@ -62,6 +62,8 @@ internal class TransactionParserContext { public bool HaveSeenAlliedCorrespondent { get; set; } = false; public bool HaveSeenEnemyCorrespondent { get; set; } = false; + public bool? SelfDestruct { get; set; } = null; + /// /// Current Odyssey settlement. ///