punish v6.8.18.0
This commit is contained in:
commit
060278c1b7
317 changed files with 554155 additions and 0 deletions
|
@ -0,0 +1,61 @@
|
|||
using System;
|
||||
using Dalamud.Game.ClientState.Conditions;
|
||||
using Dalamud.Plugin.Services;
|
||||
using FFXIVClientStructs.FFXIV.Client.Game;
|
||||
using FFXIVClientStructs.FFXIV.Client.Game.Character;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Questionable.Controller.Steps.Movement;
|
||||
|
||||
internal sealed class LandExecutor(IClientState clientState, ICondition condition, ILogger<LandExecutor> logger) : TaskExecutor<LandTask>()
|
||||
{
|
||||
private bool _landing;
|
||||
|
||||
private DateTime _continueAt;
|
||||
|
||||
protected override bool Start()
|
||||
{
|
||||
if (!condition[ConditionFlag.InFlight])
|
||||
{
|
||||
logger.LogInformation("Not flying, not attempting to land");
|
||||
return false;
|
||||
}
|
||||
_landing = AttemptLanding();
|
||||
_continueAt = DateTime.Now.AddSeconds(0.25);
|
||||
return true;
|
||||
}
|
||||
|
||||
public override ETaskResult Update()
|
||||
{
|
||||
if (DateTime.Now < _continueAt)
|
||||
{
|
||||
return ETaskResult.StillRunning;
|
||||
}
|
||||
if (condition[ConditionFlag.InFlight])
|
||||
{
|
||||
if (!_landing)
|
||||
{
|
||||
_landing = AttemptLanding();
|
||||
_continueAt = DateTime.Now.AddSeconds(0.25);
|
||||
}
|
||||
return ETaskResult.StillRunning;
|
||||
}
|
||||
return ETaskResult.TaskComplete;
|
||||
}
|
||||
|
||||
private unsafe bool AttemptLanding()
|
||||
{
|
||||
Character* ptr = (Character*)(clientState.LocalPlayer?.Address ?? 0);
|
||||
if (ptr != null && ActionManager.Instance()->GetActionStatus(ActionType.GeneralAction, 23u, 3758096384uL, checkRecastActive: true, checkCastingActive: true, null) == 0)
|
||||
{
|
||||
logger.LogInformation("Attempting to land");
|
||||
return ActionManager.Instance()->UseAction(ActionType.GeneralAction, 23u, 3758096384uL, 0u, ActionManager.UseActionMode.None, 0u, null);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool ShouldInterruptOnDamage()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue