using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using GameConsole;
using GameConsole.Commands;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using PluginConfig.API;
using PluginConfig.API.Fields;
using PluginConfig.API.Functionals;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = "")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: AssemblyCompany("ExitDoorManager")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Allows you to edit where exit doors lead.")]
[assembly: AssemblyFileVersion("1.2.1.0")]
[assembly: AssemblyInformationalVersion("1.2.1+548915656cdcb85df229079514a4068da43ab859")]
[assembly: AssemblyProduct("ExitDoorManager")]
[assembly: AssemblyTitle("ExitDoorManager")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.2.1.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.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace ExitDoorManager
{
public static class ConfigManager
{
[Serializable]
[CompilerGenerated]
private sealed class <>c
{
public static readonly <>c <>9 = new <>c();
public static Predicate<ConfigField> <>9__64_0;
public static OnClick <>9__65_0;
public static OnClick <>9__65_1;
public static Predicate<string> <>9__65_2;
internal bool <GetExits>b__64_0(ConfigField field)
{
return field.guid.StartsWith("exit") || field.guid.EndsWith("intro");
}
internal void <Initialize>b__65_0()
{
StringListField[] exits = GetExits();
foreach (StringListField val in exits)
{
val.value = val.defaultValue;
}
}
internal void <Initialize>b__65_1()
{
Randomizer.RandomizeExits();
}
internal bool <Initialize>b__65_2(string l)
{
return !l.StartsWith("Random");
}
}
public static string[] Levels = new string[54]
{
"Random Scene", "Random Level", "Level 0-1", "Level 0-2", "Level 0-3", "Level 0-4", "Level 0-5", "Level 0-S", "Level 1-1", "Level 1-2",
"Level 1-3", "Level 1-4", "Level 1-S", "Level 2-1", "Level 2-2", "Level 2-3", "Level 2-4", "Level 2-S", "Level 3-1", "Level 3-2",
"Intermission1", "Level P-1", "Level 4-1", "Level 4-2", "Level 4-3", "Level 4-4", "Level 4-S", "Level 5-1", "Level 5-2", "Level 5-3",
"Level 5-4", "Level 5-S", "Level 6-1", "Level 6-2", "Intermission2", "Level P-2", "Level 7-1", "Level 7-2", "Level 7-3", "Level 7-4",
"Level 7-S", "Level 8-1", "Level 8-2", "Level 8-3", "Level 8-4", "Level 0-E", "Level 1-E", "Intro", "Main Menu", "The Cyber Grind",
"Sandbox", "Credits Museum", "EarlyAccessEnd", "Close Game"
};
public static StringListField postintro;
public static StringListField intro;
public static StringListField exit01;
public static StringListField exit02;
public static StringListField exit02s;
public static StringListField exit03;
public static StringListField exit04;
public static StringListField exit05;
public static StringListField exit0S;
public static StringListField exit11;
public static StringListField exit11s;
public static StringListField exit12;
public static StringListField exit13;
public static StringListField exit14;
public static StringListField exit1S;
public static StringListField exit21;
public static StringListField exit22;
public static StringListField exit23;
public static StringListField exit23s;
public static StringListField exit24;
public static StringListField exit2S;
public static StringListField exit31;
public static StringListField exit31s;
public static StringListField exit32;
public static StringListField exitI1;
public static StringListField exitP1;
public static StringListField exit41;
public static StringListField exit42;
public static StringListField exit42s;
public static StringListField exit43;
public static StringListField exit44;
public static StringListField exit4S;
public static StringListField exit51;
public static StringListField exit51s;
public static StringListField exit52;
public static StringListField exit53;
public static StringListField exit54;
public static StringListField exit5S;
public static StringListField exit61;
public static StringListField exit62;
public static StringListField exit62s;
public static StringListField exitI2;
public static StringListField exitP2;
public static StringListField exit71;
public static StringListField exit72;
public static StringListField exit73;
public static StringListField exit73s;
public static StringListField exit74;
public static StringListField exit81;
public static StringListField exit82;
public static StringListField exit83;
public static StringListField exit84;
public static StringListField exit7s;
public static StringListField exit0e;
public static StringListField exit1e;
public static PluginConfigurator config;
public static ButtonField randomizeButton;
public static ButtonField resetButton;
public static ConfigPanel randoSettings;
public static BoolField allowSecretLevels;
public static BoolField allowEncoreLevels;
public static BoolField allowPrimeSanctums;
public static StringListField finalScene;
public static StringListField[] GetExits()
{
ConfigField[] array = Array.FindAll(config.rootPanel.GetAllFields(), (ConfigField field) => field.guid.StartsWith("exit") || field.guid.EndsWith("intro"));
StringListField[] array2 = (StringListField[])(object)new StringListField[array.Length];
for (int i = 0; i < array.Length; i++)
{
ref StringListField reference = ref array2[i];
ConfigField obj = array[i];
reference = (StringListField)(object)((obj is StringListField) ? obj : null);
}
return array2;
}
public static void Initialize()
{
//IL_0051: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: Expected O, but got Unknown
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
//IL_00a3: Expected O, but got Unknown
//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
//IL_00bc: Expected O, but got Unknown
//IL_0074: Unknown result type (might be due to invalid IL or missing references)
//IL_0079: Unknown result type (might be due to invalid IL or missing references)
//IL_007f: Expected O, but got Unknown
//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
//IL_0100: Expected O, but got Unknown
//IL_0110: Unknown result type (might be due to invalid IL or missing references)
//IL_011a: Expected O, but got Unknown
//IL_012a: Unknown result type (might be due to invalid IL or missing references)
//IL_0134: Expected O, but got Unknown
//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
//IL_00da: Unknown result type (might be due to invalid IL or missing references)
//IL_00e0: Expected O, but got Unknown
//IL_0171: Unknown result type (might be due to invalid IL or missing references)
//IL_017b: Expected O, but got Unknown
//IL_0199: Unknown result type (might be due to invalid IL or missing references)
//IL_01a3: Expected O, but got Unknown
//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
//IL_01cb: Expected O, but got Unknown
//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
//IL_01f3: Expected O, but got Unknown
//IL_0211: Unknown result type (might be due to invalid IL or missing references)
//IL_021b: Expected O, but got Unknown
//IL_0239: Unknown result type (might be due to invalid IL or missing references)
//IL_0243: Expected O, but got Unknown
//IL_0261: Unknown result type (might be due to invalid IL or missing references)
//IL_026b: Expected O, but got Unknown
//IL_0289: Unknown result type (might be due to invalid IL or missing references)
//IL_0293: Expected O, but got Unknown
//IL_02b1: Unknown result type (might be due to invalid IL or missing references)
//IL_02bb: Expected O, but got Unknown
//IL_02d9: Unknown result type (might be due to invalid IL or missing references)
//IL_02e3: Expected O, but got Unknown
//IL_0301: Unknown result type (might be due to invalid IL or missing references)
//IL_030b: Expected O, but got Unknown
//IL_0329: Unknown result type (might be due to invalid IL or missing references)
//IL_0333: Expected O, but got Unknown
//IL_0351: Unknown result type (might be due to invalid IL or missing references)
//IL_035b: Expected O, but got Unknown
//IL_0379: Unknown result type (might be due to invalid IL or missing references)
//IL_0383: Expected O, but got Unknown
//IL_03a1: Unknown result type (might be due to invalid IL or missing references)
//IL_03ab: Expected O, but got Unknown
//IL_03c9: Unknown result type (might be due to invalid IL or missing references)
//IL_03d3: Expected O, but got Unknown
//IL_03f1: Unknown result type (might be due to invalid IL or missing references)
//IL_03fb: Expected O, but got Unknown
//IL_0419: Unknown result type (might be due to invalid IL or missing references)
//IL_0423: Expected O, but got Unknown
//IL_0441: Unknown result type (might be due to invalid IL or missing references)
//IL_044b: Expected O, but got Unknown
//IL_0469: Unknown result type (might be due to invalid IL or missing references)
//IL_0473: Expected O, but got Unknown
//IL_0491: Unknown result type (might be due to invalid IL or missing references)
//IL_049b: Expected O, but got Unknown
//IL_04b9: Unknown result type (might be due to invalid IL or missing references)
//IL_04c3: Expected O, but got Unknown
//IL_04e1: Unknown result type (might be due to invalid IL or missing references)
//IL_04eb: Expected O, but got Unknown
//IL_0509: Unknown result type (might be due to invalid IL or missing references)
//IL_0513: Expected O, but got Unknown
//IL_0531: Unknown result type (might be due to invalid IL or missing references)
//IL_053b: Expected O, but got Unknown
//IL_0559: Unknown result type (might be due to invalid IL or missing references)
//IL_0563: Expected O, but got Unknown
//IL_0581: Unknown result type (might be due to invalid IL or missing references)
//IL_058b: Expected O, but got Unknown
//IL_05a9: Unknown result type (might be due to invalid IL or missing references)
//IL_05b3: Expected O, but got Unknown
//IL_05d1: Unknown result type (might be due to invalid IL or missing references)
//IL_05db: Expected O, but got Unknown
//IL_05f9: Unknown result type (might be due to invalid IL or missing references)
//IL_0603: Expected O, but got Unknown
//IL_0621: Unknown result type (might be due to invalid IL or missing references)
//IL_062b: Expected O, but got Unknown
//IL_0649: Unknown result type (might be due to invalid IL or missing references)
//IL_0653: Expected O, but got Unknown
//IL_0671: Unknown result type (might be due to invalid IL or missing references)
//IL_067b: Expected O, but got Unknown
//IL_0699: Unknown result type (might be due to invalid IL or missing references)
//IL_06a3: Expected O, but got Unknown
//IL_06c1: Unknown result type (might be due to invalid IL or missing references)
//IL_06cb: Expected O, but got Unknown
//IL_06e9: Unknown result type (might be due to invalid IL or missing references)
//IL_06f3: Expected O, but got Unknown
//IL_0711: Unknown result type (might be due to invalid IL or missing references)
//IL_071b: Expected O, but got Unknown
//IL_0739: Unknown result type (might be due to invalid IL or missing references)
//IL_0743: Expected O, but got Unknown
//IL_0761: Unknown result type (might be due to invalid IL or missing references)
//IL_076b: Expected O, but got Unknown
//IL_0789: Unknown result type (might be due to invalid IL or missing references)
//IL_0793: Expected O, but got Unknown
//IL_07b1: Unknown result type (might be due to invalid IL or missing references)
//IL_07bb: Expected O, but got Unknown
//IL_07d9: Unknown result type (might be due to invalid IL or missing references)
//IL_07e3: Expected O, but got Unknown
//IL_0801: Unknown result type (might be due to invalid IL or missing references)
//IL_080b: Expected O, but got Unknown
//IL_0829: Unknown result type (might be due to invalid IL or missing references)
//IL_0833: Expected O, but got Unknown
//IL_0851: Unknown result type (might be due to invalid IL or missing references)
//IL_085b: Expected O, but got Unknown
//IL_0879: Unknown result type (might be due to invalid IL or missing references)
//IL_0883: Expected O, but got Unknown
//IL_08a1: Unknown result type (might be due to invalid IL or missing references)
//IL_08ab: Expected O, but got Unknown
//IL_08c9: Unknown result type (might be due to invalid IL or missing references)
//IL_08d3: Expected O, but got Unknown
//IL_08f1: Unknown result type (might be due to invalid IL or missing references)
//IL_08fb: Expected O, but got Unknown
//IL_0919: Unknown result type (might be due to invalid IL or missing references)
//IL_0923: Expected O, but got Unknown
//IL_0941: Unknown result type (might be due to invalid IL or missing references)
//IL_094b: Expected O, but got Unknown
//IL_0969: Unknown result type (might be due to invalid IL or missing references)
//IL_0973: Expected O, but got Unknown
//IL_0991: Unknown result type (might be due to invalid IL or missing references)
//IL_099b: Expected O, but got Unknown
//IL_09b9: Unknown result type (might be due to invalid IL or missing references)
//IL_09c3: Expected O, but got Unknown
//IL_09e1: Unknown result type (might be due to invalid IL or missing references)
//IL_09eb: Expected O, but got Unknown
//IL_0a09: Unknown result type (might be due to invalid IL or missing references)
//IL_0a13: Expected O, but got Unknown
config = PluginConfigurator.Create("Exit Door Manager", "com.earthlingOnFire.ExitDoorManager");
string location = Assembly.GetExecutingAssembly().Location;
string directoryName = Path.GetDirectoryName(location);
config.SetIconWithURL(Path.Combine(directoryName, "icon.png"));
resetButton = new ButtonField(config.rootPanel, "Reset All", "resetButton");
ButtonField obj = resetButton;
object obj2 = <>c.<>9__65_0;
if (obj2 == null)
{
OnClick val = delegate
{
StringListField[] exits = GetExits();
foreach (StringListField val3 in exits)
{
val3.value = val3.defaultValue;
}
};
<>c.<>9__65_0 = val;
obj2 = (object)val;
}
obj.onClick += (OnClick)obj2;
randoSettings = new ConfigPanel(config.rootPanel, "Randomizer", "randoSettings");
randomizeButton = new ButtonField(randoSettings, "Randomize", "randomizeButton");
ButtonField obj3 = randomizeButton;
object obj4 = <>c.<>9__65_1;
if (obj4 == null)
{
OnClick val2 = delegate
{
Randomizer.RandomizeExits();
};
<>c.<>9__65_1 = val2;
obj4 = (object)val2;
}
obj3.onClick += (OnClick)obj4;
allowSecretLevels = new BoolField(randoSettings, "Allow Secret Levels", "randoAllowSecret", false);
allowEncoreLevels = new BoolField(randoSettings, "Allow Encore Levels", "randoAllowEncore", false);
allowPrimeSanctums = new BoolField(randoSettings, "Allow Prime Sanctums", "randoAllowPrime", false);
finalScene = new StringListField(randoSettings, "Final Scene", "randoFinalScene", Array.FindAll(Levels, (string l) => !l.StartsWith("Random")), "EarlyAccessEnd");
intro = new StringListField(config.rootPanel, "Initial Scene", "intro", Levels, "Intro");
postintro = new StringListField(config.rootPanel, "Post-Intro", "postintro", Levels, "Main Menu");
exit01 = new StringListField(config.rootPanel, "0-1 Exit", "exit01", Levels, "Level 0-2");
exit02 = new StringListField(config.rootPanel, "0-2 Exit", "exit02", Levels, "Level 0-3");
exit02s = new StringListField(config.rootPanel, "0-2 Secret Exit", "exit02s", Levels, "Level 0-S");
exit03 = new StringListField(config.rootPanel, "0-3 Exit", "exit03", Levels, "Level 0-4");
exit04 = new StringListField(config.rootPanel, "0-4 Exit", "exit04", Levels, "Level 0-5");
exit05 = new StringListField(config.rootPanel, "0-5 Exit", "exit05", Levels, "Level 1-1");
exit0S = new StringListField(config.rootPanel, "0-S Exit", "exit0S", Levels, "Level 0-3");
exit11 = new StringListField(config.rootPanel, "1-1 Exit", "exit11", Levels, "Level 1-2");
exit11s = new StringListField(config.rootPanel, "1-1 Secret Exit", "exit11s", Levels, "Level 1-S");
exit12 = new StringListField(config.rootPanel, "1-2 Exit", "exit12", Levels, "Level 1-3");
exit13 = new StringListField(config.rootPanel, "1-3 Exit", "exit13", Levels, "Level 1-4");
exit14 = new StringListField(config.rootPanel, "1-4 Exit", "exit14", Levels, "Level 2-1");
exit1S = new StringListField(config.rootPanel, "1-S Exit", "exit1S", Levels, "Level 1-1");
exit21 = new StringListField(config.rootPanel, "2-1 Exit", "exit21", Levels, "Level 2-2");
exit22 = new StringListField(config.rootPanel, "2-2 Exit", "exit22", Levels, "Level 2-3");
exit23 = new StringListField(config.rootPanel, "2-3 Exit", "exit23", Levels, "Level 2-4");
exit23s = new StringListField(config.rootPanel, "2-3 Secret Exit", "exit23s", Levels, "Level 2-S");
exit24 = new StringListField(config.rootPanel, "2-4 Exit", "exit24", Levels, "Level 3-1");
exit2S = new StringListField(config.rootPanel, "2-S Exit", "exit2S", Levels, "Level 2-4");
exit31 = new StringListField(config.rootPanel, "3-1 Exit", "exit31", Levels, "Level 3-2");
exit31s = new StringListField(config.rootPanel, "3-1 Secret Exit", "exit31s", Levels, "Level P-1");
exit32 = new StringListField(config.rootPanel, "3-2 Exit", "exit32", Levels, "Intermission1");
exitI1 = new StringListField(config.rootPanel, "Intermission 1 Exit", "exitI1", Levels, "Level 4-1");
exitP1 = new StringListField(config.rootPanel, "P-1 Exit", "exitP1", Levels, "Level 3-2");
exit41 = new StringListField(config.rootPanel, "4-1 Exit", "exit41", Levels, "Level 4-2");
exit42 = new StringListField(config.rootPanel, "4-2 Exit", "exit42", Levels, "Level 4-3");
exit42s = new StringListField(config.rootPanel, "4-2 Secret Exit", "exit42s", Levels, "Level 4-S");
exit43 = new StringListField(config.rootPanel, "4-3 Exit", "exit43", Levels, "Level 4-4");
exit44 = new StringListField(config.rootPanel, "4-4 Exit", "exit44", Levels, "Level 5-1");
exit4S = new StringListField(config.rootPanel, "4-S Exit", "exit4S", Levels, "Level 4-3");
exit51 = new StringListField(config.rootPanel, "5-1 Exit", "exit51", Levels, "Level 5-2");
exit51s = new StringListField(config.rootPanel, "5-1 Secret Exit", "exit51s", Levels, "Level 5-S");
exit52 = new StringListField(config.rootPanel, "5-2 Exit", "exit52", Levels, "Level 5-3");
exit53 = new StringListField(config.rootPanel, "5-3 Exit", "exit53", Levels, "Level 5-4");
exit54 = new StringListField(config.rootPanel, "5-4 Exit", "exit54", Levels, "Level 6-1");
exit5S = new StringListField(config.rootPanel, "5-S Exit", "exit5S", Levels, "Level 5-2");
exit61 = new StringListField(config.rootPanel, "6-1 Exit", "exit61", Levels, "Level 6-2");
exit62 = new StringListField(config.rootPanel, "6-2 Exit", "exit", Levels, "Intermission2");
exit62s = new StringListField(config.rootPanel, "6-2 Secret Exit", "exit62s", Levels, "Level P-2");
exitI2 = new StringListField(config.rootPanel, "Intermission 2 Exit", "exitI2", Levels, "Level 7-1");
exitP2 = new StringListField(config.rootPanel, "P-2 Exit", "exitP2", Levels, "Level 6-2");
exit71 = new StringListField(config.rootPanel, "7-1 Exit", "exit71", Levels, "Level 7-2");
exit72 = new StringListField(config.rootPanel, "7-2 Exit", "exit72", Levels, "Level 7-3");
exit73 = new StringListField(config.rootPanel, "7-3 Exit", "exit73", Levels, "Level 7-4");
exit73s = new StringListField(config.rootPanel, "7-3 Secret Exit", "exit73s", Levels, "Level 7-S");
exit74 = new StringListField(config.rootPanel, "7-4 Exit", "exit74", Levels, "Level 8-1");
exit7s = new StringListField(config.rootPanel, "7-S Exit", "exit7s", Levels, "Level 7-4");
exit81 = new StringListField(config.rootPanel, "8-1 Exit", "exit81", Levels, "Level 8-2");
exit82 = new StringListField(config.rootPanel, "8-2 Exit", "exit82", Levels, "Level 8-3");
exit83 = new StringListField(config.rootPanel, "8-3 Exit", "exit83", Levels, "Level 8-4");
exit84 = new StringListField(config.rootPanel, "8-4 Exit", "exit84", Levels, "EarlyAccessEnd");
exit0e = new StringListField(config.rootPanel, "0-E Exit", "exit0e", Levels, "Level 1-E");
exit1e = new StringListField(config.rootPanel, "1-E Exit", "exit1e", Levels, "Main Menu");
}
}
[HarmonyPatch]
public static class Patches
{
private class Exit
{
public string from { get; }
public string to { get; }
public Exit(string fromLevel, string toLevel)
{
from = fromLevel;
to = toLevel;
}
}
private static Random rand = new Random();
[HarmonyPrefix]
[HarmonyPatch(typeof(SceneHelper), "LoadScene")]
private static bool SceneHelper_LoadScene_Prefix(string sceneName, bool noBlocker)
{
Exit exit = new Exit(SceneHelper.CurrentScene, sceneName);
string text = GetNextScene(exit);
if (text == null || text == sceneName)
{
return true;
}
if (SceneHelper.CurrentScene == "Level 1-E" && (Object)(object)GameObject.Find("Canvas/PauseMenu") != (Object)null)
{
return true;
}
switch (text)
{
case "Random Scene":
{
string[] array2 = Array.FindAll(ConfigManager.Levels, (string lvl) => !lvl.StartsWith("Random") && !lvl.StartsWith("Close"));
int num2 = rand.Next(0, array2.Length);
text = array2[num2];
break;
}
case "Random Level":
{
string[] array = Array.FindAll(ConfigManager.Levels, (string lvl) => lvl.StartsWith("Level"));
int num = rand.Next(0, array.Length);
text = array[num];
break;
}
case "The Cyber Grind":
text = "Endless";
break;
case "Sandbox":
text = "uk_construct";
break;
case "Credits Museum":
text = "CreditsMuseum2";
break;
case "Close Game":
Application.Quit();
return false;
}
SceneHelper.LoadSceneAsync(text, noBlocker);
return false;
}
[HarmonyPrefix]
[HarmonyPatch(typeof(Scene), "Execute")]
private static bool Scene_Execute_Prefix(Console con, string[] args)
{
if (con.CheatBlocker() || args.Length == 0)
{
return true;
}
string text = string.Join(" ", args);
if (!Debug.isDebugBuild && MonoSingleton<SceneHelper>.Instance.IsSceneSpecial(text))
{
return true;
}
SceneHelper.LoadSceneAsync(text, false);
return false;
}
private static string GetNextScene(Exit exit)
{
if (1 == 0)
{
}
string result;
string to;
if (exit != null)
{
switch (exit.from)
{
case "Bootstrap":
break;
case "Intro":
goto IL_0723;
case "Level 0-1":
goto IL_073f;
case "Level 0-2":
goto IL_075b;
case "Level 0-3":
goto IL_0787;
case "Level 0-4":
goto IL_07a3;
case "Level 0-5":
goto IL_07bf;
case "Level 0-S":
goto IL_07db;
case "Level 1-1":
goto IL_07f7;
case "Level 1-2":
goto IL_0823;
case "Level 1-3":
goto IL_083f;
case "Level 1-4":
goto IL_085b;
case "Level 1-S":
goto IL_0877;
case "Level 2-1":
goto IL_0893;
case "Level 2-2":
goto IL_08af;
case "Level 2-3":
goto IL_08cb;
case "Level 2-4":
goto IL_08f7;
case "Level 2-S":
goto IL_0913;
case "Level 3-1":
goto IL_092f;
case "Level 3-2":
goto IL_095b;
case "Intermission1":
goto IL_0977;
case "Level P-1":
goto IL_0993;
case "Level 4-1":
goto IL_09af;
case "Level 4-2":
goto IL_09cb;
case "Level 4-3":
goto IL_09f7;
case "Level 4-4":
goto IL_0a13;
case "Level 4-S":
goto IL_0a2f;
case "Level 5-1":
goto IL_0a4b;
case "Level 5-2":
goto IL_0a77;
case "Level 5-3":
goto IL_0a93;
case "Level 5-4":
goto IL_0aaf;
case "Level 5-S":
goto IL_0acb;
case "Level 6-1":
goto IL_0ae7;
case "Level 6-2":
goto IL_0b03;
case "Intermission2":
goto IL_0b2f;
case "Level P-2":
goto IL_0b4b;
case "Level 7-1":
goto IL_0b67;
case "Level 7-2":
goto IL_0b83;
case "Level 7-3":
goto IL_0b9f;
case "Level 7-4":
goto IL_0bcb;
case "Level 7-S":
goto IL_0be7;
case "Level 8-1":
goto IL_0c03;
case "Level 8-2":
goto IL_0c1f;
case "Level 8-3":
goto IL_0c3b;
case "Level 8-4":
goto IL_0c57;
case "Level 0-E":
goto IL_0c73;
case "Level 1-E":
goto IL_0c8f;
default:
goto IL_0ffd;
}
to = exit.to;
if (to == "Intro")
{
result = ConfigManager.intro.value;
goto IL_1001;
}
}
goto IL_0ffd;
IL_0a2f:
to = exit.to;
if (!(to == "Level 4-3"))
{
goto IL_0ffd;
}
result = ConfigManager.exit4S.value;
goto IL_1001;
IL_08af:
to = exit.to;
if (!(to == "Level 2-3"))
{
goto IL_0ffd;
}
result = ConfigManager.exit22.value;
goto IL_1001;
IL_0c8f:
to = exit.to;
if (!(to == "Main Menu"))
{
goto IL_0ffd;
}
result = ConfigManager.exit1e.value;
goto IL_1001;
IL_09f7:
to = exit.to;
if (!(to == "Level 4-4"))
{
goto IL_0ffd;
}
result = ConfigManager.exit43.value;
goto IL_1001;
IL_0c73:
to = exit.to;
if (!(to == "Level 1-E"))
{
goto IL_0ffd;
}
result = ConfigManager.exit0e.value;
goto IL_1001;
IL_0893:
to = exit.to;
if (!(to == "Level 2-2"))
{
goto IL_0ffd;
}
result = ConfigManager.exit21.value;
goto IL_1001;
IL_0c57:
to = exit.to;
if (!(to == "EarlyAccessEnd"))
{
goto IL_0ffd;
}
result = ConfigManager.exit84.value;
goto IL_1001;
IL_09cb:
to = exit.to;
if (!(to == "Level 4-3"))
{
if (!(to == "Level 4-S"))
{
goto IL_0ffd;
}
result = ConfigManager.exit42s.value;
}
else
{
result = ConfigManager.exit42.value;
}
goto IL_1001;
IL_0c3b:
to = exit.to;
if (!(to == "Level 8-4"))
{
goto IL_0ffd;
}
result = ConfigManager.exit83.value;
goto IL_1001;
IL_073f:
to = exit.to;
if (!(to == "Level 0-2"))
{
goto IL_0ffd;
}
result = ConfigManager.exit01.value;
goto IL_1001;
IL_0c1f:
to = exit.to;
if (!(to == "Level 8-3"))
{
goto IL_0ffd;
}
result = ConfigManager.exit82.value;
goto IL_1001;
IL_07a3:
to = exit.to;
if (!(to == "Level 0-5"))
{
goto IL_0ffd;
}
result = ConfigManager.exit04.value;
goto IL_1001;
IL_0c03:
to = exit.to;
if (!(to == "Level 8-2"))
{
goto IL_0ffd;
}
result = ConfigManager.exit81.value;
goto IL_1001;
IL_0877:
to = exit.to;
if (!(to == "Level 1-1"))
{
goto IL_0ffd;
}
result = ConfigManager.exit1S.value;
goto IL_1001;
IL_0be7:
to = exit.to;
if (!(to == "Level 7-4"))
{
goto IL_0ffd;
}
result = ConfigManager.exit7s.value;
goto IL_1001;
IL_09af:
to = exit.to;
if (!(to == "Level 4-2"))
{
goto IL_0ffd;
}
result = ConfigManager.exit41.value;
goto IL_1001;
IL_0bcb:
to = exit.to;
if (!(to == "Level 8-1"))
{
goto IL_0ffd;
}
result = ConfigManager.exit74.value;
goto IL_1001;
IL_085b:
to = exit.to;
if (!(to == "Level 2-1"))
{
goto IL_0ffd;
}
result = ConfigManager.exit14.value;
goto IL_1001;
IL_0b9f:
to = exit.to;
if (!(to == "Level 7-4"))
{
if (!(to == "Level 7-S"))
{
goto IL_0ffd;
}
result = ConfigManager.exit73s.value;
}
else
{
result = ConfigManager.exit73.value;
}
goto IL_1001;
IL_0993:
to = exit.to;
if (!(to == "Level 3-2"))
{
goto IL_0ffd;
}
result = ConfigManager.exitP1.value;
goto IL_1001;
IL_0977:
to = exit.to;
if (!(to == "Level 4-1"))
{
goto IL_0ffd;
}
result = ConfigManager.exitI1.value;
goto IL_1001;
IL_0ffd:
result = null;
goto IL_1001;
IL_0b83:
to = exit.to;
if (!(to == "Level 7-3"))
{
goto IL_0ffd;
}
result = ConfigManager.exit72.value;
goto IL_1001;
IL_083f:
to = exit.to;
if (!(to == "Level 1-4"))
{
goto IL_0ffd;
}
result = ConfigManager.exit13.value;
goto IL_1001;
IL_0b67:
to = exit.to;
if (!(to == "Level 7-2"))
{
goto IL_0ffd;
}
result = ConfigManager.exit71.value;
goto IL_1001;
IL_095b:
to = exit.to;
if (!(to == "Intermission1"))
{
goto IL_0ffd;
}
result = ConfigManager.exit32.value;
goto IL_1001;
IL_0b4b:
to = exit.to;
if (!(to == "Level 6-2"))
{
goto IL_0ffd;
}
result = ConfigManager.exitP2.value;
goto IL_1001;
IL_0787:
to = exit.to;
if (!(to == "Level 0-4"))
{
goto IL_0ffd;
}
result = ConfigManager.exit03.value;
goto IL_1001;
IL_0b2f:
to = exit.to;
if (!(to == "Level 7-1"))
{
goto IL_0ffd;
}
result = ConfigManager.exitI2.value;
goto IL_1001;
IL_092f:
to = exit.to;
if (!(to == "Level 3-2"))
{
if (!(to == "Level P-1"))
{
goto IL_0ffd;
}
result = ConfigManager.exit31s.value;
}
else
{
result = ConfigManager.exit31.value;
}
goto IL_1001;
IL_0b03:
to = exit.to;
if (!(to == "Intermission2"))
{
if (!(to == "Level P-2"))
{
goto IL_0ffd;
}
result = ConfigManager.exit62s.value;
}
else
{
result = ConfigManager.exit62.value;
}
goto IL_1001;
IL_0823:
to = exit.to;
if (!(to == "Level 1-3"))
{
goto IL_0ffd;
}
result = ConfigManager.exit12.value;
goto IL_1001;
IL_0723:
to = exit.to;
if (!(to == "Main Menu"))
{
goto IL_0ffd;
}
result = ConfigManager.postintro.value;
goto IL_1001;
IL_07f7:
to = exit.to;
if (!(to == "Level 1-2"))
{
if (!(to == "Level 1-S"))
{
goto IL_0ffd;
}
result = ConfigManager.exit11s.value;
}
else
{
result = ConfigManager.exit11.value;
}
goto IL_1001;
IL_0ae7:
to = exit.to;
if (!(to == "Level 6-2"))
{
goto IL_0ffd;
}
result = ConfigManager.exit61.value;
goto IL_1001;
IL_0913:
to = exit.to;
if (!(to == "Level 2-4"))
{
goto IL_0ffd;
}
result = ConfigManager.exit2S.value;
goto IL_1001;
IL_0acb:
to = exit.to;
if (!(to == "Level 5-2"))
{
goto IL_0ffd;
}
result = ConfigManager.exit5S.value;
goto IL_1001;
IL_075b:
to = exit.to;
if (!(to == "Level 0-3"))
{
if (!(to == "Level 0-S"))
{
goto IL_0ffd;
}
result = ConfigManager.exit02s.value;
}
else
{
result = ConfigManager.exit02.value;
}
goto IL_1001;
IL_0aaf:
to = exit.to;
if (!(to == "Level 6-1"))
{
goto IL_0ffd;
}
result = ConfigManager.exit54.value;
goto IL_1001;
IL_08f7:
to = exit.to;
if (!(to == "Level 3-1"))
{
goto IL_0ffd;
}
result = ConfigManager.exit24.value;
goto IL_1001;
IL_0a93:
to = exit.to;
if (!(to == "Level 5-4"))
{
goto IL_0ffd;
}
result = ConfigManager.exit53.value;
goto IL_1001;
IL_07bf:
to = exit.to;
if (!(to == "Level 1-1"))
{
goto IL_0ffd;
}
result = ConfigManager.exit05.value;
goto IL_1001;
IL_0a77:
to = exit.to;
if (!(to == "Level 5-3"))
{
goto IL_0ffd;
}
result = ConfigManager.exit52.value;
goto IL_1001;
IL_08cb:
to = exit.to;
if (!(to == "Level 2-4"))
{
if (!(to == "Level 2-S"))
{
goto IL_0ffd;
}
result = ConfigManager.exit23s.value;
}
else
{
result = ConfigManager.exit23.value;
}
goto IL_1001;
IL_0a4b:
to = exit.to;
if (!(to == "Level 5-2"))
{
if (!(to == "Level 5-S"))
{
goto IL_0ffd;
}
result = ConfigManager.exit51s.value;
}
else
{
result = ConfigManager.exit51.value;
}
goto IL_1001;
IL_1001:
if (1 == 0)
{
}
return result;
IL_07db:
to = exit.to;
if (!(to == "Level 0-3"))
{
goto IL_0ffd;
}
result = ConfigManager.exit0S.value;
goto IL_1001;
IL_0a13:
to = exit.to;
if (!(to == "Level 5-1"))
{
goto IL_0ffd;
}
result = ConfigManager.exit44.value;
goto IL_1001;
}
}
[BepInPlugin("com.earthlingOnFire.ExitDoorManager", "Exit Door Manager", "1.2.1")]
public class Plugin : BaseUnityPlugin
{
public const string PLUGIN_GUID = "com.earthlingOnFire.ExitDoorManager";
public const string PLUGIN_NAME = "Exit Door Manager";
public const string PLUGIN_VERSION = "1.2.1";
public static ManualLogSource logger;
private void Awake()
{
((Object)((Component)this).gameObject).hideFlags = (HideFlags)61;
logger = ((BaseUnityPlugin)this).Logger;
}
private void Start()
{
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
ConfigManager.Initialize();
new Harmony("com.earthlingOnFire.ExitDoorManager").PatchAll();
logger.LogInfo((object)"Plugin com.earthlingOnFire.ExitDoorManager is loaded!");
}
}
public static class Randomizer
{
private static T[] Shuffle<T>(T[] array)
{
Random random = new Random();
for (int i = 0; i < array.Length - 1; i++)
{
int num = random.Next(0, array.Length);
if (num != i)
{
T val = array[i];
array[i] = array[num];
array[num] = val;
}
}
return array;
}
private static string[] GetShuffledLevels()
{
string[] levels = ConfigManager.Levels;
string endingLevel = ConfigManager.finalScene.value;
bool enableSecret = ConfigManager.allowSecretLevels.value;
bool enablePrime = ConfigManager.allowPrimeSanctums.value;
bool enableEncore = ConfigManager.allowEncoreLevels.value;
Random random = new Random();
return Shuffle(Array.FindAll(levels, (string l) => l.StartsWith("Level") && !l.Equals("Level 0-1") && !l.Equals(endingLevel) && (enableSecret || !l.EndsWith("S")) && (enablePrime || !l.StartsWith("Level P-")) && (enableEncore || !l.EndsWith("E"))));
}
private static StringListField GetLevelExit(string level)
{
string levelNumber = level.Substring(6);
StringListField[] exits = ConfigManager.GetExits();
return Array.Find(exits, (StringListField e) => ((ConfigField)e).displayName.Contains(levelNumber) && !((ConfigField)e).displayName.Contains("Secret"));
}
private static StringListField GetLevelSecretExit(string level)
{
string levelNumber = level.Substring(6);
StringListField[] exits = ConfigManager.GetExits();
return Array.Find(exits, (StringListField e) => ((ConfigField)e).displayName.Contains(levelNumber) && ((ConfigField)e).displayName.Contains("Secret"));
}
public static void RandomizeExits()
{
string[] shuffledLevels = GetShuffledLevels();
string value = ConfigManager.finalScene.value;
int i = 0;
string level = "Level 0-1";
for (; i < shuffledLevels.Length; i++)
{
string text = shuffledLevels[i];
GetLevelExit(level).value = text;
if (GetLevelSecretExit(level) != null)
{
GetLevelSecretExit(level).value = text;
}
level = text;
}
GetLevelExit(level).value = value;
if (value.StartsWith("Level"))
{
GetLevelExit(value).value = "Main Menu";
}
}
}
public static class PluginInfo
{
public const string PLUGIN_GUID = "ExitDoorManager";
public const string PLUGIN_NAME = "ExitDoorManager";
public const string PLUGIN_VERSION = "1.2.1";
}
}
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
internal sealed class IgnoresAccessChecksToAttribute : Attribute
{
internal IgnoresAccessChecksToAttribute(string assemblyName)
{
}
}
}