introduce negative influence

Sometimes missions actually tell us how much negative influence a faction got through secondary influences. We now count this, and present is as negative influence via minuses. Summaries have been updated to reflect this change.
This commit is contained in:
2023-09-08 11:20:49 +02:00
parent c7a70598c4
commit c43c6f742a
8 changed files with 93 additions and 35 deletions

View File

@@ -10,7 +10,7 @@ public class MissionFormat : LogFormatter {
Dictionary<string, Dictionary<string, int>> collated = new();
Dictionary<string, ulong> passengers = new();
StringBuilder output = new StringBuilder();
int total_influence = 0;
long total_influence = 0;
var missions = objective.EnabledOfType<MissionCompleted>();
var support = objective.EnabledOfType<InfluenceSupport>();
@@ -63,14 +63,14 @@ public class MissionFormat : LogFormatter {
foreach (InfluenceSupport inf in support) {
output.Append(inf.ToString());
output.Append("\n");
total_influence += inf.Influence.Length;
total_influence += inf.Influence.InfluenceAmount;
}
if (support.Count() > 0) {
output.Append("\n");
}
if (total_influence > 0) {
if (total_influence != 0) {
output.AppendFormat("Total Influence: {0}", total_influence);
}
@@ -84,10 +84,10 @@ public class MissionFormat : LogFormatter {
;
long support = objective
.EnabledOfType<InfluenceSupport>()
.Sum(x => x.Influence.Length)
.Sum(x => x.Influence.InfluenceAmount)
;
if (influence + support <= 0) {
if (influence == 0 && support == 0) {
return "";
}