Attempt follow path for 'Tracks in the Snow'
authorLiza Carvelli <liza@carvel.li>
Tue, 18 Jun 2024 15:48:45 +0000 (17:48 +0200)
committerLiza Carvelli <liza@carvel.li>
Tue, 18 Jun 2024 15:48:45 +0000 (17:48 +0200)
QuestPathGenerator/QuestSourceGenerator.cs
QuestPaths/Endwalker/AetherCurrents/Thavnair/4203_Alchemist or Dancer.json
QuestPaths/Endwalker/MSQ/A-Thavnair1-Labyrinthos1/4361_A Labyrinthine Descent.json
QuestPaths/Endwalker/MSQ/A-Thavnair1-Labyrinthos1/4362_Glorified Ratcatcher.json
QuestPaths/Endwalker/MSQ/B-Garlemald/4384_Tracks in the Snow.json
QuestPaths/quest-v1.json
Questionable.Model/V1/QuestStep.cs
Questionable/Controller/Steps/BaseFactory/WaitAtStart.cs [new file with mode: 0644]
Questionable/Controller/Steps/BaseTasks/AbstractDelayedTask.cs

index aa68436b15973ea22cf78aa8dd90221333ef8ae8..616ad2f5d1d0cad440805611b34ad6c47730a204 100644 (file)
@@ -297,6 +297,9 @@ public class QuestSourceGenerator : ISourceGenerator
                                             Assignment(nameof(QuestStep.TargetTerritoryId), step.TargetTerritoryId,
                                                     emptyStep.TargetTerritoryId)
                                                 .AsSyntaxNodeOrToken(),
+                                            Assignment(nameof(QuestStep.DelaySecondsAtStart), step.DelaySecondsAtStart,
+                                                    emptyStep.DelaySecondsAtStart)
+                                                .AsSyntaxNodeOrToken(),
                                             Assignment(nameof(QuestStep.Disabled), step.Disabled, emptyStep.Disabled)
                                                 .AsSyntaxNodeOrToken(),
                                             Assignment(nameof(QuestStep.DisableNavmesh), step.DisableNavmesh,
index 17fc03509658898784560bf194024131235f1138..a86ce80c766ee26e44bc1608b0e6e09228fb5d24 100644 (file)
@@ -68,7 +68,7 @@
             null,
             null,
             null,
-            32
+            -32
           ]
         },
         {
index f32f1c1a6d37319226f82aa5831412331650de58..ffcbebb548bedb7e1edb97d22bebae31dbfe0607 100644 (file)
             "Z": -209.40958
           },
           "TerritoryId": 962,
-          "InteractionType": "Interact"
+          "InteractionType": "WalkTo",
+          "Comment": "Should auto-trigger the next step once Alisaie is here"
         }
       ]
     },
index 6348c2308bae1535c2819fa2f2c99247e6b69b0a..2d3973d31aa638ed85cbc8a2e564aecbbcd67394 100644 (file)
           "InteractionType": "AttuneAetherCurrent",
           "AetherCurrentId": 2818314
         },
+        {
+          "Position": {
+            "X": 280.38452,
+            "Y": 216.34708,
+            "Z": -823.3921
+          },
+          "TerritoryId": 956,
+          "InteractionType": "WalkTo"
+        },
         {
           "DataId": 1038701,
           "Position": {
           },
           "TerritoryId": 956,
           "InteractionType": "UseItem",
-          "ItemId": 2003129
+          "ItemId": 2003129,
+          "Mount": false
         }
       ]
     },
index ce1c7980c2d5da05d36edf5e49209609a97ebf19..1972e4bac1121952a1f182834687929e483add31 100644 (file)
     {
       "Sequence": 6,
       "Steps": [
+        {
+          "DataId": 1038845,
+          "Position": {
+            "X": 156.66682,
+            "Y": -18.078814,
+            "Z": 361.58972
+          },
+          "TerritoryId": 958,
+          "InteractionType": "WaitForNpcAtPosition",
+          "NpcWaitDistance": 5,
+          "StopDistance": 100,
+          "Mount": false,
+          "Sprint": false
+        },
+        {
+          "Position": {
+            "X": 204.82344,
+            "Y": -19.113703,
+            "Z": 373.52936
+          },
+          "TerritoryId": 958,
+          "InteractionType": "WalkTo",
+          "Mount": false,
+          "Sprint": false,
+          "DelaySecondsAtStart": 1
+        },
+        {
+          "DataId": 1038845,
+          "Position": {
+            "X": 232.28406,
+            "Y": -16.777779,
+            "Z": 339.1168
+          },
+          "TerritoryId": 958,
+          "InteractionType": "WaitForNpcAtPosition",
+          "NpcWaitDistance": 5,
+          "StopDistance": 100,
+          "Mount": false,
+          "Sprint": false
+        },
+        {
+          "Position": {
+            "X": 272.79572,
+            "Y": -13.174152,
+            "Z": 317.53406
+          },
+          "TerritoryId": 958,
+          "InteractionType": "WalkTo",
+          "Mount": false,
+          "Sprint": false,
+          "DelaySecondsAtStart": 8
+        },
+        {
+          "DataId": 1038845,
+          "Position": {
+            "X": 287.9112,
+            "Y": -11.811615,
+            "Z": 292.6589
+          },
+          "TerritoryId": 958,
+          "InteractionType": "WaitForNpcAtPosition",
+          "NpcWaitDistance": 5,
+          "StopDistance": 100,
+          "Mount": false,
+          "Sprint": false
+        },
+        {
+          "Position": {
+            "X": 323.9364,
+            "Y": -10.539692,
+            "Z": 254.19264
+          },
+          "TerritoryId": 958,
+          "InteractionType": "WalkTo",
+          "Mount": false,
+          "Sprint": false
+        },
+        {
+          "DataId": 1038845,
+          "Position": {
+            "X": 354.5913,
+            "Y": -5.5008125,
+            "Z": 245.22939
+          },
+          "TerritoryId": 958,
+          "InteractionType": "WaitForNpcAtPosition",
+          "NpcWaitDistance": 5,
+          "StopDistance": 100,
+          "Mount": false,
+          "Sprint": false
+        },
+        {
+          "Position": {
+            "X": 354.71964,
+            "Y": -2.2201555,
+            "Z": 233.99152
+          },
+          "TerritoryId": 958,
+          "InteractionType": "WalkTo",
+          "Mount": false,
+          "Sprint": false
+        },
+        {
+          "DataId": 1038845,
+          "Position": {
+            "X": 382.75116,
+            "Y": 2.7549856,
+            "Z": 226.49387
+          },
+          "TerritoryId": 958,
+          "InteractionType": "WaitForNpcAtPosition",
+          "NpcWaitDistance": 5,
+          "StopDistance": 40,
+          "Mount": false,
+          "Sprint": false
+        },
+        {
+          "DataId": 1038845,
+          "Position": {
+            "X": 408.44272,
+            "Y": 4.965298,
+            "Z": 208.22794
+          },
+          "TerritoryId": 958,
+          "InteractionType": "WalkTo",
+          "StopDistance": 45,
+          "Mount": false,
+          "Sprint": false
+        },
+        {
+          "DataId": 1038845,
+          "Position": {
+            "X": 426.39246,
+            "Y": 5.348692,
+            "Z": 194.86263
+          },
+          "TerritoryId": 958,
+          "InteractionType": "WaitForNpcAtPosition",
+          "NpcWaitDistance": 5,
+          "StopDistance": 100,
+          "Mount": false,
+          "Sprint": false
+        },
         {
           "DataId": 1038846,
           "Position": {
             "Z": 159.10571
           },
           "TerritoryId": 958,
-          "InteractionType": "WalkTo"
+          "InteractionType": "WalkTo",
+          "Mount": false
         }
       ]
     },
index e019e2f7502989089f1350d95ddd523b505025aa..80c082a9fc9f898f43e961dbb68def07756eaee6 100644 (file)
                   "minItems": 6,
                   "maxItems": 6
                 },
+                "DelaySecondsAtStart": {
+                  "description": "Time to wait before starting",
+                  "type": [
+                    "number",
+                    "null"
+                  ]
+                },
                 "Comment": {
                   "type": "string"
                 }
index d265df6da98d9890c290ac84e5918941b153d54c..936f7aae3e0324c2456afdd8050ad89ae1fa04e3 100644 (file)
@@ -20,6 +20,7 @@ public sealed class QuestStep
     public float? NpcWaitDistance { get; set; }
     public ushort TerritoryId { get; set; }
     public ushort? TargetTerritoryId { get; set; }
+    public float? DelaySecondsAtStart { get; set; }
 
     public bool Disabled { get; set; }
     public bool DisableNavmesh { get; set; }
diff --git a/Questionable/Controller/Steps/BaseFactory/WaitAtStart.cs b/Questionable/Controller/Steps/BaseFactory/WaitAtStart.cs
new file mode 100644 (file)
index 0000000..5da57f6
--- /dev/null
@@ -0,0 +1,35 @@
+using System;
+using Microsoft.Extensions.DependencyInjection;
+using Questionable.Controller.Steps.BaseTasks;
+using Questionable.Model;
+using Questionable.Model.V1;
+
+namespace Questionable.Controller.Steps.BaseFactory;
+
+internal static class WaitAtStart
+{
+    internal sealed class Factory(IServiceProvider serviceProvider) : ITaskFactory
+    {
+        public ITask? CreateTask(Quest quest, QuestSequence sequence, QuestStep step)
+        {
+            if (step.DelaySecondsAtStart == null)
+                return null;
+
+            return serviceProvider.GetRequiredService<WaitDelay>()
+                .With(TimeSpan.FromSeconds(step.DelaySecondsAtStart.Value));
+        }
+    }
+
+    internal sealed class WaitDelay : AbstractDelayedTask
+    {
+        public ITask With(TimeSpan delay)
+        {
+            Delay = delay;
+            return this;
+        }
+
+        protected override bool StartInternal() => true;
+
+        public override string ToString() => $"Wait[S](seconds: {Delay.TotalSeconds})";
+    }
+}
index b43ee953e4cd9a2f3f352b68661c4f11f9f45335..ed1e8506ca2307b3c66f8ae4104c27374d59a90f 100644 (file)
@@ -4,7 +4,6 @@ namespace Questionable.Controller.Steps.BaseTasks;
 
 internal abstract class AbstractDelayedTask : ITask
 {
-    protected readonly TimeSpan Delay;
     private DateTime _continueAt;
 
     protected AbstractDelayedTask(TimeSpan delay)
@@ -12,6 +11,8 @@ internal abstract class AbstractDelayedTask : ITask
         Delay = delay;
     }
 
+    protected TimeSpan Delay { get; set; }
+
     protected AbstractDelayedTask()
         : this(TimeSpan.FromSeconds(5))
     {