prepare transaction engine for thargoid kills

This commit is contained in:
Florian Stinglmayr 2022-11-25 12:34:11 +01:00
parent 27cfdce912
commit 85848a7381
4 changed files with 93 additions and 1 deletions

View File

@ -1,13 +1,32 @@
namespace EDPlayerJournal.Entries; namespace EDPlayerJournal.Entries;
public class FactionKillBondEntry : Entry { public class FactionKillBondEntry : Entry {
/// <summary>
/// Reward given
/// </summary>
public int Reward { get; set; } public int Reward { get; set; }
/// <summary>
/// Faction that awarded the kill bond
/// </summary>
public string? AwardingFaction { get; set; } public string? AwardingFaction { get; set; }
/// <summary>
/// Localised string of the awarding faction if available
/// </summary>
public string? AwardingFactionLocalised { get; set; }
/// <summary>
/// Victim faction, internal name
/// </summary>
public string? VictimFaction { get; set; } public string? VictimFaction { get; set; }
/// <summary>
/// Localised name of the victim faction
/// </summary>
public string? VictimFactionLocalised { get; set; }
protected override void Initialise() { protected override void Initialise() {
Reward = JSON.Value<int?>("Reward") ?? 0; Reward = JSON.Value<int?>("Reward") ?? 0;
AwardingFaction = JSON.Value<string>("AwardingFaction"); AwardingFaction = JSON.Value<string>("AwardingFaction");
AwardingFactionLocalised = JSON.Value<string>("AwardingFaction_Localised");
VictimFaction = JSON.Value<string>("VictimFaction"); VictimFaction = JSON.Value<string>("VictimFaction");
VictimFactionLocalised = JSON.Value<string>("VictimFaction_Localised");
} }
} }

View File

@ -5,7 +5,8 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
namespace EDPlayerJournal; namespace EDPlayerJournal;
public class FactionState { public class FactionState {
public string? State { get; set; } public string? State { get; set; }
public long? Trend { get; set; } public long? Trend { get; set; }
@ -28,6 +29,18 @@ public class FactionState {
} }
} }
public class Factions {
/// <summary>
/// Internal name for the Pilots Federation faction
/// </summary>
public static string PilotsFederation = "$faction_PilotsFederation;";
/// <summary>
/// Internal name for the Thargoid faction
/// </summary>
public static string Thargoid = "$faction_Thargoid;";
}
public class Faction { public class Faction {
public string? Name { get; set; } public string? Name { get; set; }
public string? FactionState { get; set; } public string? FactionState { get; set; }

View File

@ -0,0 +1,56 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EDPlayerJournal;
public enum ThargoidVessel {
Unknown = 0,
Scout = 1,
/// <summary>
/// According to AX wiki no longer found ingame
/// </summary>
Orthrus = 2,
Cyclops = 3,
Basilisk = 4,
Medusa = 5,
Hydra = 6,
}
public class Thargoid {
public static string ThargoidFaction = Factions.Thargoid;
public static Dictionary<ulong, ThargoidVessel> VesselPayout { get; } = new() {
{ 80000, ThargoidVessel.Scout },
{ 8000000, ThargoidVessel.Cyclops },
{ 24000000, ThargoidVessel.Basilisk },
{ 40000000, ThargoidVessel.Medusa },
{ 60000000, ThargoidVessel.Hydra },
};
public static Dictionary<ThargoidVessel, string?> VesselNames { get; } = new() {
{ ThargoidVessel.Unknown, null },
{ ThargoidVessel.Scout, "Thargoid Scout" },
{ ThargoidVessel.Orthrus, "Orthrus" },
{ ThargoidVessel.Cyclops, "Cyclops" },
{ ThargoidVessel.Basilisk, "Basilisk" },
{ ThargoidVessel.Medusa, "Medusa" },
{ ThargoidVessel.Hydra, "Hydra" },
};
public static ThargoidVessel GetVesselByPayout(ulong payout) {
if (VesselPayout.ContainsKey(payout)) {
return VesselPayout[payout];
}
return ThargoidVessel.Unknown;
}
public static string? GetVesselName(ThargoidVessel v) {
if (VesselNames.ContainsKey(v)) {
return VesselNames[v];
}
return null;
}
}

View File

@ -0,0 +1,4 @@
{ "timestamp":"2022-11-25T09:50:45Z", "event":"FactionKillBond", "Reward":80000, "AwardingFaction":"$faction_PilotsFederation;", "AwardingFaction_Localised":"Pilots' Federation", "VictimFaction":"$faction_Thargoid;", "VictimFaction_Localised":"Thargoids" }
{ "timestamp":"2022-11-25T09:52:28Z", "event":"FactionKillBond", "Reward":24000000, "AwardingFaction":"$faction_PilotsFederation;", "AwardingFaction_Localised":"Pilots' Federation", "VictimFaction":"$faction_Thargoid;", "VictimFaction_Localised":"Thargoids" }
{ "timestamp":"2022-11-25T09:47:19Z", "event":"FactionKillBond", "Reward":80000, "AwardingFaction":"$faction_PilotsFederation;", "AwardingFaction_Localised":"Pilots' Federation", "VictimFaction":"$faction_Thargoid;", "VictimFaction_Localised":"Thargoids" }
{ "timestamp":"2022-11-25T10:13:53Z", "event":"RedeemVoucher", "Type":"CombatBond", "Amount":24240000, "Faction":"PilotsFederation" }