Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of Railroad v1.3.0
plugin/Railroad.dll
Decompiled 2 weeks ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using EntityStates; using EntityStates.MeridianEvent; using EntityStates.Missions.BrotherEncounter; using EntityStates.Missions.Goldshores; using EntityStates.Missions.LunarScavengerEncounter; using EntityStates.ShrineRebirth; using EntityStates.SolusHeart.Death; using EntityStates.SolusWing2; using IL.EntityStates.FalseSonBoss; using IL.EntityStates.Interactables.MSObelisk; using IL.EntityStates.ShrineRebirth; using IL.EntityStates.SolusHeart.Death; using IL.RoR2; using Mono.Cecil.Cil; using MonoMod.Cil; using On.EntityStates.MeridianEvent; using On.EntityStates.Missions.BrotherEncounter; using On.EntityStates.Missions.Goldshores; using On.EntityStates.Missions.LunarScavengerEncounter; using On.EntityStates.SolusHeart.Death; using On.EntityStates.SolusWing2; using On.RoR2; using ProperSave; using R2API.Utils; using Railroad.Changes; using Railroad.Compat; using RoR2; using RoR2.ExpansionManagement; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")] [assembly: AssemblyCompany("Railroad")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("Railroad")] [assembly: AssemblyTitle("Railroad")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] namespace Railroad { public enum ConfigRunType { Invalid = -1, Always, NoEclipse } public enum ConfigPortalType { NoPortal = -1, Shop, MS, Null, Void, DeepVoid, VoidOutro, Goldshores, Colossus, Destination, HardwareProg, HardwareProg_Haunt, SolusShop, SolusBackout, SolusWeb } public enum ConfigCurrencyType { None = 0, LunarCoin = 3, VoidCoin = 14 } public enum ConfigGoldPortal { Never, Vanilla, Meridian } public enum ConfigEclipseToggle { Never, Always, PostMithrix } public static class Configs { public static ConfigFile ConfigFile_InputHelp; public static ConfigFile ConfigFile_ModeStandard_Stages; public static ConfigFile ConfigFile_ModeEclipse_Stages; public static ConfigFile ConfigFile_ModeStandard_Looping; public static ConfigFile ConfigFile_ModeEclipse_Looping; public static ConfigFile ConfigFile_Interactables; public static ConfigFile ConfigFile_Misc; private const string Section_Stage_VoidRaid = "Planetarium"; private const string Section_Stage_Moon2 = "Commencement"; private const string Section_Stage_Meridian = "Prime Meridian"; private const string Section_Stage_Goldshores = "Gilded Coast"; private const string Section_Stage_MS = "A Moment, Fractured"; private const string Section_Stage_Limbo = "A Moment, Whole"; private const string Section_Stage_SolusWeb = "Solus Web"; private const string Section_Stage_Arena = "Void Fields"; private const string Section_Loop_Definition = "Loop Definition"; private const string Section_Loop_Effects = "Loop Effects"; private const string Section_Loop_Teleporter = "Teleporter"; private const string Section_Misc_StageTimed = "Stage Timed"; private const string Section_Enable = "!Enable Changes"; private const string Label_Enable = "!Enable Changes"; private const string Desc_Enable = "Allows this section to function."; private const string Desc_Enable_Config = "Allows all changes within this config to happen."; private const string Label_Eclipse = "Allow On Eclipse"; private const string Desc_Eclipse = "Allow changes made in this section even during Eclipse."; private const string Label_WinPortal = "Completion Portals"; private const string Label_WinReward = "Completion Reward"; private const string Section_GlassFrog = "Glass Frog"; private const string Section_PortalHelp = "Portals and Tags"; private static string PortalListHelp; private static string PortalTagHelp; private static string PortalTagExample; private static string PortalStageNumExample; public static string ConfigFolderPath => Path.Combine(Paths.ConfigPath, MainPlugin.pluginInfo.Metadata.GUID); public static void Setup() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Expected O, but got Unknown //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Expected O, but got Unknown //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Expected O, but got Unknown //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Expected O, but got Unknown ConfigFile_InputHelp = new ConfigFile(Path.Combine(ConfigFolderPath, "Railroad_InputHelp.cfg"), true); ConfigFile_ModeStandard_Stages = new ConfigFile(Path.Combine(ConfigFolderPath, "Railroad_ModeStandard_Stages.cfg"), true); ConfigFile_ModeEclipse_Stages = new ConfigFile(Path.Combine(ConfigFolderPath, "Railroad_ModeEclipse_Stages.cfg"), true); ConfigFile_ModeStandard_Looping = new ConfigFile(Path.Combine(ConfigFolderPath, "Railroad_ModeStandard_Looping.cfg"), true); ConfigFile_ModeEclipse_Looping = new ConfigFile(Path.Combine(ConfigFolderPath, "Railroad_ModeEclipse_Looping.cfg"), true); ConfigFile_Interactables = new ConfigFile(Path.Combine(ConfigFolderPath, "Railroad_Interactables.cfg"), true); ConfigFile_Misc = new ConfigFile(Path.Combine(ConfigFolderPath, "Railroad_Misc.cfg"), true); Read_StageConfig(); Read_LoopConfig(); Read_MiscConfig(); Read_InteractableConfig(); Read_InputHelpConfig(); } private static void Read_LoopConfig() { Looping.ModeStandard_Artifact_Input = ConfigFile_ModeStandard_Looping.Bind<string>("Loop Effects", "Loop Artifacts", "", "Enables the specified Artifact by their internal name upon looping.").Value; Looping.ModeEclipse_Artifact_Input = ConfigFile_ModeEclipse_Looping.Bind<string>("Loop Effects", "Loop Artifacts", "", "Enables the specified Artifact by their internal name upon looping.").Value; Looping.ModeStandard_PrimordialTele_ReplaceReq_Input = ConfigFile_ModeStandard_Looping.Bind<string>("Teleporter", "Primordial Teleporter Conditions", "5", "Stage number for when the Primordial Teleporter will replace the regular Teleporter, can take Portal Tags for additional requirements. 0 allows any Stage number.").Value; Looping.ModeEclipse_PrimordialTele_ReplaceReq_Input = ConfigFile_ModeEclipse_Looping.Bind<string>("Teleporter", "Primordial Teleporter Conditions", "5", "Stage number for when the Primordial Teleporter will replace the regular Teleporter, can take Portal Tags for additional requirements. 0 allows any Stage number.").Value; } private static void Read_StageConfig() { Stages.ModeStandard_Moon2_Portal_Input = ConfigFile_ModeStandard_Stages.Bind<string>("Commencement", "Completion Portals", "", "Portals to spawn upon defeating Mithrix.").Value; Stages.ModeEclipse_Moon2_Portal_Input = ConfigFile_ModeEclipse_Stages.Bind<string>("Commencement", "Completion Portals", "", "Portals to spawn upon defeating Mithrix.").Value; Stages.ModeStandard_Moon2_Reward = ConfigFile_ModeStandard_Stages.Bind<bool>("Commencement", "Completion Reward", false, "Drop Legendary items upon defeating Mithrix.").Value; Stages.ModeEclipse_Moon2_Reward = ConfigFile_ModeEclipse_Stages.Bind<bool>("Commencement", "Completion Reward", false, "Drop Legendary items upon defeating Mithrix.").Value; Stages.ModeStandard_Meridian_Portal_Input = ConfigFile_ModeStandard_Stages.Bind<string>("Prime Meridian", "Completion Portals", "Destination", "Portals to spawn upon defeating False Son.").Value; Stages.ModeEclipse_Meridian_Portal_Input = ConfigFile_ModeEclipse_Stages.Bind<string>("Prime Meridian", "Completion Portals", "Destination", "Portals to spawn upon defeating False Son.").Value; Stages.ModeStandard_Meridian_Reward = ConfigFile_ModeStandard_Stages.Bind<bool>("Prime Meridian", "Completion Reward", true, "Drop Aurelionite Blessings upon defeating False Son.").Value; Stages.ModeEclipse_Meridian_Reward = ConfigFile_ModeEclipse_Stages.Bind<bool>("Prime Meridian", "Completion Reward", true, "Drop Aurelionite Blessings upon defeating False Son.").Value; Stages.ModeStandard_Meridian_AllowRebirth = ConfigFile_ModeStandard_Stages.Bind<bool>("Prime Meridian", "Allow Rebirth", true, "Allows the Rebirth Shrine to spawn.").Value; Stages.ModeEclipse_Meridian_AllowRebirth = ConfigFile_ModeEclipse_Stages.Bind<bool>("Prime Meridian", "Allow Rebirth", false, "Allows the Rebirth Shrine to spawn.").Value; Stages.ModeStandard_Meridian_ACPortal = ConfigFile_ModeStandard_Stages.Bind<bool>("Prime Meridian", "Virtual Portal", true, "Allows the extra Virtual Portal to spawn.").Value; Stages.ModeEclipse_Meridian_ACPortal = ConfigFile_ModeEclipse_Stages.Bind<bool>("Prime Meridian", "Virtual Portal", true, "Allows the extra Virtual Portal to spawn.").Value; Stages.ModeStandard_VoidRaid_Portal_Input = ConfigFile_ModeStandard_Stages.Bind<string>("Planetarium", "Completion Portals", "", "Portal to spawn upon defeating Voidling.").Value; Stages.ModeEclipse_VoidRaid_Portal_Input = ConfigFile_ModeEclipse_Stages.Bind<string>("Planetarium", "Completion Portals", "", "Portal to spawn upon defeating Voidling.").Value; Stages.ModeStandard_VoidRaid_Reward = ConfigFile_ModeStandard_Stages.Bind<bool>("Planetarium", "Completion Reward", false, "Drop Void Potentials that contain Legendary items upon defeating Voidling.").Value; Stages.ModeEclipse_VoidRaid_Reward = ConfigFile_ModeEclipse_Stages.Bind<bool>("Planetarium", "Completion Reward", false, "Drop Void Potentials that contain Legendary items upon defeating Voidling.").Value; Stages.ModeStandard_VoidRaid_VoidOutroPortal = ConfigFile_ModeStandard_Stages.Bind<bool>("Planetarium", "Void Outro Portal", true, "Allows the Void Outro Portal to spawn upon defeating Voidling.").Value; Stages.ModeEclipse_VoidRaid_VoidOutroPortal = ConfigFile_ModeEclipse_Stages.Bind<bool>("Planetarium", "Void Outro Portal", true, "Allows the Void Outro Portal to spawn upon defeating Voidling.").Value; Stages.ModeStandard_GoldShores_MeridianPortal = ConfigFile_ModeStandard_Stages.Bind<ConfigGoldPortal>("Gilded Coast", "Colossus Portal", ConfigGoldPortal.Vanilla, "Controls how the Colossus Portal spawns on Gilded Coast. (Meridian = Always spawns and takes you to Prime Meridian)").Value; Stages.ModeEclipse_GoldShores_MeridianPortal = ConfigFile_ModeEclipse_Stages.Bind<ConfigGoldPortal>("Gilded Coast", "Colossus Portal", ConfigGoldPortal.Vanilla, "Controls how the Colossus Portal spawns on Gilded Coast. (Meridian = Always spawns and takes you to Prime Meridian)").Value; Stages.ModeStandard_MS_NeedBeads = ConfigFile_ModeStandard_Stages.Bind<bool>("A Moment, Fractured", "Beads Required", true, "Beads of Fealty are required to go to A Moment, Whole.").Value; Stages.ModeEclipse_MS_NeedBeads = ConfigFile_ModeEclipse_Stages.Bind<bool>("A Moment, Fractured", "Beads Required", true, "Beads of Fealty are required to go to A Moment, Whole.").Value; Stages.ModeStandard_MS_OrbReq_Input = ConfigFile_ModeStandard_Stages.Bind<string>("A Moment, Fractured", "Celestial Orb", "SO3;PostLoop", "Stage number that the Celestial Orb is allowed to spawn on, can take Portal Tags for additional requirements. 0 allows any Stage number.").Value; Stages.ModeEclipse_MS_OrbReq_Input = ConfigFile_ModeEclipse_Stages.Bind<string>("A Moment, Fractured", "Celestial Orb", "-1", "Stage number that the Celestial Orb is allowed to spawn on, can take Portal Tags for additional requirements. 0 allows any Stage number.").Value; Misc.ModeEclipse_AllowBeads = ConfigFile_ModeEclipse_Stages.Bind<bool>("A Moment, Fractured", "Allow Beads of Fealty", false, "Allow Beads of Fealty to appear in Eclipse runs?").Value; Stages.ModeStandard_Limbo_Portal_Input = ConfigFile_ModeStandard_Stages.Bind<string>("A Moment, Whole", "Completion Portals", "", "Portals to spawn upon defeating the Twisted Scavenger.").Value; Stages.ModeEclipse_Limbo_Portal_Input = ConfigFile_ModeEclipse_Stages.Bind<string>("A Moment, Whole", "Completion Portals", "", "Portals to spawn upon defeating the Twisted Scavenger.").Value; Stages.ModeStandard_Limbo_Reward = ConfigFile_ModeStandard_Stages.Bind<bool>("A Moment, Whole", "Completion Reward", false, "Drop Legendary items upon defeating the Twisted Scavenger.").Value; Stages.ModeEclipse_Limbo_Reward = ConfigFile_ModeEclipse_Stages.Bind<bool>("A Moment, Whole", "Completion Reward", false, "Drop Legendary items upon defeating the Twisted Scavenger.").Value; Stages.ModeStandard_SolusWeb_Portal_Input = ConfigFile_ModeStandard_Stages.Bind<string>("Solus Web", "Completion Portals", "SolusBackout, Void", "Portals to spawn upon defeating the Solus Heart.").Value; Stages.ModeEclipse_SolusWeb_Portal_Input = ConfigFile_ModeEclipse_Stages.Bind<string>("Solus Web", "Completion Portals", "SolusBackout", "Portals to spawn upon defeating the Solus Heart.").Value; Stages.ModeStandard_SolusWeb_Reward = ConfigFile_ModeStandard_Stages.Bind<bool>("Solus Web", "Completion Reward", true, "Drop Legendary Items upon purging Solus Heart.").Value; Stages.ModeEclipse_SolusWeb_Reward = ConfigFile_ModeEclipse_Stages.Bind<bool>("Solus Web", "Completion Reward", true, "Drop Legendary Items upon purging Solus Heart.").Value; Stages.ModeStandard_SolusWeb_AllowDecompile = ConfigFile_ModeStandard_Stages.Bind<bool>("Solus Web", "Allow Decompile", true, "Allows you to accept Solus Heart's offering and end the run.").Value; Stages.ModeEclipse_SolusWeb_AllowDecompile = ConfigFile_ModeEclipse_Stages.Bind<bool>("Solus Web", "Allow Decompile", false, "Allows you to accept Solus Heart's offering and end the run.").Value; Stages.ModeStandard_Arena_VoidPortal = ConfigFile_ModeStandard_Stages.Bind<bool>("Void Fields", "Void Portal", true, "Allows the Void Portal to spawn upon completing the Void Fields.").Value; Stages.ModeEclipse_Arena_VoidPortal = ConfigFile_ModeEclipse_Stages.Bind<bool>("Void Fields", "Void Portal", false, "Allows the Void Portal to spawn upon completing the Void Fields.").Value; } private static void Read_InteractableConfig() { Interactables.Frog_Enable = ConfigFile_Interactables.Bind<bool>("Glass Frog", "Enable Changes", false, "Allows the configurations in this section to apply.").Value; Interactables.Frog_Portal = ConfigFile_Interactables.Bind<ConfigPortalType>("Glass Frog", "Portal", ConfigPortalType.DeepVoid, "The portal to spawn upon petting the frog enough times.").Value; Interactables.Frog_Pet_Count = ConfigFile_Interactables.Bind<int>("Glass Frog", "Pet Count", 10, "How many times the frog needs to be pet to spawn the portal.").Value; Interactables.Frog_Stop_Petting = ConfigFile_Interactables.Bind<bool>("Glass Frog", "Finish Petting", false, "Disable further interaction after petting the frog enough times.").Value; Interactables.Frog_Pet_Currency = ConfigFile_Interactables.Bind<ConfigCurrencyType>("Glass Frog", "Cost Currency", ConfigCurrencyType.LunarCoin, "The type of currency required to pet the frog.").Value; } private static void Read_MiscConfig() { RunFlags.Looping_RequireDejaVu = ConfigFile_Misc.Bind<bool>("Loop Definition", "Deja Vu Requirement", false, "Mod counts it as looping once you've cleared the minimum amount of stages and are on a stage 1. (The same requirements for the Deja Vu achievement.)").Value; Misc.TimeFlows_Meridian = ConfigFile_Misc.Bind<bool>("Stage Timed", "Prime Meridian", false, "Allow time to flow normally at Prime Meridian?").Value; Misc.TimeFlows_SolusWeb = ConfigFile_Misc.Bind<bool>("Stage Timed", "Solus Web", false, "Allow time to flow normally at Solus Web?").Value; Misc.TimeFlows_SolutionalHaunt = ConfigFile_Misc.Bind<bool>("Stage Timed", "Solutional Haunt", false, "Allow time to flow normally at Solutional Haunt?").Value; Misc.TimeFlows_VoidRaid = ConfigFile_Misc.Bind<bool>("Stage Timed", "Planetarium", true, "Allow time to flow normally at the Planetarium?").Value; Misc.TimeFlows_Arena = ConfigFile_Misc.Bind<bool>("Stage Timed", "Void Fields", true, "Allow time to flow normally at the Void Fields?").Value; Stages.Limbo_ExtraTime = ConfigFile_Misc.Bind<float>("A Moment, Whole", "Fade Out Extra Time", 8f, "How much extra time it takes for the run to automatically end after defeating the Twisted Scavenger.").Value; } private static void Read_InputHelpConfig() { PortalListHelp = ConfigFile_InputHelp.Bind<string>("Portals and Tags", "Portal List", "NoPortal, Shop, MS, Null, Void, DeepVoid, VoidOutro, GoldShores, Colossus, Destination, HardwareProg, HardwareProg_Haunt, SolusShop, SolusBackout, SolusWeb", "List of all Portal types this mod uses, check the mod's Thunderstore Page for more details.").Value; PortalTagHelp = ConfigFile_InputHelp.Bind<string>("Portals and Tags", "Portal Tags", "PreLoop, PostLoop, PreMithrix, PostMithrix, PreTwistedScavenger, PostTwistedScavenger, PreVoidling, PostVoidling, PreFalseSon, PostFalseSon, PreSolusWing, PostSolusWing, PreSolusHeart, PostSolusHeart, PreVoidFields, PostVoidFields", "List of Tags that can be inputed along with portals, used to add additional conditions to when this mod spawns portals. Most configs should specify whether or not they accept Portal Tags.").Value; PortalTagExample = ConfigFile_InputHelp.Bind<string>("Portals and Tags", "Portal Plus Tags Example", "Shop, VoidOutro;PostMithrix;PreVoidling, Colossus;PreFalseSon", "An example input of multiple portals using tags, this will spawn a Shop Portal, a VoidOutro Portal(If during the run Mithrix has been defeated and Voidling has not.) and Colossus Portal (If during the run False Son has not been defeated.).").Value; PortalStageNumExample = ConfigFile_InputHelp.Bind<string>("Portals and Tags", "Portal Stage Number and Order", "SO5, 0;PostLoop", "Used by Primordial Teleport Conditions and Celestial Orb settings. SO and SN stand for Stage Order and Stage Number followed by the specific number. Stage Order is the stage's order number, while Stage Number is the run's stage number. In this example SO5 means Stage Order 5, which is Sky Meadow, Helminth Hatchery or anything modded that's a stage 5.").Value; } } [BepInPlugin("com.kking117.Railroad", "Railroad", "1.3.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] public class MainPlugin : BaseUnityPlugin { public const string MODUID = "com.kking117.Railroad"; public const string MODNAME = "Railroad"; public const string MODVERSION = "1.3.0"; internal static ManualLogSource ModLogger; internal static PluginInfo pluginInfo; internal static bool ProperSave_Loaded; public void Awake() { ModLogger = ((BaseUnityPlugin)this).Logger; pluginInfo = ((BaseUnityPlugin)this).Info; ProperSave_Loaded = Chainloader.PluginInfos.ContainsKey("com.KingEnderBrine.ProperSave"); Configs.Setup(); EnableChanges(); SharedHooks.Setup(); } private void EnableChanges() { new PortalUtility(); new ReqList(); new RunFlags(); new Looping(); new Stages(); new Interactables(); new Misc(); if (ProperSave_Loaded) { ProperSaveCompat.Init(); } } } public class SharedHooks { public delegate void Handle_EclipseRun_Start(EclipseRun self); public delegate void Handle_Mithrix_Clear(EncounterFinished self); public delegate void Handle_TwistedScavenger_Clear(FadeOut self); public delegate void Handle_Voidling_Clear(VoidRaidGauntletController self); public delegate void Handle_FalseSon_Clear(Phase3 self); public delegate void Handle_SolusWing_Clear(Mission5Death self); public delegate void Handle_SolusHeart_Clear(MissionCompleted self); public delegate void Handle_PostLoad(); public static Handle_EclipseRun_Start Handle_EclipseRun_Start_Actions; public static Handle_Mithrix_Clear Handle_Mithrix_Clear_Actions; public static Handle_TwistedScavenger_Clear Handle_TwistedScavenger_Clear_Actions; public static Handle_Voidling_Clear Handle_Voidling_Clear_Actions; public static Handle_FalseSon_Clear Handle_FalseSon_Clear_Actions; public static Handle_SolusWing_Clear Handle_SolusWing_Clear_Actions; public static Handle_SolusHeart_Clear Handle_SolusHeart_Clear_Actions; public static Handle_PostLoad Handle_PostLoad_Actions; public static void Setup() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Expected O, but got Unknown //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Expected O, but got Unknown //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Expected O, but got Unknown //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Expected O, but got Unknown //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Expected O, but got Unknown if (Handle_EclipseRun_Start_Actions != null) { EclipseRun.Start += new hook_Start(EclipseRun_Start); } if (Handle_Mithrix_Clear_Actions != null) { EncounterFinished.OnEnter += new hook_OnEnter(Mithrix_Clear); } if (Handle_TwistedScavenger_Clear_Actions != null) { FadeOut.OnEnter += new hook_OnEnter(TwistedScavenger_Clear); } if (Handle_Voidling_Clear_Actions != null) { VoidRaidGauntletController.SpawnOutroPortal += new hook_SpawnOutroPortal(Voidling_Clear); } if (Handle_FalseSon_Clear_Actions != null) { Phase3.OnExit += new hook_OnExit(FalseSon_Clear); } if (Handle_SolusWing_Clear_Actions != null) { Mission5Death.OnEnter += new hook_OnEnter(SolusWing_Clear); } if (Handle_SolusHeart_Clear_Actions != null) { MissionCompleted.OnEnter += new hook_OnEnter(SolusHeart_Clear); } if (Handle_PostLoad_Actions != null) { ((ResourceAvailability)(ref GameModeCatalog.availability)).CallWhenAvailable((Action)PostLoad_GameModeCatalog); } } internal static void PostLoad_GameModeCatalog() { Handle_PostLoad_Actions(); } internal static void Mithrix_Clear(orig_OnEnter orig, EncounterFinished self) { orig.Invoke(self); Handle_Mithrix_Clear_Actions(self); } internal static void TwistedScavenger_Clear(orig_OnEnter orig, FadeOut self) { orig.Invoke(self); Handle_TwistedScavenger_Clear_Actions(self); } internal static void Voidling_Clear(orig_SpawnOutroPortal orig, VoidRaidGauntletController self) { orig.Invoke(self); Handle_Voidling_Clear_Actions(self); } internal static void FalseSon_Clear(orig_OnExit orig, Phase3 self) { orig.Invoke(self); Handle_FalseSon_Clear_Actions(self); } internal static void SolusWing_Clear(orig_OnEnter orig, Mission5Death self) { orig.Invoke(self); Handle_SolusWing_Clear_Actions(self); } internal static void SolusHeart_Clear(orig_OnEnter orig, MissionCompleted self) { orig.Invoke(self); Handle_SolusHeart_Clear_Actions(self); } internal static void EclipseRun_Start(orig_Start orig, EclipseRun self) { orig.Invoke(self); Handle_EclipseRun_Start_Actions(self); } } } namespace Railroad.Compat { internal static class ProperSaveCompat { public class RailRoadSaveData { public RunProgressFlags BossDefeatFlags = RunProgressFlags.None; public bool ArenaCleared = false; internal RailRoadSaveData() { BossDefeatFlags = RunFlags.SaveData_RunProgressFlags; } internal void Load() { RunFlags.SaveData_RunProgressFlags = BossDefeatFlags; } } internal static void Init() { SaveFile.OnGatherSaveData += SaveData_OnGather; Loading.OnLoadingEnded += SaveData_OnLoad; } private static void SaveData_OnGather(Dictionary<string, object> obj) { obj.Add("RailRoad_SaveData", new RailRoadSaveData()); } private static void SaveData_OnLoad(SaveFile obj) { obj.GetModdedData<RailRoadSaveData>("RailRoad_SaveData")?.Load(); } } } namespace Railroad.Changes { public class InteractablePaths { internal static bool Enable = true; private List<InteractableSpawnCard> HalcyoniteShrines = new List<InteractableSpawnCard>(); private InteractableSpawnCard HalcyonShrine = Addressables.LoadAssetAsync<InteractableSpawnCard>((object)"0fc0fd67b3dab9645acb561484c72d28").WaitForCompletion(); private InteractableSpawnCard HalcyonShrineT1 = Addressables.LoadAssetAsync<InteractableSpawnCard>((object)"73074fe5c5128b04b85a42385324f447").WaitForCompletion(); private List<InteractableSpawnCard> AccessNodes = new List<InteractableSpawnCard>(); public InteractablePaths() { //IL_0011: 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_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) if (Enable) { Hooks(); CreateLists(); } } private void CreateLists() { if ((Object)(object)HalcyonShrine != (Object)null) { HalcyoniteShrines.Add(HalcyonShrine); } if ((Object)(object)HalcyonShrineT1 != (Object)null) { HalcyoniteShrines.Add(HalcyonShrineT1); } } private void Hooks() { } } public class Interactables { internal static bool Frog_Enable = false; internal static ConfigPortalType Frog_Portal = ConfigPortalType.DeepVoid; internal static int Frog_Pet_Count = 10; internal static ConfigCurrencyType Frog_Pet_Currency = ConfigCurrencyType.LunarCoin; internal static bool Frog_Stop_Petting = false; internal static GameObject GlassFrog = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/moon/FrogInteractable.prefab").WaitForCompletion(); public Interactables() { ClampConfig(); Hooks(); ModifyObjects(); } private void ClampConfig() { Frog_Portal = (ConfigPortalType)Math.Min((int)Frog_Portal, 12); Frog_Pet_Currency = (ConfigCurrencyType)Math.Min((int)Frog_Pet_Currency, 14); } private void ModifyObjects() { //IL_0050: 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_0071: Unknown result type (might be due to invalid IL or missing references) if (!Frog_Enable || !Object.op_Implicit((Object)(object)GlassFrog)) { return; } PurchaseInteraction component = GlassFrog.GetComponent<PurchaseInteraction>(); if (Object.op_Implicit((Object)(object)component)) { switch (Frog_Pet_Currency) { case ConfigCurrencyType.LunarCoin: component.cost = 1; component.costType = (CostTypeIndex)3; break; case ConfigCurrencyType.VoidCoin: component.cost = 1; component.costType = (CostTypeIndex)14; break; default: component.cost = 0; component.costType = (CostTypeIndex)0; break; } } } private void Hooks() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown if (Frog_Enable) { FrogController.Pet += new hook_Pet(FrogOnPet); if (Frog_Stop_Petting) { PurchaseInteraction.GetInteractability += new hook_GetInteractability(GetInteractability); } } } private Interactability GetInteractability(orig_GetInteractability orig, PurchaseInteraction self, Interactor activator) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: 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_003f: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)((Component)self).gameObject)) { FrogController component = ((Component)self).gameObject.GetComponent<FrogController>(); if (Object.op_Implicit((Object)(object)component) && component.petCount >= component.maxPets) { return (Interactability)0; } } return orig.Invoke(self, activator); } private void FrogOnPet(orig_Pet orig, FrogController self, Interactor interactor) { if (self.petCount == 0) { self.maxPets = Frog_Pet_Count; if (Object.op_Implicit((Object)(object)self.portalSpawner)) { bool flag = true; if (PortalUtility.CanSpawnPortal(Frog_Portal)) { InteractableSpawnCard spawnCardFromIndex = PortalUtility.GetSpawnCardFromIndex(Frog_Portal); if (Object.op_Implicit((Object)(object)spawnCardFromIndex)) { self.portalSpawner.willSpawn = true; self.portalSpawner.spawnChance = 1f; self.portalSpawner.portalSpawnCard = spawnCardFromIndex; self.portalSpawner.spawnMessageToken = PortalUtility.GetSpawnMessageFromIndex(Frog_Portal); flag = false; } } if (flag) { self.portalSpawner.willSpawn = false; } } } orig.Invoke(self, interactor); } } public class Looping { internal static bool Loop_LoopTeleporter = false; internal static int Loop_OrderTeleporter = 0; private static InteractableSpawnCard BaseTeleporter = Addressables.LoadAssetAsync<InteractableSpawnCard>((object)"RoR2/Base/Teleporters/iscTeleporter.asset").WaitForCompletion(); private static InteractableSpawnCard LunarTeleporter = Addressables.LoadAssetAsync<InteractableSpawnCard>((object)"RoR2/Base/Teleporters/iscLunarTeleporter.asset").WaitForCompletion(); private static string LunarTeleporterOBJName = "LunarTeleporter Variant(Clone)"; internal static string ModeStandard_PrimordialTele_ReplaceReq_Input = ""; internal static string ModeEclipse_PrimordialTele_ReplaceReq_Input = ""; internal static List<ReqAllowData> ModeStandard_PrimordialTele_Data = null; internal static List<ReqAllowData> ModeEclipse_PrimordialTele_Data = null; internal static string ModeStandard_Artifact_Input = ""; internal static string ModeEclipse_Artifact_Input = ""; internal static List<ArtifactDef> ModeStandard_Artifacts = null; internal static List<ArtifactDef> ModeEclipse_Artifacts = null; public Looping() { ProcessConfig(); Hooks(); } private void ProcessConfig() { if (ModeStandard_PrimordialTele_ReplaceReq_Input.Length > 0) { ModeStandard_PrimordialTele_Data = ReqList.ReadStageNumberInput(ModeStandard_PrimordialTele_ReplaceReq_Input, "Looping|Standard|Primordial Teleporter Conditions"); } if (ModeEclipse_PrimordialTele_ReplaceReq_Input.Length > 0) { ModeEclipse_PrimordialTele_Data = ReqList.ReadStageNumberInput(ModeEclipse_PrimordialTele_ReplaceReq_Input, "Looping|Eclipse|Primordial Teleporter Conditions"); } } private void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown Run.BeginStage += new hook_BeginStage(Run_BeginStage); SceneDirector.onPrePopulateSceneServer += OnPrePopulateScene; ArtifactCatalog.Init += new hook_Init(ArtifactCatalog_Init); } internal static ArtifactDef ConvertStringToArtifactDef(string artifactName) { //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Invalid comparison between Unknown and I4 ArtifactDef val = null; val = ArtifactCatalog.FindArtifactDef(artifactName); if ((Object)(object)val == (Object)null) { for (int i = 0; i < ArtifactCatalog.artifactCount; i++) { if (Object.op_Implicit((Object)(object)ArtifactCatalog.artifactDefs[i])) { string text = Language.GetString(ArtifactCatalog.artifactDefs[i].nameToken, "en").Replace(" ", ""); if (text == artifactName) { val = ArtifactCatalog.artifactDefs[i]; break; } } } } if ((Object)(object)val == (Object)null || (int)val.artifactIndex <= -1) { return null; } return val; } internal static void ArtifactCatalog_Init(orig_Init orig) { orig.Invoke(); ModeStandard_Artifacts = new List<ArtifactDef>(); if (ModeStandard_Artifact_Input.Length > 0) { string[] array = ModeStandard_Artifact_Input.Split(','); for (int i = 0; i < array.Length; i++) { string text = array[i].Trim(); ArtifactDef val = ConvertStringToArtifactDef(text); if ((Object)(object)val != (Object)null) { if (!ModeStandard_Artifacts.Contains(val)) { ModeStandard_Artifacts.Add(val); } } else { MainPlugin.ModLogger.LogWarning((object)("Could not find ArtifactDef: [" + text + "]")); } } if (ModeStandard_Artifacts.Count < 1) { ModeStandard_Artifacts = null; } } ModeEclipse_Artifacts = new List<ArtifactDef>(); if (ModeEclipse_Artifact_Input.Length <= 0) { return; } string[] array2 = ModeEclipse_Artifact_Input.Split(','); for (int j = 0; j < array2.Length; j++) { string text2 = array2[j].Trim(); ArtifactDef val2 = ConvertStringToArtifactDef(text2); if ((Object)(object)val2 != (Object)null) { if (!ModeEclipse_Artifacts.Contains(val2)) { ModeEclipse_Artifacts.Add(val2); } } else { MainPlugin.ModLogger.LogWarning((object)("Could not find ArtifactDef: [" + text2 + "]")); } } if (ModeEclipse_Artifacts.Count < 1) { ModeEclipse_Artifacts = null; } } private void OnPrePopulateScene(SceneDirector self) { if (!Object.op_Implicit((Object)(object)self.teleporterSpawnCard)) { return; } SceneDef sceneDefForCurrentScene = SceneCatalog.GetSceneDefForCurrentScene(); if (IsEclipse()) { if (ReqList.PassesReqDataList(ModeEclipse_PrimordialTele_Data, Run.instance.stageClearCount + 1, sceneDefForCurrentScene)) { self.teleporterSpawnCard = (SpawnCard)(object)LunarTeleporter; } else { self.teleporterSpawnCard = (SpawnCard)(object)BaseTeleporter; } } else if (ReqList.PassesReqDataList(ModeStandard_PrimordialTele_Data, Run.instance.stageClearCount + 1, sceneDefForCurrentScene)) { self.teleporterSpawnCard = (SpawnCard)(object)LunarTeleporter; } else { self.teleporterSpawnCard = (SpawnCard)(object)BaseTeleporter; } } private void Run_BeginStage(orig_BeginStage orig, Run self) { orig.Invoke(self); if ((RunFlags.SaveData_RunProgressFlags & RunProgressFlags.Looping) == 0) { return; } if (IsEclipse()) { for (int i = 0; i < ModeEclipse_Artifacts.Count; i++) { ExpansionDef requiredExpansion = ModeEclipse_Artifacts[i].requiredExpansion; if ((Object)(object)requiredExpansion == (Object)null || Run.instance.IsExpansionEnabled(requiredExpansion)) { RunArtifactManager.instance.SetArtifactEnabledServer(ModeEclipse_Artifacts[i], true); } } return; } for (int j = 0; j < ModeStandard_Artifacts.Count; j++) { ExpansionDef requiredExpansion2 = ModeStandard_Artifacts[j].requiredExpansion; if ((Object)(object)requiredExpansion2 == (Object)null || Run.instance.IsExpansionEnabled(requiredExpansion2)) { RunArtifactManager.instance.SetArtifactEnabledServer(ModeStandard_Artifacts[j], true); } } } private bool IsEclipse() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Invalid comparison between Unknown and I4 Run instance = Run.instance; if (Object.op_Implicit((Object)(object)instance)) { return (int)instance.selectedDifficulty >= 3; } return false; } } public class Misc { internal static bool ModeStandard_AllowBeads = true; internal static bool ModeEclipse_AllowBeads = false; internal static bool TimeFlows_Meridian = false; internal static bool TimeFlows_SolusWeb = false; internal static bool TimeFlows_SolutionalHaunt = false; internal static bool TimeFlows_VoidRaid = false; internal static bool TimeFlows_Arena = false; internal static int Loop_OrderTeleporter = 0; private SceneDef SceneDef_Arena = Addressables.LoadAssetAsync<SceneDef>((object)"RoR2/Base/arena/arena.asset").WaitForCompletion(); private SceneDef SceneDef_VoidRaid = Addressables.LoadAssetAsync<SceneDef>((object)"RoR2/DLC1/voidraid/voidraid.asset").WaitForCompletion(); private SceneDef SceneDef_Meridian = Addressables.LoadAssetAsync<SceneDef>((object)"RoR2/DLC2/meridian/meridian.asset").WaitForCompletion(); private SceneDef SceneDef_SolutionalHaunt = Addressables.LoadAssetAsync<SceneDef>((object)"RoR2/DLC3/solutionalhaunt/solutionalhaunt.asset").WaitForCompletion(); private SceneDef SceneDef_SolusWeb = Addressables.LoadAssetAsync<SceneDef>((object)"RoR2/DLC3/solusweb/solusweb.asset").WaitForCompletion(); public Misc() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: 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_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) Hooks(); } private void Hooks() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown UpdateSceneDefs(); if (ModeEclipse_AllowBeads) { EclipseRun.OverrideRuleChoices += new Manipulator(IL_EclipseRunRules); } SharedHooks.Handle_EclipseRun_Start_Actions = (SharedHooks.Handle_EclipseRun_Start)Delegate.Combine(SharedHooks.Handle_EclipseRun_Start_Actions, new SharedHooks.Handle_EclipseRun_Start(EclipseRun_Start)); } private void UpdateSceneDefs() { //IL_0023: 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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: 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_0082: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)SceneDef_Arena)) { SceneDef_Arena.sceneType = AdjustSceneTimeFlow(SceneDef_Arena, TimeFlows_Arena); } if (Object.op_Implicit((Object)(object)SceneDef_VoidRaid)) { SceneDef_VoidRaid.sceneType = AdjustSceneTimeFlow(SceneDef_VoidRaid, TimeFlows_VoidRaid); } if (Object.op_Implicit((Object)(object)SceneDef_Meridian)) { SceneDef_Meridian.sceneType = AdjustSceneTimeFlow(SceneDef_Meridian, TimeFlows_Meridian); } if (Object.op_Implicit((Object)(object)SceneDef_SolutionalHaunt)) { SceneDef_SolutionalHaunt.sceneType = AdjustSceneTimeFlow(SceneDef_SolutionalHaunt, TimeFlows_SolutionalHaunt); } if (Object.op_Implicit((Object)(object)SceneDef_SolusWeb)) { SceneDef_SolusWeb.sceneType = AdjustSceneTimeFlow(SceneDef_SolusWeb, TimeFlows_SolusWeb); } } private SceneType AdjustSceneTimeFlow(SceneDef sceneDef, bool AllowTimeFlow) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Invalid comparison between Unknown and I4 //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Invalid comparison between Unknown and I4 //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Invalid comparison between Unknown and I4 //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Invalid comparison between Unknown and I4 //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0054: 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_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0059: 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) if (AllowTimeFlow) { if ((int)sceneDef.sceneType == 2) { return (SceneType)4; } if ((int)sceneDef.sceneType == 5) { return (SceneType)1; } } else { if ((int)sceneDef.sceneType == 4) { return (SceneType)2; } if ((int)sceneDef.sceneType == 1) { return (SceneType)5; } } return sceneDef.sceneType; } private void EclipseRun_Start(EclipseRun self) { if (NetworkServer.active) { ((Run)self).ResetEventFlag("NoMysterySpace"); } } private void IL_EclipseRunRules(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Items), "LunarTrinket") })) { val.Index -= 4; val.RemoveRange(9); } else { Debug.LogError((object)"Railroad: EclipseRunRules LunarTrinket IL Hook failed"); } } } public enum PortalProgReqTags { None = 0, PreLoop = 1, PostLoop = 2, PreMithrix = 4, PostMithrix = 8, PreTwistedScavenger = 0x10, PostTwistedScavenger = 0x20, PreVoidling = 0x40, PostVoidling = 0x80, PreFalseSon = 0x100, PostFalseSon = 0x200, PreSolusWing = 0x400, PostSolusWing = 0x800, PreSolusHeart = 0x1000, PostSolusHeart = 0x2000, PreVoidFields = 0x4000, PostVoidFields = 0x8000 } public class PortalSpawnData { internal ConfigPortalType PortalType = ConfigPortalType.NoPortal; internal PortalProgReqTags ReqTags = PortalProgReqTags.None; } public class PortalUtility { internal static string Portal_Default_Open = ""; internal static string Portal_Shop_Open = "PORTAL_SHOP_OPEN"; internal static string Portal_GoldCoast_Open = "PORTAL_GOLDSHORES_OPEN"; internal static string Portal_MS_Open = "PORTAL_MS_OPEN"; internal static string Portal_DeepVoid_Open = "PORTAL_DEEPVOID_OPEN"; internal static string Portal_Storm_Open = "PORTAL_STORM_OPEN"; internal static string Portal_HardwareProg_Open = "PORTAL_SOLUSSHOP_OPEN"; internal static string Portal_HardwareProg_Haunt_Open = "PORTAL_SOLUSSHOP_OPEN"; internal static string Portal_SolusShop_Open = "PORTAL_SOLUSSHOP_OPEN"; private static GameObject VoidPotential = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/OptionPickup/OptionPickup.prefab").WaitForCompletion(); private static BasicPickupDropTable Tier3PickupTable = Addressables.LoadAssetAsync<BasicPickupDropTable>((object)"RoR2/Base/Common/dtTier3Item.asset").WaitForCompletion(); private static InteractableSpawnCard Portal_Shop = Addressables.LoadAssetAsync<InteractableSpawnCard>((object)"RoR2/Base/PortalShop/iscShopPortal.asset").WaitForCompletion(); private static InteractableSpawnCard Portal_MS = Addressables.LoadAssetAsync<InteractableSpawnCard>((object)"RoR2/Base/PortalMS/iscMSPortal.asset").WaitForCompletion(); private static InteractableSpawnCard Portal_Arena = null; private static InteractableSpawnCard Portal_Void = Addressables.LoadAssetAsync<InteractableSpawnCard>((object)"RoR2/DLC1/PortalVoid/iscVoidPortal.asset").WaitForCompletion(); private static InteractableSpawnCard Portal_DeepVoid = Addressables.LoadAssetAsync<InteractableSpawnCard>((object)"RoR2/DLC1/DeepVoidPortal/iscDeepVoidPortal.asset").WaitForCompletion(); private static InteractableSpawnCard Portal_VoidOutro = Addressables.LoadAssetAsync<InteractableSpawnCard>((object)"RoR2/DLC1/VoidOutroPortal/iscVoidOutroPortal.asset").WaitForCompletion(); private static InteractableSpawnCard Portal_Goldshores = Addressables.LoadAssetAsync<InteractableSpawnCard>((object)"RoR2/Base/PortalGoldshores/iscGoldshoresPortal.asset").WaitForCompletion(); private static InteractableSpawnCard Portal_Colossus = Addressables.LoadAssetAsync<InteractableSpawnCard>((object)"RoR2/DLC2/iscColossusPortal.asset").WaitForCompletion(); private static InteractableSpawnCard Portal_Destination = Addressables.LoadAssetAsync<InteractableSpawnCard>((object)"RoR2/DLC2/iscDestinationPortal.asset").WaitForCompletion(); private static InteractableSpawnCard Portal_HardwareProg = Addressables.LoadAssetAsync<InteractableSpawnCard>((object)"RoR2/DLC3/iscHardwareProgPortal.asset").WaitForCompletion(); private static InteractableSpawnCard Portal_HardwareProg_Haunt = Addressables.LoadAssetAsync<InteractableSpawnCard>((object)"RoR2/DLC3/iscHardwareProgPortal_Haunt.asset").WaitForCompletion(); private static InteractableSpawnCard Portal_SolusShop = Addressables.LoadAssetAsync<InteractableSpawnCard>((object)"RoR2/DLC3/iscSolusShopPortal.asset").WaitForCompletion(); private static InteractableSpawnCard Portal_SolusBackout = Addressables.LoadAssetAsync<InteractableSpawnCard>((object)"RoR2/DLC3/iscSolusPortalBackout.asset").WaitForCompletion(); private static InteractableSpawnCard Portal_SolusWeb = null; private static SceneDef Arena_SceneDef = Addressables.LoadAssetAsync<SceneDef>((object)"RoR2/Base/arena/arena.asset").WaitForCompletion(); private static SceneDef Meridian_SceneDef = Addressables.LoadAssetAsync<SceneDef>((object)"RoR2/DLC2/meridian/meridian.asset").WaitForCompletion(); private static ExpansionDef DLC1Def = Addressables.LoadAssetAsync<ExpansionDef>((object)"RoR2/DLC1/Common/DLC1.asset").WaitForCompletion(); private static ExpansionDef DLC2Def = Addressables.LoadAssetAsync<ExpansionDef>((object)"RoR2/DLC2/Common/DLC2.asset").WaitForCompletion(); private static ExpansionDef DLC3Def = Addressables.LoadAssetAsync<ExpansionDef>((object)"RoR2/DLC3/DLC3.asset").WaitForCompletion(); public PortalUtility() { CreateSpawnCards(); } private void CreateSpawnCards() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: 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_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) Portal_Arena = ScriptableObject.CreateInstance<InteractableSpawnCard>(); ((SpawnCard)Portal_Arena).prefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/PortalArena/PortalArena.prefab").WaitForCompletion(); ((Object)Portal_Arena).name = ((Object)((SpawnCard)Portal_Arena).prefab).name; ((SpawnCard)Portal_Arena).sendOverNetwork = ((SpawnCard)Portal_Destination).sendOverNetwork; ((SpawnCard)Portal_Arena).hullSize = ((SpawnCard)Portal_Destination).hullSize; ((SpawnCard)Portal_Arena).nodeGraphType = ((SpawnCard)Portal_Destination).nodeGraphType; ((SpawnCard)Portal_Arena).requiredFlags = ((SpawnCard)Portal_Destination).requiredFlags; ((SpawnCard)Portal_Arena).forbiddenFlags = ((SpawnCard)Portal_Destination).forbiddenFlags; ((SpawnCard)Portal_Arena).directorCreditCost = ((SpawnCard)Portal_Destination).directorCreditCost; ((SpawnCard)Portal_Arena).occupyPosition = ((SpawnCard)Portal_Destination).occupyPosition; Portal_Arena.orientToFloor = Portal_Destination.orientToFloor; Portal_Arena.skipSpawnWhenDevotionArtifactEnabled = Portal_Destination.skipSpawnWhenDevotionArtifactEnabled; Portal_Arena.skipSpawnWhenSacrificeArtifactEnabled = Portal_Destination.skipSpawnWhenSacrificeArtifactEnabled; Portal_SolusWeb = ScriptableObject.CreateInstance<InteractableSpawnCard>(); ((SpawnCard)Portal_SolusWeb).prefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC3/SolusWebPortal.prefab").WaitForCompletion(); ((Object)Portal_SolusWeb).name = ((Object)((SpawnCard)Portal_SolusWeb).prefab).name; ((SpawnCard)Portal_SolusWeb).sendOverNetwork = ((SpawnCard)Portal_Destination).sendOverNetwork; ((SpawnCard)Portal_SolusWeb).hullSize = ((SpawnCard)Portal_Destination).hullSize; ((SpawnCard)Portal_SolusWeb).nodeGraphType = ((SpawnCard)Portal_Destination).nodeGraphType; ((SpawnCard)Portal_SolusWeb).requiredFlags = ((SpawnCard)Portal_Destination).requiredFlags; ((SpawnCard)Portal_SolusWeb).forbiddenFlags = ((SpawnCard)Portal_Destination).forbiddenFlags; ((SpawnCard)Portal_SolusWeb).directorCreditCost = ((SpawnCard)Portal_Destination).directorCreditCost; ((SpawnCard)Portal_SolusWeb).occupyPosition = ((SpawnCard)Portal_Destination).occupyPosition; Portal_SolusWeb.orientToFloor = Portal_Destination.orientToFloor; Portal_SolusWeb.skipSpawnWhenDevotionArtifactEnabled = Portal_Destination.skipSpawnWhenDevotionArtifactEnabled; Portal_SolusWeb.skipSpawnWhenSacrificeArtifactEnabled = Portal_Destination.skipSpawnWhenSacrificeArtifactEnabled; } internal static List<PortalSpawnData> BuildPortalList(string portalList, string errorCode = "Not Specified") { List<PortalSpawnData> list = new List<PortalSpawnData>(); if (portalList.Length > 0) { string[] array = portalList.Split(','); for (int i = 0; i < array.Length; i++) { string text = array[i].Trim(); string[] array2 = null; if (text.Contains(";")) { array2 = text.Split(';'); text = array2[0]; } ConfigPortalType result = ConfigPortalType.NoPortal; if (!Enum.TryParse<ConfigPortalType>(text, out result)) { MainPlugin.ModLogger.LogWarning((object)("[" + errorCode + "] Could not find Portal Type: [" + text + "]")); continue; } bool flag = true; for (int j = 0; j < list.Count; j++) { if (list[j].PortalType == result) { flag = false; break; } } if (flag) { PortalSpawnData portalSpawnData = new PortalSpawnData(); portalSpawnData.PortalType = result; PortalProgReqTags portalProgReqTags = PortalProgReqTags.None; if (array2 != null && array2.Length > 1) { for (int k = 1; k < array2.Length; k++) { PortalProgReqTags result2 = PortalProgReqTags.None; if (!Enum.TryParse<PortalProgReqTags>(array2[k], out result2)) { MainPlugin.ModLogger.LogWarning((object)("[" + errorCode + ", " + text + "] Could not find Portal Tag: [" + array2[k] + "]")); } else if ((portalProgReqTags & result2) != result2) { portalProgReqTags |= result2; } else { MainPlugin.ModLogger.LogWarning((object)("[" + errorCode + ", " + text + "] Duplicate Portal Tag in config: [" + result2.ToString() + "]")); } } } portalSpawnData.ReqTags = portalProgReqTags; list.Add(portalSpawnData); } else { MainPlugin.ModLogger.LogWarning((object)("[" + errorCode + "] Duplicate Portal Type in config: [" + text + "]")); } } if (list.Count < 1) { list = null; } } return list; } internal static List<ConfigPortalType> GetValidPortals_NEO(List<PortalSpawnData> PortalList) { List<ConfigPortalType> list = new List<ConfigPortalType>(); for (int i = 0; i < PortalList.Count; i++) { if (AllowedToSpawnPortal(PortalList[i].PortalType, PortalList[i].ReqTags)) { list.Add(PortalList[i].PortalType); } else { list.Add(ConfigPortalType.NoPortal); } } return list; } internal static List<ConfigPortalType> GetValidPortals(List<ConfigPortalType> PortalList) { List<ConfigPortalType> list = new List<ConfigPortalType>(); for (int i = 0; i < PortalList.Count; i++) { if (CanSpawnPortal(PortalList[i])) { list.Add(PortalList[i]); } else { list.Add(ConfigPortalType.NoPortal); } } return list; } internal static bool PassesPortalTags(PortalProgReqTags portalReqs) { if ((portalReqs & PortalProgReqTags.PostSolusHeart) == PortalProgReqTags.PostSolusWing && (RunFlags.SaveData_RunProgressFlags & RunProgressFlags.SolusHeart) != RunProgressFlags.SolusHeart) { return false; } if ((portalReqs & PortalProgReqTags.PreSolusHeart) == PortalProgReqTags.PreSolusHeart && (RunFlags.SaveData_RunProgressFlags & RunProgressFlags.SolusHeart) == RunProgressFlags.SolusHeart) { return false; } if ((portalReqs & PortalProgReqTags.PostSolusWing) == PortalProgReqTags.PostSolusWing && (RunFlags.SaveData_RunProgressFlags & RunProgressFlags.SolusWing) != RunProgressFlags.SolusWing) { return false; } if ((portalReqs & PortalProgReqTags.PreSolusWing) == PortalProgReqTags.PreSolusWing && (RunFlags.SaveData_RunProgressFlags & RunProgressFlags.SolusWing) == RunProgressFlags.SolusWing) { return false; } if ((portalReqs & PortalProgReqTags.PostFalseSon) == PortalProgReqTags.PostFalseSon && (RunFlags.SaveData_RunProgressFlags & RunProgressFlags.FalseSon) != RunProgressFlags.FalseSon) { return false; } if ((portalReqs & PortalProgReqTags.PreFalseSon) == PortalProgReqTags.PreFalseSon && (RunFlags.SaveData_RunProgressFlags & RunProgressFlags.FalseSon) == RunProgressFlags.FalseSon) { return false; } if ((portalReqs & PortalProgReqTags.PostVoidling) == PortalProgReqTags.PostFalseSon && (RunFlags.SaveData_RunProgressFlags & RunProgressFlags.Voidling) != RunProgressFlags.Voidling) { return false; } if ((portalReqs & PortalProgReqTags.PreVoidling) == PortalProgReqTags.PreFalseSon && (RunFlags.SaveData_RunProgressFlags & RunProgressFlags.Voidling) == RunProgressFlags.Voidling) { return false; } if ((portalReqs & PortalProgReqTags.PostTwistedScavenger) != PortalProgReqTags.None && (RunFlags.SaveData_RunProgressFlags & RunProgressFlags.TwistedScavenger) != RunProgressFlags.TwistedScavenger) { return false; } if ((portalReqs & PortalProgReqTags.PreTwistedScavenger) != PortalProgReqTags.None && (RunFlags.SaveData_RunProgressFlags & RunProgressFlags.TwistedScavenger) == RunProgressFlags.TwistedScavenger) { return false; } if ((portalReqs & PortalProgReqTags.PostMithrix) != PortalProgReqTags.None && (RunFlags.SaveData_RunProgressFlags & RunProgressFlags.Mithrix) != RunProgressFlags.Mithrix) { return false; } if ((portalReqs & PortalProgReqTags.PreMithrix) != PortalProgReqTags.None && (RunFlags.SaveData_RunProgressFlags & RunProgressFlags.Mithrix) == RunProgressFlags.Mithrix) { return false; } if ((portalReqs & PortalProgReqTags.PostVoidFields) != PortalProgReqTags.None && (RunFlags.SaveData_RunProgressFlags & RunProgressFlags.VoidFields) != RunProgressFlags.VoidFields) { return false; } if ((portalReqs & PortalProgReqTags.PreVoidFields) != PortalProgReqTags.None && (RunFlags.SaveData_RunProgressFlags & RunProgressFlags.VoidFields) == RunProgressFlags.VoidFields) { return false; } if ((portalReqs & PortalProgReqTags.PostLoop) != PortalProgReqTags.None && (RunFlags.SaveData_RunProgressFlags & RunProgressFlags.Looping) != RunProgressFlags.Looping) { return false; } if ((portalReqs & PortalProgReqTags.PreLoop) != PortalProgReqTags.None && (RunFlags.SaveData_RunProgressFlags & RunProgressFlags.Looping) == RunProgressFlags.Looping) { return false; } return true; } internal static bool AllowedToSpawnPortal(ConfigPortalType portalType, PortalProgReqTags portalReqs) { if (!PassesPortalTags(portalReqs)) { return false; } switch (portalType) { case ConfigPortalType.NoPortal: return false; default: if (portalType != ConfigPortalType.VoidOutro) { if (portalType == ConfigPortalType.Colossus || portalType == ConfigPortalType.Destination) { return Run.instance.IsExpansionEnabled(DLC2Def); } if (portalType == ConfigPortalType.HardwareProg || portalType == ConfigPortalType.HardwareProg_Haunt || portalType == ConfigPortalType.SolusShop || portalType == ConfigPortalType.SolusBackout || portalType == ConfigPortalType.SolusWeb) { return Run.instance.IsExpansionEnabled(DLC3Def); } return true; } goto case ConfigPortalType.Void; case ConfigPortalType.Void: case ConfigPortalType.DeepVoid: return Run.instance.IsExpansionEnabled(DLC1Def); } } internal static bool CanSpawnPortal(ConfigPortalType portalType) { switch (portalType) { case ConfigPortalType.NoPortal: return false; default: if (portalType != ConfigPortalType.VoidOutro) { if (portalType == ConfigPortalType.Colossus || portalType == ConfigPortalType.Destination) { return Run.instance.IsExpansionEnabled(DLC2Def); } if (portalType == ConfigPortalType.HardwareProg || portalType == ConfigPortalType.HardwareProg_Haunt || portalType == ConfigPortalType.SolusShop || portalType == ConfigPortalType.SolusBackout || portalType == ConfigPortalType.SolusWeb) { return Run.instance.IsExpansionEnabled(DLC3Def); } return true; } goto case ConfigPortalType.Void; case ConfigPortalType.Void: case ConfigPortalType.DeepVoid: return Run.instance.IsExpansionEnabled(DLC1Def); } } internal static InteractableSpawnCard GetSpawnCardFromIndex(ConfigPortalType portalType) { return (InteractableSpawnCard)(portalType switch { ConfigPortalType.Shop => Portal_Shop, ConfigPortalType.MS => Portal_MS, ConfigPortalType.Null => Portal_Arena, ConfigPortalType.Void => Portal_Void, ConfigPortalType.DeepVoid => Portal_DeepVoid, ConfigPortalType.VoidOutro => Portal_VoidOutro, ConfigPortalType.Goldshores => Portal_Goldshores, ConfigPortalType.Colossus => Portal_Colossus, ConfigPortalType.Destination => Portal_Destination, ConfigPortalType.HardwareProg => Portal_HardwareProg, ConfigPortalType.HardwareProg_Haunt => Portal_HardwareProg_Haunt, ConfigPortalType.SolusShop => Portal_SolusShop, ConfigPortalType.SolusBackout => Portal_SolusBackout, ConfigPortalType.SolusWeb => Portal_SolusWeb, _ => null, }); } internal static string GetSpawnMessageFromIndex(ConfigPortalType portalType) { return portalType switch { ConfigPortalType.Shop => Portal_Shop_Open, ConfigPortalType.MS => Portal_MS_Open, ConfigPortalType.DeepVoid => Portal_DeepVoid_Open, ConfigPortalType.Goldshores => Portal_GoldCoast_Open, ConfigPortalType.Colossus => Portal_Storm_Open, ConfigPortalType.HardwareProg => Portal_HardwareProg_Open, ConfigPortalType.HardwareProg_Haunt => Portal_HardwareProg_Haunt_Open, ConfigPortalType.SolusShop => Portal_SolusShop_Open, _ => Portal_Default_Open, }; } internal static GameObject TrySpawnPortal_FindFloor(ConfigPortalType portalType, Vector3 location, PlacementMode placementMode = (PlacementMode)1) { //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_004c: Unknown result type (might be due to invalid IL or missing references) //IL_005c: 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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Expected O, but got Unknown //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Expected O, but got Unknown if (CanSpawnPortal(portalType)) { InteractableSpawnCard spawnCardFromIndex = GetSpawnCardFromIndex(portalType); if (Object.op_Implicit((Object)(object)spawnCardFromIndex)) { RaycastHit val = default(RaycastHit); Physics.Raycast(location, Vector3.down, ref val, float.PositiveInfinity, LayerMask.GetMask(new string[1] { "World" })); if (((RaycastHit)(ref val)).point.y + 1f <= location.y) { location.y = ((RaycastHit)(ref val)).point.y + 1f; } else { location.y = ((RaycastHit)(ref val)).point.y; } return DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest((SpawnCard)(object)spawnCardFromIndex, new DirectorPlacementRule { maxDistance = 30f, minDistance = 10f, placementMode = placementMode, position = location }, Run.instance.stageRng)); } } return null; } internal static void TrySpawnPortalCircle(List<ConfigPortalType> portalList, Vector3 baselocation, PlacementMode placementMode = (PlacementMode)1, float baseDistance = 20f, bool groundPortals = false, bool randomAngle = false) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: 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_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: 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_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Expected O, but got Unknown //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Expected O, but got Unknown //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) int count = portalList.Count; if (count == 1) { if (groundPortals) { TrySpawnPortal_FindFloor(portalList[0], baselocation, placementMode); } else { TrySpawnPortal(portalList[0], baselocation, placementMode); } } else { if (count <= 0) { return; } float num = 360f / (float)count; float num2 = 90f; if (randomAngle) { num2 = Random.Range(0, 360); } Vector3 val = Quaternion.AngleAxis(num2, Vector3.up) * Vector3.forward; Quaternion val2 = Quaternion.AngleAxis(num, Vector3.up); int num3 = 0; RaycastHit val4 = default(RaycastHit); while (num3 < count) { if (CanSpawnPortal(portalList[num3])) { InteractableSpawnCard spawnCardFromIndex = GetSpawnCardFromIndex(portalList[num3]); if (Object.op_Implicit((Object)(object)spawnCardFromIndex)) { Vector3 val3 = baselocation + val * baseDistance; if (groundPortals) { Physics.Raycast(val3, Vector3.down, ref val4, float.PositiveInfinity, LayerMask.GetMask(new string[1] { "World" })); if (((RaycastHit)(ref val4)).point.y + 1f <= val3.y) { val3.y = ((RaycastHit)(ref val4)).point.y + 1f; } else { val3.y = ((RaycastHit)(ref val4)).point.y; } } GameObject val5 = DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest((SpawnCard)(object)spawnCardFromIndex, new DirectorPlacementRule { maxDistance = 30f, minDistance = 10f, placementMode = placementMode, position = val3, rotation = Quaternion.AngleAxis(0f, val) }, Run.instance.stageRng)); } } num3++; val = val2 * val; } } } internal static GameObject TrySpawnPortal(ConfigPortalType portalType, Vector3 location, PlacementMode placementMode = (PlacementMode)1) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0034: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Expected O, but got Unknown //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Expected O, but got Unknown if (CanSpawnPortal(portalType)) { InteractableSpawnCard spawnCardFromIndex = GetSpawnCardFromIndex(portalType); if (Object.op_Implicit((Object)(object)spawnCardFromIndex)) { return DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest((SpawnCard)(object)spawnCardFromIndex, new DirectorPlacementRule { maxDistance = 30f, minDistance = 10f, placementMode = placementMode, position = location }, Run.instance.stageRng)); } } return null; } internal static void TryDropPotential(PickupDropTable dropTable, Vector3 location, int optionCount) { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0067: 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_0084: 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_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)dropTable == (Object)null) { return; } int participatingPlayerCount = Run.instance.participatingPlayerCount; if (participatingPlayerCount <= 0) { return; } List<UniquePickup> list = new List<UniquePickup>(); dropTable.GenerateDistinctPickups(list, optionCount, Run.instance.treasureRng, true); if (list.Count > 0) { ItemTier itemTier = PickupCatalog.GetPickupDef(list[0].pickupIndex).itemTier; float num = 360f / (float)participatingPlayerCount; Vector3 val = Quaternion.AngleAxis((float)Random.Range(0, 360), Vector3.up) * (Vector3.up * 40f + Vector3.forward * 5f); Quaternion val2 = Quaternion.AngleAxis(num, Vector3.up); int num2 = 0; while (num2 < participatingPlayerCount) { CreatePickupInfo val3 = new CreatePickupInfo { pickerOptions = PickupPickerController.GenerateOptionsFromList<List<UniquePickup>>(list), prefabOverride = VoidPotential, position = location, rotation = Quaternion.identity }; ((CreatePickupInfo)(ref val3)).pickup = new UniquePickup(PickupCatalog.FindPickupIndex(itemTier)); CreatePickupInfo val4 = val3; PickupDropletController.CreatePickupDroplet(val4, location, val); num2++; val = val2 * val; } } } internal static void TryDropItems(List<PickupIndex> dropList, Vector3 location) { //IL_002d: 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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: 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_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) int participatingPlayerCount = Run.instance.participatingPlayerCount; if (participatingPlayerCount <= 0) { return; } int count = dropList.Count; if (count > 0) { UniquePickup val = new UniquePickup { pickupIndex = dropList[Random.Range(0, count - 1)] }; float num = 360f / (float)participatingPlayerCount; Vector3 val2 = Quaternion.AngleAxis((float)Random.Range(0, 360), Vector3.up) * (Vector3.up * 40f + Vector3.forward * 5f); Quaternion val3 = Quaternion.AngleAxis(num, Vector3.up); int num2 = 0; while (num2 < participatingPlayerCount) { PickupDropletController.CreatePickupDroplet(val, location, val2, false); num2++; val2 = val3 * val2; } } } } public class ReqAllowData { internal int StageNumber = -1; internal bool UseStageOrder = false; internal ConfigPortalType PortalType = ConfigPortalType.NoPortal; internal PortalProgReqTags ReqTags = PortalProgReqTags.None; } public class ReqList { internal static bool IsStageNumberOrOrder(string inputstring) { if (inputstring.Contains("SO")) { return true; } if (inputstring.Contains("SN")) { return true; } int result = 0; if (int.TryParse(inputstring, out result)) { return true; } return false; } internal static bool PassesReqDataList(List<ReqAllowData> allowDataList, int stageNumber, SceneDef sceneDef) { if (allowDataList != null) { for (int i = 0; i < allowDataList.Count; i++) { if (allowDataList[i].StageNumber <= -1) { continue; } if (allowDataList[i].UseStageOrder) { if ((allowDataList[i].StageNumber == 0 || allowDataList[i].StageNumber == sceneDef.stageOrder) && PortalUtility.PassesPortalTags(allowDataList[i].ReqTags)) { return true; } } else if ((allowDataList[i].StageNumber == 0 || allowDataList[i].StageNumber == stageNumber) && PortalUtility.PassesPortalTags(allowDataList[i].ReqTags)) { return true; } } } return false; } internal static List<ReqAllowData> ReadStageNumberInput(string portalList, string errorCode = "NONE") { List<ReqAllowData> list = new List<ReqAllowData>(); if (portalList.Length > 0) { string[] array = portalList.Split(','); for (int i = 0; i < array.Length; i++) { string text = array[i].Trim(); string[] array2 = null; if (text.Contains(";")) { array2 = text.Split(';'); text = array2[0]; } if (IsStageNumberOrOrder(text)) { ReqAllowData reqAllowData = new ReqAllowData(); int result = -1; if (int.TryParse(text, out result)) { reqAllowData.StageNumber = result; } else { if (text.Contains("SO")) { reqAllowData.UseStageOrder = true; } string text2 = text.Replace("SO", ""); text2 = text2.Replace("SN", ""); if (int.TryParse(text2, out result)) { reqAllowData.StageNumber = result; } } PortalProgReqTags portalProgReqTags = PortalProgReqTags.None; if (array2 != null && array2.Length > 1) { for (int j = 1; j < array2.Length; j++) { PortalProgReqTags result2 = PortalProgReqTags.None; if (!Enum.TryParse<PortalProgReqTags>(array2[j], out result2)) { MainPlugin.ModLogger.LogWarning((object)("[" + errorCode + ", " + text + "] Could not find Portal Tag: [" + array2[j] + "]")); } else if ((portalProgReqTags & result2) != result2) { portalProgReqTags |= result2; } else { MainPlugin.ModLogger.LogWarning((object)("[" + errorCode + ", " + text + "] Duplicate Portal Tag in config: [" + result2.ToString() + "]")); } } } reqAllowData.ReqTags = portalProgReqTags; list.Add(reqAllowData); } else { MainPlugin.ModLogger.LogWarning((object)("[" + errorCode + "|" + text + "] No stage number specified, skipping.")); } } if (list.Count < 1) { list = null; } } return list; } } public enum RunProgressFlags { None = 0, Looping = 1, VoidFields = 2, Mithrix = 4, TwistedScavenger = 8, Voidling = 0x10, FalseSon = 0x20, SolusWing = 0x40, SolusHeart = 0x80 } public class RunFlags { internal static bool Enable = true; public static bool Looping_RequireDejaVu = false; public static RunProgressFlags SaveData_RunProgressFlags = RunProgressFlags.None; public RunFlags() { if (Enable) { Hooks(); } } internal static void LogRunData() { MainPlugin.ModLogger.LogInfo((object)"====LOGGING RUN DATA===="); if ((SaveData_RunProgressFlags & RunProgressFlags.Looping) != RunProgressFlags.None) { MainPlugin.ModLogger.LogInfo((object)"Currently Looping."); } if ((SaveData_RunProgressFlags & RunProgressFlags.VoidFields) != RunProgressFlags.None) { MainPlugin.ModLogger.LogInfo((object)"Void Fields, cleared."); } if ((SaveData_RunProgressFlags & RunProgressFlags.Mithrix) != RunProgressFlags.None) { MainPlugin.ModLogger.LogInfo((object)"Mithrix, defeated."); } if ((SaveData_RunProgressFlags & RunProgressFlags.TwistedScavenger) != RunProgressFlags.None) { MainPlugin.ModLogger.LogInfo((object)"Twisted Scavenger, defeated."); } if ((SaveData_RunProgressFlags & RunProgressFlags.Voidling) != RunProgressFlags.None) { MainPlugin.ModLogger.LogInfo((object)"Voidling, defeated."); } if ((SaveData_RunProgressFlags & RunProgressFlags.FalseSon) != RunProgressFlags.None) { MainPlugin.ModLogger.LogInfo((object)"False Son, defeated."); } if ((SaveData_RunProgressFlags & RunProgressFlags.SolusWing) != RunProgressFlags.None) { MainPlugin.ModLogger.LogInfo((object)"Solus Wing, defeated."); } if ((SaveData_RunProgressFlags & RunProgressFlags.SolusHeart) != RunProgressFlags.None) { MainPlugin.ModLogger.LogInfo((object)"Solus Heart, defeated."); } MainPlugin.ModLogger.LogInfo((object)"====LOGGING END===="); } private void Hooks() { //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Expected O, but got Unknown //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Expected O, but got Unknown //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Expected O, but got Unknown SharedHooks.Handle_Mithrix_Clear_Actions = (SharedHooks.Handle_Mithrix_Clear)Delegate.Combine(SharedHooks.Handle_Mithrix_Clear_Actions, new SharedHooks.Handle_Mithrix_Clear(Mithrix_Clear)); SharedHooks.Handle_TwistedScavenger_Clear_Actions = (SharedHooks.Handle_TwistedScavenger_Clear)Delegate.Combine(SharedHooks.Handle_TwistedScavenger_Clear_Actions, new SharedHooks.Handle_TwistedScavenger_Clear(TwistedScavenger_Clear)); SharedHooks.Handle_Voidling_Clear_Actions = (SharedHooks.Handle_Voidling_Clear)Delegate.Combine(SharedHooks.Handle_Voidling_Clear_Actions, new SharedHooks.Handle_Voidling_Clear(Voidling_Clear)); SharedHooks.Handle_FalseSon_Clear_Actions = (SharedHooks.Handle_FalseSon_Clear)Delegate.Combine(SharedHooks.Handle_FalseSon_Clear_Actions, new SharedHooks.Handle_FalseSon_Clear(FalseSon_Clear)); SharedHooks.Handle_SolusWing_Clear_Actions = (SharedHooks.Handle_SolusWing_Clear)Delegate.Combine(SharedHooks.Handle_SolusWing_Clear_Actions, new SharedHooks.Handle_SolusWing_Clear(SolusWing_Clear)); SharedHooks.Handle_SolusHeart_Clear_Actions = (SharedHooks.Handle_SolusHeart_Clear)Delegate.Combine(SharedHooks.Handle_SolusHeart_Clear_Actions, new SharedHooks.Handle_SolusHeart_Clear(SolusHeart_Clear)); ArenaMissionController.EndRound += new hook_EndRound(Arena_EndRound); Run.Start += new hook_Start(Run_Start); Run.BeginStage += new hook_BeginStage(Run_BeginStage); } private void Mithrix_Clear(EncounterFinished self) { SaveData_RunProgressFlags |= RunProgressFlags.Mithrix; } private void TwistedScavenger_Clear(FadeOut self) { SaveData_RunProgressFlags |= RunProgressFlags.TwistedScavenger; } private void Voidling_Clear(VoidRaidGauntletController self) { SaveData_RunProgressFlags |= RunProgressFlags.Voidling; } private void FalseSon_Clear(Phase3 self) { SaveData_RunProgressFlags |= RunProgressFlags.FalseSon; } private void SolusWing_Clear(Mission5Death self) { SaveData_RunProgressFlags |= RunProgressFlags.SolusWing; } private void SolusHeart_Clear(MissionCompleted self) { SaveData_RunProgressFlags |= RunProgressFlags.SolusHeart; } private void Arena_EndRound(orig_EndRound orig, ArenaMissionController self) { orig.Invoke(self); if (self.clearedRounds >= self.totalRoundsMax) { SaveData_RunProgressFlags |= RunProgressFlags.VoidFields; } } private void Run_Start(orig_Start orig, Run self) { orig.Invoke(self); SaveData_RunProgressFlags = RunProgressFlags.None; } private void Run_BeginStage(orig_BeginStage orig, Run self) { orig.Invoke(self); SceneDef sceneDefForCurrentScene = SceneCatalog.GetSceneDefForCurrentScene(); bool flag = false; if (Object.op_Implicit((Object)(object)sceneDefForCurrentScene) && StageCountsForLoop(sceneDefForCurrentScene)) { flag = true; } if (flag) { SaveData_RunProgressFlags |= RunProgressFlags.Looping; } else { SaveData_RunProgressFlags &= (RunProgressFlags)(-2); } } private bool StageCountsForLoop(SceneDef scene) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Invalid comparison between Unknown and I4 if (Looping_RequireDejaVu) { if ((int)scene.sceneType != 1) { return false; } if (scene.isFinalStage) { return false; } if (scene.stageOrder == 1) { return Run.instance.loopClearCount > 0; } return false; } return Run.instance.loopClearCount > 0; } } public class Stages { internal static bool Enable = true; internal static string ModeStandard_Moon2_Portal_Input = ""; internal static string ModeEclipse_Moon2_Portal_Input = ""; internal static List<PortalSpawnData> ModeStandard_Moon2_Portals; internal static List<PortalSpawnData> ModeEclipse_Moon2_Portals; internal static bool ModeStandard_Moon2_Reward = false; internal static bool ModeEclipse_Moon2_Reward = false; internal static string ModeStandard_Meridian_Portal_Input = ""; internal static string ModeEclipse_Meridian_Portal_Input = ""; internal static List<PortalSpawnData> ModeStandard_Meridian_Portals; internal static List<PortalSpawnData> ModeEclipse_Meridian_Portals; internal static bool ModeStandard_Meridian_Modify_Portal = false; internal static bool ModeEclipse_Meridian_Modify_Portal = false; internal static bool ModeStandard_Meridian_Reward = true; internal static bool ModeEclipse_Meridian_Reward = true; internal static bool ModeStandard_Meridian_AllowRebirth = true; internal static bool ModeEclipse_Meridian_AllowRebirth = false; internal static bool ModeStandard_Meridian_ACPortal = true; internal static bool ModeEclipse_Meridian_ACPortal = true; internal static string ModeStandard_VoidRaid_Portal_Input = ""; internal static string ModeEclipse_VoidRaid_Portal_Input = ""; internal static List<PortalSpawnData> ModeStandard_VoidRaid_Portals; internal static List<PortalSpawnData> ModeEclipse_VoidRaid_Portals; internal static bool ModeStandard_VoidRaid_Reward = false; internal static bool ModeEclipse_VoidRaid_Reward = false; internal static bool ModeStandard_VoidRaid_VoidOutroPortal = true; internal static bool ModeEclipse_VoidRaid_VoidOutroPortal = true; internal static bool ModeStandard_MS_NeedBeads = true; internal static bool ModeEclipse_MS_NeedBeads = true; internal static string ModeStandard_MS_OrbReq_Input = ""; internal static string ModeEclipse_MS_OrbReq_Input = ""; internal static List<ReqAllowData> ModeStandard_MS_OrbReq_Data = null; internal static List<ReqAllowData> ModeEclipse_MS_OrbReq_Data = null; internal static string ModeStandard_Limbo_Portal_Input = ""; internal static string ModeEclipse_Limbo_Portal_Input = ""; internal static List<PortalSpawnData> ModeStandard_Limbo_Portals; internal static List<PortalSpawnData> ModeEclipse_Limbo_Portals; internal static bool ModeStandard_Limbo_Reward = false; internal static bool ModeEclipse_Limbo_Reward = false; internal static float Limbo_ExtraTime = 8f; internal static string ModeStandard_SolusWeb_Portal_Input = ""; internal static string ModeEclipse_SolusWeb_Portal_Input = ""; internal static List<PortalSpawnData> ModeStandard_SolusWeb_Portals; internal static List<PortalSpawnData> ModeEclipse_SolusWeb_Portals; internal static bool ModeStandard_SolusWeb_Reward = true; internal static bool ModeEclipse_SolusWeb_Reward = true; internal static bool ModeStandard_SolusWeb_AllowDecompile = true; internal static bool ModeEclipse_SolusWeb_AllowDecompile = false; internal static ConfigPortalType Bazaar_ArenaRepeat_Portal = ConfigPortalType.Void; internal static bool ModeStandard_Arena_VoidPortal = true; internal static bool ModeEclipse_Arena_VoidPortal = false; internal static ConfigGoldPortal ModeStandard_GoldShores_MeridianPortal = ConfigGoldPortal.Vanilla; internal static ConfigGoldPortal ModeEclipse_GoldShores_MeridianPortal = ConfigGoldPortal.Vanilla; private static Vector3 Bazaar_Pos = new Vector3(280.83f, -445.67f, -126.48f); private static Vector3 Moon2_Pos = new Vector3(-89f, 493f, 1.15f); private static Vector3 Limbo_Pos = new Vector3(-6.7f, -8.6f, 87f); private static Vector3 Meridian_Pos = new Vector3(109.21f, 146.5f, -121.78f); private GameObject VoidPotential = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/OptionPickup/OptionPickup.prefab").WaitForCompletion(); private BasicPickupDropTable Tier3PickupTable = Addressables.LoadAssetAsync<BasicPickupDropTable>((object)"RoR2/Base/Common/dtTier3Item.asset").WaitForCompletion(); private SceneDef Scene_Arena = Addressables.LoadAssetAsync<SceneDef>((object)"RoR2/Base/arena/arena.asset").WaitForCompletion(); private SceneDef Scene_VoidRaid = Addressables.LoadAssetAsync<SceneDef>((object)"RoR2/DLC1/voidraid/voidraid.asset").WaitForCompletion(); private SceneDef Arena_SceneDef = Addressables.LoadAssetAsync<SceneDef>((object)"RoR2/Base/arena/arena.asset").WaitForCompletion(); private SceneDef Meridian_SceneDef = Addressables.LoadAssetAsync<SceneDef>((object)"RoR2/DLC2/meridian/meridian.asset").WaitForCompletion(); public Stages() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: 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_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) if (Enable) { ClampConfig(); BuildLists(); Hooks(); } } private void BuildLists() { if (ModeStandard_MS_OrbReq_Input.Length > 0) { ModeStandard_MS_OrbReq_Data = ReqList.ReadStageNumberInput(ModeStandard_MS_OrbReq_Input, "Stages|Standard|Celestial Orb"); } if (ModeEclipse_MS_OrbReq_Input.Length > 0) { ModeEclipse_MS_OrbReq_Data = ReqList.ReadStageNumberInput(ModeEclipse_MS_OrbReq_Input, "Stages|Eclipse|Celestial Orb"); } ModeEclipse_Moon2_Portals = PortalUtility.BuildPortalList(ModeEclipse_Moon2_Portal_Input, "Eclipse, Commencement"); ModeStandard_Moon2_Portals = PortalUtility.BuildPortalList(ModeStandard_Moon2_Portal_Input, "Standard, Commencement"); ModeEclipse_Limbo_Portals = PortalUtility.BuildPortalList(ModeEclipse_Limbo_Portal_Input, "Eclipse, A Moment Whole"); ModeStandard_Limbo_Portals = PortalUtility.BuildPortalList(ModeStandard_Limbo_Portal_Input, "Standard, A Moment Whole"); ModeEclipse_VoidRaid_Portals = PortalUtility.BuildPortalList(ModeEclipse_VoidRaid_Portal_Input, "Eclipse, Planetarium"); ModeStandard_VoidRaid_Portals = PortalUtility.BuildPortalList(ModeStandard_VoidRaid_Portal_Input, "Standard, Planetarium"); ModeEclipse_Meridian_Portals = PortalUtility.BuildPortalList(ModeEclipse_Meridian_Portal_Input, "Eclipse, Prime Meridian"); ModeStandard_Meridian_Portals = PortalUtility.BuildPortalList(ModeStandard_Meridian_Portal_Input, "Standard, Prime Meridian"); ModeStandard_Meridian_Modify_Portal = true; if (ModeStandard_Meridian_Portals != null && ModeStandard_Meridian_Portals.Count == 1 && ModeStandard_Meridian_Portals[0].PortalType == ConfigPortalType.Destination) { ModeStandard_Meridian_Modify_Portal = false; } ModeEclipse_Meridian_Modify_Portal = true; if (ModeEclipse_Meridian_Portals != null && ModeEclipse_Meridian_Portals.Count == 1 && ModeEclipse_Meridian_Portals[0].PortalType == ConfigPortalType.Destination) { ModeEclipse_Meridian_Modify_Portal = false; } ModeEclipse_SolusWeb_Portals = PortalUtility.BuildPortalList(ModeEclipse_SolusWeb_Portal_Input, "Eclipse, Solus Web"); ModeStandard_SolusWeb_Portals = PortalUtility.BuildPortalList(ModeStandard_SolusWeb_Portal_Input, "Standard, Solus Web"); } private void ClampConfig() { ModeStandard_GoldShores_MeridianPortal = (ConfigGoldPortal)Math.Min((int)ModeStandard_GoldShores_MeridianPortal, 2); ModeEclipse_GoldShores_MeridianPortal = (ConfigGoldPortal)Math.Min((int)ModeEclipse_GoldShores_MeridianPortal, 2); } private void Hooks() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Expected O, but got Unknown //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Expected O, but got Unknown //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Expected O, but got Unknown //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Expected O, but got Unknown //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Expected O, but got Unknown //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Expected O, but got Unknown //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Expected O, but got Unknown //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Expected O, but got Unknown //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Expected O, but got Unknown //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Expected O, but got Unknown //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Expected O, but got Unknown SharedHooks.Handle_Mithrix_Clear_Actions = (SharedHooks.Handle_Mithrix_Clear)Delegate.Combine(SharedHooks.Handle_Mithrix_Clear_Actions, new SharedHooks.Handle_Mithrix_Clear(Mithrix_Clear)); VoidRaidGauntletController.SpawnOutroPortal += new hook_SpawnOutroPortal(VoidRaidOnPortal); if (!ModeStandard_VoidRaid_VoidOutroPortal || !ModeEclipse_VoidRaid_VoidOutroPortal) { VoidRaidGauntletController.SpawnOutroPortal += new Manipulator(IL_VoidRaid_SpawnOutroPortal); } ArenaMissionController.GeneratePlayerSpawnPointsServer += new hook_GeneratePlayerSpawnPointsServer(ArenaMissionController_GeneratePlayerSpawnPointsServer); ShrineRebirthController.Start += new hook_Start(ShrineRebirthController_Start); if (!ModeStandard_Meridian_Reward || !ModeEclipse_Meridian_Reward) { SkyJumpDeathState.GiveColossusItem += new Manipulator(IL_FalseSonBossComplete); } RebirthOrPortalChoice.OnEnter += new Manipulator(IL_RebirthOrPortalChoice); RevealRebirthShriine.OnEnter += new Manipulator(IL_RevealRebirthShrine); if (!ModeStandard_MS_NeedBeads || !ModeEclipse_MS_NeedBeads) { EndingGame.DoFinalAction += new Manipulator(IL_OnObliteration); } Exit.IsValidStormTier += new hook_IsValidStormTier(IsValidStormTier); Exit.OnEnter += new hook_OnEnter(Goldshores_Exit); FadeOut.OnEnter += new hook_OnEnter(LimboComplete); SolusWebMissionController.SpawnExitPortal += new hook_SpawnExitPortal(SolusWeb_SpawnExitPortals); if (!ModeStandard_SolusWeb_AllowDecompile) { Run.Start += new hook_Start(RunStart); } SharedHooks.Handle_EclipseRun_Start_Actions = (SharedHooks.Handle_EclipseRun_Start)Delegate.Combine(SharedHooks.Handle_EclipseRun_Start_Actions, new SharedHooks.Handle_EclipseRun_Start(EclipseRun_Start)); Death.OnEnter += new Manipulator(IL_SolusHeartDeath); TeleporterInteraction.Start += new Manipulator(IL_TeleInteractionStart); } private void RunStart(orig_Start orig, Run self) { orig.Invoke(self); self.SetEventFlag("NoSolusHeartOffer"); } private void EclipseRun_Start(EclipseRun self) { if (NetworkServer.active && ModeEclipse_SolusWeb_AllowDecompile) { ((Run)self).ResetEventFlag("NoSolusHeartOffer"); } } private void SolusWeb_SpawnExitPortals(orig_SpawnExitPortal orig, SolusWebMissionController self) { //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_012a: 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_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: 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_006f: Unknown result type (might be due to invalid IL or missing references) if (IsEclipse()) { self.PortalPrefab = null; self.VoidPrefab = null; if (ModeEclipse_SolusWeb_Portals != null) { Vector3 baselocation = ((Component)