Compare commits

...

2 Commits

Author SHA1 Message Date
0b001e83c9
Update Wrath IPC 2025-03-02 23:19:13 +01:00
d2501825c8
Don't stop Questionable/AD if dying in an AD-run dungeon 2025-03-02 22:06:39 +01:00
3 changed files with 64 additions and 16 deletions

View File

@ -1,5 +1,5 @@
<Project>
<PropertyGroup Condition="$(MSBuildProjectName) != 'GatheringPathRenderer'">
<Version>4.21</Version>
<Version>4.22</Version>
</PropertyGroup>
</Project>

View File

@ -3,6 +3,7 @@ using Dalamud.Game.ClientState.Objects.Types;
using Dalamud.Plugin;
using Dalamud.Plugin.Ipc;
using Dalamud.Plugin.Ipc.Exceptions;
using JetBrains.Annotations;
using Microsoft.Extensions.Logging;
using Questionable.Controller.Steps;
@ -17,8 +18,8 @@ internal sealed class WrathComboModule : ICombatModule, IDisposable
private readonly ICallGateSubscriber<object> _test;
private readonly ICallGateSubscriber<string, string, string, Guid?> _registerForLeaseWithCallback;
private readonly ICallGateSubscriber<Guid, object> _releaseControl;
private readonly ICallGateSubscriber<Guid,bool,object> _setAutoRotationState;
private readonly ICallGateSubscriber<Guid,object> _setCurrentJobAutoRotationReady;
private readonly ICallGateSubscriber<Guid,bool,ESetResult> _setAutoRotationState;
private readonly ICallGateSubscriber<Guid,ESetResult> _setCurrentJobAutoRotationReady;
private readonly ICallGateProvider<int, string, object> _callback;
private Guid? _lease;
@ -32,9 +33,9 @@ internal sealed class WrathComboModule : ICombatModule, IDisposable
_registerForLeaseWithCallback =
pluginInterface.GetIpcSubscriber<string, string, string, Guid?>("WrathCombo.RegisterForLeaseWithCallback");
_releaseControl = pluginInterface.GetIpcSubscriber<Guid, object>("WrathCombo.ReleaseControl");
_setAutoRotationState = pluginInterface.GetIpcSubscriber<Guid, bool, object>("WrathCombo.SetAutoRotationState");
_setAutoRotationState = pluginInterface.GetIpcSubscriber<Guid, bool, ESetResult>("WrathCombo.SetAutoRotationState");
_setCurrentJobAutoRotationReady =
pluginInterface.GetIpcSubscriber<Guid, object>("WrathCombo.SetCurrentJobAutoRotationReady");
pluginInterface.GetIpcSubscriber<Guid, ESetResult>("WrathCombo.SetCurrentJobAutoRotationReady");
_callback = pluginInterface.GetIpcProvider<int, string, object>($"{CallbackPrefix}.WrathComboCallback");
_callback.RegisterAction(Callback);
@ -65,8 +66,22 @@ internal sealed class WrathComboModule : ICombatModule, IDisposable
{
_logger.LogDebug("Wrath combo lease: {Lease}", _lease.Value);
_setAutoRotationState.InvokeAction(_lease.Value, true);
_setCurrentJobAutoRotationReady.InvokeAction(_lease.Value);
ESetResult autoRotationSet = _setAutoRotationState.InvokeFunc(_lease.Value, true);
if (!autoRotationSet.IsSuccess())
{
_logger.LogError("Unable to set autorotation state");
Stop();
return false;
}
ESetResult currentJobSetForAutoRotation = _setCurrentJobAutoRotationReady.InvokeFunc(_lease.Value);
if (!currentJobSetForAutoRotation.IsSuccess())
{
_logger.LogError("Unable to setr current job for autorotation");
Stop();
return false;
}
return true;
}
else
@ -120,4 +135,27 @@ internal sealed class WrathComboModule : ICombatModule, IDisposable
Stop();
_callback.UnregisterAction();
}
[PublicAPI]
public enum ESetResult
{
Okay = 0,
OkayWorking = 1,
IpcDisabled = 10,
InvalidLease = 11,
BlacklistedLease = 12,
Duplicate = 13,
PlayerNotAvailable = 14,
InvalidConfiguration = 15,
InvalidValue = 16,
}
}
internal static class WrathResultExtensions
{
public static bool IsSuccess(this WrathComboModule.ESetResult result)
{
return result is WrathComboModule.ESetResult.Okay or WrathComboModule.ESetResult.OkayWorking;
}
}

View File

@ -199,7 +199,11 @@ internal sealed class QuestController : MiniTaskController<QuestController>
UpdateCurrentQuest();
if (!_clientState.IsLoggedIn || _condition[ConditionFlag.Unconscious])
if (!_clientState.IsLoggedIn)
{
StopAllDueToConditionFailed("Logged out");
}
if (_condition[ConditionFlag.Unconscious])
{
if (_condition[ConditionFlag.Unconscious] &&
_condition[ConditionFlag.SufferingStatusAffliction63] &&
@ -207,22 +211,20 @@ internal sealed class QuestController : MiniTaskController<QuestController>
{
// ignore, we're in the lahabrea fight
}
else if (_taskQueue.CurrentTaskExecutor is Duty.WaitAutoDutyExecutor)
{
// ignoring death in a dungeon if it is being run by AD
}
else if (!_taskQueue.AllTasksComplete)
{
Stop("HP = 0");
_movementController.Stop();
_combatController.Stop("HP = 0");
_gatheringController.Stop("HP = 0");
StopAllDueToConditionFailed("HP = 0");
}
}
else if (_configuration.General.UseEscToCancelQuesting && _keyState[VirtualKey.ESCAPE])
{
if (!_taskQueue.AllTasksComplete)
{
Stop("ESC pressed");
_movementController.Stop();
_combatController.Stop("ESC pressed");
_gatheringController.Stop("ESC pressed");
StopAllDueToConditionFailed("ESC pressed");
}
}
@ -509,6 +511,14 @@ internal sealed class QuestController : MiniTaskController<QuestController>
}
}
private void StopAllDueToConditionFailed(string label)
{
Stop(label);
_movementController.Stop();
_combatController.Stop(label);
_gatheringController.Stop(label);
}
private void CheckNextTasks(string label)
{
if (AutomationType == EAutomationType.Automatic)