Debug stuff + update quest prereqs

This commit is contained in:
Chomp 2023-01-09 11:11:46 +00:00
parent 5703eb52f1
commit ae9a93426a
2 changed files with 26 additions and 8 deletions

View File

@ -33,14 +33,12 @@ namespace GenerateQuestFile
var mergedLiveData = QuestHelper.MergeLiveQuestFiles(liveQuestData);
OutputQuestRequirementsToConsole(mergedLiveData);
OutputQuestRequirementsToConsole(mergedLiveData.data);
JsonWriter.WriteJson<QuestRoot>(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<Quest> quests)
{
var output = new List<string>();
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<QuestRoot>(output, "output", Directory.GetCurrentDirectory(), "questRequirements");
}
private static void OutputQuestRequirementsToConsole2(Dictionary<string, Quest> quests)
{
var output = new List<string>();
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<QuestRoot>(output, "output", Directory.GetCurrentDirectory(), "questRequirements");
}
private static int[] GetQuestStatus(QuestStatus status)
{
switch (status)

View File

@ -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)