Compare commits

..

No commits in common. "f4bce14ad0d47af579f5200d91f562a21539fa6e" and "8c7e67acc6f6000d3d4f8cdff49c9aa67c5d6b06" have entirely different histories.

7 changed files with 1 additions and 132 deletions

View File

@ -1,68 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using EDJournal;
namespace EliteBGS.BGS {
/// <summary>
/// 36 Lessons of Vivec, Lesson 36
/// </summary>
public class FoulMurder : LogEntry {
public FoulMurder (CommitCrimeEntry e) {
Entries.Add(e);
}
public string CrimeType {
get { return Entries.OfType<CommitCrimeEntry>().First().CrimeType; }
}
public long Bounties => Entries.OfType<CommitCrimeEntry>().Sum(x => x.Bounty);
public long Fines => Entries.OfType<CommitCrimeEntry>().Sum(x => x.Fine);
public override int CompareTo(LogEntry other) {
if (other == null || other.GetType() != typeof(FoulMurder)) {
return -1;
}
FoulMurder hortator = other as FoulMurder;
if (Faction == other.Faction && CrimeType == hortator.CrimeType) {
return 0;
}
return -1;
}
public override string ToString() {
StringBuilder builder = new StringBuilder();
string type;
if (CrimeType == CrimeTypes.Murder) {
if (Entries.Count > 1) {
type = "ships";
} else {
type = "ship";
}
} else {
if (Entries.Count > 1) {
type = "people";
} else {
type = "person";
}
}
builder.AppendFormat("Murdered {0} {1} of {2} (Bounties: {3}, Fines: {4})",
Entries.Count,
type,
Faction,
Credits.FormatCredits(Bounties),
Credits.FormatCredits(Fines)
);
return builder.ToString();
}
}
}

View File

@ -203,24 +203,6 @@ namespace EliteBGS.BGS {
return builder.ToString(); return builder.ToString();
} }
private string BuildMurders(Objective objective) {
FoulMurder[] murders = objective.LogEntries.OfType<FoulMurder>().ToArray();
StringBuilder builder = new StringBuilder();
if (murders.Length <= 0) {
return "";
}
foreach (FoulMurder murder in murders) {
builder.Append(murder.ToString());
builder.Append("\n");
}
builder.Append("\n");
return builder.ToString();
}
public string GenerateDiscordLog(Report report) { public string GenerateDiscordLog(Report report) {
StringBuilder log = new StringBuilder(); StringBuilder log = new StringBuilder();
@ -247,9 +229,6 @@ namespace EliteBGS.BGS {
var failed = BuildFailedMissions(objective); var failed = BuildFailedMissions(objective);
entries.Append(failed); entries.Append(failed);
var murders = BuildMurders(objective);
entries.Append(murders);
var vouchers = BuildVouchers(objective); var vouchers = BuildVouchers(objective);
entries.Append(vouchers); entries.Append(vouchers);

View File

@ -253,24 +253,6 @@ namespace EliteBGS.BGS {
return builder.ToString(); return builder.ToString();
} }
private string BuildMurders(Objective objective) {
FoulMurder[] murders = objective.LogEntries.OfType<FoulMurder>().ToArray();
StringBuilder builder = new StringBuilder();
if (murders.Length <= 0) {
return "";
}
foreach (FoulMurder murder in murders) {
builder.Append(murder.ToString());
builder.Append("\n");
}
builder.Append("\n");
return builder.ToString();
}
public string GenerateDiscordLog(Report report) { public string GenerateDiscordLog(Report report) {
StringBuilder log = new StringBuilder(); StringBuilder log = new StringBuilder();
@ -296,9 +278,6 @@ namespace EliteBGS.BGS {
var failed = BuildFailedMissions(objective); var failed = BuildFailedMissions(objective);
entries.Append(failed); entries.Append(failed);
var murders = BuildMurders(objective);
entries.Append(murders);
var vouchers = BuildVouchers(objective); var vouchers = BuildVouchers(objective);
entries.Append(vouchers); entries.Append(vouchers);

View File

@ -41,8 +41,7 @@ namespace EliteBGS.BGS {
e.Is(Events.RedeemVoucher) || e.Is(Events.RedeemVoucher) ||
e.Is(Events.FactionKillBond) || e.Is(Events.FactionKillBond) ||
e.Is(Events.MarketBuy) || e.Is(Events.MarketBuy) ||
e.Is(Events.MarketSell) || e.Is(Events.MarketSell)
e.Is(Events.CommitCrime)
; ;
} }
@ -97,19 +96,6 @@ namespace EliteBGS.BGS {
if (!string.IsNullOrEmpty(location.StationName)) { if (!string.IsNullOrEmpty(location.StationName)) {
current_station = location.StationName; current_station = location.StationName;
} }
} else if (e.Is(Events.CommitCrime)) {
CommitCrimeEntry crime = e as CommitCrimeEntry;
if (!crime.IsMurder) {
/* we don't care about anything but murder for now */
continue;
}
results.Add(new FoulMurder(crime) {
System = current_system,
Faction = crime.Faction,
});
collate = true;
} else if (e.Is(Events.MissionCompleted)) { } else if (e.Is(Events.MissionCompleted)) {
var completed = e as MissionCompletedEntry; var completed = e as MissionCompletedEntry;
results.Add(new MissionCompleted(completed) { results.Add(new MissionCompleted(completed) {

View File

@ -1,10 +1,5 @@
# EliteBGS changelog # EliteBGS changelog
## 0.1.0-beta7 on ??.??.2022
* Added murders, since they give negative INF for the target faction.
* Cargo is now collated for the NONA discord template.
## 0.1.0-beta6 on 22.01.2022 ## 0.1.0-beta6 on 22.01.2022
* Month names should now always be in English in the NONA log format. * Month names should now always be in English in the NONA log format.

View File

@ -82,7 +82,6 @@
<DependentUpon>AdjustProfitWindow.xaml</DependentUpon> <DependentUpon>AdjustProfitWindow.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="BGS\DiscordLogGenerator.cs" /> <Compile Include="BGS\DiscordLogGenerator.cs" />
<Compile Include="BGS\FoulMurder.cs" />
<Compile Include="BGS\GenericDiscordLog.cs" /> <Compile Include="BGS\GenericDiscordLog.cs" />
<Compile Include="BGS\InfluenceSupport.cs" /> <Compile Include="BGS\InfluenceSupport.cs" />
<Compile Include="BGS\MissionFailed.cs" /> <Compile Include="BGS\MissionFailed.cs" />

View File

@ -25,7 +25,6 @@ recognises the following completed tasks:
* Completed missions * Completed missions
* Failed missions * Failed missions
* Murders
* Vouchers, including bounty vouchers, combat bonds, and settlement vouchers (aka intel packages) * Vouchers, including bounty vouchers, combat bonds, and settlement vouchers (aka intel packages)
* Selling of micro resources (Odyssey only) * Selling of micro resources (Odyssey only)
* Selling cartography data * Selling cartography data