Questionable/Questionable.Model/Questing/QuestStep.cs

107 lines
3.6 KiB
C#
Raw Permalink Normal View History

2024-07-27 13:39:47 +00:00
using System.Collections.Generic;
2024-05-26 13:43:33 +00:00
using System.Numerics;
using System.Text.Json.Serialization;
2024-08-02 16:30:21 +00:00
using Questionable.Model.Common;
using Questionable.Model.Common.Converter;
using Questionable.Model.Questing.Converter;
2024-05-25 21:51:37 +00:00
2024-08-02 16:30:21 +00:00
namespace Questionable.Model.Questing;
2024-05-25 21:51:37 +00:00
2024-06-14 09:37:33 +00:00
public sealed class QuestStep
2024-05-25 21:51:37 +00:00
{
public const float DefaultStopDistance = 3f;
2024-05-26 13:43:33 +00:00
public EInteractionType InteractionType { get; set; }
2024-05-26 19:45:26 +00:00
public uint? DataId { get; set; }
[JsonConverter(typeof(VectorConverter))]
public Vector3? Position { get; set; }
public float? StopDistance { get; set; }
public float? NpcWaitDistance { get; set; }
2024-05-25 21:51:37 +00:00
public ushort TerritoryId { get; set; }
public ushort? TargetTerritoryId { get; set; }
public float? DelaySecondsAtStart { get; set; }
2024-05-26 13:43:33 +00:00
public bool Disabled { get; set; }
2024-05-27 19:54:34 +00:00
public bool DisableNavmesh { get; set; }
public bool? Mount { get; set; }
2024-06-01 16:46:57 +00:00
public bool? Fly { get; set; }
2024-07-12 21:58:48 +00:00
public bool? Land { get; set; }
2024-06-01 16:46:57 +00:00
public bool? Sprint { get; set; }
public bool? IgnoreDistanceToObject { get; set; }
2024-05-26 19:45:26 +00:00
public string? Comment { get; set; }
/// <summary>
/// Only used when attuning to an aetheryte.
/// </summary>
public EAetheryteLocation? Aetheryte { get; set; }
/// <summary>
/// Only used when attuning to an aethernet shard.
/// </summary>
[JsonConverter(typeof(AethernetShardConverter))]
public EAetheryteLocation? AethernetShard { get; set; }
2024-05-26 19:45:26 +00:00
public EAetheryteLocation? AetheryteShortcut { get; set; }
2024-05-26 13:43:33 +00:00
2024-05-26 19:45:26 +00:00
public AethernetShortcut? AethernetShortcut { get; set; }
2024-05-27 19:54:34 +00:00
public uint? AetherCurrentId { get; set; }
public uint? ItemId { get; set; }
2024-05-28 22:17:19 +00:00
public bool? GroundTarget { get; set; }
2024-05-27 19:54:34 +00:00
public EEmote? Emote { get; set; }
public ChatMessage? ChatMessage { get; set; }
public EAction? Action { get; set; }
2024-05-27 19:54:34 +00:00
public EEnemySpawnType? EnemySpawnType { get; set; }
public IList<uint> KillEnemyDataIds { get; set; } = new List<uint>();
public IList<ComplexCombatData> ComplexCombatData { get; set; } = new List<ComplexCombatData>();
public float? CombatDelaySecondsAtStart { get; set; }
2024-06-14 09:37:33 +00:00
2024-06-01 12:30:20 +00:00
public JumpDestination? JumpDestination { get; set; }
public uint? ContentFinderConditionId { get; set; }
2024-07-27 13:39:47 +00:00
public SkipConditions? SkipConditions { get; set; }
2024-07-20 17:09:51 +00:00
public List<List<QuestWorkValue>?> RequiredQuestVariables { get; set; } = new();
2024-08-03 09:17:20 +00:00
public List<GatheredItem> RequiredGatheredItems { get; set; } = [];
public IList<QuestWorkValue?> CompletionQuestVariablesFlags { get; set; } = new List<QuestWorkValue?>();
2024-06-01 16:46:57 +00:00
public IList<DialogueChoice> DialogueChoices { get; set; } = new List<DialogueChoice>();
public IList<uint> PointMenuChoices { get; set; } = new List<uint>();
// TODO: Not implemented
2024-08-03 20:17:18 +00:00
[JsonConverter(typeof(ElementIdConverter))]
public ElementId? PickUpQuestId { get; set; }
2024-08-03 20:17:18 +00:00
[JsonConverter(typeof(ElementIdConverter))]
public ElementId? TurnInQuestId { get; set; }
2024-08-03 18:30:18 +00:00
2024-08-03 20:17:18 +00:00
[JsonConverter(typeof(ElementIdConverter))]
public ElementId? NextQuestId { get; set; }
2024-06-01 16:46:57 +00:00
2024-06-14 09:37:33 +00:00
[JsonConstructor]
public QuestStep()
2024-06-01 16:46:57 +00:00
{
2024-06-14 09:37:33 +00:00
}
2024-06-01 16:46:57 +00:00
2024-06-14 09:37:33 +00:00
public QuestStep(EInteractionType interactionType, uint? dataId, Vector3? position, ushort territoryId)
{
InteractionType = interactionType;
DataId = dataId;
Position = position;
TerritoryId = territoryId;
2024-06-01 16:46:57 +00:00
}
public float CalculateActualStopDistance()
{
if (InteractionType == EInteractionType.WalkTo)
return StopDistance ?? 0.25f;
if (InteractionType == EInteractionType.AttuneAetheryte)
return StopDistance ?? 10f;
else
return StopDistance ?? DefaultStopDistance;
}
2024-05-25 21:51:37 +00:00
}