diff --git a/EDPlayerJournal/BGS/MeritsGained.cs b/EDPlayerJournal/BGS/MeritsGained.cs
new file mode 100644
index 0000000..872b018
--- /dev/null
+++ b/EDPlayerJournal/BGS/MeritsGained.cs
@@ -0,0 +1,25 @@
+using EDPlayerJournal.Entries;
+
+namespace EDPlayerJournal.BGS;
+
+public class MeritsGained : Transaction {
+ public MeritsGained() { }
+
+ public MeritsGained(Entry entry) {
+ Entries.Add(entry);
+ }
+
+ ///
+ /// Number of merits gained
+ ///
+ public long Merits { get; set; } = 0;
+
+ ///
+ /// For what power those merits were gained
+ ///
+ public string Power { get; set; } = string.Empty;
+
+ public override string ToString() {
+ return string.Format("{0} Merits gained for {1}", Merits, Power);
+ }
+}
diff --git a/EDPlayerJournal/BGS/Parsers/PowerplayParser.cs b/EDPlayerJournal/BGS/Parsers/PowerplayParser.cs
new file mode 100644
index 0000000..2550628
--- /dev/null
+++ b/EDPlayerJournal/BGS/Parsers/PowerplayParser.cs
@@ -0,0 +1,29 @@
+using EDPlayerJournal.Entries;
+
+namespace EDPlayerJournal.BGS.Parsers;
+
+internal class PowerplayParser : ITransactionParserPart {
+ public void Parse(Entry entry, TransactionParserContext context, TransactionParserOptions options, TransactionList transactions) {
+ PowerplayEntry? p = entry as PowerplayEntry;
+ if (p == null) {
+ return;
+ }
+
+ if (context.LastMerits == null) {
+ context.LastMerits = p.Merits;
+ }
+
+ context.CurrentMerits = p.Merits;
+
+ if (context.LastMerits != context.CurrentMerits) {
+ transactions.Add(new MeritsGained(entry) {
+ Merits = ((long)(context.CurrentMerits - context.LastMerits)),
+ Power = p.Power,
+ System = context.CurrentSystem,
+ Faction = p.Power,
+ });
+ }
+
+ context.LastMerits = context.CurrentMerits;
+ }
+}
diff --git a/EDPlayerJournal/BGS/TransactionParser.cs b/EDPlayerJournal/BGS/TransactionParser.cs
index 32c7bb6..e34240a 100644
--- a/EDPlayerJournal/BGS/TransactionParser.cs
+++ b/EDPlayerJournal/BGS/TransactionParser.cs
@@ -638,6 +638,7 @@ public class TransactionParser {
{ Events.Missions, new MissionsParser() },
{ Events.MultiSellExplorationData, new MultiSellExplorationDataParser() },
{ Events.Music, new MusicParser() },
+ { Events.Powerplay, new PowerplayParser() },
{ Events.ReceiveText, new ReceiveTextParser() },
{ Events.RedeemVoucher, new RedeemVoucherParser() },
{ Events.SearchAndRescue, new SearchAndRescueParser() },
diff --git a/EDPlayerJournal/BGS/TransactionParserContext.cs b/EDPlayerJournal/BGS/TransactionParserContext.cs
index 94647fa..04a0f22 100644
--- a/EDPlayerJournal/BGS/TransactionParserContext.cs
+++ b/EDPlayerJournal/BGS/TransactionParserContext.cs
@@ -69,6 +69,16 @@ internal class TransactionParserContext {
///
public string? Settlement { get; set; } = null;
+ ///
+ /// Current Merits
+ ///
+ public long? CurrentMerits { get; set; } = null;
+
+ ///
+ /// Merits from last login
+ ///
+ public long? LastMerits { get; set; } = null;
+
///
/// Returns true if the current session is legacy
///