if player targeted warzone NPCs assume its medium or higher

This commit is contained in:
2022-11-25 23:54:28 +01:00
parent 1da4549e2c
commit e01d3a869d
2 changed files with 129 additions and 0 deletions

View File

@@ -17,6 +17,8 @@ internal class TransactionParserContext {
public ulong? HighestCombatBond { get; set; }
public bool HaveSeenWarzoneNPC { get; set; } = false;
/// <summary>
/// How many on foot kills were done.
/// </summary>
@@ -73,6 +75,10 @@ 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");
@@ -106,6 +112,7 @@ internal class TransactionParserContext {
public void ResetCombatZone() {
HighestCombatBond = null;
HaveSeenWarzoneNPC = false;
LastRecordedAwardingFaction = null;
OnFootKills = 0;
ShipKills = 0;
@@ -276,6 +283,11 @@ 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;
}
}
}