add code to detect thargoid combat zones
This commit is contained in:
parent
914aa43d33
commit
67966ca27a
@ -9,9 +9,9 @@ public class CombatZone : Transaction {
|
|||||||
public string Type { get; set; } = CombatZones.ShipCombatZone;
|
public string Type { get; set; } = CombatZones.ShipCombatZone;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Difficulty type, low, medium or high.
|
/// Difficulty type, low, medium or high. Null means unknown.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Grade { get; set; } = CombatZones.DifficultyLow;
|
public string? Grade { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether spec ops were won.
|
/// Whether spec ops were won.
|
||||||
@ -91,6 +91,10 @@ public class CombatZone : Transaction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public override string ToString() {
|
public override string ToString() {
|
||||||
|
if (Grade != null) {
|
||||||
return string.Format("Won {0} {1} Combat Zone", Grade, Type);
|
return string.Format("Won {0} {1} Combat Zone", Grade, Type);
|
||||||
|
} else {
|
||||||
|
return string.Format("Won {0} Combat Zone", Type);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,6 +34,16 @@ internal class TransactionParserContext {
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public ulong ShipKills { get; set; } = 0;
|
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>
|
/// <summary>
|
||||||
/// A list of accepted missions index by their mission ID
|
/// A list of accepted missions index by their mission ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -57,7 +67,7 @@ internal class TransactionParserContext {
|
|||||||
public Dictionary<string, long> BuyCost = new();
|
public Dictionary<string, long> BuyCost = new();
|
||||||
|
|
||||||
public void DiscernCombatZone(TransactionList transactions, Entry e) {
|
public void DiscernCombatZone(TransactionList transactions, Entry e) {
|
||||||
string grade = CombatZones.DifficultyLow;
|
string? grade = CombatZones.DifficultyLow;
|
||||||
string cztype;
|
string cztype;
|
||||||
ulong? highest = HighestCombatBond;
|
ulong? highest = HighestCombatBond;
|
||||||
|
|
||||||
@ -100,6 +110,11 @@ internal class TransactionParserContext {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
cztype = CombatZones.ShipCombatZone;
|
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 {
|
} else {
|
||||||
transactions.AddIncomplete(new CombatZone(), "Failed to discern combat zone type");
|
transactions.AddIncomplete(new CombatZone(), "Failed to discern combat zone type");
|
||||||
return;
|
return;
|
||||||
@ -144,6 +159,8 @@ internal class TransactionParserContext {
|
|||||||
LastRecordedAwardingFaction = null;
|
LastRecordedAwardingFaction = null;
|
||||||
OnFootKills = 0;
|
OnFootKills = 0;
|
||||||
ShipKills = 0;
|
ShipKills = 0;
|
||||||
|
ThargoidInterceptorKills = 0;
|
||||||
|
ThargoidScoutKills = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void BoughtCargo(string? cargo, long? cost) {
|
public void BoughtCargo(string? cargo, long? cost) {
|
||||||
@ -776,6 +793,15 @@ internal class FactionKillBondParser : TransactionParserPart {
|
|||||||
IsLegacy = context.IsLegacy,
|
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
|
// We are done
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user