diff --git a/BGS/InfluenceSupport.cs b/BGS/InfluenceSupport.cs new file mode 100644 index 0000000..151bece --- /dev/null +++ b/BGS/InfluenceSupport.cs @@ -0,0 +1,24 @@ +using System.Text; + +namespace EliteBGS.BGS { + /// + /// This class is used when a completed mission gives influence to another + /// faction as well. This happens, for example, when you deliver cargo from one + /// faction to another. Both sometimes gain influence. + /// + public class InfluenceSupport : LogEntry { + public string Influence { get; set; } + public MissionCompleted RelevantMission { get; set; } + + public override string ToString() { + StringBuilder builder = new StringBuilder(); + + builder.AppendFormat("Influence gained from \"{0}\": \"{1}\"", + RelevantMission.MissionName, + string.IsNullOrEmpty(Influence) ? "NONE" : Influence + ); + + return builder.ToString(); + } + } +} diff --git a/BGS/Report.cs b/BGS/Report.cs index dd216a3..d9712c9 100644 --- a/BGS/Report.cs +++ b/BGS/Report.cs @@ -107,6 +107,17 @@ namespace EliteBGS.BGS { completed.Name + "\" was generated, please report this."); } + + foreach (string other in completed.AffectedFactions.Where(x => !x.Equals(results[0].Faction))) { + string faction = other; + string influence = completed.GetInfluenceForFaction(faction); + + results.Add(new InfluenceSupport() { + Faction = faction, + Influence = influence, + RelevantMission = results[0] as MissionCompleted + }); + } } else if (e.Is(Events.MissionAccepted)) { MissionAcceptedEntry accepted = e as MissionAcceptedEntry; acceptedMissions[accepted.MissionID] = accepted; diff --git a/EliteBGS.csproj b/EliteBGS.csproj index b8e274a..aa2c8ca 100644 --- a/EliteBGS.csproj +++ b/EliteBGS.csproj @@ -82,6 +82,7 @@ +