This commit is contained in:
Chomp 2023-01-05 23:04:11 +00:00
parent e08a435894
commit dc879a5ff4
3 changed files with 43 additions and 20 deletions

View File

@ -33,6 +33,8 @@ namespace GenerateQuestFile
var mergedLiveData = QuestHelper.MergeLiveQuestFiles(liveQuestData); var mergedLiveData = QuestHelper.MergeLiveQuestFiles(liveQuestData);
OutputQuestRequirementsToConsole(mergedLiveData);
JsonWriter.WriteJson<QuestRoot>(mergedLiveData, "output", Directory.GetCurrentDirectory(), "mergedlivejson"); JsonWriter.WriteJson<QuestRoot>(mergedLiveData, "output", Directory.GetCurrentDirectory(), "mergedlivejson");
// Find the quests that are missing from the live file from existing quest data // Find the quests that are missing from the live file from existing quest data
@ -151,6 +153,25 @@ namespace GenerateQuestFile
JsonWriter.WriteJson(questsToOutputToFile, "output", Directory.GetCurrentDirectory(), "quests"); JsonWriter.WriteJson(questsToOutputToFile, "output", Directory.GetCurrentDirectory(), "quests");
} }
private static void OutputQuestRequirementsToConsole(QuestRoot mergedLiveData)
{
var output = new List<string>();
foreach (var quest in mergedLiveData.data)
{
var questConditions = quest.conditions.AvailableForStart.Where(x => x._parent == "Quest");
if (questConditions != null)
{
foreach (var questCondition in questConditions)
{
var x = questCondition._props.target.ToString();
Console.WriteLine($"{QuestHelper.GetQuestNameById(quest._id)} needs {QuestHelper.GetQuestNameById(x)}");
}
}
}
// JsonWriter.WriteJson<QuestRoot>(output, "output", Directory.GetCurrentDirectory(), "questRequirements");
}
private static int[] GetQuestStatus(QuestStatus status) private static int[] GetQuestStatus(QuestStatus status)
{ {
switch (status) switch (status)

View File

@ -43,15 +43,20 @@ namespace AssortGenerator.Common.Helpers
QuestRoot mergedResult = null; QuestRoot mergedResult = null;
foreach (var liveQuestDataFile in liveQuestDataFiles) foreach (var liveQuestDataFile in liveQuestDataFiles)
{ {
if (mergedResult == null) // If null, use whole file
{ mergedResult ??= liveQuestDataFile;
mergedResult = liveQuestDataFile;
}
foreach (var quest in liveQuestDataFile.data) foreach (var quest in liveQuestDataFile.data)
{ {
if (mergedResult.data.Any(x => x._id == quest._id)) // Already has quest
var mergedExistingQuest = mergedResult.data.Find(x => x._id == quest._id);
if (mergedExistingQuest != null)
{ {
// new quest has more avail for start conditions, use instead
if (mergedExistingQuest.conditions.AvailableForStart.Count < quest.conditions.AvailableForStart.Count)
{
mergedExistingQuest = quest;
}
continue; continue;
} }

View File

@ -185,7 +185,8 @@ namespace QuestValidator.Common.Helpers
{ Quest.GunsmithP3, GetQuestData(Quest.GunsmithP3) { Quest.GunsmithP3, GetQuestData(Quest.GunsmithP3)
.AddPrerequisiteQuest(Quest.GunsmithP1, QuestStatus.Success) }, .AddPrerequisiteQuest(Quest.GunsmithP1, QuestStatus.Success) },
{ Quest.GunsmithP4, GetQuestData(Quest.GunsmithP4) { Quest.GunsmithP4, GetQuestData(Quest.GunsmithP4)
.AddPrerequisiteQuest(Quest.GunsmithP2, QuestStatus.Success) }, .AddPrerequisiteQuest(Quest.GunsmithP2, QuestStatus.Success)
.AddPrerequisiteQuest(Quest.GunsmithP3, QuestStatus.Success) },
{ Quest.GunsmithP5, GetQuestData(Quest.GunsmithP5) { Quest.GunsmithP5, GetQuestData(Quest.GunsmithP5)
.AddPrerequisiteQuest(Quest.GunsmithP4, QuestStatus.Success) }, .AddPrerequisiteQuest(Quest.GunsmithP4, QuestStatus.Success) },
{ Quest.GunsmithP6, GetQuestData(Quest.GunsmithP6) { Quest.GunsmithP6, GetQuestData(Quest.GunsmithP6)
@ -333,7 +334,6 @@ namespace QuestValidator.Common.Helpers
{ Quest.Grenadier, GetQuestData(Quest.Grenadier) { Quest.Grenadier, GetQuestData(Quest.Grenadier)
.AddPrerequisiteQuest(Quest.ShakingUpTeller, QuestStatus.Success) }, .AddPrerequisiteQuest(Quest.ShakingUpTeller, QuestStatus.Success) },
{ Quest.DecontaminationService, GetQuestData(Quest.DecontaminationService) { Quest.DecontaminationService, GetQuestData(Quest.DecontaminationService)
.AddPrerequisiteQuest(Quest.HealthCarePrivacyP5, QuestStatus.Success)
.AddPrerequisiteQuest(Quest.PrivateClinic, QuestStatus.Success) }, .AddPrerequisiteQuest(Quest.PrivateClinic, QuestStatus.Success) },
{ Quest.PeacekeepingMission, GetQuestData(Quest.PeacekeepingMission) { Quest.PeacekeepingMission, GetQuestData(Quest.PeacekeepingMission)
.AddPrerequisiteQuest(Quest.LendLeaseP2, QuestStatus.Success) }, .AddPrerequisiteQuest(Quest.LendLeaseP2, QuestStatus.Success) },
@ -454,11 +454,7 @@ namespace QuestValidator.Common.Helpers
{ Quest.ColleaguesP2, GetQuestData(Quest.ColleaguesP2) { Quest.ColleaguesP2, GetQuestData(Quest.ColleaguesP2)
.AddPrerequisiteQuest(Quest.ColleaguesP1, QuestStatus.Success) }, .AddPrerequisiteQuest(Quest.ColleaguesP1, QuestStatus.Success) },
{ Quest.ColleaguesP3, GetQuestData(Quest.ColleaguesP3) { Quest.ColleaguesP3, GetQuestData(Quest.ColleaguesP3)
// .AddPrerequisiteQuest(Quest.HuntsmanPathSadist, QuestStatus.Started) // TODO - what happens when player completes sadist? .AddPrerequisiteQuest(Quest.HuntsmanPathSadist, QuestStatus.Started) },
.AddPrerequisiteQuest(Quest.ColleaguesP2, QuestStatus.Success)
.AddPrerequisiteQuest(Quest.RiggedGame, QuestStatus.Success)
.AddPrerequisiteQuest(Quest.TheChemistryCloset, QuestStatus.Success)
},
{ Quest.RiggedGame, GetQuestData(Quest.RiggedGame) { Quest.RiggedGame, GetQuestData(Quest.RiggedGame)
.AddPrerequisiteQuest(Quest.Anesthesia, QuestStatus.Success) }, .AddPrerequisiteQuest(Quest.Anesthesia, QuestStatus.Success) },
{ Quest.TerraGroupEmployee, GetQuestData(Quest.TerraGroupEmployee) { Quest.TerraGroupEmployee, GetQuestData(Quest.TerraGroupEmployee)
@ -592,6 +588,8 @@ namespace QuestValidator.Common.Helpers
.AddPrerequisiteQuest(Quest.BroadcastPart2, QuestStatus.Success)}, .AddPrerequisiteQuest(Quest.BroadcastPart2, QuestStatus.Success)},
{ Quest.Debtor, GetQuestData(Quest.Debtor) { Quest.Debtor, GetQuestData(Quest.Debtor)
.AddPrerequisiteQuest(Quest.Chumming, QuestStatus.Success)}, .AddPrerequisiteQuest(Quest.Chumming, QuestStatus.Success)},
{ Quest.BroadcastPart2, GetQuestData(Quest.BroadcastPart2)
.AddPrerequisiteQuest(Quest.BroadcastPart1, QuestStatus.Success)},
// { Quest.CeaseFire, GetQuestData(Quest.CeaseFire) // { Quest.CeaseFire, GetQuestData(Quest.CeaseFire)
// .AddPrerequisiteQuest(Quest., QuestStatus.Success)}, // NO DATA YET // .AddPrerequisiteQuest(Quest., QuestStatus.Success)}, // NO DATA YET
{ Quest.KingsOfTheRooftops, GetQuestData(Quest.KingsOfTheRooftops) { Quest.KingsOfTheRooftops, GetQuestData(Quest.KingsOfTheRooftops)
@ -601,14 +599,13 @@ namespace QuestValidator.Common.Helpers
// { Quest.HarleyForever, GetQuestData(Quest.HarleyForever) // { Quest.HarleyForever, GetQuestData(Quest.HarleyForever)
// .AddPrerequisiteQuest(Quest., QuestStatus.Success)}, // NO DATA YET // .AddPrerequisiteQuest(Quest., QuestStatus.Success)}, // NO DATA YET
{ Quest.TheHuntsmanPathAdministrator, GetQuestData(Quest.TheHuntsmanPathAdministrator) { Quest.TheHuntsmanPathAdministrator, GetQuestData(Quest.TheHuntsmanPathAdministrator)
.AddPrerequisiteQuest(Quest.HuntsmanPathWoodsCleaning, QuestStatus.Success)}, .AddPrerequisiteQuest(Quest.HuntsmanPathWoodsCleaning, QuestStatus.Success) },
{ Quest.GreenCorridor, GetQuestData(Quest.GreenCorridor) // { Quest.GreenCorridor, GetQuestData(Quest.GreenCorridor)
// .AddPrerequisiteQuest(Quest., QuestStatus.Success)}, // NO DATA YET // .AddPrerequisiteQuest(Quest., QuestStatus.Success)}, // NO DATA YET
// { Quest.RevisionStreetsOfTarkov, GetQuestData(Quest.RevisionStreetsOfTarkov) { Quest.RevisionStreetsOfTarkov, GetQuestData(Quest.RevisionStreetsOfTarkov)
.AddPrerequisiteQuest(Quest.RevisionStreetsOfTarkov, QuestStatus.Success)}, .AddPrerequisiteQuest(Quest.Revision, QuestStatus.Success) },
{ Quest.Surveillance, GetQuestData(Quest.Surveillance) { Quest.Surveillance, GetQuestData(Quest.Surveillance)
.AddPrerequisiteQuest(Quest.BroadcastPart2, QuestStatus.Success) .AddPrerequisiteQuest(Quest.BroadcastPart2, QuestStatus.Success) },
.AddPrerequisiteQuest(Quest.CorporateSecrets, QuestStatus.Success)},
// { Quest.NetworkProviderPart1, GetQuestData(Quest.NetworkProviderPart1) // { Quest.NetworkProviderPart1, GetQuestData(Quest.NetworkProviderPart1)
// .AddPrerequisiteQuest(Quest., QuestStatus.Success)}, // NO DATA YET // .AddPrerequisiteQuest(Quest., QuestStatus.Success)}, // NO DATA YET
// { Quest.NetworkProviderPart2, GetQuestData(Quest.NetworkProviderPart2) // { Quest.NetworkProviderPart2, GetQuestData(Quest.NetworkProviderPart2)
@ -649,8 +646,8 @@ namespace QuestValidator.Common.Helpers
// .AddPrerequisiteQuest(Quest., QuestStatus.Success)},// NO DATA YET // .AddPrerequisiteQuest(Quest., QuestStatus.Success)},// NO DATA YET
{ Quest.BroadcastPart4, GetQuestData(Quest.BroadcastPart4) { Quest.BroadcastPart4, GetQuestData(Quest.BroadcastPart4)
.AddPrerequisiteQuest(Quest.BroadcastPart3, QuestStatus.Success)}, .AddPrerequisiteQuest(Quest.BroadcastPart3, QuestStatus.Success)},
// { Quest.RoadClosed, GetQuestData(Quest.RoadClosed) { Quest.RoadClosed, GetQuestData(Quest.RoadClosed)
// .AddPrerequisiteQuest(Quest., QuestStatus.Success)},// NO DATA YET .AddPrerequisiteQuest(Quest.SpaTourP7, QuestStatus.Success)},
// { Quest.MakeAmends, GetQuestData(Quest.MakeAmends) // { Quest.MakeAmends, GetQuestData(Quest.MakeAmends)
// .AddPrerequisiteQuest(Quest., QuestStatus.Success)}// NO DATA YET // .AddPrerequisiteQuest(Quest., QuestStatus.Success)}// NO DATA YET
}; };