From ae9a93426a2f9c00b11542e34e3353e918572bd8 Mon Sep 17 00:00:00 2001 From: Chomp Date: Mon, 9 Jan 2023 11:11:46 +0000 Subject: [PATCH] Debug stuff + update quest prereqs --- GenerateQuestFile/Program.cs | 29 +++++++++++++++---- .../Helpers/QuestRequirements.cs | 5 ++-- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/GenerateQuestFile/Program.cs b/GenerateQuestFile/Program.cs index 2de05d2..ca7190a 100644 --- a/GenerateQuestFile/Program.cs +++ b/GenerateQuestFile/Program.cs @@ -33,14 +33,12 @@ namespace GenerateQuestFile var mergedLiveData = QuestHelper.MergeLiveQuestFiles(liveQuestData); - OutputQuestRequirementsToConsole(mergedLiveData); + OutputQuestRequirementsToConsole(mergedLiveData.data); JsonWriter.WriteJson(mergedLiveData, "output", Directory.GetCurrentDirectory(), "mergedlivejson"); // Find the quests that are missing from the live file from existing quest data var missingQuests = GetMissingQuestsNotInLiveFile(existingQuestData, mergedLiveData); - - // Create a list of quests to output // Use all quests in live file @@ -149,14 +147,14 @@ namespace GenerateQuestFile } } } - + OutputQuestRequirementsToConsole2(questsToOutputToFile); JsonWriter.WriteJson(questsToOutputToFile, "output", Directory.GetCurrentDirectory(), "quests"); } - private static void OutputQuestRequirementsToConsole(QuestRoot mergedLiveData) + private static void OutputQuestRequirementsToConsole(List quests) { var output = new List(); - foreach (var quest in mergedLiveData.data) + foreach (var quest in quests) { var questConditions = quest.conditions.AvailableForStart.Where(x => x._parent == "Quest"); if (questConditions != null) @@ -172,6 +170,25 @@ namespace GenerateQuestFile // JsonWriter.WriteJson(output, "output", Directory.GetCurrentDirectory(), "questRequirements"); } + private static void OutputQuestRequirementsToConsole2(Dictionary quests) + { + var output = new List(); + foreach (var quest in quests) + { + var questConditions = quest.Value.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.Value._id)} needs {QuestHelper.GetQuestNameById(x)}"); + } + } + } + + // JsonWriter.WriteJson(output, "output", Directory.GetCurrentDirectory(), "questRequirements"); + } + private static int[] GetQuestStatus(QuestStatus status) { switch (status) diff --git a/QuestValidator.Common/Helpers/QuestRequirements.cs b/QuestValidator.Common/Helpers/QuestRequirements.cs index ae29788..7135598 100644 --- a/QuestValidator.Common/Helpers/QuestRequirements.cs +++ b/QuestValidator.Common/Helpers/QuestRequirements.cs @@ -642,8 +642,9 @@ namespace QuestValidator.Common.Helpers { Quest.WorstJobInTheWorld, GetQuestData(Quest.WorstJobInTheWorld) .AddPrerequisiteQuest(Quest.RevisionStreetsOfTarkov, QuestStatus.Success) .AddPrerequisiteQuest(Quest.WetJobP5, QuestStatus.Success)}, - // { Quest.BestJobInTheWorld, GetQuestData(Quest.BestJobInTheWorld) - // .AddPrerequisiteQuest(Quest., QuestStatus.Success)},// NO DATA YET + { Quest.BestJobInTheWorld, GetQuestData(Quest.BestJobInTheWorld) + .AddPrerequisiteQuest(Quest.ThePunisherP6, QuestStatus.Success) + .AddPrerequisiteQuest(Quest.KingsOfTheRooftops, QuestStatus.Success)}, { Quest.BroadcastPart4, GetQuestData(Quest.BroadcastPart4) .AddPrerequisiteQuest(Quest.BroadcastPart3, QuestStatus.Success)}, { Quest.RoadClosed, GetQuestData(Quest.RoadClosed)