forked from aly/qstbak
muffin v7.4.19
This commit is contained in:
parent
f82b9ce2a2
commit
afafd5e377
9 changed files with 896 additions and 796 deletions
|
|
@ -101,6 +101,8 @@ internal sealed class QuestController : MiniTaskController<QuestController>
|
|||
|
||||
private readonly FateController _fateController;
|
||||
|
||||
private readonly SeasonalDutyController _seasonalDutyController;
|
||||
|
||||
private readonly QuestRegistry _questRegistry;
|
||||
|
||||
private readonly JournalData _journalData;
|
||||
|
|
@ -246,7 +248,7 @@ internal sealed class QuestController : MiniTaskController<QuestController>
|
|||
|
||||
public event AutomationTypeChangedEventHandler? AutomationTypeChanged;
|
||||
|
||||
public QuestController(IClientState clientState, IObjectTable objectTable, GameFunctions gameFunctions, QuestFunctions questFunctions, MovementController movementController, CombatController combatController, GatheringController gatheringController, FateController fateController, ILogger<QuestController> logger, QuestRegistry questRegistry, JournalData journalData, IKeyState keyState, IChatGui chatGui, ICondition condition, IToastGui toastGui, Configuration configuration, TaskCreator taskCreator, IServiceProvider serviceProvider, InterruptHandler interruptHandler, IDataManager dataManager, SinglePlayerDutyConfigComponent singlePlayerDutyConfigComponent, AutoDutyIpc autoDutyIpc, IDalamudPluginInterface pluginInterface)
|
||||
public QuestController(IClientState clientState, IObjectTable objectTable, GameFunctions gameFunctions, QuestFunctions questFunctions, MovementController movementController, CombatController combatController, GatheringController gatheringController, FateController fateController, SeasonalDutyController seasonalDutyController, ILogger<QuestController> logger, QuestRegistry questRegistry, JournalData journalData, IKeyState keyState, IChatGui chatGui, ICondition condition, IToastGui toastGui, Configuration configuration, TaskCreator taskCreator, IServiceProvider serviceProvider, InterruptHandler interruptHandler, IDataManager dataManager, SinglePlayerDutyConfigComponent singlePlayerDutyConfigComponent, AutoDutyIpc autoDutyIpc, IDalamudPluginInterface pluginInterface)
|
||||
: base(chatGui, condition, serviceProvider, interruptHandler, dataManager, logger)
|
||||
{
|
||||
_clientState = clientState;
|
||||
|
|
@ -257,6 +259,7 @@ internal sealed class QuestController : MiniTaskController<QuestController>
|
|||
_combatController = combatController;
|
||||
_gatheringController = gatheringController;
|
||||
_fateController = fateController;
|
||||
_seasonalDutyController = seasonalDutyController;
|
||||
_questRegistry = questRegistry;
|
||||
_journalData = journalData;
|
||||
_keyState = keyState;
|
||||
|
|
@ -922,6 +925,7 @@ internal sealed class QuestController : MiniTaskController<QuestController>
|
|||
_combatController.Stop("ClearTasksInternal");
|
||||
_gatheringController.Stop("ClearTasksInternal");
|
||||
_fateController.Stop("ClearTasksInternal");
|
||||
_seasonalDutyController.Stop("ClearTasksInternal");
|
||||
}
|
||||
|
||||
public override void Stop(string label)
|
||||
|
|
@ -949,6 +953,7 @@ internal sealed class QuestController : MiniTaskController<QuestController>
|
|||
_combatController.Stop(label);
|
||||
_gatheringController.Stop(label);
|
||||
_fateController.Stop(label);
|
||||
_seasonalDutyController.Stop(label);
|
||||
}
|
||||
|
||||
private void CheckNextTasks(string label)
|
||||
|
|
@ -1248,6 +1253,7 @@ internal sealed class QuestController : MiniTaskController<QuestController>
|
|||
_combatController.Stop("Execute next step");
|
||||
_gatheringController.Stop("Execute next step");
|
||||
_fateController.Stop("Execute next step");
|
||||
_seasonalDutyController.Stop("Execute next step");
|
||||
try
|
||||
{
|
||||
foreach (ITask item5 in _taskCreator.CreateTasks(CurrentQuest.Quest, CurrentQuest.Sequence, questSequence, step))
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ using Questionable.Controller.Steps.Common;
|
|||
using Questionable.Controller.Steps.Interactions;
|
||||
using Questionable.Controller.Steps.Movement;
|
||||
using Questionable.Controller.Steps.Shared;
|
||||
using Questionable.Functions;
|
||||
using Questionable.Model.Questing;
|
||||
|
||||
namespace Questionable.Controller;
|
||||
|
|
@ -17,6 +18,8 @@ internal sealed class SeasonalDutyController : MiniTaskController<SeasonalDutyCo
|
|||
{
|
||||
private readonly MovementController _movementController;
|
||||
|
||||
private readonly GameFunctions _gameFunctions;
|
||||
|
||||
private readonly IClientState _clientState;
|
||||
|
||||
private readonly ILogger<SeasonalDutyController> _logger;
|
||||
|
|
@ -49,10 +52,11 @@ internal sealed class SeasonalDutyController : MiniTaskController<SeasonalDutyCo
|
|||
}
|
||||
}
|
||||
|
||||
public SeasonalDutyController(IChatGui chatGui, ICondition condition, IServiceProvider serviceProvider, InterruptHandler interruptHandler, IDataManager dataManager, ILogger<SeasonalDutyController> logger, MovementController movementController, IClientState clientState)
|
||||
public SeasonalDutyController(IChatGui chatGui, ICondition condition, IServiceProvider serviceProvider, InterruptHandler interruptHandler, IDataManager dataManager, ILogger<SeasonalDutyController> logger, MovementController movementController, GameFunctions gameFunctions, IClientState clientState)
|
||||
: base(chatGui, condition, serviceProvider, interruptHandler, dataManager, logger)
|
||||
{
|
||||
_movementController = movementController;
|
||||
_gameFunctions = gameFunctions;
|
||||
_clientState = clientState;
|
||||
_logger = logger;
|
||||
}
|
||||
|
|
@ -89,26 +93,41 @@ internal sealed class SeasonalDutyController : MiniTaskController<SeasonalDutyCo
|
|||
|
||||
private void EnqueueDutyCycle()
|
||||
{
|
||||
if (_currentDuty != null)
|
||||
if (_currentDuty == null)
|
||||
{
|
||||
SeasonalDutyDefinition currentDuty = _currentDuty;
|
||||
_logger.LogInformation("Enqueuing seasonal duty cycle for {DutyName}", currentDuty.Name);
|
||||
if (_clientState.TerritoryType != currentDuty.TerritoryId && _clientState.TerritoryType != currentDuty.DutyTerritoryId)
|
||||
{
|
||||
_taskQueue.Enqueue(new AetheryteShortcut.Task(null, null, currentDuty.Aetheryte, currentDuty.TerritoryId));
|
||||
}
|
||||
if (currentDuty.AethernetShortcut != null)
|
||||
{
|
||||
_taskQueue.Enqueue(new AethernetShortcut.Task(currentDuty.AethernetShortcut.From, currentDuty.AethernetShortcut.To));
|
||||
}
|
||||
_taskQueue.Enqueue(new MoveTask(currentDuty.TerritoryId, currentDuty.NpcPosition, null, 3f));
|
||||
_taskQueue.Enqueue(new Mount.UnmountTask());
|
||||
_taskQueue.Enqueue(new Interact.Task(currentDuty.NpcDataId, null, EInteractionType.Interact, SkipMarkerCheck: true));
|
||||
_taskQueue.Enqueue(new WaitCondition.Task(() => _clientState.TerritoryType == _currentDuty.DutyTerritoryId, $"Wait(territory: {currentDuty.DutyTerritoryId})"));
|
||||
_taskQueue.Enqueue(new ClearObjectsWithAction.ClearTask(currentDuty.DataIds, currentDuty.Action, currentDuty.DutyTerritoryId, currentDuty.StopDistance, currentDuty.WaypointPositions));
|
||||
_taskQueue.Enqueue(new WaitCondition.Task(() => _clientState.TerritoryType != _currentDuty.DutyTerritoryId, "Wait(duty end)"));
|
||||
_taskQueue.Enqueue(new WaitAtEnd.WaitDelay(TimeSpan.FromSeconds(3L)));
|
||||
return;
|
||||
}
|
||||
SeasonalDutyDefinition duty = _currentDuty;
|
||||
_logger.LogInformation("Enqueuing seasonal duty cycle for {DutyName}", duty.Name);
|
||||
if (_clientState.TerritoryType != duty.DutyTerritoryId)
|
||||
{
|
||||
if (_clientState.TerritoryType != duty.TerritoryId)
|
||||
{
|
||||
_taskQueue.Enqueue(new AetheryteShortcut.Task(null, null, duty.Aetheryte, duty.TerritoryId));
|
||||
}
|
||||
if (duty.AethernetShortcut != null)
|
||||
{
|
||||
_taskQueue.Enqueue(new AethernetShortcut.Task(duty.AethernetShortcut.From, duty.AethernetShortcut.To));
|
||||
}
|
||||
_taskQueue.Enqueue(new MoveTask(duty.TerritoryId, duty.NpcPosition, null, 3f));
|
||||
_taskQueue.Enqueue(new Mount.UnmountTask());
|
||||
bool interacted = false;
|
||||
_taskQueue.Enqueue(new WaitCondition.Task(delegate
|
||||
{
|
||||
if (_clientState.TerritoryType == _currentDuty.DutyTerritoryId)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (!interacted)
|
||||
{
|
||||
interacted = _gameFunctions.InteractWith(duty.NpcDataId);
|
||||
}
|
||||
return false;
|
||||
}, $"InteractAndWait(territory: {duty.DutyTerritoryId})"));
|
||||
}
|
||||
_taskQueue.Enqueue(new ClearObjectsWithAction.ClearTask(duty.DataIds, duty.Action, duty.DutyTerritoryId, duty.StopDistance, duty.WaypointPositions));
|
||||
_taskQueue.Enqueue(new WaitCondition.Task(() => _clientState.TerritoryType != _currentDuty.DutyTerritoryId, "Wait(duty end)"));
|
||||
_taskQueue.Enqueue(new WaitAtEnd.WaitDelay(TimeSpan.FromSeconds(3L)));
|
||||
}
|
||||
|
||||
public override void Stop(string label)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue