forked from liza/Questionable
Compare commits
10 Commits
b0d48ab3fb
...
6832888ada
Author | SHA1 | Date | |
---|---|---|---|
|
6832888ada | ||
|
3b3008d193 | ||
aaad336c64 | |||
1572ff11a8 | |||
de7cf2a94f | |||
a5d75eb0f5 | |||
308d4b8253 | |||
ded6f6bbb2 | |||
47d9f090a2 | |||
24c1e0c5d9 |
@ -1,5 +1,5 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<Version>2.17</Version>
|
||||
<Version>2.19</Version>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
@ -62,6 +62,9 @@ internal static class QuestStepExtensions
|
||||
Assignment(nameof(QuestStep.IgnoreDistanceToObject),
|
||||
step.IgnoreDistanceToObject, emptyStep.IgnoreDistanceToObject)
|
||||
.AsSyntaxNodeOrToken(),
|
||||
Assignment(nameof(QuestStep.RestartNavigationIfCancelled),
|
||||
step.RestartNavigationIfCancelled, emptyStep.RestartNavigationIfCancelled)
|
||||
.AsSyntaxNodeOrToken(),
|
||||
Assignment(nameof(QuestStep.Comment), step.Comment, emptyStep.Comment)
|
||||
.AsSyntaxNodeOrToken(),
|
||||
Assignment(nameof(QuestStep.Aetheryte), step.Aetheryte, emptyStep.Aetheryte)
|
||||
|
@ -53,6 +53,7 @@
|
||||
"Y": -0.63573146,
|
||||
"Z": -166.33862
|
||||
},
|
||||
"StopDistance": 5,
|
||||
"TerritoryId": 141,
|
||||
"InteractionType": "Interact"
|
||||
}
|
||||
|
@ -35,6 +35,7 @@
|
||||
},
|
||||
"TerritoryId": 155,
|
||||
"InteractionType": "CompleteQuest",
|
||||
"Mount": true,
|
||||
"DialogueChoices": [
|
||||
{
|
||||
"Type": "YesNo",
|
||||
|
@ -337,16 +337,6 @@
|
||||
"InteractionType": "WalkTo",
|
||||
"Fly": true
|
||||
},
|
||||
{
|
||||
"Position": {
|
||||
"X": 233.0817,
|
||||
"Y": 8,
|
||||
"Z": -21.83023
|
||||
},
|
||||
"TerritoryId": 146,
|
||||
"InteractionType": "WalkTo",
|
||||
"Fly": true
|
||||
},
|
||||
{
|
||||
"DataId": 2000077,
|
||||
"Position": {
|
||||
@ -360,18 +350,16 @@
|
||||
"KillEnemyDataIds": [
|
||||
9489
|
||||
],
|
||||
"$": "0 0 0 0 0 0 -> 16 17 0 0 0 128"
|
||||
},
|
||||
{
|
||||
"Position": {
|
||||
"X": 614.4023,
|
||||
"Y": 301.81046,
|
||||
"Z": -101.94888
|
||||
},
|
||||
"TerritoryId": 155,
|
||||
"InteractionType": "WalkTo",
|
||||
"Fly": true,
|
||||
"AetheryteShortcut": "Coerthas Central Highlands - Camp Dragonhead"
|
||||
"$": "0 0 0 0 0 0 -> 16 17 0 0 0 128",
|
||||
"CompletionQuestVariablesFlags": [
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
128
|
||||
],
|
||||
"Fly": true
|
||||
},
|
||||
{
|
||||
"DataId": 2000078,
|
||||
@ -386,7 +374,17 @@
|
||||
"KillEnemyDataIds": [
|
||||
9490
|
||||
],
|
||||
"$": "16 17 0 0 0 128 -> 0 17 0 0 0 0"
|
||||
"Fly": true,
|
||||
"AetheryteShortcut": "Coerthas Central Highlands - Camp Dragonhead",
|
||||
"$": "16 17 0 0 0 128 -> 0 17 0 0 0 0",
|
||||
"CompletionQuestVariablesFlags": [
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
64
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -191,6 +191,15 @@
|
||||
"AethernetShard": "[Gold Saucer] Cactpot Board",
|
||||
"DelaySecondsAtStart": 3
|
||||
},
|
||||
{
|
||||
"Position": {
|
||||
"X": 111.36922,
|
||||
"Y": 13.000123,
|
||||
"Z": -24.209782
|
||||
},
|
||||
"TerritoryId": 144,
|
||||
"InteractionType": "WalkTo"
|
||||
},
|
||||
{
|
||||
"DataId": 1011079,
|
||||
"Position": {
|
||||
@ -207,6 +216,15 @@
|
||||
{
|
||||
"Sequence": 6,
|
||||
"Steps": [
|
||||
{
|
||||
"Position": {
|
||||
"X": 111.36922,
|
||||
"Y": 13.000123,
|
||||
"Z": -24.209782
|
||||
},
|
||||
"TerritoryId": 144,
|
||||
"InteractionType": "WalkTo"
|
||||
},
|
||||
{
|
||||
"TerritoryId": 144,
|
||||
"InteractionType": "None",
|
||||
|
@ -30,6 +30,12 @@
|
||||
"TerritoryId": 960,
|
||||
"InteractionType": "Interact",
|
||||
"RequiredQuestVariables": [null, null, null, [1], null, null],
|
||||
"AetheryteShortcut": "Ultima Thule - Reah Tahra",
|
||||
"SkipConditions": {
|
||||
"AetheryteShortcutIf": {
|
||||
"RequiredQuestVariablesNotMet": true
|
||||
}
|
||||
},
|
||||
"Fly": true
|
||||
},
|
||||
{
|
||||
@ -41,8 +47,9 @@
|
||||
},
|
||||
"TerritoryId": 960,
|
||||
"InteractionType": "Interact",
|
||||
"RequiredQuestVariables": [null, null, null, [1], null, null],
|
||||
"Fly": true
|
||||
"RequiredQuestVariables": [null, null, null, [17], null, null],
|
||||
"Fly": true,
|
||||
"$": "It's the only pair that increases the significant element by 16"
|
||||
},
|
||||
{
|
||||
"DataId": 1044054,
|
||||
@ -54,6 +61,12 @@
|
||||
"TerritoryId": 960,
|
||||
"InteractionType": "Interact",
|
||||
"RequiredQuestVariables": [null, null, null, [2], null, null],
|
||||
"AetheryteShortcut": "Ultima Thule - Abode of the Ea",
|
||||
"SkipConditions": {
|
||||
"AetheryteShortcutIf": {
|
||||
"RequiredQuestVariablesNotMet": true
|
||||
}
|
||||
},
|
||||
"Fly": true
|
||||
},
|
||||
{
|
||||
@ -78,6 +91,12 @@
|
||||
"TerritoryId": 960,
|
||||
"InteractionType": "Interact",
|
||||
"RequiredQuestVariables": [null, null, null, [3], null, null],
|
||||
"AetheryteShortcut": "Ultima Thule - Base Omicron",
|
||||
"SkipConditions": {
|
||||
"AetheryteShortcutIf": {
|
||||
"RequiredQuestVariablesNotMet": true
|
||||
}
|
||||
},
|
||||
"Fly": true
|
||||
},
|
||||
{
|
||||
|
@ -1,7 +1,6 @@
|
||||
{
|
||||
{
|
||||
"$schema": "https://git.carvel.li/liza/Questionable/raw/branch/master/QuestPaths/quest-v1.json",
|
||||
"Author": "liza",
|
||||
"Disabled": true,
|
||||
"Author": "plogon_enjoyer",
|
||||
"QuestSequence": [
|
||||
{
|
||||
"Sequence": 0,
|
||||
@ -18,9 +17,66 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Sequence": 1,
|
||||
"Steps": [
|
||||
{
|
||||
"DataId": 2013074,
|
||||
"Position": {
|
||||
"X": 304.3412,
|
||||
"Y": 483.48206,
|
||||
"Z": 143.11438
|
||||
},
|
||||
"TerritoryId": 960,
|
||||
"InteractionType": "Interact",
|
||||
"TargetTerritoryId": 1073,
|
||||
"$": "Without this step, there are times where it doesn't confirm automatically"
|
||||
},
|
||||
{
|
||||
"TerritoryId": 1073,
|
||||
"InteractionType": "None",
|
||||
"RequiredGatheredItems": [
|
||||
{
|
||||
"QuestAcceptedAsClass": "Miner",
|
||||
"ItemId": 38287,
|
||||
"ItemCount": 3
|
||||
},
|
||||
{
|
||||
"QuestAcceptedAsClass": "Botanist",
|
||||
"ItemId": 38311,
|
||||
"ItemCount": 3
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"DataId": 1044057,
|
||||
"Position": {
|
||||
"X": 490.2876,
|
||||
"Y": 436.9998,
|
||||
"Z": 312.3064
|
||||
},
|
||||
"TerritoryId": 960,
|
||||
"InteractionType": "Interact",
|
||||
"AetheryteShortcut": "Ultima Thule - Base Omicron",
|
||||
"Mount": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Sequence": 255,
|
||||
"Steps": [
|
||||
{
|
||||
"DataId": 2013072,
|
||||
"Position": {
|
||||
"X": 456.65674,
|
||||
"Y": 438.04077,
|
||||
"Z": 310.2312
|
||||
},
|
||||
"TerritoryId": 960,
|
||||
"InteractionType": "Interact",
|
||||
"TargetTerritoryId": 960,
|
||||
"Mount": true
|
||||
},
|
||||
{
|
||||
"DataId": 1043417,
|
||||
"Position": {
|
||||
@ -29,7 +85,8 @@
|
||||
"Z": 148.11926
|
||||
},
|
||||
"TerritoryId": 960,
|
||||
"InteractionType": "CompleteQuest"
|
||||
"InteractionType": "CompleteQuest",
|
||||
"Mount": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -235,6 +235,16 @@ internal sealed class InteractionUiController : IDisposable
|
||||
_logger.LogInformation("Checking if current quest {Name} is on the list", currentQuest.Quest.Info.Name);
|
||||
if (CheckQuestSelection(addonSelectIconString, currentQuest.Quest, answers))
|
||||
return;
|
||||
|
||||
var sequence = currentQuest.Quest.FindSequence(currentQuest.Sequence);
|
||||
QuestStep? step = sequence?.FindStep(currentQuest.Step);
|
||||
if (step is { InteractionType: EInteractionType.AcceptQuest, PickUpQuestId: not null } &&
|
||||
_questRegistry.TryGetQuest(step.PickUpQuestId, out Quest? pickupQuest))
|
||||
{
|
||||
_logger.LogInformation("Checking if current picked-up {Name} is on the list", pickupQuest.Info.Name);
|
||||
if (CheckQuestSelection(addonSelectIconString, pickupQuest, answers))
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var nextQuest = _questController.NextQuest;
|
||||
|
@ -68,7 +68,7 @@ internal static class MoveTo
|
||||
public ITask Move(MoveParams moveParams)
|
||||
{
|
||||
return new MoveInternal(moveParams, movementController, gameFunctions,
|
||||
loggerFactory.CreateLogger<MoveInternal>(), condition, clientState, dataManager);
|
||||
loggerFactory.CreateLogger<MoveInternal>(), clientState, dataManager);
|
||||
}
|
||||
|
||||
public ITask Land()
|
||||
@ -163,24 +163,22 @@ internal static class MoveTo
|
||||
private readonly string _cannotExecuteAtThisTime;
|
||||
private readonly MovementController _movementController;
|
||||
private readonly ILogger<MoveInternal> _logger;
|
||||
private readonly ICondition _condition;
|
||||
private readonly IClientState _clientState;
|
||||
|
||||
private readonly Action _startAction;
|
||||
private readonly Vector3 _destination;
|
||||
private readonly MoveParams _moveParams;
|
||||
private bool _canRestart;
|
||||
|
||||
public MoveInternal(MoveParams moveParams,
|
||||
MovementController movementController,
|
||||
GameFunctions gameFunctions,
|
||||
ILogger<MoveInternal> logger,
|
||||
ICondition condition,
|
||||
IClientState clientState,
|
||||
IDataManager dataManager)
|
||||
{
|
||||
_movementController = movementController;
|
||||
_logger = logger;
|
||||
_condition = condition;
|
||||
_clientState = clientState;
|
||||
_cannotExecuteAtThisTime = dataManager.GetString<LogMessage>(579, x => x.Text)!;
|
||||
|
||||
@ -213,6 +211,7 @@ internal static class MoveTo
|
||||
}
|
||||
|
||||
_moveParams = moveParams;
|
||||
_canRestart = moveParams.RestartNavigation;
|
||||
}
|
||||
|
||||
public bool Start()
|
||||
@ -231,13 +230,20 @@ internal static class MoveTo
|
||||
if (movementStartedAt == DateTime.MaxValue || movementStartedAt.AddSeconds(2) >= DateTime.Now)
|
||||
return ETaskResult.StillRunning;
|
||||
|
||||
if (_moveParams.RestartNavigation &&
|
||||
if (_canRestart &&
|
||||
Vector3.Distance(_clientState.LocalPlayer!.Position, _destination) >
|
||||
(_moveParams.StopDistance ?? QuestStep.DefaultStopDistance) + 5f)
|
||||
{
|
||||
_logger.LogInformation("Looks like movement was interrupted, re-attempting to move");
|
||||
_startAction();
|
||||
return ETaskResult.StillRunning;
|
||||
_canRestart = false;
|
||||
if (_clientState.TerritoryType == _moveParams.TerritoryId)
|
||||
{
|
||||
_logger.LogInformation("Looks like movement was interrupted, re-attempting to move");
|
||||
_startAction();
|
||||
return ETaskResult.StillRunning;
|
||||
}
|
||||
else
|
||||
_logger.LogInformation(
|
||||
"Looks like movement was interrupted, do nothing since we're in a different territory now");
|
||||
}
|
||||
|
||||
return ETaskResult.TaskComplete;
|
||||
@ -247,8 +253,7 @@ internal static class MoveTo
|
||||
|
||||
public bool OnErrorToast(SeString message)
|
||||
{
|
||||
if (GameFunctions.GameStringEquals(_cannotExecuteAtThisTime, message.TextValue) &&
|
||||
_condition[ConditionFlag.Diving])
|
||||
if (GameFunctions.GameStringEquals(_cannotExecuteAtThisTime, message.TextValue))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
31
Questionable/External/QuestionableIpc.cs
vendored
Normal file
31
Questionable/External/QuestionableIpc.cs
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using Dalamud.Plugin;
|
||||
using Dalamud.Plugin.Ipc;
|
||||
using Questionable.Controller;
|
||||
|
||||
namespace Questionable.External;
|
||||
|
||||
internal sealed class QuestionableIpc : IDisposable
|
||||
{
|
||||
private const string IpcIsRunning = "Questionable.IsRunning";
|
||||
private const string IpcGetCurrentQuestId = "Questionable.GetCurrentQuestId";
|
||||
|
||||
private readonly ICallGateProvider<bool> _isRunning;
|
||||
private readonly ICallGateProvider<string?> _getCurrentQuestId;
|
||||
|
||||
public QuestionableIpc(QuestController questController, IDalamudPluginInterface pluginInterface)
|
||||
{
|
||||
_isRunning = pluginInterface.GetIpcProvider<bool>(IpcIsRunning);
|
||||
_isRunning.RegisterFunc(() => questController.IsRunning);
|
||||
|
||||
_getCurrentQuestId = pluginInterface.GetIpcProvider<string?>(IpcGetCurrentQuestId);
|
||||
_getCurrentQuestId.RegisterFunc(() => questController.CurrentQuest?.Quest.Id.ToString());
|
||||
}
|
||||
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_getCurrentQuestId.UnregisterFunc();
|
||||
_isRunning.UnregisterFunc();
|
||||
}
|
||||
}
|
@ -120,6 +120,7 @@ public sealed class QuestionablePlugin : IDalamudPlugin
|
||||
serviceCollection.AddSingleton<LifestreamIpc>();
|
||||
serviceCollection.AddSingleton<YesAlreadyIpc>();
|
||||
serviceCollection.AddSingleton<ArtisanIpc>();
|
||||
serviceCollection.AddSingleton<QuestionableIpc>();
|
||||
}
|
||||
|
||||
private static void AddTaskFactories(ServiceCollection serviceCollection)
|
||||
@ -235,6 +236,7 @@ public sealed class QuestionablePlugin : IDalamudPlugin
|
||||
serviceProvider.GetRequiredService<CreditsController>();
|
||||
serviceProvider.GetRequiredService<HelpUiController>();
|
||||
serviceProvider.GetRequiredService<LeveUiController>();
|
||||
serviceProvider.GetRequiredService<QuestionableIpc>();
|
||||
serviceProvider.GetRequiredService<DalamudInitializer>();
|
||||
}
|
||||
|
||||
|
@ -177,7 +177,7 @@ internal sealed partial class ActiveQuestComponent
|
||||
{
|
||||
using var _ = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudYellow);
|
||||
ImGui.TextUnformatted(
|
||||
$"Next Quest: {Shorten(currentQuest.Quest.Info.Name)} / {currentQuest.Sequence} / {currentQuest.Step}");
|
||||
$"Next Quest: {Shorten(nextQuest.Quest.Info.Name)} / {nextQuest.Sequence} / {nextQuest.Step}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user