From 114e4d0f65465907b2b1df3ff61820537a1fe9cf Mon Sep 17 00:00:00 2001 From: CWX Date: Wed, 8 Jan 2025 21:55:08 +0000 Subject: [PATCH] Fix Quest related types --- Core/Models/Eft/Common/Tables/Quest.cs | 107 ++++++++++++++++-- .../Eft/Common/Tables/RepeatableQuests.cs | 5 +- .../{QuestStatus.cs => QuestStatusEnum.cs} | 4 +- 3 files changed, 103 insertions(+), 13 deletions(-) rename Core/Models/Enums/{QuestStatus.cs => QuestStatusEnum.cs} (89%) diff --git a/Core/Models/Eft/Common/Tables/Quest.cs b/Core/Models/Eft/Common/Tables/Quest.cs index 79b0078a..17880aaf 100644 --- a/Core/Models/Eft/Common/Tables/Quest.cs +++ b/Core/Models/Eft/Common/Tables/Quest.cs @@ -1,5 +1,6 @@ using System.Text.Json.Serialization; using Core.Models.Enums; +using Core.Utils.Json.Converters; namespace Core.Models.Eft.Common.Tables; @@ -42,7 +43,7 @@ public class Quest public string? Image { get; set; } [JsonPropertyName("type")] - public QuestTypeEnum? Type { get; set; } + public string? Type { get; set; } [JsonPropertyName("isKey")] public bool? IsKey { get; set; } @@ -115,23 +116,59 @@ public class Quest /// [JsonPropertyName("sptStatus")] public QuestStatus? SptStatus { get; set; } + + [JsonPropertyName("questStatus")] + public QuestStatus? QuestStatus { get; set; } + + [JsonPropertyName("changeCost")] + public List ChangeCost { get; set; } + + [JsonPropertyName("changeStandingCost")] + public double ChangeStandingCost { get; set; } +} + +public class QuestStatus +{ + [JsonPropertyName("id")] + public string? Id { get; set; } + + [JsonPropertyName("uid")] + public string? Uid { get; set; } + + [JsonPropertyName("qid")] + public string? Qid { get; set; } + + [JsonPropertyName("startTime")] + public double? StartTime { get; set; } + + [JsonPropertyName("status")] + public double? Status { get; set; } + + [JsonPropertyName("statusTimers")] + public Dictionary? StatusTimers { get; set; } + + [JsonPropertyName("completedConditions")] + public List? CompletedConditions { get; set; } + + [JsonPropertyName("availableAfter")] + public double? AvailableAfter { get; set; } } public class QuestConditionTypes { - [JsonPropertyName("started")] + [JsonPropertyName("Started")] public List? Started { get; set; } - [JsonPropertyName("availableForFinish")] + [JsonPropertyName("AvailableForFinish")] public List? AvailableForFinish { get; set; } - [JsonPropertyName("availableForStart")] + [JsonPropertyName("AvailableForStart")] public List? AvailableForStart { get; set; } - [JsonPropertyName("success")] + [JsonPropertyName("Success")] public List? Success { get; set; } - [JsonPropertyName("fail")] + [JsonPropertyName("Fail")] public List? Fail { get; set; } } @@ -168,7 +205,7 @@ public class QuestCondition public object? Type { get; set; } // TODO: boolean | string [JsonPropertyName("status")] - public List? Status { get; set; } + public List? Status { get; set; } [JsonPropertyName("availableAfter")] public int? AvailableAfter { get; set; } @@ -226,6 +263,46 @@ public class QuestCondition [JsonPropertyName("areaType")] public HideoutAreas? AreaType { get; set; } + + [JsonPropertyName("baseAccuracy")] + public ValueCompare? BaseAccuracy { get; set; } + + [JsonPropertyName("containsItems")] + public List? ContainsItems { get; set; } + + [JsonPropertyName("durability")] + public ValueCompare? Durability { get; set; } + + [JsonPropertyName("effectiveDistance")] + public ValueCompare? EffectiveDistance { get; set; } + + [JsonPropertyName("emptyTacticalSlot")] + public ValueCompare? EmptyTacticalSlot { get; set; } + + [JsonPropertyName("ergonomics")] + public ValueCompare? Ergonomics { get; set; } + + [JsonPropertyName("height")] + public ValueCompare? Height { get; set; } + + [JsonPropertyName("hasItemFromCategory")] + public List? HasItemFromCategory { get; set; } + + [JsonPropertyName("magazineCapacity")] + public ValueCompare? MagazineCapacity { get; set; } + + [JsonPropertyName("muzzleVelocity")] + public ValueCompare? MuzzleVelocity { get; set; } + + [JsonPropertyName("recoil")] + public ValueCompare? Recoil { get; set; } + + [JsonPropertyName("weight")] + public ValueCompare? Weight { get; set; } + + [JsonPropertyName("width")] + public ValueCompare? Width { get; set; } + } public class QuestConditionCounter @@ -316,6 +393,16 @@ public class QuestConditionCounterCondition [JsonPropertyName("bodyPartsWithEffects")] public List? BodyPartsWithEffects { get; set; } + + [JsonPropertyName("IncludeNotEquippedItems")] + public bool? IncludeNotEquippedItems { get; set; } + + [JsonPropertyName("equipmentExclusive")] + public List>? EquipmentExclusive { get; set; } + + [JsonPropertyName("zoneIds")] + public List? Zones { get; set; } + } public class EnemyHealthEffect @@ -333,7 +420,7 @@ public class ValueCompare public string? CompareMethod { get; set; } [JsonPropertyName("value")] - public int? Value { get; set; } + public double? Value { get; set; } } public class CounterConditionDistance @@ -424,7 +511,7 @@ public class QuestReward /** Hideout area id */ [JsonPropertyName("traderId")] - public string? TraderId { get; set; } + public object? TraderId { get; set; } // TODO: string | int [JsonPropertyName("isEncoded")] public bool? IsEncoded { get; set; } @@ -452,4 +539,4 @@ public class QuestReward [JsonPropertyName("isHidden")] public bool? IsHidden { get; set; } -} \ No newline at end of file +} diff --git a/Core/Models/Eft/Common/Tables/RepeatableQuests.cs b/Core/Models/Eft/Common/Tables/RepeatableQuests.cs index 67cef938..97aa009f 100644 --- a/Core/Models/Eft/Common/Tables/RepeatableQuests.cs +++ b/Core/Models/Eft/Common/Tables/RepeatableQuests.cs @@ -78,6 +78,9 @@ public class RepeatableTemplates [JsonPropertyName("Exploration")] public Quest? Exploration { get; set; } + + [JsonPropertyName("Pickup")] + public Quest? Pickup { get; set; } } public class PmcDataRepeatableQuest @@ -227,4 +230,4 @@ public class SampleQuests [JsonPropertyName("templateId")] public string? TemplateId { get; set; } -} \ No newline at end of file +} diff --git a/Core/Models/Enums/QuestStatus.cs b/Core/Models/Enums/QuestStatusEnum.cs similarity index 89% rename from Core/Models/Enums/QuestStatus.cs rename to Core/Models/Enums/QuestStatusEnum.cs index 6cc109fc..c241d559 100644 --- a/Core/Models/Enums/QuestStatus.cs +++ b/Core/Models/Enums/QuestStatusEnum.cs @@ -1,6 +1,6 @@ namespace Core.Models.Enums; -public enum QuestStatus +public enum QuestStatusEnum { Locked = 0, AvailableForStart = 1, @@ -12,4 +12,4 @@ public enum QuestStatus MarkedAsFailed = 7, Expired = 8, AvailableAfter = 9 -} \ No newline at end of file +}