Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make quest schedule data driven and add Trials of the Mighty (no rewards) #365

Merged
merged 1 commit into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions DragaliaAPI.Shared/Definitions/Enums/QuestGroupIntervalType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
namespace DragaliaAPI.Shared.Definitions.Enums;

public enum QuestGroupIntervalType
{
None,
Daily,
Weekend,
Sunday,
Monday,
Tuesday,
Wednesday,
Thursday,
Friday,
Saturday,
MonAndSun,
MonAndTue,
MonAndWed,
MonAndThu,
MonAndFri,
MonAndSat,

// Why is this 17 did they not count
WeekendAndMon = 17,
WeekendAndTue,
WeekendAndWed,
WeekendAndThu,
WeekendAndFri,
WeekendAndSat,
EventSchedule,
MonThuSatSun,
TueFriSatSun,
MonWedSatSun,
WedFriSatSun,
TueThuSatSun,
SatAndSun
}
7 changes: 6 additions & 1 deletion DragaliaAPI.Shared/DragaliaAPI.Shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@
<None Update="Resources\QuestRewards\QuestScoreMissionRewardInfo.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Resources\QuestSchedule\QuestScheduleInfo.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Resources\Story\EventStory.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down Expand Up @@ -323,9 +326,11 @@

<ItemGroup>
<Folder Include="MasterAsset\Models\Login\" />
<Folder Include="MasterAsset\Models\QuestSchedule\" />
<Folder Include="MasterAsset\Models\User\" />
<Folder Include="Resources\QuestSchedule\" />
</ItemGroup>

<ProjectExtensions><VisualStudio><UserProperties resources_4missions_4mainstorymissiongrouprewards_1json__JsonSchema="MainStoryMissionGroupRewards.schema.json" resources_4missions_4missionprogressioninfo_1json__JsonSchema="MissionProgressionInfo.schema.json" /></VisualStudio></ProjectExtensions>
<ProjectExtensions><VisualStudio><UserProperties resources_4missions_4mainstorymissiongrouprewards_1json__JsonSchema="MainStoryMissionGroupRewards.schema.json" resources_4missions_4missionprogressioninfo_1json__JsonSchema="MissionProgressionInfo.schema.json" resources_4questschedule_4questscheduleinfo_1json__JsonSchema="QuestScheduleInfo.schema.json" /></VisualStudio></ProjectExtensions>

</Project>
8 changes: 8 additions & 0 deletions DragaliaAPI.Shared/MasterAsset/MasterAsset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using DragaliaAPI.Shared.MasterAsset.Models.Missions;
using DragaliaAPI.Shared.MasterAsset.Models.QuestDrops;
using DragaliaAPI.Shared.MasterAsset.Models.QuestRewards;
using DragaliaAPI.Shared.MasterAsset.Models.QuestSchedule;
using DragaliaAPI.Shared.MasterAsset.Models.Shop;
using DragaliaAPI.Shared.MasterAsset.Models.Story;
using DragaliaAPI.Shared.MasterAsset.Models.Trade;
Expand Down Expand Up @@ -434,4 +435,11 @@ public static readonly MasterAssetData<
new("User/UserLevel.json", x => x.Id);

#endregion

#region Quest Schedule

public static readonly MasterAssetData<int, QuestScheduleInfo> QuestScheduleInfo =
new("QuestSchedule/QuestScheduleInfo.json", x => x.Id);

#endregion
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System.Text.Json.Serialization;
using DragaliaAPI.Shared.Definitions.Enums;
using DragaliaAPI.Shared.Json;

namespace DragaliaAPI.Shared.MasterAsset.Models.QuestSchedule;

public record QuestScheduleInfo(
int Id,
int ScheduleGroupId,
[property: JsonConverter(typeof(JsonStringEnumConverter))] QuestGroupIntervalType IntervalType,
[property: JsonConverter(typeof(MasterAssetDateTimeOffsetConverter))] DateTimeOffset StartDate,
[property: JsonConverter(typeof(MasterAssetDateTimeOffsetConverter))] DateTimeOffset EndDate,
int DropBonusCount = 0
);
Loading
Loading