Questionable/Questionable.Model/V1/QuestStep.cs

100 lines
3.2 KiB
C#
Raw Permalink Normal View History

using System;
using System.Collections.Generic;
2024-06-08 19:16:57 +00:00
using System.Diagnostics.CodeAnalysis;
2024-05-26 13:43:33 +00:00
using System.Numerics;
using System.Text.Json.Serialization;
using Questionable.Model.V1.Converter;
2024-05-25 21:51:37 +00:00
namespace Questionable.Model.V1;
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>();
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; }
public IList<ESkipCondition> SkipIf { get; set; } = new List<ESkipCondition>();
2024-06-01 16:46:57 +00:00
public IList<short?> CompletionQuestVariablesFlags { get; set; } = new List<short?>();
public IList<DialogueChoice> DialogueChoices { get; set; } = new List<DialogueChoice>();
public IList<uint> PointMenuChoices { get; set; } = new List<uint>();
// TODO: Not implemented
2024-07-19 19:16:40 +00:00
public ushort? PickUpQuestId { get; set; }
public ushort? TurnInQuestId { get; set; }
public ushort? 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
}