1
0
forked from liza/Questionable

Attempt follow path for 'Tracks in the Snow'

This commit is contained in:
Liza 2024-06-18 17:48:45 +02:00
parent e5507b8986
commit 7dff411947
Signed by: liza
GPG Key ID: 7199F8D727D55F67
9 changed files with 207 additions and 5 deletions

View 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,

View File

@ -68,7 +68,7 @@
null,
null,
null,
32
-32
]
},
{

View File

@ -105,7 +105,8 @@
"Z": -209.40958
},
"TerritoryId": 962,
"InteractionType": "Interact"
"InteractionType": "WalkTo",
"Comment": "Should auto-trigger the next step once Alisaie is here"
}
]
},

View File

@ -127,6 +127,15 @@
"InteractionType": "AttuneAetherCurrent",
"AetherCurrentId": 2818314
},
{
"Position": {
"X": 280.38452,
"Y": 216.34708,
"Z": -823.3921
},
"TerritoryId": 956,
"InteractionType": "WalkTo"
},
{
"DataId": 1038701,
"Position": {
@ -136,7 +145,8 @@
},
"TerritoryId": 956,
"InteractionType": "UseItem",
"ItemId": 2003129
"ItemId": 2003129,
"Mount": false
}
]
},

View File

@ -152,6 +152,149 @@
{
"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": {
@ -160,7 +303,8 @@
"Z": 159.10571
},
"TerritoryId": 958,
"InteractionType": "WalkTo"
"InteractionType": "WalkTo",
"Mount": false
}
]
},

View File

@ -387,6 +387,13 @@
"minItems": 6,
"maxItems": 6
},
"DelaySecondsAtStart": {
"description": "Time to wait before starting",
"type": [
"number",
"null"
]
},
"Comment": {
"type": "string"
}

View 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; }

View File

@ -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})";
}
}

View 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))
{