forked from aly/qstbak
274 lines
16 KiB
C#
274 lines
16 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Runtime.CompilerServices;
|
|
using System.Text;
|
|
using Questionable.Functions;
|
|
using Questionable.Model.Questing;
|
|
|
|
namespace Questionable.Controller;
|
|
|
|
internal readonly record struct QuestResolution
|
|
{
|
|
public required EQuestResolutionType Type { get; init; }
|
|
|
|
public ElementId? QuestId { get; init; }
|
|
|
|
public byte Sequence { get; init; }
|
|
|
|
public MainScenarioQuestState MsqState { get; init; }
|
|
|
|
public required string DebugReason { get; init; }
|
|
|
|
public int LevelingTargetLevel { get; init; }
|
|
|
|
public string? LevelingQuestName { get; init; }
|
|
|
|
public bool HasQuest
|
|
{
|
|
get
|
|
{
|
|
int num = ((!_206C_200E_200F_206F_200C_200D_206E_200E_202A_206B_206A_206E_206A_202B_206E_202D_200E_200E_206A_200B_200B_206F_206C_202A_202C_200B_200B_206C_206E_206D_200D_206D_206B_200F_206B_206D_206D_202A_206F_200F_202E(QuestId, (ElementId?)null)) ? 206897557 : 206897558);
|
|
while (true)
|
|
{
|
|
int num2 = num;
|
|
int num3 = 206897556;
|
|
int num4 = num2;
|
|
int num5 = num4 + num3;
|
|
int num6 = num4 & num3;
|
|
switch (num5 - (num6 + num6))
|
|
{
|
|
case 1:
|
|
return false;
|
|
case 2:
|
|
return _200C_200F_202A_206B_200E_202E_206F_206C_206D_202C_202B_206B_206D_200C_206B_200E_206E_202C_202B_202B_200D_200C_202A_200F_202E_202D_206E_202A_202E_200E_200C_206C_200F_202D_202A_202B_202C_206C_200F_202E_202E(QuestId) != 0;
|
|
case 0:
|
|
goto IL_005f;
|
|
}
|
|
continue;
|
|
IL_005f:
|
|
num = 206897558;
|
|
}
|
|
}
|
|
}
|
|
|
|
public bool IsSlotBased
|
|
{
|
|
get
|
|
{
|
|
EQuestResolutionType type = Type;
|
|
int num = (((uint)type > 2u) ? 551053514 : 551053515);
|
|
bool result = default(bool);
|
|
while (true)
|
|
{
|
|
int num2 = num;
|
|
int num3 = 551053514;
|
|
int num4 = num2;
|
|
int num5 = num4 + num3;
|
|
int num6 = num4 & num3;
|
|
switch (num5 - (num6 + num6))
|
|
{
|
|
case 2:
|
|
num = 551053515;
|
|
break;
|
|
case 1:
|
|
result = true;
|
|
num = 551053513;
|
|
break;
|
|
case 0:
|
|
result = false;
|
|
num = 551053513;
|
|
break;
|
|
case 3:
|
|
return result;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
public static QuestResolution Slot(EQuestResolutionType type, QuestController.QuestProgress progress, string reason)
|
|
{
|
|
return new QuestResolution
|
|
{
|
|
Type = type,
|
|
QuestId = progress.Quest.Id,
|
|
Sequence = progress.Sequence,
|
|
MsqState = MainScenarioQuestState.Available,
|
|
DebugReason = reason
|
|
};
|
|
}
|
|
|
|
public static QuestResolution ForQuest(EQuestResolutionType type, ElementId questId, byte sequence, MainScenarioQuestState msqState, string reason)
|
|
{
|
|
return new QuestResolution
|
|
{
|
|
Type = type,
|
|
QuestId = questId,
|
|
Sequence = sequence,
|
|
MsqState = msqState,
|
|
DebugReason = reason
|
|
};
|
|
}
|
|
|
|
[MethodImpl(MethodImplOptions.NoInlining)]
|
|
public static QuestResolution Leveling(int targetLevel, string? questName, MainScenarioQuestState msqState)
|
|
{
|
|
QuestResolution result = new QuestResolution
|
|
{
|
|
Type = EQuestResolutionType.LevelingMode,
|
|
MsqState = msqState
|
|
};
|
|
DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(17, 2);
|
|
defaultInterpolatedStringHandler.AppendLiteral(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>(842342782));
|
|
defaultInterpolatedStringHandler.AppendFormatted(targetLevel);
|
|
defaultInterpolatedStringHandler.AppendLiteral(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>(1386602519));
|
|
defaultInterpolatedStringHandler.AppendFormatted(questName);
|
|
result.DebugReason = defaultInterpolatedStringHandler.ToStringAndClear();
|
|
result.LevelingTargetLevel = targetLevel;
|
|
result.LevelingQuestName = questName;
|
|
return result;
|
|
}
|
|
|
|
public static QuestResolution None(MainScenarioQuestState msqState, string reason)
|
|
{
|
|
return new QuestResolution
|
|
{
|
|
Type = EQuestResolutionType.NoQuest,
|
|
MsqState = msqState,
|
|
DebugReason = reason
|
|
};
|
|
}
|
|
|
|
[MethodImpl(MethodImplOptions.NoInlining)]
|
|
[CompilerGenerated]
|
|
public override string ToString()
|
|
{
|
|
StringBuilder stringBuilder = _206D_206A_202A_200C_206C_202B_206D_206B_200D_206D_206E_206D_202D_200D_206B_200E_202C_200D_202E_202C_202A_206D_200E_200E_206D_206E_206B_202D_200B_206E_200B_202A_206A_206E_206E_202A_200E_206E_202A_202A_202E();
|
|
_206C_200B_206D_202C_206A_202D_202E_206B_202A_200C_206D_200F_206D_206B_202A_206F_200F_206E_202B_202E_206C_206A_200C_202E_202A_206A_202B_206A_206C_206A_206E_200D_202A_206A_200D_202E_200D_206D_202E_206A_202E(stringBuilder, 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>(-1454729843));
|
|
_206C_200B_206D_202C_206A_202D_202E_206B_202A_200C_206D_200F_206D_206B_202A_206F_200F_206E_202B_202E_206C_206A_200C_202E_202A_206A_202B_206A_206C_206A_206E_200D_202A_206A_200D_202E_200D_206D_202E_206A_202E(stringBuilder, 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>(117284107));
|
|
int num = ((!PrintMembers(stringBuilder)) ? 497105174 : 497105175);
|
|
while (true)
|
|
{
|
|
int num2 = num;
|
|
int num3 = 497105174;
|
|
int num4 = num2;
|
|
int num5 = num4 + num3;
|
|
int num6 = num4 & num3;
|
|
switch (num5 - (num6 + num6))
|
|
{
|
|
case 0:
|
|
_206B_206E_200B_206A_202D_206B_202C_206D_206B_202C_202C_206D_202E_206F_200C_206D_200E_206F_202B_200F_206B_200D_202C_206F_206D_206A_206E_202A_202B_206C_200E_202A_202B_200B_200E_206D_206A_200E_206F_200E_202E(stringBuilder, '}');
|
|
return _202B_202D_206D_200C_200C_206C_206A_206E_206D_206C_200B_206B_202E_200E_202D_206B_206C_200F_206E_206D_206E_200C_200B_206D_206A_202A_202D_200D_200E_202A_206E_202C_200D_202A_202C_200D_206D_200E_202C_200F_202E((object?)stringBuilder);
|
|
case 1:
|
|
_206B_206E_200B_206A_202D_206B_202C_206D_206B_202C_202C_206D_202E_206F_200C_206D_200E_206F_202B_200F_206B_200D_202C_206F_206D_206A_206E_202A_202B_206C_200E_202A_202B_200B_200E_206D_206A_200E_206F_200E_202E(stringBuilder, ' ');
|
|
num = 497105174;
|
|
break;
|
|
case 2:
|
|
num = 497105175;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
[MethodImpl(MethodImplOptions.NoInlining)]
|
|
[CompilerGenerated]
|
|
private bool PrintMembers(StringBuilder builder)
|
|
{
|
|
_206C_200B_206D_202C_206A_202D_202E_206B_202A_200C_206D_200F_206D_206B_202A_206F_200F_206E_202B_202E_206C_206A_200C_202E_202A_206A_202B_206A_206C_206A_206E_200D_202A_206A_200D_202E_200D_206D_202E_206A_202E(builder, global::_003CModule_003E._206C_202A_206D_206A_206E_202A_202B_206F_206D_200F_202D_200F_202D_206A_202C_202B_206D_206A_200E_200E_202D_202D_200D_200C_200D_200D_206D_206E_202A_200F_206E_206C_206D_206A_206D_202B_200F_200D_206E_200C_202E<string>(2142299818));
|
|
_206C_200B_206D_202C_206A_202D_202E_206B_202A_200C_206D_200F_206D_206B_202A_206F_200F_206E_202B_202E_206C_206A_200C_202E_202A_206A_202B_206A_206C_206A_206E_200D_202A_206A_200D_202E_200D_206D_202E_206A_202E(builder, Type.ToString());
|
|
_206C_200B_206D_202C_206A_202D_202E_206B_202A_200C_206D_200F_206D_206B_202A_206F_200F_206E_202B_202E_206C_206A_200C_202E_202A_206A_202B_206A_206C_206A_206E_200D_202A_206A_200D_202E_200D_206D_202E_206A_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>(1355464271));
|
|
_200C_206D_206F_206A_200F_206C_200E_200F_202B_206A_202D_202E_202D_202E_206E_200C_202A_202C_202C_206B_206F_200D_202C_202B_200E_202E_206C_206B_202E_200C_200B_206A_200C_202B_202A_206E_206E_206B_206E_200F_202E(builder, (object?)QuestId);
|
|
_206C_200B_206D_202C_206A_202D_202E_206B_202A_200C_206D_200F_206D_206B_202A_206F_200F_206E_202B_202E_206C_206A_200C_202E_202A_206A_202B_206A_206C_206A_206E_200D_202A_206A_200D_202E_200D_206D_202E_206A_202E(builder, global::_003CModule_003E._206C_202A_206D_206A_206E_202A_202B_206F_206D_200F_202D_200F_202D_206A_202C_202B_206D_206A_200E_200E_202D_202D_200D_200C_200D_200D_206D_206E_202A_200F_206E_206C_206D_206A_206D_202B_200F_200D_206E_200C_202E<string>(-1883281888));
|
|
_206C_200B_206D_202C_206A_202D_202E_206B_202A_200C_206D_200F_206D_206B_202A_206F_200F_206E_202B_202E_206C_206A_200C_202E_202A_206A_202B_206A_206C_206A_206E_200D_202A_206A_200D_202E_200D_206D_202E_206A_202E(builder, Sequence.ToString());
|
|
_206C_200B_206D_202C_206A_202D_202E_206B_202A_200C_206D_200F_206D_206B_202A_206F_200F_206E_202B_202E_206C_206A_200C_202E_202A_206A_202B_206A_206C_206A_206E_200D_202A_206A_200D_202E_200D_206D_202E_206A_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>(-1661504935));
|
|
_206C_200B_206D_202C_206A_202D_202E_206B_202A_200C_206D_200F_206D_206B_202A_206F_200F_206E_202B_202E_206C_206A_200C_202E_202A_206A_202B_206A_206C_206A_206E_200D_202A_206A_200D_202E_200D_206D_202E_206A_202E(builder, MsqState.ToString());
|
|
_206C_200B_206D_202C_206A_202D_202E_206B_202A_200C_206D_200F_206D_206B_202A_206F_200F_206E_202B_202E_206C_206A_200C_202E_202A_206A_202B_206A_206C_206A_206E_200D_202A_206A_200D_202E_200D_206D_202E_206A_202E(builder, 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>(-940584201));
|
|
_200C_206D_206F_206A_200F_206C_200E_200F_202B_206A_202D_202E_202D_202E_206E_200C_202A_202C_202C_206B_206F_200D_202C_202B_200E_202E_206C_206B_202E_200C_200B_206A_200C_202B_202A_206E_206E_206B_206E_200F_202E(builder, (object?)DebugReason);
|
|
_206C_200B_206D_202C_206A_202D_202E_206B_202A_200C_206D_200F_206D_206B_202A_206F_200F_206E_202B_202E_206C_206A_200C_202E_202A_206A_202B_206A_206C_206A_206E_200D_202A_206A_200D_202E_200D_206D_202E_206A_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>(-436279056));
|
|
_206C_200B_206D_202C_206A_202D_202E_206B_202A_200C_206D_200F_206D_206B_202A_206F_200F_206E_202B_202E_206C_206A_200C_202E_202A_206A_202B_206A_206C_206A_206E_200D_202A_206A_200D_202E_200D_206D_202E_206A_202E(builder, LevelingTargetLevel.ToString());
|
|
_206C_200B_206D_202C_206A_202D_202E_206B_202A_200C_206D_200F_206D_206B_202A_206F_200F_206E_202B_202E_206C_206A_200C_202E_202A_206A_202B_206A_206C_206A_206E_200D_202A_206A_200D_202E_200D_206D_202E_206A_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>(2055448933));
|
|
_200C_206D_206F_206A_200F_206C_200E_200F_202B_206A_202D_202E_202D_202E_206E_200C_202A_202C_202C_206B_206F_200D_202C_202B_200E_202E_206C_206B_202E_200C_200B_206A_200C_202B_202A_206E_206E_206B_206E_200F_202E(builder, (object?)LevelingQuestName);
|
|
_206C_200B_206D_202C_206A_202D_202E_206B_202A_200C_206D_200F_206D_206B_202A_206F_200F_206E_202B_202E_206C_206A_200C_202E_202A_206A_202B_206A_206C_206A_206E_200D_202A_206A_200D_202E_200D_206D_202E_206A_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>(-660514735));
|
|
_206C_200B_206D_202C_206A_202D_202E_206B_202A_200C_206D_200F_206D_206B_202A_206F_200F_206E_202B_202E_206C_206A_200C_202E_202A_206A_202B_206A_206C_206A_206E_200D_202A_206A_200D_202E_200D_206D_202E_206A_202E(builder, HasQuest.ToString());
|
|
_206C_200B_206D_202C_206A_202D_202E_206B_202A_200C_206D_200F_206D_206B_202A_206F_200F_206E_202B_202E_206C_206A_200C_202E_202A_206A_202B_206A_206C_206A_206E_200D_202A_206A_200D_202E_200D_206D_202E_206A_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>(1071893673));
|
|
_206C_200B_206D_202C_206A_202D_202E_206B_202A_200C_206D_200F_206D_206B_202A_206F_200F_206E_202B_202E_206C_206A_200C_202E_202A_206A_202B_206A_206C_206A_206E_200D_202A_206A_200D_202E_200D_206D_202E_206A_202E(builder, IsSlotBased.ToString());
|
|
return true;
|
|
}
|
|
|
|
[CompilerGenerated]
|
|
public bool Equals(QuestResolution other)
|
|
{
|
|
int num = ((!EqualityComparer<EQuestResolutionType>.Default.Equals(Type, other.Type)) ? 408097635 : 408097637);
|
|
while (true)
|
|
{
|
|
int num2 = num;
|
|
int num3 = 408097635;
|
|
int num4 = num2;
|
|
switch ((num4 | num3) - (num4 & num3))
|
|
{
|
|
case 5:
|
|
num = ((!EqualityComparer<byte>.Default.Equals(Sequence, other.Sequence)) ? 408097635 : 408097632);
|
|
break;
|
|
case 1:
|
|
num = ((!EqualityComparer<string>.Default.Equals(DebugReason, other.DebugReason)) ? 408097635 : 408097633);
|
|
break;
|
|
case 4:
|
|
return EqualityComparer<string>.Default.Equals(LevelingQuestName, other.LevelingQuestName);
|
|
case 2:
|
|
num = ((!EqualityComparer<int>.Default.Equals(LevelingTargetLevel, other.LevelingTargetLevel)) ? 408097635 : 408097639);
|
|
break;
|
|
case 0:
|
|
return false;
|
|
case 7:
|
|
num = 408097637;
|
|
break;
|
|
case 3:
|
|
num = ((!EqualityComparer<MainScenarioQuestState>.Default.Equals(MsqState, other.MsqState)) ? 408097635 : 408097634);
|
|
break;
|
|
case 6:
|
|
num = ((!EqualityComparer<ElementId>.Default.Equals(QuestId, other.QuestId)) ? 408097635 : 408097638);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
bool IEquatable<QuestResolution>.Equals(QuestResolution other)
|
|
{
|
|
//ILSpy generated this explicit interface implementation from .override directive in Equals
|
|
return this.Equals(other);
|
|
}
|
|
|
|
static bool _206C_200E_200F_206F_200C_200D_206E_200E_202A_206B_206A_206E_206A_202B_206E_202D_200E_200E_206A_200B_200B_206F_206C_202A_202C_200B_200B_206C_206E_206D_200D_206D_206B_200F_206B_206D_206D_202A_206F_200F_202E(ElementId? P_0, ElementId? P_1)
|
|
{
|
|
return P_0 != P_1;
|
|
}
|
|
|
|
static ushort _200C_200F_202A_206B_200E_202E_206F_206C_206D_202C_202B_206B_206D_200C_206B_200E_206E_202C_202B_202B_200D_200C_202A_200F_202E_202D_206E_202A_202E_200E_200C_206C_200F_202D_202A_202B_202C_206C_200F_202E_202E(ElementId? P_0)
|
|
{
|
|
return P_0.Value;
|
|
}
|
|
|
|
static StringBuilder? _206D_206A_202A_200C_206C_202B_206D_206B_200D_206D_206E_206D_202D_200D_206B_200E_202C_200D_202E_202C_202A_206D_200E_200E_206D_206E_206B_202D_200B_206E_200B_202A_206A_206E_206E_202A_200E_206E_202A_202A_202E()
|
|
{
|
|
return new StringBuilder();
|
|
}
|
|
|
|
static StringBuilder? _206C_200B_206D_202C_206A_202D_202E_206B_202A_200C_206D_200F_206D_206B_202A_206F_200F_206E_202B_202E_206C_206A_200C_202E_202A_206A_202B_206A_206C_206A_206E_200D_202A_206A_200D_202E_200D_206D_202E_206A_202E(StringBuilder? P_0, string? P_1)
|
|
{
|
|
return P_0.Append(P_1);
|
|
}
|
|
|
|
static StringBuilder? _206B_206E_200B_206A_202D_206B_202C_206D_206B_202C_202C_206D_202E_206F_200C_206D_200E_206F_202B_200F_206B_200D_202C_206F_206D_206A_206E_202A_202B_206C_200E_202A_202B_200B_200E_206D_206A_200E_206F_200E_202E(StringBuilder? P_0, char P_1)
|
|
{
|
|
return P_0.Append(P_1);
|
|
}
|
|
|
|
static string? _202B_202D_206D_200C_200C_206C_206A_206E_206D_206C_200B_206B_202E_200E_202D_206B_206C_200F_206E_206D_206E_200C_200B_206D_206A_202A_202D_200D_200E_202A_206E_202C_200D_202A_202C_200D_206D_200E_202C_200F_202E(object? P_0)
|
|
{
|
|
return P_0.ToString();
|
|
}
|
|
|
|
static StringBuilder? _200C_206D_206F_206A_200F_206C_200E_200F_202B_206A_202D_202E_202D_202E_206E_200C_202A_202C_202C_206B_206F_200D_202C_202B_200E_202E_206C_206B_202E_200C_200B_206A_200C_202B_202A_206E_206E_206B_206E_200F_202E(StringBuilder? P_0, object? P_1)
|
|
{
|
|
return P_0.Append(P_1);
|
|
}
|
|
}
|