two special warzone NPCs means high conflict zone

This commit is contained in:
Florian Stinglmayr 2022-11-28 19:28:55 +01:00
parent bb74d72b13
commit 65fec2cd1e

View File

@ -17,7 +17,10 @@ internal class TransactionParserContext {
public ulong? HighestCombatBond { get; set; }
public bool HaveSeenWarzoneNPC { get; set; } = false;
public bool HaveSeenCapShip { get; set; } = false;
public bool HaveSeenCaptain { get; set; } = false;
public bool HaveSeenSpecOps { get; set; } = false;
public bool HaveSeenCorrespondent { get; set; } = false;
/// <summary>
/// How many on foot kills were done.
@ -75,9 +78,22 @@ 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";
// Cap ship, means a high conflict zone
if (HaveSeenCapShip) {
grade = "High";
} else {
int warzoneNpcs = new List<bool>() { HaveSeenCaptain, HaveSeenCorrespondent, HaveSeenSpecOps }
.Where(x => x == true)
.Count()
;
if (warzoneNpcs >= 2 && grade != "High") {
// Only large combat zones have two NPCs
grade = "High";
} else if (warzoneNpcs >= 1 && grade == "Low") {
grade = "Medium";
}
}
cztype = "Ship";
} else {
@ -112,7 +128,10 @@ internal class TransactionParserContext {
public void ResetCombatZone() {
HighestCombatBond = null;
HaveSeenWarzoneNPC = false;
HaveSeenCapShip = false;
HaveSeenCaptain = false;
HaveSeenCorrespondent = false;
HaveSeenSpecOps = false;
LastRecordedAwardingFaction = null;
OnFootKills = 0;
ShipKills = 0;
@ -290,9 +309,19 @@ internal class ShipTargetedParser : TransactionParserPart {
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;
// We have seen a captain?
if (NPCs.IsWarzoneCaptain(entry.PilotName)) {
context.HaveSeenCaptain = true;
}
// Spec ops?
if (NPCs.IsSpecOps(entry.PilotName)) {
context.HaveSeenSpecOps = true;
}
// Correspondent?
if (NPCs.IsWarzoneCorrespondent(entry.PilotName)) {
context.HaveSeenCorrespondent = true;
}
}
}