add code to detect thargoid combat zones
This commit is contained in:
@@ -34,6 +34,16 @@ internal class TransactionParserContext {
|
||||
/// </summary>
|
||||
public ulong ShipKills { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Thargoid scouts killed
|
||||
/// </summary>
|
||||
public ulong ThargoidScoutKills { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Thargoid interceptor kills
|
||||
/// </summary>
|
||||
public ulong ThargoidInterceptorKills { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// A list of accepted missions index by their mission ID
|
||||
/// </summary>
|
||||
@@ -57,7 +67,7 @@ internal class TransactionParserContext {
|
||||
public Dictionary<string, long> BuyCost = new();
|
||||
|
||||
public void DiscernCombatZone(TransactionList transactions, Entry e) {
|
||||
string grade = CombatZones.DifficultyLow;
|
||||
string? grade = CombatZones.DifficultyLow;
|
||||
string cztype;
|
||||
ulong? highest = HighestCombatBond;
|
||||
|
||||
@@ -100,6 +110,11 @@ internal class TransactionParserContext {
|
||||
}
|
||||
}
|
||||
cztype = CombatZones.ShipCombatZone;
|
||||
} else if (ThargoidScoutKills > 0 && ThargoidInterceptorKills > 0) {
|
||||
// Could be a thargoid combat zones if interceptors and scouts are there
|
||||
cztype = CombatZones.ThargoidCombatZone;
|
||||
// Still unknown
|
||||
grade = null;
|
||||
} else {
|
||||
transactions.AddIncomplete(new CombatZone(), "Failed to discern combat zone type");
|
||||
return;
|
||||
@@ -144,6 +159,8 @@ internal class TransactionParserContext {
|
||||
LastRecordedAwardingFaction = null;
|
||||
OnFootKills = 0;
|
||||
ShipKills = 0;
|
||||
ThargoidInterceptorKills = 0;
|
||||
ThargoidScoutKills = 0;
|
||||
}
|
||||
|
||||
public void BoughtCargo(string? cargo, long? cost) {
|
||||
@@ -776,6 +793,15 @@ internal class FactionKillBondParser : TransactionParserPart {
|
||||
IsLegacy = context.IsLegacy,
|
||||
});
|
||||
|
||||
ThargoidVessel vessel = Thargoid.GetVesselByPayout(entry.Reward);
|
||||
if (vessel != ThargoidVessel.Unknown) {
|
||||
if (vessel == ThargoidVessel.Scout) {
|
||||
++context.ThargoidScoutKills;
|
||||
} else {
|
||||
++context.ThargoidInterceptorKills;
|
||||
}
|
||||
}
|
||||
|
||||
// We are done
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user