forked from aly/qstbak
306 lines
16 KiB
C#
306 lines
16 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Globalization;
|
|
using System.Linq;
|
|
using System.Numerics;
|
|
using System.Runtime.CompilerServices;
|
|
using System.Text;
|
|
using Dalamud.Game.ClientState.Objects.Enums;
|
|
using Dalamud.Game.ClientState.Objects.Types;
|
|
using Dalamud.Game.Text.SeStringHandling;
|
|
using Dalamud.Plugin.Services;
|
|
using Microsoft.Extensions.Logging;
|
|
using Questionable.Controller.Steps.Movement;
|
|
using Questionable.Functions;
|
|
using Questionable.Model;
|
|
using Questionable.Model.Gathering;
|
|
using Questionable.Model.Questing;
|
|
|
|
namespace Questionable.Controller.Steps.Gathering;
|
|
|
|
internal static class MoveToLandingLocation
|
|
{
|
|
internal sealed record Task(ushort TerritoryId, bool FlyBetweenNodes, GatheringNode GatheringNode) : ITask
|
|
{
|
|
[CompilerGenerated]
|
|
private Type EqualityContract
|
|
{
|
|
[CompilerGenerated]
|
|
get
|
|
{
|
|
return _206D_206E_202C_202B_206A_200C_200C_200B_200B_206B_206F_206D_206C_202B_206D_200C_202B_206D_200C_206D_206E_202A_206B_200C_202A_206D_202E_202C_200F_206C_202E_202C_200E_202B_202D_202D_202B_206F_202B_200C_202E(typeof(Task).TypeHandle);
|
|
}
|
|
}
|
|
|
|
[MethodImpl(MethodImplOptions.NoInlining)]
|
|
public override string ToString()
|
|
{
|
|
DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(5, 1);
|
|
defaultInterpolatedStringHandler.AppendLiteral(global::_003CModule_003E._202A_206B_206D_200C_206B_200E_200E_202A_200B_202E_206A_206F_206A_206B_200E_200D_200F_206D_206E_206A_206F_200C_206C_202C_202A_206E_202C_200B_206E_202A_206E_202B_206B_202E_202E_206A_206D_206D_202C_200F_202E<string>(-1985466382));
|
|
defaultInterpolatedStringHandler.AppendFormatted(FlyBetweenNodes);
|
|
return defaultInterpolatedStringHandler.ToStringAndClear();
|
|
}
|
|
|
|
[MethodImpl(MethodImplOptions.NoInlining)]
|
|
[CompilerGenerated]
|
|
private bool PrintMembers(StringBuilder builder)
|
|
{
|
|
_206B_206E_202E_202A_206D_200D_202D_200C_202C_202C_206D_206C_202A_206E_206B_202A_202A_206A_202E_206F_202A_200E_202E_202A_202D_206E_202E_202D_206A_202B_200B_206C_202B_200B_206B_206D_200F_206E_206F_206A_202E();
|
|
_206A_206F_206A_200E_206A_206E_202D_206A_202A_200B_206B_202B_200C_206A_206C_202B_200F_206B_202E_202D_202B_206C_202A_200B_202A_206D_202D_206F_200E_200F_206F_202E_202C_202D_206E_200C_202C_202A_202D_202D_202E(builder, global::_003CModule_003E._202E_206C_200F_206B_206A_202A_202C_206F_200C_206C_202B_206B_206D_206D_206D_202D_206E_202E_206C_206E_206D_202C_206F_200D_202D_202E_206A_206D_202A_206A_202B_200D_200C_206D_202B_200B_200D_200C_206E_206B_202E<string>(-1030915870));
|
|
_206A_206F_206A_200E_206A_206E_202D_206A_202A_200B_206B_202B_200C_206A_206C_202B_200F_206B_202E_202D_202B_206C_202A_200B_202A_206D_202D_206F_200E_200F_206F_202E_202C_202D_206E_200C_202C_202A_202D_202D_202E(builder, TerritoryId.ToString());
|
|
_206A_206F_206A_200E_206A_206E_202D_206A_202A_200B_206B_202B_200C_206A_206C_202B_200F_206B_202E_202D_202B_206C_202A_200B_202A_206D_202D_206F_200E_200F_206F_202E_202C_202D_206E_200C_202C_202A_202D_202D_202E(builder, global::_003CModule_003E._200B_206B_206B_200E_200B_206A_206D_206B_206E_200F_206A_206F_206E_202B_200F_206C_202B_206D_206E_200F_200C_200E_206F_200D_200F_200B_202B_202B_202B_202B_206D_202C_206A_206D_200B_206E_200D_206A_206F_200F_202E<string>(1326412835));
|
|
_206A_206F_206A_200E_206A_206E_202D_206A_202A_200B_206B_202B_200C_206A_206C_202B_200F_206B_202E_202D_202B_206C_202A_200B_202A_206D_202D_206F_200E_200F_206F_202E_202C_202D_206E_200C_202C_202A_202D_202D_202E(builder, FlyBetweenNodes.ToString());
|
|
_206A_206F_206A_200E_206A_206E_202D_206A_202A_200B_206B_202B_200C_206A_206C_202B_200F_206B_202E_202D_202B_206C_202A_200B_202A_206D_202D_206F_200E_200F_206F_202E_202C_202D_206E_200C_202C_202A_202D_202D_202E(builder, global::_003CModule_003E._202E_206C_200F_206B_206A_202A_202C_206F_200C_206C_202B_206B_206D_206D_206D_202D_206E_202E_206C_206E_206D_202C_206F_200D_202D_202E_206A_206D_202A_206A_202B_200D_200C_206D_202B_200B_200D_200C_206E_206B_202E<string>(-41827092));
|
|
_202C_200F_206A_206A_202C_200C_206F_206E_202E_202C_200C_206C_202B_202A_206B_206E_200D_206D_202A_200E_202E_200E_200C_202D_202C_202A_200F_206D_202A_202E_206C_202C_206F_202A_206F_200B_202B_202A_202A_206A_202E(builder, (object)GatheringNode);
|
|
return true;
|
|
}
|
|
|
|
[CompilerGenerated]
|
|
public bool Equals(Task? other)
|
|
{
|
|
int num = (((object)this == other) ? (-1523296508) : (-1523296507));
|
|
while (true)
|
|
{
|
|
int num2 = num;
|
|
int num3 = -1523296508;
|
|
int num4 = num2;
|
|
switch ((num4 | num3) - (num4 & num3))
|
|
{
|
|
case 7:
|
|
num = -1523296507;
|
|
break;
|
|
case 6:
|
|
num = ((!EqualityComparer<ushort>.Default.Equals(TerritoryId, other.TerritoryId)) ? (-1523296505) : (-1523296512));
|
|
break;
|
|
case 3:
|
|
return false;
|
|
case 1:
|
|
num = (((object)other == null) ? (-1523296505) : (-1523296506));
|
|
break;
|
|
case 4:
|
|
num = ((!EqualityComparer<bool>.Default.Equals(FlyBetweenNodes, other.FlyBetweenNodes)) ? (-1523296505) : (-1523296511));
|
|
break;
|
|
case 0:
|
|
return true;
|
|
case 5:
|
|
return EqualityComparer<Questionable.Model.Gathering.GatheringNode>.Default.Equals(GatheringNode, other.GatheringNode);
|
|
case 2:
|
|
num = ((!_200C_206D_202D_200F_206A_202B_206C_202A_206D_206E_202C_200F_202D_200D_206A_200D_202A_202E_206F_202B_206A_202A_206E_202A_206C_202C_202A_202B_206A_200E_206D_206D_202E_206E_202C_200C_200E_206D_202A_202C_202E(EqualityContract, other.EqualityContract)) ? (-1523296505) : (-1523296510));
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
bool IEquatable<Task>.Equals(Task? other)
|
|
{
|
|
//ILSpy generated this explicit interface implementation from .override directive in Equals
|
|
return this.Equals(other);
|
|
}
|
|
|
|
static Type _206D_206E_202C_202B_206A_200C_200C_200B_200B_206B_206F_206D_206C_202B_206D_200C_202B_206D_200C_206D_206E_202A_206B_200C_202A_206D_202E_202C_200F_206C_202E_202C_200E_202B_202D_202D_202B_206F_202B_200C_202E(RuntimeTypeHandle P_0)
|
|
{
|
|
return Type.GetTypeFromHandle(P_0);
|
|
}
|
|
|
|
static void _206B_206E_202E_202A_206D_200D_202D_200C_202C_202C_206D_206C_202A_206E_206B_202A_202A_206A_202E_206F_202A_200E_202E_202A_202D_206E_202E_202D_206A_202B_200B_206C_202B_200B_206B_206D_200F_206E_206F_206A_202E()
|
|
{
|
|
RuntimeHelpers.EnsureSufficientExecutionStack();
|
|
}
|
|
|
|
static StringBuilder _206A_206F_206A_200E_206A_206E_202D_206A_202A_200B_206B_202B_200C_206A_206C_202B_200F_206B_202E_202D_202B_206C_202A_200B_202A_206D_202D_206F_200E_200F_206F_202E_202C_202D_206E_200C_202C_202A_202D_202D_202E(StringBuilder P_0, string P_1)
|
|
{
|
|
return P_0.Append(P_1);
|
|
}
|
|
|
|
static StringBuilder _202C_200F_206A_206A_202C_200C_206F_206E_202E_202C_200C_206C_202B_202A_206B_206E_200D_206D_202A_200E_202E_200E_200C_202D_202C_202A_200F_206D_202A_202E_206C_202C_206F_202A_206F_200B_202B_202A_202A_206A_202E(StringBuilder P_0, object P_1)
|
|
{
|
|
return P_0.Append(P_1);
|
|
}
|
|
|
|
static bool _200C_206D_202D_200F_206A_202B_206C_202A_206D_206E_202C_200F_202D_200D_206A_200D_202A_202E_206F_202B_206A_202A_206E_202A_206C_202C_202A_202B_206A_200E_206D_206D_202E_206E_202C_200C_200E_206D_202A_202C_202E(Type P_0, Type P_1)
|
|
{
|
|
return P_0 == P_1;
|
|
}
|
|
}
|
|
|
|
internal sealed class MoveToLandingLocationExecutor(MoveExecutor moveExecutor, GameFunctions gameFunctions, IObjectTable objectTable, ILogger<MoveToLandingLocationExecutor> logger) : TaskExecutor<Task>(), IToastAware, ITaskExecutor
|
|
{
|
|
[CompilerGenerated]
|
|
private sealed class _003C_003Ec__DisplayClass6_0
|
|
{
|
|
public IGameObject gameObject;
|
|
|
|
internal bool _003CStart_003Eb__1(GatheringLocation x)
|
|
{
|
|
return Vector3.Distance(_206C_200F_206C_200E_202B_200C_202C_200E_206E_202D_202B_206C_202D_202B_202D_206E_200F_202E_206B_206E_200C_200D_202E_206E_200E_200C_202A_206C_206F_206B_206B_202D_200C_202D_200B_206F_200C_202A_206E_200F_202E(x), _206F_206F_200C_206F_206B_202A_200F_200D_206C_202D_206B_206B_202D_202C_200B_206F_206D_206D_206D_200C_200F_206F_206A_200D_202D_206D_206C_206D_202C_202D_202B_200D_200D_200E_200B_206E_202C_206E_202C_200D_202E(gameObject)) < 0.1f;
|
|
}
|
|
|
|
static Vector3 _206C_200F_206C_200E_202B_200C_202C_200E_206E_202D_202B_206C_202D_202B_202D_206E_200F_202E_206B_206E_200C_200D_202E_206E_200E_200C_202A_206C_206F_206B_206B_202D_200C_202D_200B_206F_200C_202A_206E_200F_202E(GatheringLocation P_0)
|
|
{
|
|
return P_0.Position;
|
|
}
|
|
|
|
static Vector3 _206F_206F_200C_206F_206B_202A_200F_200D_206C_202D_206B_206B_202D_202C_200B_206F_206D_206D_206D_200C_200F_206F_206A_200D_202D_206D_206C_206D_202C_202D_202B_200D_200D_200E_200B_206E_202C_206E_202C_200D_202E(IGameObject P_0)
|
|
{
|
|
return P_0.Position;
|
|
}
|
|
}
|
|
|
|
private ITask _moveTask;
|
|
|
|
[MethodImpl(MethodImplOptions.NoInlining)]
|
|
protected override bool Start()
|
|
{
|
|
GatheringLocation gatheringLocation = _202B_202D_206F_206B_202D_200B_200E_200F_200D_200F_202D_206E_200E_202C_200C_206C_206C_200F_202B_202C_200B_200E_202C_206F_206D_206A_200F_200D_206D_202D_200E_200B_206F_202D_206C_206C_206C_200D_206B_206C_202E(base.Task.GatheringNode).First();
|
|
int num = ((_202B_202D_206F_206B_202D_200B_200E_200F_200D_200F_202D_206E_200E_202C_200C_206C_206C_200F_202B_202C_200B_200E_202C_206F_206D_206A_200F_200D_206D_202D_200E_200B_206F_202D_206C_206C_206C_200D_206B_206C_202E(base.Task.GatheringNode).Count <= 1) ? (-148025039) : (-148025036));
|
|
_003C_003Ec__DisplayClass6_0 _003C_003Ec__DisplayClass6_ = default(_003C_003Ec__DisplayClass6_0);
|
|
Vector3 vector = default(Vector3);
|
|
while (true)
|
|
{
|
|
int num2 = num;
|
|
int num3 = -148025039;
|
|
int num4 = num2;
|
|
int num5;
|
|
bool flag;
|
|
ushort territoryId;
|
|
Vector3 destination;
|
|
float? stopDistance;
|
|
uint? dataId;
|
|
bool fly;
|
|
switch ((num4 | num3) - (num4 & num3))
|
|
{
|
|
case 3:
|
|
num5 = 0;
|
|
goto IL_0086;
|
|
case 4:
|
|
return false;
|
|
case 5:
|
|
_003C_003Ec__DisplayClass6_ = new _003C_003Ec__DisplayClass6_0();
|
|
_003C_003Ec__DisplayClass6_.gameObject = objectTable.SingleOrDefault(delegate(IGameObject x)
|
|
{
|
|
int num8 = ((_202D_202A_206A_206A_206A_202C_200E_206E_200D_202C_206A_206A_200E_206E_200E_200D_200C_202E_200E_200D_202B_206E_202A_200E_200C_202D_202A_200F_206A_206A_206D_200F_200C_202B_202D_206E_206D_206F_206B_202A_202E(x) != ObjectKind.GatheringPoint) ? 412306684 : 412306686);
|
|
while (true)
|
|
{
|
|
int num9 = num8;
|
|
int num10 = 412306687;
|
|
int num11 = num9;
|
|
int num12 = num11 + num10;
|
|
int num13 = num11 & num10;
|
|
switch (num12 - (num13 + num13))
|
|
{
|
|
case 0:
|
|
num8 = 412306686;
|
|
break;
|
|
case 2:
|
|
return _206E_202D_206F_200D_206C_206F_206E_206F_200E_200B_206F_200D_206D_202B_206A_200F_206E_202A_202E_202E_206B_202C_200B_202D_202A_202A_200F_202D_206F_200B_202D_200C_202B_202E_200D_206E_200D_206A_206F_206D_202E(x);
|
|
case 3:
|
|
return false;
|
|
case 1:
|
|
num8 = ((_202D_202A_206D_202C_206F_206C_202A_206D_202B_202A_206F_206D_206C_202B_202E_200B_202A_206D_200F_200B_200F_202A_202E_200E_202A_200B_202A_200E_206F_202C_200D_206B_206D_202D_206C_206A_206A_206B_202D_202B_202E(x) != _202A_202B_206B_202E_200F_206B_202C_206D_206F_202C_202A_200F_202E_202E_206F_200D_206D_206E_206D_202D_200F_200E_202B_206B_206E_206E_206B_202C_200B_200D_206B_200D_206A_200E_206C_202D_200D_206D_200F_200C_202E(base.Task.GatheringNode)) ? 412306684 : 412306685);
|
|
break;
|
|
}
|
|
}
|
|
});
|
|
num = ((_003C_003Ec__DisplayClass6_.gameObject != null) ? (-148025037) : (-148025035));
|
|
break;
|
|
case 0:
|
|
{
|
|
int num6;
|
|
float num7;
|
|
(vector, num6, num7) = _206D_202A_202C_202B_200E_200B_206F_202C_202B_200F_200D_202C_200D_202E_206C_202C_202B_206C_206A_206A_202D_206B_200D_206C_200B_206C_206E_200E_200F_200C_200C_202A_202E_206B_200F_206E_200F_206B_206E_202D_202E(gatheringLocation);
|
|
_202C_200B_200F_206D_200B_202B_202B_206C_200F_206D_202C_200B_202C_206A_206D_202E_200F_200E_202E_206C_206B_202C_206F_206D_206D_202B_200D_202D_200C_206F_202C_200F_202A_200F_200D_200F_202E_200E_206A_206B_202E((ILogger)logger, global::_003CModule_003E._202D_206D_206A_206E_202C_202B_200C_206C_200E_206A_206D_200E_206A_202A_200C_202E_206E_202C_206F_200B_206D_206F_200C_202C_200B_202B_200F_200B_206A_206F_200F_202E_206B_200E_202B_202A_200F_200B_202A_200E_202E<string>(-1690558388), new object[3]
|
|
{
|
|
vector.ToString(global::_003CModule_003E._200B_206B_206B_200E_200B_206A_206D_206B_206E_200F_206A_206F_206E_202B_200F_206C_202B_206D_206E_200F_200C_200E_206F_200D_200F_200B_202B_202B_202B_202B_206D_202C_206A_206D_200B_206E_200D_206A_206F_200F_202E<string>(-1318690943), _200D_202B_202B_206A_206B_206D_206A_202B_200B_206E_206E_200E_202B_200C_206C_206E_200C_206C_202E_202A_200C_200B_206C_206A_206C_206F_206B_200E_202A_202B_202A_206B_200D_202A_202A_206D_202A_202B_206C_202A_202E()),
|
|
num6,
|
|
num7
|
|
});
|
|
num = ((!base.Task.FlyBetweenNodes) ? (-148025038) : (-148025040));
|
|
break;
|
|
}
|
|
case 6:
|
|
num = -148025036;
|
|
break;
|
|
case 1:
|
|
num5 = (gameFunctions.IsFlyingUnlocked(base.Task.TerritoryId) ? 1 : 0);
|
|
goto IL_0086;
|
|
case 2:
|
|
{
|
|
gatheringLocation = _202B_202D_206F_206B_202D_200B_200E_200F_200D_200F_202D_206E_200E_202C_200C_206C_206C_200F_202B_202C_200B_200E_202C_206F_206D_206A_200F_200D_206D_202D_200E_200B_206F_202D_206C_206C_206C_200D_206B_206C_202E(base.Task.GatheringNode).Single(_003C_003Ec__DisplayClass6_._003CStart_003Eb__1);
|
|
num = -148025039;
|
|
break;
|
|
}
|
|
IL_0086:
|
|
flag = (byte)num5 != 0;
|
|
territoryId = base.Task.TerritoryId;
|
|
destination = vector;
|
|
stopDistance = 0.25f;
|
|
dataId = _202A_202B_206B_202E_200F_206B_202C_206D_206F_202C_202A_200F_202E_202E_206F_200D_206D_206E_206D_202D_200F_200E_202B_206B_206E_206E_206B_202C_200B_200D_206B_200D_206A_200E_206C_202D_200D_206D_200F_200C_202E(base.Task.GatheringNode);
|
|
fly = flag;
|
|
_moveTask = new MoveTask(territoryId, destination, null, MountRequired: false, DismountRequired: false, stopDistance, dataId, DisableNavmesh: false, null, fly, Land: false, IgnoreDistanceToObject: true, RestartNavigation: true, EInteractionType.Gather);
|
|
return moveExecutor.Start(_moveTask);
|
|
}
|
|
}
|
|
}
|
|
|
|
public override ETaskResult Update()
|
|
{
|
|
return moveExecutor.Update();
|
|
}
|
|
|
|
public bool OnErrorToast(SeString message)
|
|
{
|
|
return moveExecutor.OnErrorToast(message);
|
|
}
|
|
|
|
bool IToastAware.OnErrorToast(SeString message)
|
|
{
|
|
//ILSpy generated this explicit interface implementation from .override directive in OnErrorToast
|
|
return this.OnErrorToast(message);
|
|
}
|
|
|
|
public override bool ShouldInterruptOnDamage()
|
|
{
|
|
return moveExecutor.ShouldInterruptOnDamage();
|
|
}
|
|
|
|
static List<GatheringLocation> _202B_202D_206F_206B_202D_200B_200E_200F_200D_200F_202D_206E_200E_202C_200C_206C_206C_200F_202B_202C_200B_200E_202C_206F_206D_206A_200F_200D_206D_202D_200E_200B_206F_202D_206C_206C_206C_200D_206B_206C_202E(GatheringNode P_0)
|
|
{
|
|
return P_0.Locations;
|
|
}
|
|
|
|
static (Vector3, int, float) _206D_202A_202C_202B_200E_200B_206F_202C_202B_200F_200D_202C_200D_202E_206C_202C_202B_206C_206A_206A_202D_206B_200D_206C_200B_206C_206E_200E_200F_200C_200C_202A_202E_206B_200F_206E_200F_206B_206E_202D_202E(GatheringLocation P_0)
|
|
{
|
|
return GatheringMath.CalculateLandingLocation(P_0);
|
|
}
|
|
|
|
static CultureInfo _200D_202B_202B_206A_206B_206D_206A_202B_200B_206E_206E_200E_202B_200C_206C_206E_200C_206C_202E_202A_200C_200B_206C_206A_206C_206F_206B_200E_202A_202B_202A_206B_200D_202A_202A_206D_202A_202B_206C_202A_202E()
|
|
{
|
|
return CultureInfo.InvariantCulture;
|
|
}
|
|
|
|
static void _202C_200B_200F_206D_200B_202B_202B_206C_200F_206D_202C_200B_202C_206A_206D_202E_200F_200E_202E_206C_206B_202C_206F_206D_206D_202B_200D_202D_200C_206F_202C_200F_202A_200F_200D_200F_202E_200E_206A_206B_202E(ILogger P_0, string P_1, object[] P_2)
|
|
{
|
|
P_0.LogDebug(P_1, P_2);
|
|
}
|
|
|
|
static uint _202A_202B_206B_202E_200F_206B_202C_206D_206F_202C_202A_200F_202E_202E_206F_200D_206D_206E_206D_202D_200F_200E_202B_206B_206E_206E_206B_202C_200B_200D_206B_200D_206A_200E_206C_202D_200D_206D_200F_200C_202E(GatheringNode P_0)
|
|
{
|
|
return P_0.DataId;
|
|
}
|
|
|
|
static ObjectKind _202D_202A_206A_206A_206A_202C_200E_206E_200D_202C_206A_206A_200E_206E_200E_200D_200C_202E_200E_200D_202B_206E_202A_200E_200C_202D_202A_200F_206A_206A_206D_200F_200C_202B_202D_206E_206D_206F_206B_202A_202E(IGameObject P_0)
|
|
{
|
|
return P_0.ObjectKind;
|
|
}
|
|
|
|
static uint _202D_202A_206D_202C_206F_206C_202A_206D_202B_202A_206F_206D_206C_202B_202E_200B_202A_206D_200F_200B_200F_202A_202E_200E_202A_200B_202A_200E_206F_202C_200D_206B_206D_202D_206C_206A_206A_206B_202D_202B_202E(IGameObject P_0)
|
|
{
|
|
return P_0.BaseId;
|
|
}
|
|
|
|
static bool _206E_202D_206F_200D_206C_206F_206E_206F_200E_200B_206F_200D_206D_202B_206A_200F_206E_202A_202E_202E_206B_202C_200B_202D_202A_202A_200F_202D_206F_200B_202D_200C_202B_202E_200D_206E_200D_206A_206F_206D_202E(IGameObject P_0)
|
|
{
|
|
return P_0.IsTargetable;
|
|
}
|
|
}
|
|
}
|