add code to detect thargoid combat zones

This commit is contained in:
2022-12-03 14:42:32 +01:00
parent 914aa43d33
commit 67966ca27a
2 changed files with 34 additions and 4 deletions

View File

@@ -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;
}