From 563a11d47d14fcb47d63ec21ed57b2f1af14cb50 Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Sun, 5 Jan 2025 14:23:38 +0100 Subject: [PATCH] Override journal genre for some Radz-at-Han/Thavnair side quests --- Questionable/Data/QuestData.cs | 8 +++++++- Questionable/Model/JournalGenreOverrides.cs | 7 +++++++ Questionable/Model/QuestInfo.cs | 9 +++++++-- 3 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 Questionable/Model/JournalGenreOverrides.cs diff --git a/Questionable/Data/QuestData.cs b/Questionable/Data/QuestData.cs index 7a3229a7..65225863 100644 --- a/Questionable/Data/QuestData.cs +++ b/Questionable/Data/QuestData.cs @@ -40,6 +40,12 @@ internal sealed class QuestData public QuestData(IDataManager dataManager) { + JournalGenreOverrides journalGenreOverrides = new() + { + RadzAtHanSideQuests = dataManager.GetExcelSheet().GetRow(69805).JournalGenre.RowId, + ThavnairSideQuests = dataManager.GetExcelSheet().GetRow(70025).JournalGenre.RowId, + }; + Dictionary questChapters = dataManager.GetExcelSheet() .Where(x => x.RowId > 0 && x.Quest.RowId > 0) @@ -59,7 +65,7 @@ internal sealed class QuestData .Where(x => x.RowId > 0) .Where(x => x.IssuerLocation.RowId > 0) .Select(x => new QuestInfo(x, questChapters.GetValueOrDefault(x.RowId), - startingCities.GetValueOrDefault(x.RowId))), + startingCities.GetValueOrDefault(x.RowId), journalGenreOverrides)), ..dataManager.GetExcelSheet() .Where(x => x is { RowId: > 0, Npc.RowId: > 0 }) .Select(x => new SatisfactionSupplyInfo(x)), diff --git a/Questionable/Model/JournalGenreOverrides.cs b/Questionable/Model/JournalGenreOverrides.cs new file mode 100644 index 00000000..bafd7282 --- /dev/null +++ b/Questionable/Model/JournalGenreOverrides.cs @@ -0,0 +1,7 @@ +namespace Questionable.Model; + +internal sealed class JournalGenreOverrides +{ + public required uint ThavnairSideQuests { get; init; } + public required uint RadzAtHanSideQuests { get; init; } +} diff --git a/Questionable/Model/QuestInfo.cs b/Questionable/Model/QuestInfo.cs index 06c6dc34..751470b5 100644 --- a/Questionable/Model/QuestInfo.cs +++ b/Questionable/Model/QuestInfo.cs @@ -12,7 +12,7 @@ namespace Questionable.Model; internal sealed class QuestInfo : IQuestInfo { - public QuestInfo(ExcelQuest quest, uint newGamePlusChapter, byte startingCity) + public QuestInfo(ExcelQuest quest, uint newGamePlusChapter, byte startingCity, JournalGenreOverrides journalGenreOverrides) { QuestId = new QuestId((ushort)(quest.RowId & 0xFFFF)); @@ -53,7 +53,12 @@ internal sealed class QuestInfo : IQuestInfo .Where(x => x.Value != 0) .ToImmutableList(); QuestLockJoin = (EQuestJoin)quest.QuestLockJoin; - JournalGenre = quest.JournalGenre.ValueNullable?.RowId; + JournalGenre = QuestId.Value switch + { + >= 4196 and <= 4209 => journalGenreOverrides.ThavnairSideQuests, + 4173 => journalGenreOverrides.RadzAtHanSideQuests, + _ => quest.JournalGenre.ValueNullable?.RowId, + }; SortKey = quest.SortKey; IsMainScenarioQuest = quest.JournalGenre.ValueNullable?.JournalCategory.ValueNullable?.JournalSection .ValueNullable?.RowId is 0 or 1;