using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using GlobalEnums;
using HarmonyLib;
using HutongGames.PlayMaker;
using HutongGames.PlayMaker.Actions;
using LostSinner.Behaviours;
using LostSinner.Patches;
using Microsoft.CodeAnalysis;
using TeamCherry.Localization;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Audio;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("LostSinner")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+6b91eae8e7ea04d7b25692e43616aec33da3803d")]
[assembly: AssemblyProduct("LostSinner")]
[assembly: AssemblyTitle("LostSinner")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
internal sealed class NullableAttribute : Attribute
{
public readonly byte[] NullableFlags;
public NullableAttribute(byte P_0)
{
NullableFlags = new byte[1] { P_0 };
}
public NullableAttribute(byte[] P_0)
{
NullableFlags = P_0;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
internal sealed class NullableContextAttribute : Attribute
{
public readonly byte Flag;
public NullableContextAttribute(byte P_0)
{
Flag = P_0;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace LostSinner
{
internal static class AssetManager
{
[CompilerGenerated]
private sealed class <>c__DisplayClass5_0
{
public string assetPath;
internal bool <Initialize>b__0(string objName)
{
return assetPath.Contains(objName);
}
}
[CompilerGenerated]
private sealed class <>c__DisplayClass8_0
{
public string bundleName;
internal bool <ManuallyLoadBundles>b__0(AssetBundle bundle)
{
return ((Object)bundle).name == bundleName;
}
}
[CompilerGenerated]
private sealed class <>c__DisplayClass8_1
{
public AssetBundleRequest assetLoadRequest;
internal void <ManuallyLoadBundles>b__1(AsyncOperation _)
{
Object asset = assetLoadRequest.asset;
GameObject val = (GameObject)(object)((asset is GameObject) ? asset : null);
if (val != null && asset.name == "Lost Lace Ground Tendril")
{
ConstrainPosition component = val.GetComponent<ConstrainPosition>();
component.xMax = 100f;
component.yMin = 0f;
component.yMax = 100f;
FsmState[] fsmStates = FSMUtility.LocateMyFSM(val, "Control").FsmStates;
foreach (FsmState val2 in fsmStates)
{
if (val2.Name == "Antic")
{
FsmStateAction[] actions = val2.Actions;
FsmStateAction[] array = actions;
foreach (FsmStateAction val3 in array)
{
SetFloatValue val4 = (SetFloatValue)(object)((val3 is SetFloatValue) ? val3 : null);
if (val4 == null)
{
EaseFloat val5 = (EaseFloat)(object)((val3 is EaseFloat) ? val3 : null);
if (val5 != null)
{
val5.fromValue.Value = 11f;
val5.toValue.Value = 13f;
}
}
else
{
val4.floatValue.Value = 11f;
}
}
val2.Actions = actions;
}
else
{
if (!(val2.Name == "Recycle"))
{
continue;
}
FsmStateAction[] actions2 = val2.Actions;
FsmStateAction[] array = actions2;
foreach (FsmStateAction obj in array)
{
SetPosition2D val6 = (SetPosition2D)(object)((obj is SetPosition2D) ? obj : null);
if (val6 != null)
{
val6.Y.Value = 11f;
}
}
val2.Actions = actions2;
}
}
}
AssetManager.TryAdd<Object>(asset);
}
}
[CompilerGenerated]
private sealed class <Initialize>d__5 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
private IEnumerator<AssetBundle> <>7__wrap1;
private AssetBundle <bundle>5__3;
private string[] <>7__wrap3;
private int <>7__wrap4;
private AssetBundleRequest <assetLoadHandle>5__6;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <Initialize>d__5(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
int num = <>1__state;
if (num == -3 || num == 1)
{
try
{
}
finally
{
<>m__Finally1();
}
}
<>7__wrap1 = null;
<bundle>5__3 = null;
<>7__wrap3 = null;
<assetLoadHandle>5__6 = null;
<>1__state = -2;
}
private bool MoveNext()
{
try
{
int num = <>1__state;
if (num != 0)
{
if (num != 1)
{
return false;
}
<>1__state = -3;
Object asset = <assetLoadHandle>5__6.asset;
if (asset != (Object)null)
{
AssetManager.TryAdd<Object>(asset);
}
<assetLoadHandle>5__6 = null;
goto IL_010a;
}
<>1__state = -1;
if (_initialized)
{
return false;
}
_initialized = true;
<>7__wrap1 = AssetBundle.GetAllLoadedAssetBundles().GetEnumerator();
<>1__state = -3;
goto IL_0139;
IL_0139:
if (<>7__wrap1.MoveNext())
{
<bundle>5__3 = <>7__wrap1.Current;
<>7__wrap3 = <bundle>5__3.GetAllAssetNames();
<>7__wrap4 = 0;
goto IL_0118;
}
<>m__Finally1();
<>7__wrap1 = null;
return false;
IL_010a:
<>7__wrap4++;
goto IL_0118;
IL_0118:
if (<>7__wrap4 < <>7__wrap3.Length)
{
<>c__DisplayClass5_0 CS$<>8__locals0 = new <>c__DisplayClass5_0
{
assetPath = <>7__wrap3[<>7__wrap4]
};
if (_assetNames.Any((string objName) => CS$<>8__locals0.assetPath.Contains(objName)))
{
<assetLoadHandle>5__6 = <bundle>5__3.LoadAssetAsync(CS$<>8__locals0.assetPath);
<>2__current = <assetLoadHandle>5__6;
<>1__state = 1;
return true;
}
goto IL_010a;
}
<>7__wrap3 = null;
<bundle>5__3 = null;
goto IL_0139;
}
catch
{
//try-fault
((IDisposable)this).Dispose();
throw;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
private void <>m__Finally1()
{
<>1__state = -1;
if (<>7__wrap1 != null)
{
<>7__wrap1.Dispose();
}
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
[CompilerGenerated]
private sealed class <ManuallyLoadBundles>d__8 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
private string[] <>7__wrap1;
private int <>7__wrap2;
private AssetBundleCreateRequest <bundleLoadRequest>5__4;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <ManuallyLoadBundles>d__8(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>7__wrap1 = null;
<bundleLoadRequest>5__4 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_0065: Unknown result type (might be due to invalid IL or missing references)
//IL_006a: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Invalid comparison between Unknown and I4
//IL_0071: Unknown result type (might be due to invalid IL or missing references)
//IL_0074: Invalid comparison between Unknown and I4
//IL_0076: Unknown result type (might be due to invalid IL or missing references)
//IL_007a: Invalid comparison between Unknown and I4
int num = <>1__state;
if (num != 0)
{
if (num != 1)
{
return false;
}
<>1__state = -1;
AssetBundle assetBundle = <bundleLoadRequest>5__4.assetBundle;
_manuallyLoadedBundles.Add(assetBundle);
string[] allAssetNames = assetBundle.GetAllAssetNames();
foreach (string text in allAssetNames)
{
string[] assetNames = _assetNames;
foreach (string value in assetNames)
{
if (!text.Contains(value))
{
continue;
}
<>c__DisplayClass8_1 CS$<>8__locals1 = new <>c__DisplayClass8_1
{
assetLoadRequest = assetBundle.LoadAssetAsync(text)
};
((AsyncOperation)CS$<>8__locals1.assetLoadRequest).completed += delegate
{
Object asset = CS$<>8__locals1.assetLoadRequest.asset;
GameObject val = (GameObject)(object)((asset is GameObject) ? asset : null);
if (val != null && asset.name == "Lost Lace Ground Tendril")
{
ConstrainPosition component = val.GetComponent<ConstrainPosition>();
component.xMax = 100f;
component.yMin = 0f;
component.yMax = 100f;
FsmState[] fsmStates = FSMUtility.LocateMyFSM(val, "Control").FsmStates;
foreach (FsmState val2 in fsmStates)
{
if (val2.Name == "Antic")
{
FsmStateAction[] actions = val2.Actions;
FsmStateAction[] array = actions;
foreach (FsmStateAction val3 in array)
{
SetFloatValue val4 = (SetFloatValue)(object)((val3 is SetFloatValue) ? val3 : null);
if (val4 == null)
{
EaseFloat val5 = (EaseFloat)(object)((val3 is EaseFloat) ? val3 : null);
if (val5 != null)
{
val5.fromValue.Value = 11f;
val5.toValue.Value = 13f;
}
}
else
{
val4.floatValue.Value = 11f;
}
}
val2.Actions = actions;
}
else if (val2.Name == "Recycle")
{
FsmStateAction[] actions2 = val2.Actions;
FsmStateAction[] array = actions2;
foreach (FsmStateAction obj in array)
{
SetPosition2D val6 = (SetPosition2D)(object)((obj is SetPosition2D) ? obj : null);
if (val6 != null)
{
val6.Y.Value = 11f;
}
}
val2.Actions = actions2;
}
}
}
AssetManager.TryAdd<Object>(asset);
};
}
}
<bundleLoadRequest>5__4 = null;
goto IL_0186;
}
<>1__state = -1;
<>7__wrap1 = _bundleNames;
<>7__wrap2 = 0;
goto IL_0194;
IL_0186:
<>7__wrap2++;
goto IL_0194;
IL_0194:
if (<>7__wrap2 < <>7__wrap1.Length)
{
<>c__DisplayClass8_0 CS$<>8__locals0 = new <>c__DisplayClass8_0
{
bundleName = <>7__wrap1[<>7__wrap2]
};
if (!AssetBundle.GetAllLoadedAssetBundles().Any((AssetBundle bundle) => ((Object)bundle).name == CS$<>8__locals0.bundleName))
{
RuntimePlatform platform = Application.platform;
string text2 = (((int)platform == 1) ? "StandaloneOSX" : (((int)platform == 2) ? "StandaloneWindows64" : (((int)platform != 13) ? "" : "StandaloneLinux64")));
string path = text2;
string text3 = Path.Combine(Addressables.RuntimePath, path, CS$<>8__locals0.bundleName + ".bundle");
<bundleLoadRequest>5__4 = AssetBundle.LoadFromFileAsync(text3);
<>2__current = <bundleLoadRequest>5__4;
<>1__state = 1;
return true;
}
goto IL_0186;
}
<>7__wrap1 = null;
return false;
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
private static string[] _bundleNames = new string[1] { "localpoolprefabs_assets_laceboss" };
private static List<AssetBundle> _manuallyLoadedBundles = new List<AssetBundle>();
private static string[] _assetNames = new string[4] { "Abyss Vomit Glob", "Audio Player Actor Simple", "Lost Lace Ground Tendril", "mini_mawlek_spit" };
private static readonly Dictionary<Type, Dictionary<string, Object>> Assets = new Dictionary<Type, Dictionary<string, Object>>();
private static bool _initialized;
[IteratorStateMachine(typeof(<Initialize>d__5))]
internal static IEnumerator Initialize()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <Initialize>d__5(0);
}
private static void TryAdd<T>(T asset) where T : Object
{
string name = ((Object)asset).name;
if (Has(name))
{
Log.Warn("Asset \"" + ((Object)asset).name + "\" has already been loaded!");
return;
}
Type type = ((object)asset).GetType();
if (Assets.ContainsKey(type))
{
Dictionary<string, Object> dictionary = Assets[type];
if (dictionary != null)
{
if (dictionary.ContainsKey(name))
{
if (dictionary[name] != (Object)null)
{
Log.Warn($"There is already an asset \"{name}\" of type \"{type}\"!");
return;
}
Log.Info($"Key \"{name}\" for sub-dictionary of type \"{type}\" exists, but its value is null; Replacing with new asset...");
Assets[type][name] = (Object)(object)asset;
}
else
{
Log.Debug($"Adding asset \"{name}\" of type \"{type}\".");
Assets[type].Add(name, (Object)(object)asset);
}
}
else
{
Log.Error($"Failed to get sub-dictionary of type \"{type}\"!");
Assets.Add(type, new Dictionary<string, Object>());
}
}
else
{
Assets.Add(type, new Dictionary<string, Object> { [name] = (Object)(object)asset });
Log.Debug($"Added new sub-dictionary of type \"{type}\" with initial asset \"{name}\".");
}
}
internal static void LoadTextures()
{
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
//IL_005a: Unknown result type (might be due to invalid IL or missing references)
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_006a: Expected O, but got Unknown
//IL_0070: Expected O, but got Unknown
Assembly executingAssembly = Assembly.GetExecutingAssembly();
string[] manifestResourceNames = executingAssembly.GetManifestResourceNames();
foreach (string text in manifestResourceNames)
{
using Stream stream = executingAssembly.GetManifestResourceStream(text);
if (stream != null)
{
byte[] array = new byte[stream.Length];
stream.Read(array, 0, array.Length);
Texture2D val = new Texture2D(2, 2);
string name = text.Split('.')[^2];
((Object)val).name = name;
ImageConversion.LoadImage(val, array);
TryAdd<Texture2D>(val);
}
}
}
[IteratorStateMachine(typeof(<ManuallyLoadBundles>d__8))]
internal static IEnumerator ManuallyLoadBundles()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <ManuallyLoadBundles>d__8(0);
}
internal static void UnloadAll()
{
foreach (Dictionary<string, Object> value in Assets.Values)
{
foreach (Object value2 in value.Values)
{
Object.DestroyImmediate(value2);
}
}
Assets.Clear();
GC.Collect();
}
internal static void UnloadManualBundles()
{
foreach (AssetBundle manuallyLoadedBundle in _manuallyLoadedBundles)
{
string bundleName = ((Object)manuallyLoadedBundle).name;
((AsyncOperation)manuallyLoadedBundle.UnloadAsync(true)).completed += delegate
{
Log.Info("Successfully unloaded bundle \"" + bundleName + "\"");
};
}
_manuallyLoadedBundles.Clear();
foreach (KeyValuePair<string, Object> item in Assets[typeof(GameObject)])
{
item.Deconstruct(out var _, out var value);
GameObject val = (GameObject)(object)((value is GameObject) ? value : null);
if (val != null && val.activeSelf)
{
Log.Info("Recycling all instances of prefab \"" + ((Object)val).name + "\"");
ObjectPoolExtensions.RecycleAll(val);
}
}
}
private static bool Has(string assetName)
{
foreach (KeyValuePair<Type, Dictionary<string, Object>> asset in Assets)
{
asset.Deconstruct(out var _, out var value);
foreach (var (text2, val2) in value)
{
if (assetName == text2 && Object.op_Implicit(val2))
{
return true;
}
}
}
return false;
}
internal static T? Get<T>(string assetName) where T : Object
{
Type typeFromHandle = typeof(T);
if (Assets.ContainsKey(typeFromHandle))
{
Dictionary<string, Object> dictionary = Assets[typeFromHandle];
if (dictionary != null)
{
if (dictionary.ContainsKey(assetName))
{
Object val = dictionary[assetName];
if (val != (Object)null)
{
return (T)(object)((val is T) ? val : null);
}
Log.Error("Failed to get asset \"" + assetName + "\"; asset is null!");
return default(T);
}
Log.Error($"Sub-dictionary for type \"{typeFromHandle}\" does not contain key \"{assetName}\"!");
return default(T);
}
Log.Error($"Failed to get asset \"{assetName}\"; sub-dictionary of key \"{typeFromHandle}\" is null!");
return default(T);
}
Log.Error($"Could not find a sub-dictionary of type \"{typeFromHandle}\"!");
return default(T);
}
}
public class InvokeCoroutine : FsmStateAction
{
[CompilerGenerated]
private sealed class <Coroutine>d__3 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public InvokeCoroutine <>4__this;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <Coroutine>d__3(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
int num = <>1__state;
InvokeCoroutine invokeCoroutine = <>4__this;
switch (num)
{
default:
return false;
case 0:
<>1__state = -1;
<>2__current = invokeCoroutine._coroutine();
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
((FsmStateAction)invokeCoroutine).Finish();
return false;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
private readonly Func<IEnumerator> _coroutine;
private readonly bool _wait;
public InvokeCoroutine(Func<IEnumerator> coroutine, bool wait)
{
_coroutine = coroutine;
_wait = wait;
}
[IteratorStateMachine(typeof(<Coroutine>d__3))]
private IEnumerator Coroutine()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <Coroutine>d__3(0)
{
<>4__this = this
};
}
public override void OnEnter()
{
((FsmStateAction)this).Fsm.Owner.StartCoroutine(_wait ? Coroutine() : _coroutine());
if (!_wait)
{
((FsmStateAction)this).Finish();
}
}
}
public class InvokeMethod : FsmStateAction
{
private readonly Action _action;
public InvokeMethod(Action action)
{
_action = action;
}
public override void OnEnter()
{
_action();
((FsmStateAction)this).Finish();
}
}
internal static class Log
{
private static ManualLogSource? _logSource;
private static string LogPrefix => $"[{Assembly.GetExecutingAssembly().GetName().Version}] ";
internal static void Init(ManualLogSource logSource)
{
_logSource = logSource;
}
internal static void Debug(object debug)
{
ManualLogSource? logSource = _logSource;
if (logSource != null)
{
logSource.LogDebug((object)(LogPrefix + debug));
}
}
internal static void Error(object error)
{
ManualLogSource? logSource = _logSource;
if (logSource != null)
{
logSource.LogError((object)(LogPrefix + error));
}
}
internal static void Fatal(object fatal)
{
ManualLogSource? logSource = _logSource;
if (logSource != null)
{
logSource.LogFatal((object)(LogPrefix + fatal));
}
}
internal static void Info(object info)
{
ManualLogSource? logSource = _logSource;
if (logSource != null)
{
logSource.LogInfo((object)(LogPrefix + info));
}
}
internal static void Message(object message)
{
ManualLogSource? logSource = _logSource;
if (logSource != null)
{
logSource.LogMessage((object)(LogPrefix + message));
}
}
internal static void Warn(object warning)
{
ManualLogSource? logSource = _logSource;
if (logSource != null)
{
logSource.LogWarning((object)(LogPrefix + warning));
}
}
}
[BepInPlugin("LostSinner", "LostSinner", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
private static Harmony _harmony;
private void Awake()
{
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Expected O, but got Unknown
Log.Init(((BaseUnityPlugin)this).Logger);
AssetManager.LoadTextures();
_harmony = new Harmony("LostSinner");
MainPatches.Initialize();
_harmony.PatchAll(typeof(MainPatches));
}
private void OnDestroy()
{
_harmony.UnpatchSelf();
AssetManager.UnloadAll();
}
}
public static class MyPluginInfo
{
public const string PLUGIN_GUID = "LostSinner";
public const string PLUGIN_NAME = "LostSinner";
public const string PLUGIN_VERSION = "1.0.0";
}
}
namespace LostSinner.Patches
{
internal static class DebugPatches
{
[HarmonyPrefix]
[HarmonyPatch(typeof(HeroController), "Awake")]
private static void ForceInvincible()
{
CheatManager.Invincibility = (InvincibilityStates)3;
}
}
internal static class MainPatches
{
[CompilerGenerated]
private sealed class <UnpatchSinner>d__3 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public IEnumerator result;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <UnpatchSinner>d__3(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
break;
case 1:
<>1__state = -1;
break;
}
if (result.MoveNext())
{
<>2__current = result.Current;
<>1__state = 1;
return true;
}
_harmony.UnpatchSelf();
return false;
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
private static Harmony _harmony;
internal static void Initialize()
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Expected O, but got Unknown
_harmony = new Harmony("MainPatches");
}
[HarmonyPostfix]
[HarmonyPatch(typeof(GameManager), "SetLoadedGameData", new Type[]
{
typeof(SaveGameData),
typeof(int)
})]
private static void CheckPatchSinner(GameManager __instance)
{
__instance.GetSaveStatsForSlot(PlayerData.instance.profileID, (Action<SaveStats, string>)delegate(SaveStats saveStats, string _)
{
if (saveStats.IsAct3)
{
_harmony.PatchAll(typeof(SinnerPatches));
}
});
}
[IteratorStateMachine(typeof(<UnpatchSinner>d__3))]
[HarmonyPostfix]
[HarmonyPatch(typeof(GameManager), "ReturnToMainMenu")]
private static IEnumerator UnpatchSinner(IEnumerator result)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <UnpatchSinner>d__3(0)
{
result = result
};
}
}
internal static class SinnerPatches
{
[HarmonyPrefix]
[HarmonyPatch(typeof(PlayMakerFSM), "Start")]
private static void ModifySinner(PlayMakerFSM __instance)
{
if (((Object)__instance).name == "First Weaver" && __instance.FsmName == "Control" && ((Component)__instance).gameObject.layer == LayerMask.NameToLayer("Enemies"))
{
((Component)__instance).gameObject.AddComponent<Sinner>();
}
else if (((Object)__instance).name == "Pin Projectiles")
{
((Component)__instance).gameObject.AddComponent<PinProjectiles>();
}
}
[HarmonyPostfix]
[HarmonyPatch(typeof(Language), "Get", new Type[]
{
typeof(string),
typeof(string)
})]
private static void ChangeSinnerTitle(string key, string sheetTitle, ref string __result)
{
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Invalid comparison between Unknown and I4
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
//IL_003e: Invalid comparison between Unknown and I4
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Invalid comparison between Unknown and I4
//IL_0089: Unknown result type (might be due to invalid IL or missing references)
//IL_008e: Unknown result type (might be due to invalid IL or missing references)
//IL_008f: Unknown result type (might be due to invalid IL or missing references)
//IL_0092: Invalid comparison between Unknown and I4
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
//IL_0046: Invalid comparison between Unknown and I4
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_0032: Invalid comparison between Unknown and I4
//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
//IL_00a3: Invalid comparison between Unknown and I4
//IL_0094: Unknown result type (might be due to invalid IL or missing references)
//IL_0097: Invalid comparison between Unknown and I4
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_004e: Invalid comparison between Unknown and I4
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_0037: Invalid comparison between Unknown and I4
//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ab: Invalid comparison between Unknown and I4
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
//IL_009c: Invalid comparison between Unknown and I4
string text2;
LanguageCode val;
string text;
if (!(key == "FIRST_WEAVER_SUPER"))
{
if (key == "FIRST_WEAVER_SUB")
{
val = Language.CurrentLanguage();
if ((int)val <= 82)
{
if ((int)val != 57)
{
if ((int)val != 82)
{
goto IL_00cf;
}
text = "Déchue";
}
else
{
text = "Perdida";
}
}
else if ((int)val != 105)
{
if ((int)val != 147)
{
goto IL_00cf;
}
text = "Perdida";
}
else
{
text = "Perduta";
}
goto IL_00d2;
}
text2 = __result;
goto IL_00d9;
}
val = Language.CurrentLanguage();
if ((int)val <= 109)
{
if ((int)val != 37)
{
if ((int)val != 44)
{
if ((int)val != 109)
{
goto IL_0082;
}
text = "漆黒の";
}
else
{
text = "Lost";
}
}
else
{
text = "Verlorene";
}
}
else if ((int)val != 117)
{
if ((int)val != 154)
{
if ((int)val != 199)
{
goto IL_0082;
}
text = "失心";
}
else
{
text = "Пропащая";
}
}
else
{
text = "광기에 빠진";
}
goto IL_0085;
IL_00d2:
text2 = text;
goto IL_00d9;
IL_00d9:
__result = text2;
return;
IL_0082:
text = __result;
goto IL_0085;
IL_00cf:
text = __result;
goto IL_00d2;
IL_0085:
text2 = text;
goto IL_00d9;
}
}
}
namespace LostSinner.Behaviours
{
internal class PinProjectiles : MonoBehaviour
{
private const int AdditionalPins = 32;
private void Awake()
{
CreateMorePins();
ModifyFsm();
}
private void CreateMorePins()
{
for (int i = 0; i < 32; i++)
{
Object.Instantiate<GameObject>(((Component)((Component)this).transform.GetChild(0)).gameObject, ((Component)this).transform);
}
}
private void ModifyFsm()
{
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Expected O, but got Unknown
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Expected O, but got Unknown
//IL_024e: Unknown result type (might be due to invalid IL or missing references)
//IL_0253: Unknown result type (might be due to invalid IL or missing references)
//IL_025e: Unknown result type (might be due to invalid IL or missing references)
//IL_026f: Expected O, but got Unknown
//IL_055a: Unknown result type (might be due to invalid IL or missing references)
//IL_055f: Unknown result type (might be due to invalid IL or missing references)
//IL_0570: Unknown result type (might be due to invalid IL or missing references)
//IL_0575: Unknown result type (might be due to invalid IL or missing references)
//IL_02b1: Unknown result type (might be due to invalid IL or missing references)
//IL_02b6: Unknown result type (might be due to invalid IL or missing references)
//IL_02be: Unknown result type (might be due to invalid IL or missing references)
//IL_02cb: Unknown result type (might be due to invalid IL or missing references)
//IL_02d7: Expected O, but got Unknown
//IL_03c0: Unknown result type (might be due to invalid IL or missing references)
//IL_03c5: Unknown result type (might be due to invalid IL or missing references)
//IL_03d6: Unknown result type (might be due to invalid IL or missing references)
//IL_03db: Unknown result type (might be due to invalid IL or missing references)
//IL_05a0: Unknown result type (might be due to invalid IL or missing references)
//IL_05a5: Unknown result type (might be due to invalid IL or missing references)
//IL_05b0: Unknown result type (might be due to invalid IL or missing references)
//IL_05b5: Unknown result type (might be due to invalid IL or missing references)
//IL_05b6: Unknown result type (might be due to invalid IL or missing references)
//IL_05c0: Expected O, but got Unknown
//IL_05c0: Unknown result type (might be due to invalid IL or missing references)
//IL_05cc: Expected O, but got Unknown
//IL_05ce: Unknown result type (might be due to invalid IL or missing references)
//IL_05d3: Unknown result type (might be due to invalid IL or missing references)
//IL_05e3: Expected O, but got Unknown
//IL_05e5: Unknown result type (might be due to invalid IL or missing references)
//IL_05ea: Unknown result type (might be due to invalid IL or missing references)
//IL_05eb: Unknown result type (might be due to invalid IL or missing references)
//IL_05fc: Unknown result type (might be due to invalid IL or missing references)
//IL_0609: Expected O, but got Unknown
//IL_060b: Unknown result type (might be due to invalid IL or missing references)
//IL_0610: Unknown result type (might be due to invalid IL or missing references)
//IL_061d: Unknown result type (might be due to invalid IL or missing references)
//IL_062a: Unknown result type (might be due to invalid IL or missing references)
//IL_0637: Expected O, but got Unknown
//IL_0639: Unknown result type (might be due to invalid IL or missing references)
//IL_063e: Unknown result type (might be due to invalid IL or missing references)
//IL_0645: Unknown result type (might be due to invalid IL or missing references)
//IL_064d: Unknown result type (might be due to invalid IL or missing references)
//IL_064e: Unknown result type (might be due to invalid IL or missing references)
//IL_0664: Expected O, but got Unknown
//IL_0666: Unknown result type (might be due to invalid IL or missing references)
//IL_066b: Unknown result type (might be due to invalid IL or missing references)
//IL_0672: Unknown result type (might be due to invalid IL or missing references)
//IL_067f: Expected O, but got Unknown
//IL_0681: Unknown result type (might be due to invalid IL or missing references)
//IL_0686: Unknown result type (might be due to invalid IL or missing references)
//IL_0687: Unknown result type (might be due to invalid IL or missing references)
//IL_068c: Unknown result type (might be due to invalid IL or missing references)
//IL_068e: Unknown result type (might be due to invalid IL or missing references)
//IL_0693: Unknown result type (might be due to invalid IL or missing references)
//IL_069f: Expected O, but got Unknown
//IL_069f: Unknown result type (might be due to invalid IL or missing references)
//IL_06b4: Expected O, but got Unknown
//IL_0406: Unknown result type (might be due to invalid IL or missing references)
//IL_040b: Unknown result type (might be due to invalid IL or missing references)
//IL_0416: Unknown result type (might be due to invalid IL or missing references)
//IL_041b: Unknown result type (might be due to invalid IL or missing references)
//IL_0422: Unknown result type (might be due to invalid IL or missing references)
//IL_042e: Expected O, but got Unknown
//IL_0430: Unknown result type (might be due to invalid IL or missing references)
//IL_0435: Unknown result type (might be due to invalid IL or missing references)
//IL_0445: Expected O, but got Unknown
//IL_0447: Unknown result type (might be due to invalid IL or missing references)
//IL_044c: Unknown result type (might be due to invalid IL or missing references)
//IL_044d: Unknown result type (might be due to invalid IL or missing references)
//IL_045e: Unknown result type (might be due to invalid IL or missing references)
//IL_046b: Expected O, but got Unknown
//IL_046d: Unknown result type (might be due to invalid IL or missing references)
//IL_0472: Unknown result type (might be due to invalid IL or missing references)
//IL_047f: Unknown result type (might be due to invalid IL or missing references)
//IL_048c: Unknown result type (might be due to invalid IL or missing references)
//IL_0499: Expected O, but got Unknown
//IL_049b: Unknown result type (might be due to invalid IL or missing references)
//IL_04a0: Unknown result type (might be due to invalid IL or missing references)
//IL_04a7: Unknown result type (might be due to invalid IL or missing references)
//IL_04af: Unknown result type (might be due to invalid IL or missing references)
//IL_04b0: Unknown result type (might be due to invalid IL or missing references)
//IL_04c6: Expected O, but got Unknown
//IL_04c8: Unknown result type (might be due to invalid IL or missing references)
//IL_04cd: Unknown result type (might be due to invalid IL or missing references)
//IL_04d4: Unknown result type (might be due to invalid IL or missing references)
//IL_04e1: Expected O, but got Unknown
//IL_04e3: Unknown result type (might be due to invalid IL or missing references)
//IL_04e8: Unknown result type (might be due to invalid IL or missing references)
//IL_04e9: Unknown result type (might be due to invalid IL or missing references)
//IL_04ee: Unknown result type (might be due to invalid IL or missing references)
//IL_04f0: Unknown result type (might be due to invalid IL or missing references)
//IL_04f5: Unknown result type (might be due to invalid IL or missing references)
//IL_0501: Expected O, but got Unknown
//IL_0501: Unknown result type (might be due to invalid IL or missing references)
//IL_0516: Expected O, but got Unknown
//IL_0794: Unknown result type (might be due to invalid IL or missing references)
//IL_0799: Unknown result type (might be due to invalid IL or missing references)
//IL_07a5: Expected O, but got Unknown
//IL_07a7: Unknown result type (might be due to invalid IL or missing references)
//IL_07ac: Unknown result type (might be due to invalid IL or missing references)
//IL_07b3: Unknown result type (might be due to invalid IL or missing references)
//IL_07c3: Expected O, but got Unknown
//IL_07c5: Unknown result type (might be due to invalid IL or missing references)
//IL_07ca: Unknown result type (might be due to invalid IL or missing references)
//IL_07d1: Unknown result type (might be due to invalid IL or missing references)
//IL_07de: Expected O, but got Unknown
//IL_07e0: Unknown result type (might be due to invalid IL or missing references)
//IL_07e5: Unknown result type (might be due to invalid IL or missing references)
//IL_07ed: Unknown result type (might be due to invalid IL or missing references)
//IL_07ff: Expected O, but got Unknown
//IL_0801: Unknown result type (might be due to invalid IL or missing references)
//IL_0806: Unknown result type (might be due to invalid IL or missing references)
//IL_0819: Unknown result type (might be due to invalid IL or missing references)
//IL_082c: Unknown result type (might be due to invalid IL or missing references)
//IL_0839: Expected O, but got Unknown
//IL_083b: Unknown result type (might be due to invalid IL or missing references)
//IL_0840: Unknown result type (might be due to invalid IL or missing references)
//IL_0847: Unknown result type (might be due to invalid IL or missing references)
//IL_084f: Unknown result type (might be due to invalid IL or missing references)
//IL_0864: Expected O, but got Unknown
//IL_0866: Unknown result type (might be due to invalid IL or missing references)
//IL_086b: Unknown result type (might be due to invalid IL or missing references)
//IL_0872: Unknown result type (might be due to invalid IL or missing references)
//IL_087f: Expected O, but got Unknown
//IL_0881: Unknown result type (might be due to invalid IL or missing references)
//IL_0886: Unknown result type (might be due to invalid IL or missing references)
//IL_089b: Expected O, but got Unknown
PlayMakerFSM val = FSMUtility.LocateMyFSM(((Component)this).gameObject, "Pattern Control");
Fsm fsm = val.Fsm;
FsmOwnerDefault gameObject = new FsmOwnerDefault
{
ownerOption = (OwnerDefaultOption)0
};
FsmGameObject fsmGameObject = fsm.GetFsmGameObject("Next Pin");
FsmOwnerDefault gameObject2 = new FsmOwnerDefault
{
gameObject = fsmGameObject
};
FsmFloat fsmFloat = fsm.GetFsmFloat("Pos X");
FsmFloat fsmFloat2 = fsm.GetFsmFloat("Rotation");
FsmFloat fsmFloat3 = fsm.GetFsmFloat("Scene Centre X");
FsmState[] fsmStates = val.FsmStates;
foreach (FsmState val2 in fsmStates)
{
switch (val2.name)
{
case "Rain 1":
{
FsmStateAction[] actions = val2.Actions;
foreach (FsmStateAction obj5 in actions)
{
SetIntValue val8 = (SetIntValue)(object)((obj5 is SetIntValue) ? obj5 : null);
if (val8 != null)
{
val8.intValue = FsmInt.op_Implicit(8);
break;
}
}
break;
}
case "Rain 2":
{
FsmStateAction[] actions = val2.Actions;
foreach (FsmStateAction obj4 in actions)
{
FloatAdd val7 = (FloatAdd)(object)((obj4 is FloatAdd) ? obj4 : null);
if (val7 != null)
{
val7.add = FsmFloat.op_Implicit(3f);
break;
}
}
break;
}
case "Sweep Dir":
{
val2.Actions = (FsmStateAction[])(object)new FsmStateAction[1] { (FsmStateAction)new SendEventByName
{
eventTarget = FsmEventTarget.Self,
sendEvent = FsmString.op_Implicit("FINISHED")
} };
FsmState val10 = ((IEnumerable<FsmState>)val.FsmStates).FirstOrDefault((Func<FsmState, bool>)((FsmState s) => s.name == "Sweep R"));
if (val10 != null)
{
val2.Transitions = (FsmTransition[])(object)new FsmTransition[1]
{
new FsmTransition
{
toFsmState = val10,
toState = val10.Name,
FsmEvent = FsmEvent.Finished
}
};
}
break;
}
case "Sweep R":
{
FsmState val5 = ((IEnumerable<FsmState>)val.FsmStates).FirstOrDefault((Func<FsmState, bool>)((FsmState s) => s.name == "Sweep L"));
if (val5 != null)
{
val2.Transitions[0].toFsmState = val5;
val2.Transitions[0].toState = val5.Name;
}
FsmStateAction obj3 = val2.Actions[5];
SetPosition val6 = (SetPosition)(object)((obj3 is SetPosition) ? obj3 : null);
if (val6 != null)
{
val6.x = FsmFloat.op_Implicit(fsmFloat3.Value - 15f);
}
break;
}
case "Sweep L":
{
FsmStateAction obj6 = val2.Actions[5];
SetPosition val11 = (SetPosition)(object)((obj6 is SetPosition) ? obj6 : null);
if (val11 != null)
{
val11.x = FsmFloat.op_Implicit(fsmFloat3.Value + 15f);
}
break;
}
case "Claw R":
{
List<FsmStateAction> list2 = val2.Actions.ToList();
Vector2[] array3 = (Vector2[])(object)new Vector2[2]
{
new Vector2(28f, 18.7f),
new Vector2(35f, 19.7f)
};
float[] array4 = new float[2] { -62f, -47f };
for (int l = 0; l < array3.Length; l++)
{
Vector2 val9 = array3[l];
float num3 = array4[l];
list2.Add((FsmStateAction)new GetRandomChild
{
gameObject = gameObject,
storeResult = fsmGameObject
});
list2.Add((FsmStateAction)new GameObjectIsNull
{
isNull = FsmEvent.Finished
});
list2.Add((FsmStateAction)new FloatOperator
{
float1 = FsmFloat.op_Implicit(val9.x),
storeResult = fsmFloat
});
list2.Add((FsmStateAction)new RandomFloat
{
min = FsmFloat.op_Implicit(num3),
max = FsmFloat.op_Implicit(num3),
storeResult = fsmFloat2
});
list2.Add((FsmStateAction)new SetPosition
{
gameObject = gameObject2,
x = fsmFloat,
y = FsmFloat.op_Implicit(val9.y)
});
list2.Add((FsmStateAction)new SetRotation
{
gameObject = gameObject2,
zAngle = fsmFloat2
});
list2.Add((FsmStateAction)new SendEventByName
{
eventTarget = new FsmEventTarget
{
target = (EventTarget)1,
gameObject = gameObject2
},
sendEvent = FsmString.op_Implicit("ATTACK")
});
}
val2.Actions = list2.ToArray();
break;
}
case "Claw L":
{
List<FsmStateAction> list3 = val2.Actions.ToList();
Vector2[] array5 = (Vector2[])(object)new Vector2[2]
{
new Vector2(48f, 18.7f),
new Vector2(40f, 19.7f)
};
float[] array6 = new float[2] { 242f, 228f };
for (int m = 0; m < array5.Length; m++)
{
Vector2 val12 = array5[m];
float num4 = array6[m];
list3.Add((FsmStateAction)new GetRandomChild
{
gameObject = new FsmOwnerDefault(),
storeResult = fsmGameObject
});
list3.Add((FsmStateAction)new GameObjectIsNull
{
isNull = FsmEvent.Finished
});
list3.Add((FsmStateAction)new FloatOperator
{
float1 = FsmFloat.op_Implicit(val12.x),
storeResult = fsmFloat
});
list3.Add((FsmStateAction)new RandomFloat
{
min = FsmFloat.op_Implicit(num4),
max = FsmFloat.op_Implicit(num4),
storeResult = fsmFloat2
});
list3.Add((FsmStateAction)new SetPosition
{
gameObject = gameObject2,
x = fsmFloat,
y = FsmFloat.op_Implicit(val12.y)
});
list3.Add((FsmStateAction)new SetRotation
{
gameObject = gameObject2,
zAngle = fsmFloat2
});
list3.Add((FsmStateAction)new SendEventByName
{
eventTarget = new FsmEventTarget
{
target = (EventTarget)1,
gameObject = gameObject2
},
sendEvent = FsmString.op_Implicit("ATTACK")
});
}
val2.Actions = list3.ToArray();
break;
}
case "Pincer":
{
List<FsmStateAction> list = val2.Actions.ToList();
FsmStateAction obj = list[4];
RandomFloat val3 = (RandomFloat)(object)((obj is RandomFloat) ? obj : null);
if (val3 != null)
{
val3.min = FsmFloat.op_Implicit(-122f);
val3.max = FsmFloat.op_Implicit(-118f);
}
FsmStateAction obj2 = list[12];
RandomFloat val4 = (RandomFloat)(object)((obj2 is RandomFloat) ? obj2 : null);
if (val4 != null)
{
val4.min = FsmFloat.op_Implicit(-62f);
val4.max = FsmFloat.op_Implicit(-58f);
}
float[] array = new float[3] { -15f, 0f, 15f };
float[] array2 = new float[3] { -30f, -90f, -150f };
for (int j = 0; j < array.Length; j++)
{
float num = array[j];
float num2 = array2[j];
list.Add((FsmStateAction)new GetRandomChild
{
storeResult = fsmGameObject
});
list.Add((FsmStateAction)new GameObjectIsNull
{
gameObject = fsmGameObject,
isNull = FsmEvent.Finished
});
list.Add((FsmStateAction)new GetPosition
{
gameObject = gameObject,
x = fsmFloat
});
list.Add((FsmStateAction)new FloatAdd
{
floatVariable = fsmFloat,
add = FsmFloat.op_Implicit(num)
});
list.Add((FsmStateAction)new RandomFloat
{
min = FsmFloat.op_Implicit(num2 - 2f),
max = FsmFloat.op_Implicit(num2 + 2f),
storeResult = fsmFloat2
});
list.Add((FsmStateAction)new SetPosition
{
gameObject = gameObject2,
x = fsmFloat,
y = FsmFloat.op_Implicit(18f)
});
list.Add((FsmStateAction)new SetRotation
{
gameObject = gameObject2,
zAngle = fsmFloat2
});
list.Add((FsmStateAction)new SendEventByName
{
sendEvent = FsmString.op_Implicit("ATTACK")
});
}
val2.Actions = list.ToArray();
break;
}
}
}
}
}
[RequireComponent(typeof(tk2dSpriteAnimator))]
[RequireComponent(typeof(Rigidbody2D))]
[RequireComponent(typeof(PlayMakerFSM))]
internal class Sinner : MonoBehaviour
{
[CompilerGenerated]
private sealed class <>c__DisplayClass22_0
{
public float riseTimer;
public Sinner <>4__this;
public float riseTime;
internal bool <VomitGlobAttack>b__0()
{
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
riseTimer += Time.deltaTime;
float num = <>4__this._body.linearVelocity.y * 0.85f;
<>4__this._body.linearVelocity = new Vector2(<>4__this._body.linearVelocity.x, num);
return riseTimer >= riseTime;
}
}
[CompilerGenerated]
private sealed class <SetupBoss>d__6 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public Sinner <>4__this;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <SetupBoss>d__6(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
int num = <>1__state;
Sinner sinner = <>4__this;
switch (num)
{
default:
return false;
case 0:
<>1__state = -1;
<>2__current = AssetManager.ManuallyLoadBundles();
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
<>2__current = AssetManager.Initialize();
<>1__state = 2;
return true;
case 2:
<>1__state = -1;
sinner.GetComponents();
sinner.ChangeBlackThreadVoice();
sinner.ChangeTextures();
sinner.ModifyDamage();
sinner.IncreaseHealth();
sinner.RemoveStuns();
sinner.ModifyFsm();
return false;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
[CompilerGenerated]
private sealed class <VomitGlobAttack>d__22 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public Sinner <>4__this;
private GameObject <abyssGlobPrefab>5__2;
private GameObject <audioPlayerPrefab>5__3;
private AudioClip <spitClip>5__4;
private int <shots>5__5;
private int <i>5__6;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <VomitGlobAttack>d__22(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<abyssGlobPrefab>5__2 = null;
<audioPlayerPrefab>5__3 = null;
<spitClip>5__4 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_0114: Unknown result type (might be due to invalid IL or missing references)
//IL_0123: Unknown result type (might be due to invalid IL or missing references)
//IL_0148: Unknown result type (might be due to invalid IL or missing references)
//IL_019b: Unknown result type (might be due to invalid IL or missing references)
//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0207: Expected O, but got Unknown
//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
//IL_00f8: Expected O, but got Unknown
int num = <>1__state;
Sinner sinner = <>4__this;
switch (num)
{
default:
return false;
case 0:
{
<>1__state = -1;
<>c__DisplayClass22_0 CS$<>8__locals0 = new <>c__DisplayClass22_0
{
<>4__this = <>4__this
};
<abyssGlobPrefab>5__2 = AssetManager.Get<GameObject>("Abyss Vomit Glob");
if ((Object)(object)<abyssGlobPrefab>5__2 == (Object)null)
{
return false;
}
<audioPlayerPrefab>5__3 = AssetManager.Get<GameObject>("Audio Player Actor Simple");
if ((Object)(object)<audioPlayerPrefab>5__3 == (Object)null)
{
return false;
}
<spitClip>5__4 = AssetManager.Get<AudioClip>("mini_mawlek_spit");
if ((Object)(object)<spitClip>5__4 == (Object)null)
{
return false;
}
sinner._anim.Play("Cast");
sinner.FaceHero();
sinner._body.linearVelocity = new Vector2(0f, 15f);
CS$<>8__locals0.riseTime = 0.25f;
CS$<>8__locals0.riseTimer = 0f;
<>2__current = (object)new WaitUntil((Func<bool>)delegate
{
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
CS$<>8__locals0.riseTimer += Time.deltaTime;
float num2 = CS$<>8__locals0.<>4__this._body.linearVelocity.y * 0.85f;
CS$<>8__locals0.<>4__this._body.linearVelocity = new Vector2(CS$<>8__locals0.<>4__this._body.linearVelocity.x, num2);
return CS$<>8__locals0.riseTimer >= CS$<>8__locals0.riseTime;
});
<>1__state = 1;
return true;
}
case 1:
<>1__state = -1;
sinner._body.linearVelocity = new Vector2(sinner._body.linearVelocity.x, 0f);
<shots>5__5 = Random.Range(5, 8);
<i>5__6 = 0;
break;
case 2:
<>1__state = -1;
<i>5__6++;
break;
}
if (<i>5__6 < <shots>5__5)
{
Config val = default(Config);
val.Prefab = <abyssGlobPrefab>5__2;
val.SpeedMin = 20f;
val.SpeedMax = 30f;
val.AngleMin = 45f;
val.AngleMax = 135f;
val.AmountMin = 1;
val.AmountMax = 1;
FlingUtils.SpawnAndFling(val, ((Component)sinner).transform, Vector3.up * 2f, (List<GameObject>)null, -1f);
AudioSource component = ObjectPoolExtensions.Spawn(<audioPlayerPrefab>5__3, ((Component)sinner).transform.position).GetComponent<AudioSource>();
component.pitch = Random.Range(0.85f, 1.15f);
component.PlayOneShot(<spitClip>5__4);
<>2__current = (object)new WaitForSeconds(0.05f);
<>1__state = 2;
return true;
}
sinner._control.SendEvent("FINISHED");
return false;
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
private const float GroundY = 13f;
private tk2dSpriteAnimator _anim;
private Rigidbody2D _body;
private PlayMakerFSM _control;
private Transform _heroTransform;
private void Awake()
{
((MonoBehaviour)this).StartCoroutine(SetupBoss());
}
[IteratorStateMachine(typeof(<SetupBoss>d__6))]
private IEnumerator SetupBoss()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <SetupBoss>d__6(0)
{
<>4__this = this
};
}
private void GetComponents()
{
_anim = ((Component)this).GetComponent<tk2dSpriteAnimator>();
_body = ((Component)this).GetComponent<Rigidbody2D>();
_control = FSMUtility.LocateMyFSM(((Component)this).gameObject, "Control");
_heroTransform = HeroController.instance.transform;
}
private void ChangeBlackThreadVoice()
{
foreach (AudioSource item in from audio in ((Component)this).GetComponentsInChildren<AudioSource>(true)
where ((Object)audio).name == "Audio Loop Voice"
select audio)
{
AudioMixerGroup[] array = item.outputAudioMixerGroup.audioMixer.FindMatchingGroups("Actors VoiceBlackThread");
item.outputAudioMixerGroup = array[0];
}
}
private void ChangeTextures()
{
tk2dSpriteCollectionData collection = ((tk2dBaseSprite)((Component)this).GetComponent<tk2dSprite>()).Collection;
for (int i = 0; i < collection.materials.Length; i++)
{
collection.materials[i].mainTexture = (Texture)(object)AssetManager.Get<Texture2D>($"atlas{i}");
}
}
private void ModifyDamage()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
DamagePropertyFlags damagePropertyFlags = (DamagePropertyFlags)8;
DamageHero[] componentsInChildren = ((Component)this).GetComponentsInChildren<DamageHero>(true);
foreach (DamageHero val in componentsInChildren)
{
PlayMakerFSM val2 = FSMUtility.LocateMyFSM(((Component)val).gameObject, "hornet_multi_wounder");
if (Object.op_Implicit((Object)(object)val2))
{
val2.Fsm.GetFsmBool("z3 Force Black Threaded").Value = true;
continue;
}
val.damageDealt = 2;
val.damagePropertyFlags = damagePropertyFlags;
}
}
private void IncreaseHealth()
{
((Component)this).GetComponent<HealthManager>().hp = 2000;
}
private void RemoveStuns()
{
Object.Destroy((Object)(object)FSMUtility.LocateMyFSM(((Component)this).gameObject, "Stun Control"));
}
private void ModifyFsm()
{
AddAbyssTendrilsToCharge();
AddVomitGlobAttack();
MakeFacingSecondSlash();
ShortenBindTime();
ModifyPhase2();
}
private void AddAbyssTendrilsToCharge()
{
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_005e: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: Unknown result type (might be due to invalid IL or missing references)
//IL_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_0089: Unknown result type (might be due to invalid IL or missing references)
//IL_008a: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
//IL_00ae: Expected O, but got Unknown
GameObject val = AssetManager.Get<GameObject>("Lost Lace Ground Tendril");
if (!Object.op_Implicit((Object)(object)val))
{
return;
}
FsmState[] fsmStates = _control.FsmStates;
foreach (FsmState val2 in fsmStates)
{
if (val2.Name == "Slice Charge")
{
List<FsmStateAction> list = val2.Actions.ToList();
list.Insert(0, (FsmStateAction)new SpawnObjectFromGlobalPoolOverTime
{
gameObject = FsmGameObject.op_Implicit(val),
spawnPoint = FsmGameObject.op_Implicit(((Component)this).gameObject),
position = FsmVector3.op_Implicit(Vector3.up * 1.8000002f),
rotation = FsmVector3.op_Implicit(Vector3.one),
frequency = FsmFloat.op_Implicit(0.25f)
});
val2.Actions = list.ToArray();
}
}
}
private void AddVomitGlobAttack()
{
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Expected O, but got Unknown
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006e: Expected O, but got Unknown
//IL_006e: Unknown result type (might be due to invalid IL or missing references)
//IL_0073: Unknown result type (might be due to invalid IL or missing references)
//IL_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_0086: Unknown result type (might be due to invalid IL or missing references)
//IL_008e: Expected O, but got Unknown
//IL_00be: Unknown result type (might be due to invalid IL or missing references)
//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
//IL_00e2: Expected O, but got Unknown
//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
//IL_00ff: Expected O, but got Unknown
//IL_010c: Unknown result type (might be due to invalid IL or missing references)
//IL_0113: Expected O, but got Unknown
//IL_0120: Unknown result type (might be due to invalid IL or missing references)
//IL_0127: Expected O, but got Unknown
//IL_0134: Unknown result type (might be due to invalid IL or missing references)
//IL_013b: Expected O, but got Unknown
FsmState val = new FsmState(_control.Fsm);
val.Name = "Vomit Routine";
val.Actions = (FsmStateAction[])(object)new FsmStateAction[1]
{
new InvokeCoroutine(VomitGlobAttack, wait: true)
};
_control.Fsm.States = _control.FsmStates.Append(val).ToArray();
FsmEvent val2 = new FsmEvent("VOMIT");
FsmTransition element = new FsmTransition
{
ToFsmState = val,
ToState = val.Name,
FsmEvent = val2
};
FsmState toFsmState = _control.FsmStates.First((FsmState state) => state.Name == "Idle");
FsmTransition val3 = new FsmTransition
{
ToFsmState = toFsmState,
ToState = "Idle",
FsmEvent = FsmEvent.Finished
};
val.Transitions = (FsmTransition[])(object)new FsmTransition[1] { val3 };
FsmInt val4 = new FsmInt("Ct Vomit");
val4.Value = 0;
FsmInt val5 = new FsmInt("Vomit Max");
val5.Value = 2;
FsmInt val6 = new FsmInt("Ms Vomit");
val6.Value = 0;
FsmInt val7 = new FsmInt("Ms Vomit");
val7.Value = 3;
_control.FsmVariables.IntVariables = _control.FsmVariables.IntVariables.Append(val4).ToArray();
FsmState[] fsmStates = _control.FsmStates;
foreach (FsmState val8 in fsmStates)
{
bool flag;
switch (val8.Name)
{
case "P1 Early":
case "P1":
case "P2":
case "No Tele Event":
case "Tele Event":
flag = true;
break;
default:
flag = false;
break;
}
if (flag)
{
val8.Transitions = val8.Transitions.Append(element).ToArray();
int num = 0;
string name = val8.Name;
if ((name == "P1 Early" || name == "P1") ? true : false)
{
num = 1;
}
FsmStateAction obj = val8.Actions[num];
SendRandomEventV3 val9 = (SendRandomEventV3)(object)((obj is SendRandomEventV3) ? obj : null);
if (val9 != null)
{
val9.events = val9.events.Append(val2).ToArray();
val9.weights = val9.weights.Append(FsmFloat.op_Implicit(0.5f)).ToArray();
val9.trackingInts = val9.trackingInts.Append(val4).ToArray();
val9.eventMax = val9.eventMax.Append(val5).ToArray();
val9.trackingIntsMissed = val9.trackingIntsMissed.Append(val6).ToArray();
val9.missedMax = val9.missedMax.Append(val7).ToArray();
}
}
}
}
private void MakeFacingSecondSlash()
{
FsmState val = ((IEnumerable<FsmState>)_control.FsmStates).FirstOrDefault((Func<FsmState, bool>)((FsmState state) => state.Name == "Slash 3"));
if (val != null)
{
List<FsmStateAction> list = val.Actions.ToList();
list.Insert(0, (FsmStateAction)(object)new InvokeMethod(FaceHero));
val.Actions = list.ToArray();
}
}
private void ShortenBindTime()
{
FsmState val = ((IEnumerable<FsmState>)_control.FsmStates).FirstOrDefault((Func<FsmState, bool>)((FsmState state) => state.Name == "Bind Silk"));
if (val == null)
{
return;
}
FsmStateAction[] actions = val.Actions;
foreach (FsmStateAction obj in actions)
{
Wait val2 = (Wait)(object)((obj is Wait) ? obj : null);
if (val2 != null)
{
val2.time = FsmFloat.op_Implicit(1f);
break;
}
}
}
private void ModifyPhase2()
{
FsmState val = ((IEnumerable<FsmState>)_control.FsmStates).FirstOrDefault((Func<FsmState, bool>)((FsmState state) => state.name == "P2 Start"));
if (val != null)
{
val.Actions = val.Actions.Append((FsmStateAction)(object)new InvokeMethod(IncreaseChargeSliceSpeed)).Append((FsmStateAction)(object)new InvokeMethod(SpeedUpPhase2Pins)).Append((FsmStateAction)(object)new InvokeMethod(SlashToCharge))
.ToArray();
}
}
private void SlashToCharge()
{
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_0065: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Unknown result type (might be due to invalid IL or missing references)
//IL_0078: Unknown result type (might be due to invalid IL or missing references)
//IL_0084: Expected O, but got Unknown
FsmState val = null;
FsmState val2 = null;
FsmState[] fsmStates = _control.FsmStates;
foreach (FsmState val3 in fsmStates)
{
if (val3.Name == "After Slash")
{
val = val3;
}
else if (val3.Name == "Slice Charge Antic")
{
val2 = val3;
}
}
if (val != null && val2 != null)
{
val.Transitions = (FsmTransition[])(object)new FsmTransition[1]
{
new FsmTransition
{
toFsmState = val2,
toState = val.Name,
FsmEvent = FsmEvent.Finished
}
};
}
}
private void IncreaseChargeSliceSpeed()
{
FsmStateAction[] actions = _control.FsmStates.First((FsmState state) => state.Name == "Slice Charge").Actions;
FsmStateAction obj = actions[1];
SetVelocityByScale val = (SetVelocityByScale)(object)((obj is SetVelocityByScale) ? obj : null);
if (val != null)
{
val.speed = FsmFloat.op_Implicit(-12f);
}
FsmStateAction obj2 = actions[2];
AccelerateToXByScale val2 = (AccelerateToXByScale)(object)((obj2 is AccelerateToXByScale) ? obj2 : null);
if (val2 != null)
{
val2.accelerationFactor = FsmFloat.op_Implicit(0.65f);
val2.targetSpeed = FsmFloat.op_Implicit(40f);
}
FsmStateAction obj3 = actions[6];
Wait val3 = (Wait)(object)((obj3 is Wait) ? obj3 : null);
if (val3 != null)
{
val3.time = FsmFloat.op_Implicit(1f);
}
}
private void SpeedUpPhase2Pins()
{
foreach (PlayMakerFSM item in from fsm in Object.FindObjectsByType<PlayMakerFSM>((FindObjectsSortMode)0)
where ((Object)fsm).name.Contains("FW Pin Projectile")
select fsm)
{
FsmStateAction obj = item.FsmStates.First((FsmState state) => state.Name == "Fire").Actions.First((FsmStateAction action) => action is SetVelocityAsAngle);
((SetVelocityAsAngle)((obj is SetVelocityAsAngle) ? obj : null)).speed = FsmFloat.op_Implicit(180f);
FsmStateAction obj2 = item.FsmStates.First((FsmState state) => state.Name == "Thread Pull").Actions[3];
Wait val = (Wait)(object)((obj2 is Wait) ? obj2 : null);
if (val != null)
{
val.time = FsmFloat.op_Implicit(0.4f);
}
}
}
[IteratorStateMachine(typeof(<VomitGlobAttack>d__22))]
private IEnumerator VomitGlobAttack()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <VomitGlobAttack>d__22(0)
{
<>4__this = this
};
}
private void FaceHero()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_0078: Unknown result type (might be due to invalid IL or missing references)
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_0094: Unknown result type (might be due to invalid IL or missing references)
if ((_heroTransform.position.x > ((Component)this).transform.position.x && ((Component)this).transform.localScale.x > 0f) || (_heroTransform.position.x < ((Component)this).transform.position.x && ((Component)this).transform.localScale.x < 0f))
{
Vector3 localScale = ((Component)this).transform.localScale;
localScale.x *= -1f;
((Component)this).transform.localScale = localScale;
}
}
private void OnDestroy()
{
AssetManager.UnloadManualBundles();
}
}
}