Compare commits
No commits in common. "e01d3a869d95ccf68a7ad168bb0119426ddc82ce" and "0be9791abc742518f1e0fca9bb9429cc377f10cb" have entirely different histories.
e01d3a869d
...
0be9791abc
@ -6,6 +6,13 @@ public class CombatZone : Transaction {
|
||||
public string Type { get; set; } = "";
|
||||
public string Grade { get; set; } = "";
|
||||
public int Amount { get; set; } = 0;
|
||||
public DateTime Completed { get; set; } = DateTime.UtcNow;
|
||||
|
||||
public override string CompletedAt {
|
||||
get {
|
||||
return Completed.ToString("dd.MM.yyyy HH:mm UTC");
|
||||
}
|
||||
}
|
||||
|
||||
public override int CompareTo(Transaction? obj) {
|
||||
if (obj == null || obj.GetType() != typeof(CombatZone)) {
|
||||
|
@ -1,5 +1,4 @@
|
||||
using EDPlayerJournal.Entries;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace EDPlayerJournal.BGS;
|
||||
|
||||
|
@ -17,8 +17,6 @@ internal class TransactionParserContext {
|
||||
|
||||
public ulong? HighestCombatBond { get; set; }
|
||||
|
||||
public bool HaveSeenWarzoneNPC { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// How many on foot kills were done.
|
||||
/// </summary>
|
||||
@ -51,7 +49,7 @@ internal class TransactionParserContext {
|
||||
/// </summary>
|
||||
public Dictionary<string, long> BuyCost = new();
|
||||
|
||||
public void DiscernCombatZone(TransactionList transactions, Entry e) {
|
||||
public void DiscernCombatZone(TransactionList transactions) {
|
||||
string grade = "Low";
|
||||
string cztype;
|
||||
ulong? highest = HighestCombatBond;
|
||||
@ -75,10 +73,6 @@ 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";
|
||||
}
|
||||
cztype = "Ship";
|
||||
} else {
|
||||
transactions.AddIncomplete(new CombatZone(), "Failed to discern combat zone type");
|
||||
@ -92,7 +86,6 @@ internal class TransactionParserContext {
|
||||
Type = cztype,
|
||||
Amount = 1,
|
||||
};
|
||||
zone.Entries.Add(e);
|
||||
transactions.Add(zone);
|
||||
}
|
||||
|
||||
@ -112,7 +105,6 @@ internal class TransactionParserContext {
|
||||
|
||||
public void ResetCombatZone() {
|
||||
HighestCombatBond = null;
|
||||
HaveSeenWarzoneNPC = false;
|
||||
LastRecordedAwardingFaction = null;
|
||||
OnFootKills = 0;
|
||||
ShipKills = 0;
|
||||
@ -283,11 +275,6 @@ internal class ShipTargetedParser : TransactionParserPart {
|
||||
!string.IsNullOrEmpty(entry.Faction)) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -722,14 +709,14 @@ internal class EmbarkDisembarkParser : TransactionParserPart {
|
||||
|
||||
internal class SupercruiseEntryParser : TransactionParserPart {
|
||||
public void Parse(Entry entry, TransactionParserContext context, TransactionList transactions) {
|
||||
context.DiscernCombatZone(transactions, entry);
|
||||
context.DiscernCombatZone(transactions);
|
||||
context.ResetCombatZone();
|
||||
}
|
||||
}
|
||||
|
||||
internal class ShutdownParser : TransactionParserPart {
|
||||
public void Parse(Entry entry, TransactionParserContext context, TransactionList transactions) {
|
||||
context.DiscernCombatZone(transactions, entry);
|
||||
context.DiscernCombatZone(transactions);
|
||||
context.ResetCombatZone();
|
||||
}
|
||||
}
|
||||
|
@ -1,117 +0,0 @@
|
||||
namespace EDPlayerJournal;
|
||||
|
||||
public class NPCs {
|
||||
/// <summary>
|
||||
/// Internal name of Spec Ops Wing Alpha
|
||||
/// </summary>
|
||||
public static string SpecOpsAInternal = "$LUASC_Scenario_Warzone_NPC_SpecOps_A;";
|
||||
|
||||
/// <summary>
|
||||
/// Internal name of Spec Ops Wing Beta
|
||||
/// </summary>
|
||||
public static string SpecOpsBInternal = "$LUASC_Scenario_Warzone_NPC_SpecOps_B;";
|
||||
|
||||
/// <summary>
|
||||
/// Internal name of Spec Ops Wing Gamma
|
||||
/// </summary>
|
||||
public static string SpecOpsGInternal = "$LUASC_Scenario_Warzone_NPC_SpecOps_G;";
|
||||
|
||||
/// <summary>
|
||||
/// Internal name of Spec Ops Wing Delta
|
||||
/// </summary>
|
||||
public static string SpecOpsDInternal = "$LUASC_Scenario_Warzone_NPC_SpecOps_D;";
|
||||
|
||||
/// <summary>
|
||||
/// Empire captain
|
||||
/// </summary>
|
||||
public static string EmpireCaptain = "$LUASC_Scenario_Warzone_NPC_WarzoneGeneral_Emp;";
|
||||
|
||||
/// <summary>
|
||||
/// Federation captain
|
||||
/// </summary>
|
||||
public static string FederationCaptain = "$LUASC_Scenario_Warzone_NPC_WarzoneGeneral_Fed;";
|
||||
|
||||
/// <summary>
|
||||
/// Federation captain
|
||||
/// </summary>
|
||||
public static string IndependentCaptain = "$LUASC_Scenario_Warzone_NPC_WarzoneGeneral_Ind;";
|
||||
|
||||
/// <summary>
|
||||
/// Warzone correspondant
|
||||
/// </summary>
|
||||
public static string WarzoneCorrespondent = "$LUASC_Scenario_Warzone_NPC_WarzoneCorrespondent;";
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if the pilotname is either a captain, specops, or correspondent
|
||||
/// </summary>
|
||||
/// <param name="pilotname"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsWarzoneNPC(string? pilotname) {
|
||||
if (IsWarzoneCaptain(pilotname) ||
|
||||
IsWarzoneCorrespondent(pilotname) ||
|
||||
IsSpecOps(pilotname)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if the given pilot name is a warzone correspondent
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsWarzoneCorrespondent(string? pilotname) {
|
||||
if (pilotname == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (string.Compare(pilotname, WarzoneCorrespondent) == 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if the given pilot name is a spec ops wing.
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsSpecOps(string? pilotname) {
|
||||
if (pilotname == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (string.Compare(pilotname, SpecOpsAInternal) == 0 ||
|
||||
string.Compare(pilotname, SpecOpsBInternal) == 0 ||
|
||||
string.Compare(pilotname, SpecOpsGInternal) == 0 ||
|
||||
string.Compare(pilotname, SpecOpsDInternal) == 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if the given pilot name is a warzone captain
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsWarzoneCaptain(string? pilotname) {
|
||||
if (pilotname == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (string.Compare(pilotname, EmpireCaptain) == 0 ||
|
||||
string.Compare(pilotname, FederationCaptain) == 0 ||
|
||||
string.Compare(pilotname, IndependentCaptain) == 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public class NPC {
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user