prepare transaction engine for thargoid kills
This commit is contained in:
parent
27cfdce912
commit
85848a7381
@ -1,13 +1,32 @@
|
||||
namespace EDPlayerJournal.Entries;
|
||||
|
||||
public class FactionKillBondEntry : Entry {
|
||||
/// <summary>
|
||||
/// Reward given
|
||||
/// </summary>
|
||||
public int Reward { get; set; }
|
||||
/// <summary>
|
||||
/// Faction that awarded the kill bond
|
||||
/// </summary>
|
||||
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; }
|
||||
/// <summary>
|
||||
/// Localised name of the victim faction
|
||||
/// </summary>
|
||||
public string? VictimFactionLocalised { get; set; }
|
||||
|
||||
protected override void Initialise() {
|
||||
Reward = JSON.Value<int?>("Reward") ?? 0;
|
||||
AwardingFaction = JSON.Value<string>("AwardingFaction");
|
||||
AwardingFactionLocalised = JSON.Value<string>("AwardingFaction_Localised");
|
||||
VictimFaction = JSON.Value<string>("VictimFaction");
|
||||
VictimFactionLocalised = JSON.Value<string>("VictimFaction_Localised");
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,8 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace EDPlayerJournal;
|
||||
namespace EDPlayerJournal;
|
||||
|
||||
public class FactionState {
|
||||
public string? State { 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 string? Name { get; set; }
|
||||
public string? FactionState { get; set; }
|
||||
|
56
EDPlayerJournal/Thargoid.cs
Normal file
56
EDPlayerJournal/Thargoid.cs
Normal 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;
|
||||
}
|
||||
}
|
4
EDPlayerJournalTests/ThargoidKills.txt
Normal file
4
EDPlayerJournalTests/ThargoidKills.txt
Normal 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" }
|
Loading…
Reference in New Issue
Block a user