muffin v7.38.8

This commit is contained in:
alydev 2025-11-30 10:36:46 +10:00
parent 5e2d8f648b
commit 3e10cbbbf2
51 changed files with 2585 additions and 1972 deletions

View file

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Numerics;
using System.Runtime.InteropServices;
using Dalamud.Game.ClientState.Conditions;
using Dalamud.Game.ClientState.Objects.Types;
using Dalamud.Plugin.Services;
using FFXIVClientStructs.FFXIV.Client.Game;
using Microsoft.Extensions.Logging;
@ -47,12 +48,17 @@ internal static class Jump
}
}
internal abstract class JumpBase<T>(MovementController movementController, IClientState clientState, IFramework framework) : TaskExecutor<T>() where T : class, IJumpTask
internal abstract class JumpBase<T>(MovementController movementController, IObjectTable objectTable, IFramework framework) : TaskExecutor<T>() where T : class, IJumpTask
{
protected unsafe override bool Start()
{
IGameObject gameObject = _003CobjectTable_003EP[0];
if (gameObject == null)
{
return false;
}
float num = base.Task.JumpDestination.CalculateStopDistance();
if ((_003CclientState_003EP.LocalPlayer.Position - base.Task.JumpDestination.Position).Length() <= num)
if ((gameObject.Position - base.Task.JumpDestination.Position).Length() <= num)
{
return false;
}
@ -94,8 +100,8 @@ internal static class Jump
internal sealed class DoSingleJump : JumpBase<SingleJumpTask>
{
public DoSingleJump(MovementController movementController, IClientState clientState, IFramework framework)
: base(movementController, clientState, framework)
public DoSingleJump(MovementController movementController, IObjectTable objectTable, IFramework framework)
: base(movementController, objectTable, framework)
{
}
}
@ -110,19 +116,19 @@ internal static class Jump
internal sealed class DoRepeatedJumps : JumpBase<RepeatedJumpTask>
{
private readonly IClientState _clientState;
private readonly IObjectTable _objectTable;
private DateTime _continueAt;
private int _attempts;
public DoRepeatedJumps(MovementController movementController, IClientState clientState, IFramework framework, ICondition condition, ILogger<DoRepeatedJumps> logger)
public DoRepeatedJumps(MovementController movementController, IObjectTable objectTable, IFramework framework, ICondition condition, ILogger<DoRepeatedJumps> logger)
{
_003Ccondition_003EP = condition;
_003Clogger_003EP = logger;
_clientState = clientState;
_objectTable = objectTable;
_continueAt = DateTime.MinValue;
base._002Ector(movementController, clientState, framework);
base._002Ector(movementController, objectTable, framework);
}
protected override bool Start()
@ -137,12 +143,17 @@ internal static class Jump
{
return ETaskResult.StillRunning;
}
float num = base.Task.JumpDestination.CalculateStopDistance();
if ((_clientState.LocalPlayer.Position - base.Task.JumpDestination.Position).Length() <= num || _clientState.LocalPlayer.Position.Y >= base.Task.JumpDestination.Position.Y - 0.5f)
IGameObject gameObject = _objectTable[0];
if (gameObject == null)
{
return ETaskResult.TaskComplete;
}
_003Clogger_003EP.LogTrace("Y-Heights for jumps: player={A}, target={B}", _clientState.LocalPlayer.Position.Y, base.Task.JumpDestination.Position.Y - 0.5f);
float num = base.Task.JumpDestination.CalculateStopDistance();
if ((gameObject.Position - base.Task.JumpDestination.Position).Length() <= num || gameObject.Position.Y >= base.Task.JumpDestination.Position.Y - 0.5f)
{
return ETaskResult.TaskComplete;
}
_003Clogger_003EP.LogTrace("Y-Heights for jumps: player={A}, target={B}", gameObject.Position.Y, base.Task.JumpDestination.Position.Y - 0.5f);
if (ActionManager.Instance()->UseAction(ActionType.GeneralAction, 2u, 3758096384uL, 0u, ActionManager.UseActionMode.None, 0u, null))
{
_attempts++;