580 lines
20 KiB
C#
580 lines
20 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Runtime.CompilerServices;
|
|
using System.Text;
|
|
using Dalamud.Plugin.Services;
|
|
using FFXIVClientStructs.FFXIV.Client.Game;
|
|
using FFXIVClientStructs.FFXIV.Client.UI.Agent;
|
|
using FFXIVClientStructs.FFXIV.Component.GUI;
|
|
using FFXIVClientStructs.Interop;
|
|
using LLib.GameUI;
|
|
|
|
namespace LLib.Shop;
|
|
|
|
public static class SatisfactionSupplyActions
|
|
{
|
|
public readonly record struct NpcState(int Rank, int SatisfactionCurrent, int SatisfactionMax, int UsedDeliveries)
|
|
{
|
|
[MethodImpl(MethodImplOptions.NoInlining)]
|
|
[CompilerGenerated]
|
|
public override string ToString()
|
|
{
|
|
StringBuilder stringBuilder = _206F_200F_202A_202D_202C_206E_202E_202A_202A_202D_200F_202B_206E_206D_206C_202B_206E_206B_200D_200C_200D_200C_200C_200E_202B_202D_200D_202E_206D_206C_200D_202A_202D_200D_206B_202A_206F_200B_202E_200D_202E();
|
|
_202E_206E_202A_200B_206C_202C_206A_206E_206D_202E_206D_202B_202A_206B_202E_206D_200D_206B_200E_202D_206E_202E_206F_206B_206C_200D_206B_200D_200C_202A_202B_206E_200E_206E_206B_200E_206A_200D_206B_200C_202E(stringBuilder, global::_003CModule_003E._206E_202B_206C_202A_202A_200E_202B_202B_206D_200B_200C_206B_200B_206D_202E_202D_206C_202B_200B_206A_202D_206C_202A_200F_202D_200C_200B_200B_200B_200D_202C_206E_206D_202E_200C_206B_206A_206D_202D_202C_202E<string>(-1314736612));
|
|
_202E_206E_202A_200B_206C_202C_206A_206E_206D_202E_206D_202B_202A_206B_202E_206D_200D_206B_200E_202D_206E_202E_206F_206B_206C_200D_206B_200D_200C_202A_202B_206E_200E_206E_206B_200E_206A_200D_206B_200C_202E(stringBuilder, global::_003CModule_003E._206A_206D_202C_206E_206D_206E_202A_200F_200D_206A_200F_206C_202C_202D_206D_206A_200D_200F_206A_206C_202C_206D_206E_200F_200F_200C_206B_200B_206B_206E_202B_206B_200E_200E_200B_206F_200F_202E_200C_200C_202E<string>(1581517409));
|
|
int num = ((!PrintMembers(stringBuilder)) ? 745418664 : 745418667);
|
|
while (true)
|
|
{
|
|
int num2 = num;
|
|
int num3 = 745418666;
|
|
int num4 = num2;
|
|
int num5 = num4 + num3;
|
|
int num6 = num4 & num3;
|
|
switch (num5 - (num6 + num6))
|
|
{
|
|
case 2:
|
|
_200E_206F_202E_202A_202C_200C_200F_202D_206C_202D_200E_202A_202D_202B_200F_200C_202C_206A_200B_200B_202E_206D_206D_200E_200F_206A_202D_206A_200D_200F_200C_206D_206D_206B_200E_202E_200E_202A_202A_206F_202E(stringBuilder, '}');
|
|
return _200C_200F_200B_200C_200C_202C_200E_200E_200C_202D_202C_200F_206F_200C_206C_206D_200F_206C_206E_200B_202E_200F_202C_206B_206D_206A_200D_202C_206B_206D_200E_200F_202B_206E_200E_202E_200C_202A_202B_206F_202E((object)stringBuilder);
|
|
case 1:
|
|
_200E_206F_202E_202A_202C_200C_200F_202D_206C_202D_200E_202A_202D_202B_200F_200C_202C_206A_200B_200B_202E_206D_206D_200E_200F_206A_202D_206A_200D_200F_200C_206D_206D_206B_200E_202E_200E_202A_202A_206F_202E(stringBuilder, ' ');
|
|
num = 745418664;
|
|
break;
|
|
case 0:
|
|
num = 745418667;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
[MethodImpl(MethodImplOptions.NoInlining)]
|
|
[CompilerGenerated]
|
|
private bool PrintMembers(StringBuilder builder)
|
|
{
|
|
_202E_206E_202A_200B_206C_202C_206A_206E_206D_202E_206D_202B_202A_206B_202E_206D_200D_206B_200E_202D_206E_202E_206F_206B_206C_200D_206B_200D_200C_202A_202B_206E_200E_206E_206B_200E_206A_200D_206B_200C_202E(builder, global::_003CModule_003E._200E_206F_206C_206C_200E_202A_206D_206B_200B_202D_202B_200F_200F_206B_206C_206F_202D_206F_206A_202D_206A_200B_200B_202B_202D_202C_200F_200D_202E_200E_200D_202A_202B_206F_202E_200E_200B_206B_200E_202E_202E<string>(2105858442));
|
|
_202E_206E_202A_200B_206C_202C_206A_206E_206D_202E_206D_202B_202A_206B_202E_206D_200D_206B_200E_202D_206E_202E_206F_206B_206C_200D_206B_200D_200C_202A_202B_206E_200E_206E_206B_200E_206A_200D_206B_200C_202E(builder, Rank.ToString());
|
|
_202E_206E_202A_200B_206C_202C_206A_206E_206D_202E_206D_202B_202A_206B_202E_206D_200D_206B_200E_202D_206E_202E_206F_206B_206C_200D_206B_200D_200C_202A_202B_206E_200E_206E_206B_200E_206A_200D_206B_200C_202E(builder, global::_003CModule_003E._200E_206F_206C_206C_200E_202A_206D_206B_200B_202D_202B_200F_200F_206B_206C_206F_202D_206F_206A_202D_206A_200B_200B_202B_202D_202C_200F_200D_202E_200E_200D_202A_202B_206F_202E_200E_200B_206B_200E_202E_202E<string>(2014742517));
|
|
_202E_206E_202A_200B_206C_202C_206A_206E_206D_202E_206D_202B_202A_206B_202E_206D_200D_206B_200E_202D_206E_202E_206F_206B_206C_200D_206B_200D_200C_202A_202B_206E_200E_206E_206B_200E_206A_200D_206B_200C_202E(builder, SatisfactionCurrent.ToString());
|
|
_202E_206E_202A_200B_206C_202C_206A_206E_206D_202E_206D_202B_202A_206B_202E_206D_200D_206B_200E_202D_206E_202E_206F_206B_206C_200D_206B_200D_200C_202A_202B_206E_200E_206E_206B_200E_206A_200D_206B_200C_202E(builder, global::_003CModule_003E._200E_206F_206C_206C_200E_202A_206D_206B_200B_202D_202B_200F_200F_206B_206C_206F_202D_206F_206A_202D_206A_200B_200B_202B_202D_202C_200F_200D_202E_200E_200D_202A_202B_206F_202E_200E_200B_206B_200E_202E_202E<string>(1923626592));
|
|
_202E_206E_202A_200B_206C_202C_206A_206E_206D_202E_206D_202B_202A_206B_202E_206D_200D_206B_200E_202D_206E_202E_206F_206B_206C_200D_206B_200D_200C_202A_202B_206E_200E_206E_206B_200E_206A_200D_206B_200C_202E(builder, SatisfactionMax.ToString());
|
|
_202E_206E_202A_200B_206C_202C_206A_206E_206D_202E_206D_202B_202A_206B_202E_206D_200D_206B_200E_202D_206E_202E_206F_206B_206C_200D_206B_200D_200C_202A_202B_206E_200E_206E_206B_200E_206A_200D_206B_200C_202E(builder, global::_003CModule_003E._206E_202B_206C_202A_202A_200E_202B_202B_206D_200B_200C_206B_200B_206D_202E_202D_206C_202B_200B_206A_202D_206C_202A_200F_202D_200C_200B_200B_200B_200D_202C_206E_206D_202E_200C_206B_206A_206D_202D_202C_202E<string>(564142829));
|
|
_202E_206E_202A_200B_206C_202C_206A_206E_206D_202E_206D_202B_202A_206B_202E_206D_200D_206B_200E_202D_206E_202E_206F_206B_206C_200D_206B_200D_200C_202A_202B_206E_200E_206E_206B_200E_206A_200D_206B_200C_202E(builder, UsedDeliveries.ToString());
|
|
return true;
|
|
}
|
|
|
|
[CompilerGenerated]
|
|
public bool Equals(NpcState other)
|
|
{
|
|
int num = ((!EqualityComparer<int>.Default.Equals(Rank, other.Rank)) ? 1376880194 : 1376880192);
|
|
while (true)
|
|
{
|
|
int num2 = num;
|
|
int num3 = 1376880193;
|
|
int num4 = num2;
|
|
int num5 = num4 + num3;
|
|
int num6 = num4 & num3;
|
|
switch (num5 - (num6 + num6))
|
|
{
|
|
case 0:
|
|
return EqualityComparer<int>.Default.Equals(UsedDeliveries, other.UsedDeliveries);
|
|
case 3:
|
|
return false;
|
|
case 4:
|
|
num = ((!EqualityComparer<int>.Default.Equals(SatisfactionMax, other.SatisfactionMax)) ? 1376880194 : 1376880193);
|
|
break;
|
|
case 2:
|
|
num = 1376880192;
|
|
break;
|
|
case 1:
|
|
num = ((!EqualityComparer<int>.Default.Equals(SatisfactionCurrent, other.SatisfactionCurrent)) ? 1376880194 : 1376880197);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
bool IEquatable<NpcState>.Equals(NpcState other)
|
|
{
|
|
//ILSpy generated this explicit interface implementation from .override directive in Equals
|
|
return this.Equals(other);
|
|
}
|
|
|
|
static StringBuilder _206F_200F_202A_202D_202C_206E_202E_202A_202A_202D_200F_202B_206E_206D_206C_202B_206E_206B_200D_200C_200D_200C_200C_200E_202B_202D_200D_202E_206D_206C_200D_202A_202D_200D_206B_202A_206F_200B_202E_200D_202E()
|
|
{
|
|
return new StringBuilder();
|
|
}
|
|
|
|
static StringBuilder _202E_206E_202A_200B_206C_202C_206A_206E_206D_202E_206D_202B_202A_206B_202E_206D_200D_206B_200E_202D_206E_202E_206F_206B_206C_200D_206B_200D_200C_202A_202B_206E_200E_206E_206B_200E_206A_200D_206B_200C_202E(StringBuilder P_0, string P_1)
|
|
{
|
|
return P_0.Append(P_1);
|
|
}
|
|
|
|
static StringBuilder _200E_206F_202E_202A_202C_200C_200F_202D_206C_202D_200E_202A_202D_202B_200F_200C_202C_206A_200B_200B_202E_206D_206D_200E_200F_206A_202D_206A_200D_200F_200C_206D_206D_206B_200E_202E_200E_202A_202A_206F_202E(StringBuilder P_0, char P_1)
|
|
{
|
|
return P_0.Append(P_1);
|
|
}
|
|
|
|
static string _200C_200F_200B_200C_200C_202C_200E_200E_200C_202D_202C_200F_206F_200C_206C_206D_200F_206C_206E_200B_202E_200F_202C_206B_206D_206A_200D_202C_206B_206D_200E_200F_202B_206E_200E_202E_200C_202A_202B_206F_202E(object P_0)
|
|
{
|
|
return P_0.ToString();
|
|
}
|
|
}
|
|
|
|
private const string SatisfactionSupplyAddon = "SatisfactionSupply";
|
|
|
|
private const string SatisfactionSupplyResultAddon = "SatisfactionSupplyResult";
|
|
|
|
private const string TalkAddon = "Talk";
|
|
|
|
[MethodImpl(MethodImplOptions.NoInlining)]
|
|
public unsafe static bool IsSatisfactionSupplyReady(IGameGui gameGui)
|
|
{
|
|
AtkUnitBase* addonPtr;
|
|
int num = (gameGui.TryGetAddonByName<AtkUnitBase>(global::_003CModule_003E._206E_202B_206C_202A_202A_200E_202B_202B_206D_200B_200C_206B_200B_206D_202E_202D_206C_202B_200B_206A_202D_206C_202A_200F_202D_200C_200B_200B_200B_200D_202C_206E_206D_202E_200C_206B_206A_206D_202D_202C_202E<string>(-799124681), out addonPtr) ? 288080028 : 288080031);
|
|
while (true)
|
|
{
|
|
int num2 = num;
|
|
int num3 = 288080030;
|
|
int num4 = num2;
|
|
int num5 = num4 + num3;
|
|
int num6 = num4 & num3;
|
|
switch (num5 - (num6 + num6))
|
|
{
|
|
case 0:
|
|
goto IL_0054;
|
|
case 2:
|
|
return LAddon.IsAddonReady(addonPtr);
|
|
case 1:
|
|
return false;
|
|
}
|
|
continue;
|
|
IL_0054:
|
|
num = 288080031;
|
|
}
|
|
}
|
|
|
|
[MethodImpl(MethodImplOptions.NoInlining)]
|
|
public unsafe static bool IsSatisfactionSupplyFullyReady(IGameGui gameGui)
|
|
{
|
|
AtkUnitBase* addonPtr;
|
|
int num = (gameGui.TryGetAddonByName<AtkUnitBase>(global::_003CModule_003E._206A_202C_200C_206F_202A_200C_200F_206F_202B_202B_200D_206F_206D_200E_206A_206B_202A_200F_200B_206C_202B_202A_202B_206C_200F_206C_202C_202C_200C_206C_206F_200C_200B_202D_200E_202A_202A_206B_206B_200F_202E<string>(1887910937), out addonPtr) ? (-536091870) : (-536091865));
|
|
AgentSatisfactionSupply* ptr = default(AgentSatisfactionSupply*);
|
|
while (true)
|
|
{
|
|
int num2 = num;
|
|
int num3 = -536091868;
|
|
int num4 = num2;
|
|
switch ((num4 | num3) - (num4 & num3))
|
|
{
|
|
case 1:
|
|
ptr = AgentSatisfactionSupply.Instance();
|
|
num = ((ptr == null) ? (-536091871) : (-536091872));
|
|
break;
|
|
case 2:
|
|
return ptr->NpcInfo.Initialized;
|
|
case 6:
|
|
num = (LAddon.IsAddonReady(addonPtr) ? (-536091867) : (-536091869));
|
|
break;
|
|
case 7:
|
|
return false;
|
|
case 8:
|
|
num = ((!ptr->NpcInfo.Valid) ? (-536091871) : (-536091866));
|
|
break;
|
|
case 0:
|
|
num = -536091865;
|
|
break;
|
|
case 4:
|
|
num = ((!ptr->IsAgentActive()) ? (-536091871) : (-536091860));
|
|
break;
|
|
case 5:
|
|
return false;
|
|
case 3:
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
|
|
public unsafe static bool TrySelectDeliverySlot(IGameGui gameGui, int slot)
|
|
{
|
|
int num = (IsSatisfactionSupplyFullyReady(gameGui) ? 1316647877 : 1316647878);
|
|
while (true)
|
|
{
|
|
int num2 = num;
|
|
int num3 = 1316647876;
|
|
int num4 = num2;
|
|
switch ((num4 | num3) - (num4 & num3))
|
|
{
|
|
case 1:
|
|
{
|
|
AgentSatisfactionSupply* ptr = AgentSatisfactionSupply.Instance();
|
|
AtkValue atkValue = new AtkValue();
|
|
Span<AtkValue> span = stackalloc AtkValue[2];
|
|
span[0].SetInt(1);
|
|
span[1].SetInt(slot);
|
|
ptr->ReceiveEvent(&atkValue, span.GetPointer(0), 2u, 0uL);
|
|
return true;
|
|
}
|
|
case 2:
|
|
return false;
|
|
case 0:
|
|
goto IL_009f;
|
|
}
|
|
continue;
|
|
IL_009f:
|
|
num = 1316647878;
|
|
}
|
|
}
|
|
|
|
[MethodImpl(MethodImplOptions.NoInlining)]
|
|
public unsafe static bool TryCloseSatisfactionSupply(IGameGui gameGui)
|
|
{
|
|
AtkUnitBase* addonPtr;
|
|
int num = (gameGui.TryGetAddonByName<AtkUnitBase>(global::_003CModule_003E._202E_202C_206D_206B_202B_202D_206D_202E_206F_202E_202A_206A_206A_202B_206A_202D_202C_206C_206B_202C_206E_202B_200E_206E_206A_206C_200D_200D_200F_200B_202C_200B_200E_206F_202C_200F_202D_202A_206E_202B_202E<string>(-304354033), out addonPtr) ? (-1559808430) : (-1559808431));
|
|
while (true)
|
|
{
|
|
int num2 = num;
|
|
int num3 = -1559808429;
|
|
int num4 = num2;
|
|
switch ((num4 | num3) - (num4 & num3))
|
|
{
|
|
case 0:
|
|
goto IL_0052;
|
|
case 1:
|
|
addonPtr->FireCallbackInt(0);
|
|
return true;
|
|
case 2:
|
|
return false;
|
|
}
|
|
continue;
|
|
IL_0052:
|
|
num = -1559808431;
|
|
}
|
|
}
|
|
|
|
[MethodImpl(MethodImplOptions.NoInlining)]
|
|
public unsafe static bool IsTalkInProgress(IGameGui gameGui)
|
|
{
|
|
AtkUnitBase* addonPtr;
|
|
int num = (gameGui.TryGetAddonByName<AtkUnitBase>(global::_003CModule_003E._206A_206D_202C_206E_206D_206E_202A_200F_200D_206A_200F_206C_202C_202D_206D_206A_200D_200F_206A_206C_202C_206D_206E_200F_200F_200C_206B_200B_206B_206E_202B_206B_200E_200E_200B_206F_200F_202E_200C_200C_202E<string>(-5198087), out addonPtr) ? 208572511 : 208572508);
|
|
while (true)
|
|
{
|
|
int num2 = num;
|
|
int num3 = 208572510;
|
|
int num4 = num2;
|
|
int num5 = num4 + num3;
|
|
int num6 = num4 & num3;
|
|
switch (num5 - (num6 + num6))
|
|
{
|
|
case 3:
|
|
num = 208572508;
|
|
break;
|
|
case 0:
|
|
return LAddon.IsAddonReady(addonPtr);
|
|
case 2:
|
|
return false;
|
|
case 4:
|
|
return false;
|
|
case 1:
|
|
num = ((!addonPtr->IsVisible) ? 208572506 : 208572510);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
[MethodImpl(MethodImplOptions.NoInlining)]
|
|
public unsafe static bool TryProgressTalk(IGameGui gameGui)
|
|
{
|
|
AtkUnitBase* addonPtr;
|
|
int num = (gameGui.TryGetAddonByName<AtkUnitBase>(global::_003CModule_003E._202E_202C_206D_206B_202B_202D_206D_202E_206F_202E_202A_206A_206A_202B_206A_202D_202C_206C_206B_202C_206E_202B_200E_206E_206A_206C_200D_200D_200F_200B_202C_200B_200E_206F_202C_200F_202D_202A_206E_202B_202E<string>(1257507185), out addonPtr) ? 1712398322 : 1712398327);
|
|
while (true)
|
|
{
|
|
int num2 = num;
|
|
int num3 = 1712398326;
|
|
int num4 = num2;
|
|
switch ((num4 | num3) - (num4 & num3))
|
|
{
|
|
case 2:
|
|
return false;
|
|
case 1:
|
|
return false;
|
|
case 3:
|
|
num = 1712398327;
|
|
break;
|
|
case 0:
|
|
num = (LAddon.IsAddonReady(addonPtr) ? 1712398323 : 1712398324);
|
|
break;
|
|
case 5:
|
|
addonPtr->FireCallbackInt(0);
|
|
return true;
|
|
case 4:
|
|
num = ((!addonPtr->IsVisible) ? 1712398324 : 1712398326);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
[MethodImpl(MethodImplOptions.NoInlining)]
|
|
public unsafe static bool IsSatisfactionSupplyResultVisible(IGameGui gameGui)
|
|
{
|
|
AtkUnitBase* addonPtr;
|
|
int num = (gameGui.TryGetAddonByName<AtkUnitBase>(global::_003CModule_003E._202E_202C_206D_206B_202B_202D_206D_202E_206F_202E_202A_206A_206A_202B_206A_202D_202C_206C_206B_202C_206E_202B_200E_206E_206A_206C_200D_200D_200F_200B_202C_200B_200E_206F_202C_200F_202D_202A_206E_202B_202E<string>(-1902425193), out addonPtr) ? 744661943 : 744661940);
|
|
while (true)
|
|
{
|
|
int num2 = num;
|
|
int num3 = 744661941;
|
|
int num4 = num2;
|
|
switch ((num4 | num3) - (num4 & num3))
|
|
{
|
|
case 2:
|
|
return LAddon.IsAddonReady(addonPtr);
|
|
case 1:
|
|
return false;
|
|
case 0:
|
|
goto IL_005b;
|
|
}
|
|
continue;
|
|
IL_005b:
|
|
num = 744661940;
|
|
}
|
|
}
|
|
|
|
[MethodImpl(MethodImplOptions.NoInlining)]
|
|
public unsafe static bool TryCloseSatisfactionSupplyResult(IGameGui gameGui)
|
|
{
|
|
AtkUnitBase* addonPtr;
|
|
int num = (gameGui.TryGetAddonByName<AtkUnitBase>(global::_003CModule_003E._206A_202C_200C_206F_202A_200C_200F_206F_202B_202B_200D_206F_206D_200E_206A_206B_202A_200F_200B_206C_202B_202A_202B_206C_200F_206C_202C_202C_200C_206C_206F_200C_200B_202D_200E_202A_202A_206B_206B_200F_202E<string>(-2097771631), out addonPtr) ? (-1858872072) : (-1858872069));
|
|
while (true)
|
|
{
|
|
int num2 = num;
|
|
int num3 = -1858872071;
|
|
int num4 = num2;
|
|
int num5 = num4 + num3;
|
|
int num6 = num4 & num3;
|
|
switch (num5 - (num6 + num6))
|
|
{
|
|
case 0:
|
|
goto IL_0054;
|
|
case 2:
|
|
return false;
|
|
case 1:
|
|
addonPtr->Close(fireCallback: true);
|
|
return true;
|
|
}
|
|
continue;
|
|
IL_0054:
|
|
num = -1858872069;
|
|
}
|
|
}
|
|
|
|
public unsafe static bool IsNpcTradeReady()
|
|
{
|
|
AgentNpcTrade* ptr = AgentNpcTrade.Instance();
|
|
int num = ((ptr == null) ? 553633651 : 553633650);
|
|
while (true)
|
|
{
|
|
int num2 = num;
|
|
int num3 = 553633651;
|
|
int num4 = num2;
|
|
int num5 = num4 + num3;
|
|
int num6 = num4 & num3;
|
|
switch (num5 - (num6 + num6))
|
|
{
|
|
case 2:
|
|
goto IL_004b;
|
|
case 1:
|
|
return ptr->IsAgentActive();
|
|
case 0:
|
|
return false;
|
|
}
|
|
continue;
|
|
IL_004b:
|
|
num = 553633650;
|
|
}
|
|
}
|
|
|
|
public unsafe static (bool Exists, bool Active, int SelectedSlot) GetNpcTradeState()
|
|
{
|
|
AgentNpcTrade* ptr = AgentNpcTrade.Instance();
|
|
int num = ((ptr != null) ? 1702648938 : 1702648937);
|
|
while (true)
|
|
{
|
|
int num2 = num;
|
|
int num3 = 1702648939;
|
|
int num4 = num2;
|
|
switch ((num4 | num3) - (num4 & num3))
|
|
{
|
|
case 0:
|
|
goto IL_0049;
|
|
case 2:
|
|
return (Exists: false, Active: false, SelectedSlot: -99);
|
|
case 1:
|
|
return (Exists: true, Active: ptr->IsAgentActive(), SelectedSlot: ptr->SelectedTurnInSlot);
|
|
}
|
|
continue;
|
|
IL_0049:
|
|
num = 1702648937;
|
|
}
|
|
}
|
|
|
|
public unsafe static bool TryConfirmTrade()
|
|
{
|
|
AgentNpcTrade* ptr = AgentNpcTrade.Instance();
|
|
int num = ((ptr == null) ? (-859221764) : (-859221774));
|
|
AtkValue atkValue = default(AtkValue);
|
|
Span<AtkValue> span = default(Span<AtkValue>);
|
|
while (true)
|
|
{
|
|
int num2 = num;
|
|
int num3 = -859221772;
|
|
int num4 = num2;
|
|
int num5 = num4 + num3;
|
|
int num6 = num4 & num3;
|
|
switch (num5 - (num6 + num6))
|
|
{
|
|
case 2:
|
|
return false;
|
|
case 0:
|
|
atkValue = new AtkValue();
|
|
span = stackalloc AtkValue[4];
|
|
num = ((ptr->SelectedTurnInSlot >= 0) ? (-859221771) : (-859221776));
|
|
break;
|
|
case 6:
|
|
num = (ptr->IsAgentActive() ? (-859221772) : (-859221764));
|
|
break;
|
|
case 8:
|
|
return false;
|
|
case 7:
|
|
return false;
|
|
case 5:
|
|
span[0].SetInt(0);
|
|
span[1].SetInt(0);
|
|
span[2].SetInt(0);
|
|
span[3].SetInt(0);
|
|
ptr->ReceiveEvent(&atkValue, span.GetPointer(0), 4u, 1uL);
|
|
ptr->ReceiveEvent(&atkValue, span.GetPointer(0), 4u, 0uL);
|
|
return true;
|
|
case 1:
|
|
num = ((ptr->SelectedTurnInSlot == 0) ? (-859221775) : (-859221770));
|
|
break;
|
|
case 9:
|
|
num = -859221774;
|
|
break;
|
|
case 3:
|
|
num = ((ptr->SelectedTurnInSlotItemOptions > 0) ? (-859221775) : (-859221773));
|
|
break;
|
|
case 4:
|
|
span[0].SetInt(2);
|
|
span[1].SetInt(0);
|
|
span[2].SetInt(0);
|
|
span[3].SetInt(0);
|
|
ptr->ReceiveEvent(&atkValue, span.GetPointer(0), 4u, 0uL);
|
|
num = ((ptr->SelectedTurnInSlot != 0) ? (-859221773) : (-859221769));
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
public unsafe static int GetRemainingAllowances()
|
|
{
|
|
SatisfactionSupplyManager* ptr = SatisfactionSupplyManager.Instance();
|
|
int num = ((ptr != null) ? (-1768883873) : (-1768883876));
|
|
while (true)
|
|
{
|
|
int num2 = num;
|
|
int num3 = -1768883874;
|
|
int num4 = num2;
|
|
switch ((num4 | num3) - (num4 & num3))
|
|
{
|
|
case 0:
|
|
goto IL_0049;
|
|
case 2:
|
|
return 0;
|
|
case 1:
|
|
return ptr->GetRemainingAllowances();
|
|
}
|
|
continue;
|
|
IL_0049:
|
|
num = -1768883876;
|
|
}
|
|
}
|
|
|
|
public unsafe static NpcState GetNpcState(int npcIndex)
|
|
{
|
|
SatisfactionSupplyManager* ptr = SatisfactionSupplyManager.Instance();
|
|
int num = ((ptr != null) ? (-1038874379) : (-1038874380));
|
|
while (true)
|
|
{
|
|
int num2 = num;
|
|
int num3 = -1038874384;
|
|
int num4 = num2;
|
|
switch ((num4 | num3) - (num4 & num3))
|
|
{
|
|
case 0:
|
|
num = -1038874380;
|
|
break;
|
|
case 2:
|
|
return new NpcState(ptr->SatisfactionRanks[npcIndex], ptr->Satisfaction[npcIndex], 0, ptr->UsedAllowances[npcIndex]);
|
|
case 1:
|
|
return default(NpcState);
|
|
case 3:
|
|
num = ((npcIndex < ptr->SatisfactionRanks.Length) ? (-1038874382) : (-1038874383));
|
|
break;
|
|
case 5:
|
|
num = ((npcIndex < 0) ? (-1038874383) : (-1038874381));
|
|
break;
|
|
case 4:
|
|
return default(NpcState);
|
|
}
|
|
}
|
|
}
|
|
|
|
public unsafe static uint GetSupplySeed()
|
|
{
|
|
SatisfactionSupplyManager* ptr = SatisfactionSupplyManager.Instance();
|
|
int num = ((ptr != null) ? (-919360628) : (-919360625));
|
|
while (true)
|
|
{
|
|
int num2 = num;
|
|
int num3 = -919360626;
|
|
int num4 = num2;
|
|
int num5 = num4 + num3;
|
|
int num6 = num4 & num3;
|
|
switch (num5 - (num6 + num6))
|
|
{
|
|
case 0:
|
|
goto IL_004b;
|
|
case 1:
|
|
return 0u;
|
|
case 2:
|
|
return ptr->SupplySeed;
|
|
}
|
|
continue;
|
|
IL_004b:
|
|
num = -919360625;
|
|
}
|
|
}
|
|
|
|
public unsafe static byte GetBonusGuaranteeRowId()
|
|
{
|
|
SatisfactionSupplyManager* ptr = SatisfactionSupplyManager.Instance();
|
|
int num = ((ptr != null) ? (-1374760124) : (-1374760121));
|
|
while (true)
|
|
{
|
|
int num2 = num;
|
|
int num3 = -1374760123;
|
|
int num4 = num2;
|
|
int num5 = num4 + num3;
|
|
int num6 = num4 & num3;
|
|
switch (num5 - (num6 + num6))
|
|
{
|
|
case 1:
|
|
return ptr->BonusGuaranteeRowId;
|
|
case 2:
|
|
return byte.MaxValue;
|
|
case 0:
|
|
goto IL_0058;
|
|
}
|
|
continue;
|
|
IL_0058:
|
|
num = -1374760121;
|
|
}
|
|
}
|
|
}
|