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 EclipseAllMaps v2.2.0
EclipseAllMaps.dll
Decompiled a month 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.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using EntityStates; using EntityStates.LunarTeleporter; using EntityStates.Missions.Goldshores; using EntityStates.ShrineRebirth; using EntityStates.SolusWing.PostFight; using EntityStates.TeleporterCatastrophe.DLC4.Teleporter; using HG; using Microsoft.CodeAnalysis; using On.EntityStates.LunarTeleporter; using On.EntityStates.Missions.Goldshores; using On.EntityStates.ShrineRebirth; using On.EntityStates.SolusWing.PostFight; using On.EntityStates.TeleporterCatastrophe.DLC4.Teleporter; using On.RoR2; using RiskOfOptions; using RiskOfOptions.OptionConfigs; using RiskOfOptions.Options; using RoR2; using RoR2.ConVar; using RoR2.ExpansionManagement; using RoR2.Navigation; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Events; using UnityEngine.Networking; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("EclipseAllMaps")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("2.2.0.0")] [assembly: AssemblyInformationalVersion("2.2.0+b040d15e42a57235b5f711fddb35f459294c320b")] [assembly: AssemblyProduct("EclipseAllMaps")] [assembly: AssemblyTitle("EclipseAllMaps")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("2.2.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace EclipseAllMaps { internal static class AddedMapCredits { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_Start <>9__0_0; internal void <Init>b__0_0(orig_Start orig, SceneDirector self) { if (NetworkServer.active) { Rebalance(); } orig.Invoke(self); } } internal static void Init() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown object obj = <>c.<>9__0_0; if (obj == null) { hook_Start val = delegate(orig_Start orig, SceneDirector self) { if (NetworkServer.active) { Rebalance(); } orig.Invoke(self); }; <>c.<>9__0_0 = val; obj = (object)val; } SceneDirector.Start += (hook_Start)obj; } private static (int interactable, int monster)? MedianCredits(int stage) { return stage switch { 2 => (280, 100), 3 => (280, 100), 4 => (400, 230), 5 => (545, 230), _ => null, }; } private static void Rebalance() { AddedMap addedMap = AddedMaps.InPlay(); ClassicStageInfo val = (Object.op_Implicit((Object)(object)SceneInfo.instance) ? ((Component)SceneInfo.instance).GetComponent<ClassicStageInfo>() : null); if (addedMap != null && Object.op_Implicit((Object)(object)val)) { int num = addedMap.StageOf(SceneCatalog.FindSceneDef(addedMap.SceneName)); (int, int)? tuple = MedianCredits(num); if (tuple.HasValue) { var (num2, num3) = tuple.Value; Log.Info($"{SceneCatalog.mostRecentSceneDef.cachedName} as stage {num}: interactable credits {val.sceneDirectorInteractibleCredits} -> {num2}, monster credits {val.sceneDirectorMonsterCredits} -> {num3}."); val.sceneDirectorInteractibleCredits = num2; val.sceneDirectorMonsterCredits = num3; } } } } internal static class AddedMapInteractables { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_RebuildCards <>9__3_0; public static Func<Category, float> <>9__5_0; public static Func<DirectorCard, string> <>9__5_2; internal void <Init>b__3_0(orig_RebuildCards orig, ClassicStageInfo self, DirectorCardCategorySelection forcedMonsterCategory, DirectorCardCategorySelection forcedInteractableCategory) { orig.Invoke(self, forcedMonsterCategory, forcedInteractableCategory); if (!Object.op_Implicit((Object)(object)forcedInteractableCategory) && NetworkServer.active && !(AddedMaps.InPlay()?.SceneName != "voidstage")) { DirectorCardCategorySelection val = VoidLocusInteractables(self); if (Object.op_Implicit((Object)(object)val)) { self.interactableCategories = val; } } } internal float <Describe>b__5_0(Category category) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return category.selectionWeight; } internal string <Describe>b__5_2(DirectorCard card) { SpawnCard spawnCard = card.GetSpawnCard(); if (spawnCard == null) { return null; } return ((Object)spawnCard).name.Replace("isc", ""); } } private const string VoidLocus = "voidstage"; private const string SkyMeadowInteractablesAddress = "RoR2/Base/skymeadow/dpSkyMeadowInteractables.asset"; private const string VoidLocusInteractablesAddress = "RoR2/DLC1/voidstage/dccsVoidStageInteractables.asset"; internal static void Init() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown object obj = <>c.<>9__3_0; if (obj == null) { hook_RebuildCards val = delegate(orig_RebuildCards orig, ClassicStageInfo self, DirectorCardCategorySelection forcedMonsterCategory, DirectorCardCategorySelection forcedInteractableCategory) { orig.Invoke(self, forcedMonsterCategory, forcedInteractableCategory); if (!Object.op_Implicit((Object)(object)forcedInteractableCategory) && NetworkServer.active && !(AddedMaps.InPlay()?.SceneName != "voidstage")) { DirectorCardCategorySelection val2 = VoidLocusInteractables(self); if (Object.op_Implicit((Object)(object)val2)) { self.interactableCategories = val2; } } }; <>c.<>9__3_0 = val; obj = (object)val; } ClassicStageInfo.RebuildCards += (hook_RebuildCards)obj; } private static DirectorCardCategorySelection VoidLocusInteractables(ClassicStageInfo stageInfo) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0019: 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_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Expected O, but got Unknown DccsPool val = Addressables.LoadAssetAsync<DccsPool>((object)"RoR2/Base/skymeadow/dpSkyMeadowInteractables.asset").WaitForCompletion(); DirectorCardCategorySelection val2 = Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC1/voidstage/dccsVoidStageInteractables.asset").WaitForCompletion(); if (!Object.op_Implicit((Object)(object)val) || val.poolCategories.Length == 0 || !Object.op_Implicit((Object)(object)val2)) { Log.Warning("Sky Meadow's or Void Locus's interactable list is missing; Void Locus keeps its own interactables."); return null; } DirectorCardCategorySelection modifiableMonsterCategories = stageInfo.modifiableMonsterCategories; object obj; if (Object.op_Implicit((Object)(object)modifiableMonsterCategories)) { List<ExpansionDef> expansionsInEffect = modifiableMonsterCategories.expansionsInEffect; if (expansionsInEffect != null && expansionsInEffect.Count > 0) { obj = new List<ExpansionDef>(modifiableMonsterCategories.expansionsInEffect); goto IL_0081; } } obj = null; goto IL_0081; IL_0081: List<ExpansionDef> list = (List<ExpansionDef>)obj; Xoroshiro128Plus val3 = new Xoroshiro128Plus(stageInfo.seedServer); DirectorCardCategorySelection blendedDCCS = DCCSBlender.GetBlendedDCCS(val.poolCategories[0], ref val3, stageInfo, stageInfo.contentInteractableSourceMixLimit, list); DirectorCardCategorySelection val4 = DCCSBlender.BlendSpecificDCCS(new List<DirectorCardCategorySelection> { blendedDCCS, val2 }); Object.Destroy((Object)(object)blendedDCCS); Log.Info("Void Locus interactables: " + Describe(val4)); return val4; } private static string Describe(DirectorCardCategorySelection interactables) { float totalWeight = interactables.categories.Sum((Category category) => category.selectionWeight); return string.Join("; ", interactables.categories.Select((Category category) => string.Format("{0} {1:P0} ({2})", category.name, category.selectionWeight / totalWeight, string.Join(", ", category.cards.Select(delegate(DirectorCard card) { SpawnCard spawnCard = card.GetSpawnCard(); return (spawnCard == null) ? null : ((Object)spawnCard).name.Replace("isc", ""); }))))); } } internal static class AddedMapMonsters { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_RebuildCards <>9__4_0; public static Func<Category, bool> <>9__6_0; public static Predicate<DirectorCard> <>9__6_1; public static Func<DirectorCard, bool> <>9__7_1; public static Func<DirectorCard, string> <>9__7_2; public static Func<Category, string> <>9__7_0; internal void <Init>b__4_0(orig_RebuildCards orig, ClassicStageInfo self, DirectorCardCategorySelection forcedMonsterCategory, DirectorCardCategorySelection forcedInteractableCategory) { DirectorCardCategorySelection val = ((!Object.op_Implicit((Object)(object)forcedMonsterCategory) && NetworkServer.active && IsFirstLoopVoidLocus()) ? FirstLoopVoidLocusMonsters(self) : null); if (!Object.op_Implicit((Object)(object)val)) { orig.Invoke(self, forcedMonsterCategory, forcedInteractableCategory); return; } try { orig.Invoke(self, val, forcedInteractableCategory); } finally { Object.Destroy((Object)(object)val); } } internal bool <FirstLoopVoidLocusMonsters>b__6_0(Category category) { return category.name == "Standard"; } internal bool <FirstLoopVoidLocusMonsters>b__6_1(DirectorCard card) { SpawnCard spawnCard = card.GetSpawnCard(); return ((spawnCard != null) ? ((Object)spawnCard).name : null) != "cscNullifier"; } internal string <Describe>b__7_0(Category category) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) return category.name + ": " + string.Join(", ", from card in category.cards where card.IsAvailable() select string.Format("{0} x{1}", ((Object)card.GetSpawnCard()).name.Replace("csc", ""), card.selectionWeight)); } internal bool <Describe>b__7_1(DirectorCard card) { return card.IsAvailable(); } internal string <Describe>b__7_2(DirectorCard card) { return string.Format("{0} x{1}", ((Object)card.GetSpawnCard()).name.Replace("csc", ""), card.selectionWeight); } } private const string VoidLocus = "voidstage"; private const int VanillaVoidLocusMinStagesCleared = 6; private const string SkyMeadowMonstersAddress = "RoR2/Base/skymeadow/dpSkyMeadowMonsters.asset"; private static readonly (string category, string address, bool preventOverhead)[] VoidMonsters = new(string, string, bool)[3] { ("Champions", "RoR2/DLC1/VoidMegaCrab/cscVoidMegaCrab.asset", false), ("Minibosses", "RoR2/Base/Nullifier/cscNullifier.asset", true), ("Basic Monsters", "RoR2/DLC1/VoidBarnacle/cscVoidBarnacle.asset", true) }; internal static void Init() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown object obj = <>c.<>9__4_0; if (obj == null) { hook_RebuildCards val = delegate(orig_RebuildCards orig, ClassicStageInfo self, DirectorCardCategorySelection forcedMonsterCategory, DirectorCardCategorySelection forcedInteractableCategory) { DirectorCardCategorySelection val2 = ((!Object.op_Implicit((Object)(object)forcedMonsterCategory) && NetworkServer.active && IsFirstLoopVoidLocus()) ? FirstLoopVoidLocusMonsters(self) : null); if (!Object.op_Implicit((Object)(object)val2)) { orig.Invoke(self, forcedMonsterCategory, forcedInteractableCategory); return; } try { orig.Invoke(self, val2, forcedInteractableCategory); } finally { Object.Destroy((Object)(object)val2); } }; <>c.<>9__4_0 = val; obj = (object)val; } ClassicStageInfo.RebuildCards += (hook_RebuildCards)obj; } private static bool IsFirstLoopVoidLocus() { if (AddedMaps.InPlay() != null && SceneCatalog.mostRecentSceneDef.cachedName == "voidstage") { return Run.instance.stageClearCount < 6; } return false; } private static DirectorCardCategorySelection FirstLoopVoidLocusMonsters(ClassicStageInfo stageInfo) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: 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_0065: Expected O, but got Unknown //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Expected O, but got Unknown DccsPool val = Addressables.LoadAssetAsync<DccsPool>((object)"RoR2/Base/skymeadow/dpSkyMeadowMonsters.asset").WaitForCompletion(); Category val2 = (Object.op_Implicit((Object)(object)val) ? ((IEnumerable<Category>)val.poolCategories).FirstOrDefault((Func<Category, bool>)((Category category) => category.name == "Standard")) : null); if (val2 == null) { Log.Warning("RoR2/Base/skymeadow/dpSkyMeadowMonsters.asset has no Standard category; Void Locus keeps its own monsters."); return null; } Xoroshiro128Plus val3 = new Xoroshiro128Plus(stageInfo.seedServer); DirectorCardCategorySelection blendedDCCS = DCCSBlender.GetBlendedDCCS(val2, ref val3, stageInfo, stageInfo.contentSourceMixLimit, (List<ExpansionDef>)null); blendedDCCS.RemoveCardsThatFailFilter((Predicate<DirectorCard>)delegate(DirectorCard card) { SpawnCard spawnCard = card.GetSpawnCard(); return ((spawnCard != null) ? ((Object)spawnCard).name : null) != "cscNullifier"; }); (string, string, bool)[] voidMonsters = VoidMonsters; for (int num = 0; num < voidMonsters.Length; num++) { (string, string, bool) tuple = voidMonsters[num]; string item = tuple.Item1; string item2 = tuple.Item2; bool item3 = tuple.Item3; int num2 = blendedDCCS.FindCategoryIndexByName(item); if (num2 >= 0) { float num3 = blendedDCCS.SumAllWeightsInCategory(blendedDCCS.categories[num2]); blendedDCCS.AddCard(num2, new DirectorCard { spawnCard = Addressables.LoadAssetAsync<SpawnCard>((object)item2).WaitForCompletion(), selectionWeight = Mathf.Max(1, Mathf.RoundToInt(num3)), preventOverhead = item3 }); } } Log.Info("Void Locus monsters (first loop): " + Describe(blendedDCCS)); return blendedDCCS; } private static string Describe(DirectorCardCategorySelection monsters) { return string.Join("; ", monsters.categories.Select((Category category) => category.name + ": " + string.Join(", ", from card in category.cards where card.IsAvailable() select string.Format("{0} x{1}", ((Object)card.GetSpawnCard()).name.Replace("csc", ""), card.selectionWeight)))); } } internal static class AddedMapProgression { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_Start <>9__5_0; public static hook_Start <>9__5_1; public static hook_PickNextStageSceneFromCurrentSceneDestinations <>9__5_2; public static hook_ShouldBeginLoop <>9__5_3; public static hook_Start <>9__5_4; internal void <Init>b__5_0(orig_Start orig, VoidStageMissionController self) { if (NetworkServer.active && VoidLocusGetsTeleporter()) { self.batteryCount = 0; } orig.Invoke(self); } internal void <Init>b__5_1(orig_Start orig, SceneDirector self) { //IL_001a: 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) if (NetworkServer.active && VoidLocusGetsTeleporter()) { if (primordialTeleporter == null) { primordialTeleporter = Addressables.LoadAssetAsync<SpawnCard>((object)"RoR2/Base/Teleporters/iscLunarTeleporter.asset").WaitForCompletion(); } self.teleporterSpawnCard = primordialTeleporter; Log.Info("Void Locus: no Deep Void Signals; placing a Primordial Teleporter."); } orig.Invoke(self); } internal void <Init>b__5_2(orig_PickNextStageSceneFromCurrentSceneDestinations orig, Run self) { if (VoidLocusGetsTeleporter()) { PickStageOne(self); } else { orig.Invoke(self); } } internal bool <Init>b__5_3(orig_ShouldBeginLoop orig, Run self, SceneDef sceneDef) { if (!orig.Invoke(self, sceneDef)) { return VoidLocusGetsTeleporter(); } return true; } internal void <Init>b__5_4(orig_Start orig, TeleporterInteraction self) { orig.Invoke(self); if (NetworkServer.active && IsChanged("conduitcanyon")) { self.sceneExitController.useRunNextStageScene = true; SceneDef nextStageScene = Run.instance.nextStageScene; Log.Info("Conduit Canyon: the teleporter leads to " + ((nextStageScene != null) ? nextStageScene.cachedName : null) + " instead of the Alloyed path."); } } } private const string VoidLocus = "voidstage"; private const string ConduitCanyon = "conduitcanyon"; private const string VoidLocusLeadsOnLike = "skymeadow"; private const string PrimordialTeleporterAddress = "RoR2/Base/Teleporters/iscLunarTeleporter.asset"; private static SpawnCard primordialTeleporter; internal static void Init() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown //IL_005c: 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_0067: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Expected O, but got Unknown //IL_00a4: 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_00af: Expected O, but got Unknown object obj = <>c.<>9__5_0; if (obj == null) { hook_Start val = delegate(orig_Start orig, VoidStageMissionController self) { if (NetworkServer.active && VoidLocusGetsTeleporter()) { self.batteryCount = 0; } orig.Invoke(self); }; <>c.<>9__5_0 = val; obj = (object)val; } VoidStageMissionController.Start += (hook_Start)obj; object obj2 = <>c.<>9__5_1; if (obj2 == null) { hook_Start val2 = delegate(orig_Start orig, SceneDirector self) { //IL_001a: 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) if (NetworkServer.active && VoidLocusGetsTeleporter()) { if (primordialTeleporter == null) { primordialTeleporter = Addressables.LoadAssetAsync<SpawnCard>((object)"RoR2/Base/Teleporters/iscLunarTeleporter.asset").WaitForCompletion(); } self.teleporterSpawnCard = primordialTeleporter; Log.Info("Void Locus: no Deep Void Signals; placing a Primordial Teleporter."); } orig.Invoke(self); }; <>c.<>9__5_1 = val2; obj2 = (object)val2; } SceneDirector.Start += (hook_Start)obj2; object obj3 = <>c.<>9__5_2; if (obj3 == null) { hook_PickNextStageSceneFromCurrentSceneDestinations val3 = delegate(orig_PickNextStageSceneFromCurrentSceneDestinations orig, Run self) { if (VoidLocusGetsTeleporter()) { PickStageOne(self); } else { orig.Invoke(self); } }; <>c.<>9__5_2 = val3; obj3 = (object)val3; } Run.PickNextStageSceneFromCurrentSceneDestinations += (hook_PickNextStageSceneFromCurrentSceneDestinations)obj3; object obj4 = <>c.<>9__5_3; if (obj4 == null) { hook_ShouldBeginLoop val4 = (orig_ShouldBeginLoop orig, Run self, SceneDef sceneDef) => orig.Invoke(self, sceneDef) || VoidLocusGetsTeleporter(); <>c.<>9__5_3 = val4; obj4 = (object)val4; } Run.ShouldBeginLoop += (hook_ShouldBeginLoop)obj4; object obj5 = <>c.<>9__5_4; if (obj5 == null) { hook_Start val5 = delegate(orig_Start orig, TeleporterInteraction self) { orig.Invoke(self); if (NetworkServer.active && IsChanged("conduitcanyon")) { self.sceneExitController.useRunNextStageScene = true; SceneDef nextStageScene = Run.instance.nextStageScene; Log.Info("Conduit Canyon: the teleporter leads to " + ((nextStageScene != null) ? nextStageScene.cachedName : null) + " instead of the Alloyed path."); } }; <>c.<>9__5_4 = val5; obj5 = (object)val5; } TeleporterInteraction.Start += (hook_Start)obj5; } internal static void PickStageOne(Run run) { WeightedSelection<SceneDef> val = new WeightedSelection<SceneDef>(8); SceneCatalog.FindSceneDef("skymeadow").AddDestinationsToWeightedSelection(val, (Func<SceneDef, bool>)run.CanPickStage); run.PickNextStageScene(val); } private static bool IsChanged(string sceneName) { if (AddedMaps.InPlay() != null) { return SceneCatalog.mostRecentSceneDef.cachedName == sceneName; } return false; } private static bool VoidLocusGetsTeleporter() { return IsChanged("voidstage"); } } internal static class AddedMaps { internal static readonly AddedMap[] All = new AddedMap[4] { new AddedMap("lemuriantemple"), new AddedMap("habitat"), new AddedMap("conduitcanyon"), new AddedMap("voidstage", 5) }; internal static AddedMap Of(SceneDef scene) { if (!Object.op_Implicit((Object)(object)scene)) { return null; } AddedMap[] all = All; foreach (AddedMap addedMap in all) { SceneDef val = SceneCatalog.FindSceneDef(addedMap.SceneName); if (Object.op_Implicit((Object)(object)val) && ((Object)(object)scene == (Object)(object)val || (Object)(object)scene == (Object)(object)val.loopedSceneDef)) { return addedMap; } } return null; } internal static AddedMap InPlay() { AddedMap addedMap = Of(SceneCatalog.mostRecentSceneDef); if (addedMap == null || !addedMap.Enabled || !EclipseStagePool.IsActive(Run.instance)) { return null; } return addedMap; } } internal sealed class AddedMap { internal readonly string SceneName; private readonly int? stage; internal bool Enabled => StageMaps.IsEnabled(SceneName); internal AddedMap(string sceneName, int? stage = null) { SceneName = sceneName; this.stage = stage; } internal int StageOf(SceneDef sceneDef) { return stage ?? sceneDef.stageOrder; } } internal static class AlternatePathPortals { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_OnStartServer <>9__2_0; public static hook_Start <>9__2_1; public static hook_IsValidStormTier <>9__2_2; public static hook_OnWillSpawnUpdated <>9__2_3; internal void <Init>b__2_0(orig_OnStartServer orig, AccessCodesMissionController self) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) if (!EclipseStagePool.IsActive(Run.instance)) { orig.Invoke(self); return; } AccessCodesNodeData[] nodes = self.nodes; for (int i = 0; i < nodes.Length; i++) { nodes[i].node.SetActive(false); } Log.Info(SceneCatalog.mostRecentSceneDef.cachedName + ": no access nodes."); } internal void <Init>b__2_1(orig_Start orig, PortalSpawner self) { if (NetworkServer.active && Object.op_Implicit((Object)(object)self.portalSpawnCard) && ((Object)self.portalSpawnCard).name == "iscColossusPortal" && IsClosedColossusPortal(self, out var source)) { self.spawnChance = -1f; Log.Info(SceneCatalog.mostRecentSceneDef.cachedName + ": no green Colossus portal from the " + source + "."); } orig.Invoke(self); } internal bool <Init>b__2_2(orig_IsValidStormTier orig, Exit self) { if (EclipseStagePool.IsActive(Run.instance)) { Log.Info("Gilded Coast: no green Colossus portal."); return false; } return orig.Invoke(self); } internal void <Init>b__2_3(orig_OnWillSpawnUpdated orig, PortalSpawner self, bool newValue) { if (newValue && NetworkServer.active && IsClosedAlloyedPortal(self)) { newValue = false; Log.Info(SceneCatalog.mostRecentSceneDef.cachedName + ": no portal down the Alloyed path (" + ((Object)self.PortalSpawnCard).name + ")."); } orig.Invoke(self, newValue); } } private const string ColossusPortalCard = "iscColossusPortal"; private const string SolutionalHauntPortalCard = "iscHardwareProgPortal_Haunt"; internal static void Init() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown //IL_005c: 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_0067: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Expected O, but got Unknown object obj = <>c.<>9__2_0; if (obj == null) { hook_OnStartServer val = delegate(orig_OnStartServer orig, AccessCodesMissionController self) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) if (!EclipseStagePool.IsActive(Run.instance)) { orig.Invoke(self); } else { AccessCodesNodeData[] nodes = self.nodes; for (int i = 0; i < nodes.Length; i++) { nodes[i].node.SetActive(false); } Log.Info(SceneCatalog.mostRecentSceneDef.cachedName + ": no access nodes."); } }; <>c.<>9__2_0 = val; obj = (object)val; } AccessCodesMissionController.OnStartServer += (hook_OnStartServer)obj; object obj2 = <>c.<>9__2_1; if (obj2 == null) { hook_Start val2 = delegate(orig_Start orig, PortalSpawner self) { if (NetworkServer.active && Object.op_Implicit((Object)(object)self.portalSpawnCard) && ((Object)self.portalSpawnCard).name == "iscColossusPortal" && IsClosedColossusPortal(self, out var source)) { self.spawnChance = -1f; Log.Info(SceneCatalog.mostRecentSceneDef.cachedName + ": no green Colossus portal from the " + source + "."); } orig.Invoke(self); }; <>c.<>9__2_1 = val2; obj2 = (object)val2; } PortalSpawner.Start += (hook_Start)obj2; object obj3 = <>c.<>9__2_2; if (obj3 == null) { hook_IsValidStormTier val3 = delegate(orig_IsValidStormTier orig, Exit self) { if (EclipseStagePool.IsActive(Run.instance)) { Log.Info("Gilded Coast: no green Colossus portal."); return false; } return orig.Invoke(self); }; <>c.<>9__2_2 = val3; obj3 = (object)val3; } Exit.IsValidStormTier += (hook_IsValidStormTier)obj3; object obj4 = <>c.<>9__2_3; if (obj4 == null) { hook_OnWillSpawnUpdated val4 = delegate(orig_OnWillSpawnUpdated orig, PortalSpawner self, bool newValue) { if (newValue && NetworkServer.active && IsClosedAlloyedPortal(self)) { newValue = false; Log.Info(SceneCatalog.mostRecentSceneDef.cachedName + ": no portal down the Alloyed path (" + ((Object)self.PortalSpawnCard).name + ")."); } orig.Invoke(self, newValue); }; <>c.<>9__2_3 = val4; obj4 = (object)val4; } PortalSpawner.OnWillSpawnUpdated += (hook_OnWillSpawnUpdated)obj4; } private static bool IsClosedColossusPortal(PortalSpawner spawner, out string source) { if (Object.op_Implicit((Object)(object)((Component)spawner).GetComponentInParent<TeleporterInteraction>())) { source = "teleporter"; return AddedMaps.InPlay() != null; } source = (Object.op_Implicit((Object)(object)((Component)spawner).GetComponentInParent<HalcyoniteShrineInteractable>()) ? "Halcyon Shrine" : ((Object)spawner).name); return EclipseStagePool.IsActive(Run.instance); } private static bool IsClosedAlloyedPortal(PortalSpawner spawner) { if (Object.op_Implicit((Object)(object)spawner.PortalSpawnCard) && ((Object)spawner.PortalSpawnCard).name == "iscHardwareProgPortal_Haunt") { return EclipseStagePool.IsActive(Run.instance); } return false; } } internal static class DebugStart { private const int StagesBeforeFive = 4; private const string PrimeMeridian = "meridian"; private const int Mochas = 20; private const int Feathers = 20; private const int FocusedConvergences = 10; internal static void Init() { Run.onRunStartGlobal += delegate(Run run) { if (NetworkServer.active && Applies(run) && run.stageClearCount == 0) { if (Object.op_Implicit((Object)(object)run.nextStageScene) && run.nextStageScene.cachedName == "meridian") { run.NetworkstageClearCount = 5; run.NetworkstageClearCountAtLoopStart = 5; run.Network_loopClearCount = 1; Log.Info($"Debug: {5} stages counted as cleared and a loop begun."); } else if (ModSettings.StartAtStageFive.Value) { run.NetworkstageClearCount = 4; Log.Info($"Debug: {4} stages counted as cleared."); } } }; Run.onPlayerFirstCreatedServer += delegate(Run run, PlayerCharacterMasterController player) { if (Applies(run) && Object.op_Implicit((Object)(object)player.master)) { Inventory inventory = player.master.inventory; inventory.GiveItemPermanent(Items.AttackSpeedAndMoveSpeed, 20); inventory.GiveItemPermanent(Items.Feather, 20); inventory.GiveItemPermanent(Items.FocusConvergence, 10); player.master.godMode = true; } }; } internal static void ReplaceStageOne(Run run, WeightedSelection<SceneDef> choices) { //IL_000a: 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_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) if (!Applies(run) || choices.GetChoice(0).value.stageOrder != 1) { return; } SceneDef val = SceneCatalog.FindSceneDef("meridian"); if (ModSettings.StartAtPrimeMeridian.Value && run.stageClearCount == 0) { if (Object.op_Implicit((Object)(object)val) && run.CanPickStage(val)) { choices.Clear(); choices.AddChoice(val, 1f); Log.Info("Debug: Prime Meridian as the final stage instead of stage 1."); return; } Log.Warning("Debug: Prime Meridian needs Seekers of the Storm, so the run starts as usual."); } if (!ModSettings.StartAtStageFive.Value) { return; } choices.Clear(); Enumerator<SceneDef> enumerator = SceneCatalog.allStageSceneDefs.GetEnumerator(); try { while (enumerator.MoveNext()) { SceneDef current = enumerator.Current; if (current.stageOrder == 5 && run.CanPickStage(current)) { choices.AddChoice(current, 1f); } } } finally { ((IDisposable)enumerator/*cast due to .constrained prefix*/).Dispose(); } Log.Info("Debug: a stage 5 instead of stage 1."); } private static bool Applies(Run run) { if (ModSettings.StartAtStageFive.Value || ModSettings.StartAtPrimeMeridian.Value) { return EclipseStagePool.IsActive(run); } return false; } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("chen-ror2.EclipseAllMaps", "EclipseAllMaps", "2.2.0")] public class EclipseAllMapsPlugin : BaseUnityPlugin { public const string PluginAuthor = "chen-ror2"; public const string PluginName = "EclipseAllMaps"; public const string PluginGuid = "chen-ror2.EclipseAllMaps"; public const string PluginVersion = "2.2.0"; public void Awake() { Log.Init(((BaseUnityPlugin)this).Logger); ModSettings.Bind(((BaseUnityPlugin)this).Config); EclipseStagePool.Init(); AddedMapCredits.Init(); AddedMapProgression.Init(); AddedMapMonsters.Init(); AddedMapInteractables.Init(); AlternatePathPortals.Init(); FinalStage.Init(); EndAltar.Init(); TeleporterBosses.Init(); HalcyonShrines.Init(); DebugStart.Init(); if (RiskOfOptionsCompat.IsInstalled) { RiskOfOptionsCompat.AddOptions(ModSettings.Menu); } Log.Info("EclipseAllMaps 2.2.0 ready."); } } internal static class EclipseStagePool { [CompilerGenerated] private static class <>O { public static Action <0>__LogAddedMaps; public static Predicate<SceneDef> <1>__IsEnabled; } [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_PickNextStageScene <>9__2_0; public static hook_SetUpSeerStations <>9__2_1; public static Func<(SceneDef map, float weight), float> <>9__4_0; internal void <Init>b__2_0(orig_PickNextStageScene orig, Run self, WeightedSelection<SceneDef> choices) { if (IsActive(self)) { ApplyMapSettings(self, choices); } orig.Invoke(self, choices); } internal void <Init>b__2_1(orig_SetUpSeerStations orig, BazaarController self) { Run instance = Run.instance; if (!ModSettings.AppliesTo(instance)) { orig.Invoke(self); return; } List<Action> list = new List<Action>(); try { RefileStageOrders(instance, list); if (IsActive(instance)) { FilterLeftOutMapsOutOfBazaar(instance, self, list); } orig.Invoke(self); } finally { for (int num = list.Count - 1; num >= 0; num--) { list[num](); } } } internal float <ApplyMapSettings>b__4_0((SceneDef map, float weight) entry) { return entry.weight; } } private static float AddedMapWeight => ModSettings.AddedMapChance.Value; internal static void Init() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown object obj = <>c.<>9__2_0; if (obj == null) { hook_PickNextStageScene val = delegate(orig_PickNextStageScene orig, Run self, WeightedSelection<SceneDef> choices) { if (IsActive(self)) { ApplyMapSettings(self, choices); } orig.Invoke(self, choices); }; <>c.<>9__2_0 = val; obj = (object)val; } Run.PickNextStageScene += (hook_PickNextStageScene)obj; object obj2 = <>c.<>9__2_1; if (obj2 == null) { hook_SetUpSeerStations val2 = delegate(orig_SetUpSeerStations orig, BazaarController self) { Run instance = Run.instance; if (!ModSettings.AppliesTo(instance)) { orig.Invoke(self); return; } List<Action> list = new List<Action>(); try { RefileStageOrders(instance, list); if (IsActive(instance)) { FilterLeftOutMapsOutOfBazaar(instance, self, list); } orig.Invoke(self); } finally { for (int num = list.Count - 1; num >= 0; num--) { list[num](); } } }; <>c.<>9__2_1 = val2; obj2 = (object)val2; } BazaarController.SetUpSeerStations += (hook_SetUpSeerStations)obj2; ((ResourceAvailability)(ref SceneCatalog.availability)).CallWhenAvailable((Action)LogAddedMaps); } internal static bool IsActive(Run run) { if (ModSettings.AppliesTo(run)) { return ModSettings.AddAllMaps.Value; } return false; } private static void ApplyMapSettings(Run run, WeightedSelection<SceneDef> choices) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008b: 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_00a1: Unknown result type (might be due to invalid IL or missing references) if ((int)run.ruleBook.stageOrder != 0 || choices.Count == 0) { return; } if (!Object.op_Implicit((Object)(object)run.nextStageScene)) { Console instance = Console.instance; object value; if (instance == null) { value = null; } else { BaseConVar obj = instance.FindConVar("run_scene_override"); value = ((obj != null) ? obj.GetString() : null); } if (!string.IsNullOrEmpty((string?)value)) { return; } } DebugStart.ReplaceStageOne(run, choices); int stageOrder = choices.GetChoice(0).value.stageOrder; List<SceneDef> list = MapsForStage(run, stageOrder); Predicate<SceneDef> predicate = PoolFilter(list); List<(SceneDef, float)> list2 = new List<(SceneDef, float)>(); for (int i = 0; i < choices.Count; i++) { ChoiceInfo<SceneDef> choice = choices.GetChoice(i); if (predicate(choice.value)) { list2.Add((choice.value, choice.weight)); } } foreach (SceneDef map in list) { if (!list2.Exists(((SceneDef map, float weight) entry) => (Object)(object)entry.map == (Object)(object)map)) { list2.Add((map, AddedMapWeight)); } } if (list2.Sum<(SceneDef, float)>(((SceneDef map, float weight) entry) => entry.weight) <= 0f) { Log.Warning($"Every map that could roll on stage {stageOrder} is switched off, so it keeps its usual maps."); return; } choices.Clear(); foreach (var (val, num) in list2) { choices.AddChoice(val, num); } Log.Info(string.Format("Stage {0} pool{1}: {2}", stageOrder, (ModSettings.OnlyAddedMaps.Value && list.Count > 0) ? " (only added maps)" : "", Describe(choices))); } private static Predicate<SceneDef> PoolFilter(List<SceneDef> addedMaps) { object obj; if (!ModSettings.OnlyAddedMaps.Value || ModSettings.StartAtStageFive.Value || addedMaps.Count <= 0) { obj = <>O.<1>__IsEnabled; if (obj == null) { return <>O.<1>__IsEnabled = StageMaps.IsEnabled; } } else { obj = new Predicate<SceneDef>(addedMaps.Contains); } return (Predicate<SceneDef>)obj; } private static List<SceneDef> MapsForStage(Run run, int stage) { List<SceneDef> list = new List<SceneDef>(); AddedMap[] all = AddedMaps.All; foreach (AddedMap addedMap in all) { if (!addedMap.Enabled) { continue; } SceneDef val = SceneCatalog.FindSceneDef(addedMap.SceneName); if (Object.op_Implicit((Object)(object)val) && addedMap.StageOf(val) == stage) { val = LoopedVariant(run, val); if (run.CanPickStage(val)) { list.Add(val); } } } return list; } private static SceneDef LoopedVariant(Run run, SceneDef sceneDef) { SceneDef loopedSceneDef = sceneDef.loopedSceneDef; if (run.loopClearCount <= 0 || run.stageClearCount <= 5 || !Object.op_Implicit((Object)(object)loopedSceneDef)) { return sceneDef; } return loopedSceneDef; } private static void RefileStageOrders(Run run, List<Action> undo) { AddedMap[] all = AddedMaps.All; foreach (AddedMap addedMap in all) { SceneDef sceneDef = SceneCatalog.FindSceneDef(addedMap.SceneName); if (!Object.op_Implicit((Object)(object)sceneDef) || ((!ModSettings.AddAllMaps.Value || !addedMap.Enabled) && (Object)(object)sceneDef != (Object)(object)run.nextStageScene)) { continue; } int num = addedMap.StageOf(sceneDef); int stageOrder = sceneDef.stageOrder; if (num != stageOrder) { sceneDef.stageOrder = num; undo.Add(delegate { sceneDef.stageOrder = stageOrder; }); } } } private static void FilterLeftOutMapsOutOfBazaar(Run run, BazaarController bazaar, List<Action> undo) { //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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)run.nextStageScene)) { return; } int stageOrder = run.nextStageScene.stageOrder; Predicate<SceneDef> canRoll = PoolFilter(MapsForStage(run, stageOrder)); List<string> list = new List<string>(); Enumerator<SceneDef> enumerator = SceneCatalog.allSceneDefs.GetEnumerator(); try { while (enumerator.MoveNext()) { SceneDef sceneDef = enumerator.Current; if (sceneDef.stageOrder == stageOrder && !sceneDef.filterOutOfBazaar && !canRoll(sceneDef)) { sceneDef.filterOutOfBazaar = true; undo.Add(delegate { sceneDef.filterOutOfBazaar = false; }); list.Add(sceneDef.cachedName); } } } finally { ((IDisposable)enumerator/*cast due to .constrained prefix*/).Dispose(); } SeerSceneOverride[] overrides = bazaar.seerSceneOverrides; bazaar.seerSceneOverrides = Array.FindAll(overrides, (SeerSceneOverride seerOverride) => canRoll(seerOverride.sceneDef)); undo.Add(delegate { bazaar.seerSceneOverrides = overrides; }); if (list.Count > 0) { Log.Info(string.Format("Bazaar seers for stage {0} leave out: {1}", stageOrder, string.Join(", ", list))); } } private static string Describe(WeightedSelection<SceneDef> choices) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_002a: 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) float totalWeight = choices.GetTotalWeight(); StringBuilder stringBuilder = new StringBuilder(); for (int i = 0; i < choices.Count; i++) { ChoiceInfo<SceneDef> choice = choices.GetChoice(i); if (i > 0) { stringBuilder.Append(", "); } stringBuilder.Append(choice.value.cachedName).Append(' ').Append((choice.weight / totalWeight).ToString("P0")); } return stringBuilder.ToString(); } private static void LogAddedMaps() { AddedMap[] all = AddedMaps.All; foreach (AddedMap addedMap in all) { SceneDef val = SceneCatalog.FindSceneDef(addedMap.SceneName); if (!Object.op_Implicit((Object)(object)val)) { Log.Warning("This game build has no '" + addedMap.SceneName + "' scene; it will not be added to Eclipse."); } else { Log.Info($"{Language.GetString(val.nameToken)} ({val.cachedName}) joins Eclipse stage {addedMap.StageOf(val)}."); } } } } internal static class EndAltar { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_OnDeserialize <>9__13_0; internal void <Init>b__13_0(orig_OnDeserialize orig, PurchaseInteraction self, NetworkReader reader, bool initialState) { orig.Invoke(self, reader, initialState); if (self.displayNameToken == "Altar of the Eclipse") { Dress(self); } } } internal const string Name = "Altar of the Eclipse"; private const string Context = "Let your journey end"; private const string ShrineCardAddress = "RoR2/Base/ShrineRestack/iscShrineRestack.asset"; private const string StoneAddress = "RoR2/Base/skymeadow/matSMRock.mat"; private const string SoulConduitAddress = "RoR2/DLC4/WakeSacrifice/SacrificeMount.prefab"; private static readonly Color EmblemGlow = new Color(1.2f, 1.2f, 1.2f); private const float BeamLifetime = 1000000f; private static InteractableSpawnCard spawnCard; private static Mesh mesh; private static Material[] materials; private static GameObject successBeam; internal static InteractableSpawnCard SpawnCard { get { //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_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)spawnCard)) { spawnCard = Object.Instantiate<InteractableSpawnCard>(Addressables.LoadAssetAsync<InteractableSpawnCard>((object)"RoR2/Base/ShrineRestack/iscShrineRestack.asset").WaitForCompletion()); ((SpawnCard)spawnCard).forbiddenFlags = (NodeFlags)0; ((SpawnCard)spawnCard).hullSize = (HullClassification)0; spawnCard.orientToFloor = false; } return spawnCard; } } internal static void Init() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown object obj = <>c.<>9__13_0; if (obj == null) { hook_OnDeserialize val = delegate(orig_OnDeserialize orig, PurchaseInteraction self, NetworkReader reader, bool initialState) { orig.Invoke(self, reader, initialState); if (self.displayNameToken == "Altar of the Eclipse") { Dress(self); } }; <>c.<>9__13_0 = val; obj = (object)val; } PurchaseInteraction.OnDeserialize += (hook_OnDeserialize)obj; } internal static SceneExitController SetUp(GameObject shrineObject) { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown PurchaseInteraction shrine = shrineObject.GetComponent<PurchaseInteraction>(); shrine.NetworkdisplayNameToken = "Altar of the Eclipse"; shrine.NetworkcontextToken = "Let your journey end"; shrine.NetworkcostType = (CostTypeIndex)0; shrine.Networkcost = 0; SceneExitController exit = shrineObject.AddComponent<SceneExitController>(); shrine.onPurchase = new PurchaseEvent(); ((UnityEvent<Interactor>)(object)shrine.onPurchase).AddListener((UnityAction<Interactor>)delegate { shrine.SetAvailable(false); exit.Begin(); }); Dress(shrine); return exit; } private static void Dress(PurchaseInteraction shrine) { //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Expected O, but got Unknown //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010f: 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_011e: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)((Component)shrine).transform.Find("Altar of the Eclipse"))) { LoadAssets(); Renderer[] componentsInChildren = ((Component)shrine).GetComponentsInChildren<Renderer>(true); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].enabled = false; } Collider[] componentsInChildren2 = ((Component)shrine).GetComponentsInChildren<Collider>(true); for (int i = 0; i < componentsInChildren2.Length; i++) { componentsInChildren2[i].enabled = false; } GameObject val = new GameObject("Altar of the Eclipse") { layer = LayerIndex.world.intVal }; val.transform.SetParent(((Component)shrine).transform, false); val.AddComponent<MeshFilter>().sharedMesh = mesh; MeshRenderer val2 = val.AddComponent<MeshRenderer>(); ((Renderer)val2).sharedMaterials = materials; val.AddComponent<MeshCollider>().sharedMesh = mesh; val.AddComponent<EntityLocator>().entity = ((Component)shrine).gameObject; GameObject obj = Object.Instantiate<GameObject>(successBeam, val.transform, false); ParticleSystem component = ((Component)obj.transform.Find("Beam")).GetComponent<ParticleSystem>(); MainModule main = component.main; ((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(1000000f); ColorOverLifetimeModule colorOverLifetime = component.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = false; MainModule main2 = ((Component)obj.transform.Find("Beam/Motes")).GetComponent<ParticleSystem>().main; ((MainModule)(ref main2)).loop = true; obj.SetActive(true); ((Component)shrine).GetComponent<Highlight>().targetRenderer = (Renderer)(object)val2; ((Component)shrine).GetComponent<GenericDisplayNameProvider>().displayToken = "Altar of the Eclipse"; } } private static void LoadAssets() { //IL_0019: 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_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Expected O, but got Unknown //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: 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) if (!Object.op_Implicit((Object)(object)mesh)) { Material stone = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/skymeadow/matSMRock.mat").WaitForCompletion(); Texture2D val = new Texture2D(2, 2) { wrapMode = (TextureWrapMode)1 }; ImageConversion.LoadImage(val, ReadResource("EndAltarEmblem.png")); Material emblem = new Material(stone) { mainTexture = (Texture)(object)val }; emblem.SetTexture("_NormalTex", (Texture)null); emblem.SetTexture("_EmTex", (Texture)(object)val); emblem.SetColor("_EmColor", EmblemGlow); List<string> list = new List<string>(); using (StreamReader reader = new StreamReader(new MemoryStream(ReadResource("EndAltar.obj")))) { mesh = LoadObj(reader, list); } materials = list.ConvertAll((string name) => (!name.StartsWith("emblem")) ? stone : emblem).ToArray(); successBeam = ((Component)Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC4/WakeSacrifice/SacrificeMount.prefab").WaitForCompletion().transform.Find("SuccessIndicator")).gameObject; } } private static byte[] ReadResource(string name) { using Stream stream = typeof(EndAltar).Assembly.GetManifestResourceStream(name); using MemoryStream memoryStream = new MemoryStream(); stream.CopyTo(memoryStream); return memoryStream.ToArray(); } private static Mesh LoadObj(TextReader reader, List<string> materialNames) { //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Expected O, but got Unknown //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) List<Vector3> positions = new List<Vector3>(); List<Vector2> uvs = new List<Vector2>(); List<Vector3> normals = new List<Vector3>(); List<Vector3> vertices = new List<Vector3>(); List<Vector2> vertexUvs = new List<Vector2>(); List<Vector3> vertexNormals = new List<Vector3>(); Dictionary<string, int> corners = new Dictionary<string, int>(); List<List<int>> list = new List<List<int>>(); string text; while ((text = reader.ReadLine()) != null) { string[] array = text.Split((char[]?)null, StringSplitOptions.RemoveEmptyEntries); switch ((array.Length != 0) ? array[0] : null) { case "v": positions.Add(new Vector3(0f - Number(array[1]), Number(array[2]), Number(array[3]))); break; case "vt": uvs.Add(new Vector2(Number(array[1]), Number(array[2]))); break; case "vn": normals.Add(new Vector3(0f - Number(array[1]), Number(array[2]), Number(array[3]))); break; case "usemtl": materialNames.Add(array[1]); list.Add(new List<int>()); break; case "f": { if (list.Count == 0) { materialNames.Add("stone"); list.Add(new List<int>()); } List<int> list2 = list[list.Count - 1]; for (int i = 3; i < array.Length; i++) { list2.Add(Corner(array[1])); list2.Add(Corner(array[i])); list2.Add(Corner(array[i - 1])); } break; } } } Mesh val = new Mesh { name = "EndAltar" }; val.SetVertices(vertices); val.SetUVs(0, vertexUvs); val.SetNormals(vertexNormals); val.subMeshCount = list.Count; for (int j = 0; j < list.Count; j++) { val.SetTriangles(list[j], j); } val.RecalculateTangents(); return val; int Corner(string corner) { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_006e: 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) if (!corners.TryGetValue(corner, out var value)) { string[] array2 = corner.Split('/'); int num = (corners[corner] = vertices.Count); value = num; vertices.Add(positions[int.Parse(array2[0]) - 1]); vertexUvs.Add(uvs[int.Parse(array2[1]) - 1]); vertexNormals.Add(normals[int.Parse(array2[2]) - 1]); } return value; } static float Number(string s) { return float.Parse(s, CultureInfo.InvariantCulture); } } } internal static class FinalStage { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_Start <>9__13_0; public static hook_OnExit <>9__13_1; public static Action<Stage> <>9__13_2; public static hook_BeginEscapeSequence <>9__13_3; public static Func<SceneExitController, bool> <>9__13_12; public static hook_SpawnOutroPortal <>9__13_4; public static hook_OnEnter <>9__13_5; public static Func<SceneExitController, bool> <>9__13_13; public static hook_CompleteReaperFight <>9__13_6; public static hook_OnEnter <>9__13_7; public static hook_Begin <>9__13_8; public static Action<CharacterBody> <>9__13_9; public static hook_OnExit <>9__13_10; public static hook_SetNextState <>9__13_11; public static Predicate<SceneDef> <>9__16_2; public static Func<SceneDef, string> <>9__16_3; internal void <Init>b__13_0(orig_Start orig, TeleporterInteraction self) { orig.Invoke(self); SceneExitController sceneExitController = self.sceneExitController; if (NetworkServer.active && EclipseStagePool.IsActive(Run.instance) && Object.op_Implicit((Object)(object)sceneExitController) && Object.op_Implicit((Object)(object)sceneExitController.destinationScene) && sceneExitController.destinationScene.cachedName == "moon2" && OnStageFive()) { PickFinalStage(sceneExitController); } } internal void <Init>b__13_1(orig_OnExit orig, IdleToActive self) { //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Expected O, but got Unknown orig.Invoke(self); SceneDef val = (Object.op_Implicit((Object)(object)((LunarTeleporterBaseState)self).teleporterInteraction) ? ((LunarTeleporterBaseState)self).teleporterInteraction.sceneExitController.destinationScene : null); if (!NetworkServer.active || !Object.op_Implicit((Object)(object)val) || !EclipseStagePool.IsActive(Run.instance) || !OnStageFive()) { return; } (string, string)[] finalStages = FinalStages; for (int i = 0; i < finalStages.Length; i++) { var (text, text2) = finalStages[i]; if (text == val.cachedName) { Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage { baseToken = "<style=cWorldEvent>" + text2 + "</style>" }); } } } internal void <Init>b__13_2(Stage stage) { MarkVisited(); } internal void <Init>b__13_3(orig_BeginEscapeSequence orig, EscapeSequenceController self) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (NetworkServer.active && EclipseStagePool.IsActive(Run.instance)) { Transform val = ((Component)self).transform.Find("EscapeSequenceObjects/FrogSpawner"); OpenLoopPortal((Object.op_Implicit((Object)(object)val) ? val : ((Component)self).transform).position); } } internal void <Init>b__13_4(orig_SpawnOutroPortal orig, VoidRaidGauntletController self) { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (NetworkServer.active && EclipseStagePool.IsActive(Run.instance) && Object.op_Implicit((Object)(object)self.currentDonut?.returnPoint)) { OpenLoopPortal(ExitPosition((SceneExitController exit) => Object.op_Implicit((Object)(object)exit.destinationScene) && exit.destinationScene.cachedName == "voidoutro", self.currentDonut.returnPoint.position)); } } internal bool <Init>b__13_12(SceneExitController exit) { if (Object.op_Implicit((Object)(object)exit.destinationScene)) { return exit.destinationScene.cachedName == "voidoutro"; } return false; } internal void <Init>b__13_5(orig_OnEnter orig, RevealRebirthShriine self) { //IL_004b: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (NetworkServer.active && self.isEclipse && EclipseStagePool.IsActive(Run.instance) && IsFinalStage()) { GameObject portalObject = ((ShrineRebirthEntityStates)self)._shrineController.portalObject; OpenEndAltar((Object.op_Implicit((Object)(object)portalObject) ? portalObject.transform : ((EntityState)self).transform).position, GameEndings.RebirthEndingDef, "The storm falls silent.."); } } internal void <Init>b__13_6(orig_CompleteReaperFight orig, ChampRushMissionController self) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Invalid comparison between Unknown and I4 //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (NetworkServer.active && self.reaperSpawned && (int)Run.instance.selectedDifficulty >= 3 && EclipseStagePool.IsActive(Run.instance) && IsFinalStage()) { OpenEndAltar(ExitPosition((SceneExitController exit) => ((Object)exit).name.StartsWith("ChampRushExitPortal"), ((Component)self).transform.position), GameEndings.CRSacrificeEndingGood, "The scales are balanced.."); } } internal bool <Init>b__13_13(SceneExitController exit) { return ((Object)exit).name.StartsWith("ChampRushExitPortal"); } internal void <Init>b__13_7(orig_OnEnter orig, SpawnEyePortal self) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (NetworkServer.active && EclipseStagePool.IsActive(Run.instance) && IsFinalStage()) { OpenEndAltar((Object.op_Implicit((Object)(object)self.exitPortal) ? self.exitPortal.transform : ((EntityState)self).transform).position, GameEndings.DecompileEnding, "Connection terminated.."); } } internal void <Init>b__13_8(orig_Begin orig, SceneExitController self) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active && (Object)(object)self == (Object)(object)endExit && Object.op_Implicit((Object)(object)endExitEnding) && (int)self.exitState == 0) { Log.Info("The end altar ends the run: " + endExitEnding.cachedName + "."); Run.instance.BeginGameOver(endExitEnding); } orig.Invoke(self); } internal void <Init>b__13_9(CharacterBody body) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Invalid comparison between Unknown and I4 if (NetworkServer.active && (int)body.teamComponent.teamIndex == 2 && Object.op_Implicit((Object)(object)body.inventory) && EclipseStagePool.IsActive(Run.instance) && SceneCatalog.mostRecentSceneDef.cachedName == "champrush" && IsFinalStage() && body.inventory.GetItemCountPermanent(Items.PercentMaxHealth) == 0) { bool flag = ((Object)body).name.StartsWith("ReaperBoss"); body.inventory.GiveItemPermanent(Items.PercentMaxHealth, flag ? 80 : 60); if (flag) { Log.Info($"Soulbound Threshold: {((Object)body).name} at {80}% health, its monsters at {60}%."); } } } internal void <Init>b__13_10(orig_OnExit orig, OverchargingState self) { if (NetworkServer.active && EclipseStagePool.IsActive(Run.instance)) { self.portalSpawnCard = null; Log.Info("Shrine of Descent: no Ritual Portal to Soulbound Threshold."); } orig.Invoke(self); } internal void <Init>b__13_11(orig_SetNextState orig, EntityStateMachine self, EntityState newNextState) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown if (newNextState is ChargedState && NetworkServer.active && EclipseStagePool.IsActive(Run.instance)) { Util.KarmaEventTrigger("SurviveMajorCatastrophe"); newNextState = (EntityState)new ChargedStateAlwaysInteractable(); Log.Info("Shrine of Descent: the teleporter stays usable."); } orig.Invoke(self, newNextState); } internal bool <PickFinalStage>b__16_2(SceneDef choice) { return choice.cachedName != lastVisited; } internal string <PickFinalStage>b__16_3(SceneDef choice) { return choice.cachedName; } } private const string Commencement = "moon2"; private const string SoulboundThreshold = "champrush"; private static readonly (string scene, string omen)[] FinalStages = new(string, string)[5] { ("moon2", "You dream of a king, ruling over nothing."), ("voidraid", "You dream of stars, drowning in the dark."), ("meridian", "You dream of thunder, and a forsaken heir."), ("solutionalhaunt", "You dream of steel wings, and an unblinking eye."), ("champrush", "You dream of scales, tipped askew.") }; private const string LoopPortalAddress = "RoR2/DLC2/iscDestinationPortal.asset"; private const float BesideMin = 10f; private const float BesideMax = 18f; private const string AnimaHarvesterBody = "ReaperBoss"; private const int AnimaHarvesterHealthPercent = 80; private const int SoulboundThresholdMonsterHealthPercent = 60; private static SpawnCard loopPortalCard; private static SceneExitController endExit; private static GameEndingDef endExitEnding; private static string lastVisited; internal static void Init() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Expected O, but got Unknown //IL_00a4: 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_00af: Expected O, but got Unknown //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Expected O, but got Unknown //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Expected O, but got Unknown //IL_0110: 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_011b: Expected O, but got Unknown //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Expected O, but got Unknown //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Expected O, but got Unknown //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Expected O, but got Unknown object obj = <>c.<>9__13_0; if (obj == null) { hook_Start val = delegate(orig_Start orig, TeleporterInteraction self) { orig.Invoke(self); SceneExitController sceneExitController = self.sceneExitController; if (NetworkServer.active && EclipseStagePool.IsActive(Run.instance) && Object.op_Implicit((Object)(object)sceneExitController) && Object.op_Implicit((Object)(object)sceneExitController.destinationScene) && sceneExitController.destinationScene.cachedName == "moon2" && OnStageFive()) { PickFinalStage(sceneExitController); } }; <>c.<>9__13_0 = val; obj = (object)val; } TeleporterInteraction.Start += (hook_Start)obj; object obj2 = <>c.<>9__13_1; if (obj2 == null) { hook_OnExit val2 = delegate(orig_OnExit orig, IdleToActive self) { //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Expected O, but got Unknown orig.Invoke(self); SceneDef val11 = (Object.op_Implicit((Object)(object)((LunarTeleporterBaseState)self).teleporterInteraction) ? ((LunarTeleporterBaseState)self).teleporterInteraction.sceneExitController.destinationScene : null); if (NetworkServer.active && Object.op_Implicit((Object)(object)val11) && EclipseStagePool.IsActive(Run.instance) && OnStageFive()) { (string, string)[] finalStages = FinalStages; for (int i = 0; i < finalStages.Length; i++) { var (text, text2) = finalStages[i]; if (text == val11.cachedName) { Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage { baseToken = "<style=cWorldEvent>" + text2 + "</style>" }); } } } }; <>c.<>9__13_1 = val2; obj2 = (object)val2; } IdleToActive.OnExit += (hook_OnExit)obj2; Stage.onServerStageBegin += delegate { MarkVisited(); }; object obj3 = <>c.<>9__13_3; if (obj3 == null) { hook_BeginEscapeSequence val3 = delegate(orig_BeginEscapeSequence orig, EscapeSequenceController self) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (NetworkServer.active && EclipseStagePool.IsActive(Run.instance)) { Transform val11 = ((Component)self).transform.Find("EscapeSequenceObjects/FrogSpawner"); OpenLoopPortal((Object.op_Implicit((Object)(object)val11) ? val11 : ((Component)self).transform).position); } }; <>c.<>9__13_3 = val3; obj3 = (object)val3; } EscapeSequenceController.BeginEscapeSequence += (hook_BeginEscapeSequence)obj3; object obj4 = <>c.<>9__13_4; if (obj4 == null) { hook_SpawnOutroPortal val4 = delegate(orig_SpawnOutroPortal orig, VoidRaidGauntletController self) { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (NetworkServer.active && EclipseStagePool.IsActive(Run.instance) && Object.op_Implicit((Object)(object)self.currentDonut?.returnPoint)) { OpenLoopPortal(ExitPosition((SceneExitController exit) => Object.op_Implicit((Object)(object)exit.destinationScene) && exit.destinationScene.cachedName == "voidoutro", self.currentDonut.returnPoint.position)); } }; <>c.<>9__13_4 = val4; obj4 = (object)val4; } VoidRaidGauntletController.SpawnOutroPortal += (hook_SpawnOutroPortal)obj4; object obj5 = <>c.<>9__13_5; if (obj5 == null) { hook_OnEnter val5 = delegate(orig_OnEnter orig, RevealRebirthShriine self) { //IL_004b: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (NetworkServer.active && self.isEclipse && EclipseStagePool.IsActive(Run.instance) && IsFinalStage()) { GameObject portalObject = ((ShrineRebirthEntityStates)self)._shrineController.portalObject; OpenEndAltar((Object.op_Implicit((Object)(object)portalObject) ? portalObject.transform : ((EntityState)self).transform).position, GameEndings.RebirthEndingDef, "The storm falls silent.."); } }; <>c.<>9__13_5 = val5; obj5 = (object)val5; } RevealRebirthShriine.OnEnter += (hook_OnEnter)obj5; object obj6 = <>c.<>9__13_6; if (obj6 == null) { hook_CompleteReaperFight val6 = delegate(orig_CompleteReaperFight orig, ChampRushMissionController self) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Invalid comparison between Unknown and I4 //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (NetworkServer.active && self.reaperSpawned && (int)Run.instance.selectedDifficulty >= 3 && EclipseStagePool.IsActive(Run.instance) && IsFinalStage()) { OpenEndAltar(ExitPosition((SceneExitController exit) => ((Object)exit).name.StartsWith("ChampRushExitPortal"), ((Component)self).transform.position), GameEndings.CRSacrificeEndingGood, "The scales are balanced.."); } }; <>c.<>9__13_6 = val6; obj6 = (object)val6; } ChampRushMissionController.CompleteReaperFight += (hook_CompleteReaperFight)obj6; object obj7 = <>c.<>9__13_7; if (obj7 == null) { hook_OnEnter val7 = delegate(orig_OnEnter orig, SpawnEyePortal self) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (NetworkServer.active && EclipseStagePool.IsActive(Run.instance) && IsFinalStage()) { OpenEndAltar((Object.op_Implicit((Object)(object)self.exitPortal) ? self.exitPortal.transform : ((EntityState)self).transform).position, GameEndings.DecompileEnding, "Connection terminated.."); } }; <>c.<>9__13_7 = val7; obj7 = (object)val7; } SpawnEyePortal.OnEnter += (hook_OnEnter)obj7; object obj8 = <>c.<>9__13_8; if (obj8 == null) { hook_Begin val8 = delegate(orig_Begin orig, SceneExitController self) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active && (Object)(object)self == (Object)(object)endExit && Object.op_Implicit((Object)(object)endExitEnding) && (int)self.exitState == 0) { Log.Info("The end altar ends the run: " + endExitEnding.cachedName + "."); Run.instance.BeginGameOver(endExitEnding); } orig.Invoke(self); }; <>c.<>9__13_8 = val8; obj8 = (object)val8; } SceneExitController.Begin += (hook_Begin)obj8; CharacterBody.onBodyStartGlobal += delegate(CharacterBody body) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Invalid comparison between Unknown and I4 if (NetworkServer.active && (int)body.teamComponent.teamIndex == 2 && Object.op_Implicit((Object)(object)body.inventory) && EclipseStagePool.IsActive(Run.instance) && SceneCatalog.mostRecentSceneDef.cachedName == "champrush" && IsFinalStage() && body.inventory.GetItemCountPermanent(Items.PercentMaxHealth) == 0) { bool flag = ((Object)body).name.StartsWith("ReaperBoss"); body.inventory.GiveItemPermanent(Items.PercentMaxHealth, flag ? 80 : 60); if (flag) { Log.Info($"Soulbound Threshold: {((Object)body).name} at {80}% health, its monsters at {60}%."); } } }; object obj9 = <>c.<>9__13_10; if (obj9 == null) { hook_OnExit val9 = delegate(orig_OnExit orig, OverchargingState self) { if (NetworkServer.active && EclipseStagePool.IsActive(Run.instance)) { self.portalSpawnCard = null; Log.Info("Shrine of Descent: no Ritual Portal to Soulbound Threshold."); } orig.Invoke(self); }; <>c.<>9__13_10 = val9; obj9 = (object)val9; } OverchargingState.OnExit += (hook_OnExit)obj9; object obj10 = <>c.<>9__13_11; if (obj10 == null) { hook_SetNextState val10 = delegate(orig_SetNextState orig, EntityStateMachine self, EntityState newNextState) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown if (newNextState is ChargedState && NetworkServer.active && EclipseStagePool.IsActive(Run.instance)) { Util.KarmaEventTrigger("SurviveMajorCatastrophe"); newNextState = (EntityState)new ChargedStateAlwaysInteractable(); Log.Info("Shrine of Descent: the teleporter stays usable."); } orig.Invoke(self, newNextState); }; <>c.<>9__13_11 = val10; obj10 = (object)val10; } EntityStateMachine.SetNextState += (hook_SetNextState)obj10; } internal static bool OnStageFive() { if (SceneCatalog.mostRecentSceneDef.stageOrder != 5) { return AddedMaps.InPlay()?.SceneName == "voidstage"; } return true; } private static bool IsFinalStage() { if (Run.instance.stageClearCount > 0) { return Run.instance.stageClearCountInCurrentLoop == 0; } return false; } private static void PickFinalStage(SceneExitController exit) { Run run = Run.instance; List<SceneDef> list = new List<SceneDef>(); (string, string)[] finalStages = FinalStages; for (int i = 0; i < finalStages.Length; i++) { SceneDef val = SceneCatalog.FindSceneDef(finalStages[i].Item1); if (Object.op_Implicit((Object)(object)val) && run.CanPickStage(val) && StageMaps.IsEnabled(val)) { list.Add(val); } } if (list.Count == 0) { Log.Warning("Every final stage is switched off, so the Primordial Teleporter leads to Commencement."); return; } List<SceneDef> list2 = list.FindAll((SceneDef choice) => !run.GetEventFlag(VisitedFlag(choice.cachedName))); if (list2.Count == 0) { list.ForEach(delegate(SceneDef choice) { run.ResetEventFlag(VisitedFlag(choice.cachedName)); }); list2 = ((list.Count > 1) ? list.FindAll((SceneDef choice) => choice.cachedName != lastVisited) : list); } exit.destinationScene = list2[run.nextStageRng.RangeInt(0, list2.Count)]; Log.Info(SceneCatalog.mostRecentSceneDef.cachedName + ": the Primordial Teleporter leads to " + exit.destinationScene.cachedName + " (one of " + string.Join(", ", list2.Select((SceneDef choice) => choice.cachedName)) + ")."); } private static void MarkVisited() { string scene = (Object.op_Implicit((Object)(object)SceneCatalog.mostRecentSceneDef) ? SceneCatalog.mostRecentSceneDef.cachedName : null); if (EclipseStagePool.IsActive(Run.instance) && IsFinalStage() && FinalStages.Any(((string scene, string omen) finalStage) => finalStage.scene == scene)) { Run.instance.SetEventFlag(VisitedFlag(scene)); lastVisited = scene; } } private static string VisitedFlag(string scene) { return "EclipseAllMaps.FinalStageReached." + scene; } private static Vector3 ExitPosition(Func<SceneExitController, bool> match, Vector3 fallback) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) SceneExitController val = InstanceTracker.GetInstancesList<SceneExitController>().FirstOrDefault(match); if (!Object.op_Implicit((Object)(object)val)) { return fallback; } return ((Component)val).transform.position; } private static void OpenLoopPortal(Vector3 position) { //IL_002d: 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_001b: Unknown result type (might be due to invalid IL or missing references) //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_006d: Expected O, but got Unknown AddedMapProgression.PickStageOne(Run.instance); if (loopPortalCard == null) { loopPortalCard = Addressables.LoadAssetAsync<SpawnCard>((object)"RoR2/DLC2/iscDestinationPortal.asset").WaitForCompletion(); } GameObject val = SpawnBeside(loopPortalCard, position); SceneExitController val2 = default(SceneExitController); if (!Object.op_Implicit((Object)(object)val) || !val.TryGetComponent<SceneExitController>(ref val2)) { Log.Warning("Could not place the Destination Portal to stage 1."); return; } val2.doNotIncrementStageNumber = true; Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage { baseToken = "<style=cWorldEvent>A Destination Portal opens: it leads on to the next loop.</style>" }); string cachedName = SceneCatalog.mostRecentSceneDef.cachedName; SceneDef nextStageScene = Run.instance.nextStageScene; Log.Info(cachedName + ": a Destination Portal to " + ((nextStageScene != null) ? nextStageScene.cachedName : null) + "."); } private static void OpenEndAltar(Vector3 position, GameEndingDef ending, string aftermath) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown GameObject val = SpawnBeside((SpawnCard)(object)EndAltar.SpawnCard, position); if (!Object.op_Implicit((Object)(object)ending) || !Object.op_Implicit((Object)(object)val)) { Log.Warning("Could not place the altar that ends the run."); return; } endExit = EndAltar.SetUp(val); endExitEnding = ending; Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage { baseToken = "<style=cWorldEvent>" + aftermath + " An altar rises.. touch it, and let your journey end.</style>" }); Log.Info(SceneCatalog.mostRecentSceneDef.cachedName + ": an altar that ends the run (" + ending.cachedName + ")."); } private static GameObject SpawnBeside(SpawnCard card, Vector3 position) { //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) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0040: 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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Expected O, but got Unknown //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Expected O, but got Unknown //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown if (!Object.op_Implicit((Object)(object)card)) { return null; } float[] array = new float[2] { 18f, 40f }; foreach (float maxDistance in array) { DirectorPlacementRule val = new DirectorPlacementRule { placementMode = (PlacementMode)1, minDistance = 10f, maxDistance = maxDistance, position = position }; GameObject val2 = DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest(card, val, new Xoroshiro128Plus(Run.instance.stageRng.nextUlong))); if (Object.op_Implicit((Object)(object)val2)) { return val2; } } return null; } } internal static class HalcyonShrines { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_Awake <>9__7_0; public static hook_HalcyoniteShrineActivation <>9__7_1; public static Func<Category, bool> <>9__7_3; public static Action<SceneDirector, DirectorCardCategorySelection> <>9__7_2; internal void <Init>b__7_0(orig_Awake orig, HalcyoniteShrineInteractable self) { orig.Invoke(self); if (NetworkServer.active && IsWeakened()) { self.monsterCredit *= 0.5f; } } internal void <Init>b__7_1(orig_HalcyoniteShrineActivation orig, CombatDirector self, float monsterCredit, DirectorCard chosenDirectorCard, int difficultyLevel, Transform shrineTransform) { if (IsWeakened()) { int num = Mathf.Min(difficultyLevel, 15) / 2; Log.Info($"Halcyon Shrine: Halcyonite gold bonus {difficultyLevel} -> {num}."); difficultyLevel = num; } orig.Invoke(self, monsterCredit, chosenDirectorCard, difficultyLevel, shrineTransform); } internal void <Init>b__7_2(SceneDirector sceneDirector, DirectorCardCategorySelection interactables) { if (!ModSettings.HalcyonShrineEveryStage.Value || !EclipseStagePool.IsActive(Run.instance)) { return; } int num = CurrentStage(); if (num < 1 || num > 5 || interactables.categories.Any((Category category) => category.cards.Any(IsHalcyonShrine))) { return; } bool flag = num == 1; DirectorCard val = (flag ? (tier1Shrine ?? (tier1Shrine = NewCard("RoR2/DLC2/iscShrineHalcyoniteTier1.asset", 7))) : (shrine ?? (shrine = NewCard("RoR2/DLC2/iscShrineHalcyonite.asset", 1)))); if (val.IsAvailable()) { int num2 = interactables.FindCategoryIndexByName("Storm Stuff"); if (num2 < 0) { num2 = interactables.AddCategory("Storm Stuff", flag ? 3f : 1.5f); } interactables.AddCard(num2, val); Log.Info(SceneCatalog.mostRecentSceneDef.cachedName + ": a Halcyon Shrine can spawn."); } } internal bool <Init>b__7_3(Category category) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return category.cards.Any(IsHalcyonShrine); } } private const string Tier1ShrineAddress = "RoR2/DLC2/iscShrineHalcyoniteTier1.asset"; private const string ShrineAddress = "RoR2/DLC2/iscShrineHalcyonite.asset"; private const string CategoryName = "Storm Stuff"; private const int Stage4ClearCount = 3; private const int MaxGoldLevel = 15; private static DirectorCard tier1Shrine; private static DirectorCard shrine; internal static void Init() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown object obj = <>c.<>9__7_0; if (obj == null) { hook_Awake val = delegate(orig_Awake orig, HalcyoniteShrineInteractable self) { orig.Invoke(self); if (NetworkServer.active && IsWeakened()) { self.monsterCredit *= 0.5f; } }; <>c.<>9__7_0 = val; obj = (object)val; } HalcyoniteShrineInteractable.Awake += (hook_Awake)obj; object obj2 = <>c.<>9__7_1; if (obj2 == null) { hook_HalcyoniteShrineActivation val2 = delegate(orig_HalcyoniteShrineActivation orig, CombatDirector self, float monsterCredit, DirectorCard chosenDirectorCard, int difficultyLevel, Transform shrineTransform) { if (IsWeakened()) { int num = Mathf.Min(difficultyLevel, 15) / 2; Log.Info($"Halcyon Shrine: Halcyonite gold bonus {difficultyLevel} -> {num}."); difficultyLevel = num; } orig.Invoke(self, monsterCredit, chosenDirectorCard, difficultyLevel, shrineTransform); }; <>c.<>9__7_1 = val2; obj2 = (object)val2; } CombatDirector.HalcyoniteShrineActivation += (hook_HalcyoniteShrineActivation)obj2; SceneDirector.onGenerateInteractableCardSelection += delegate(SceneDirector sceneDirector, DirectorCardCategorySelection interactables) { if (ModSettings.HalcyonShrineEveryStage.Value && EclipseStagePool.IsActive(Run.instance)) { int num = CurrentStage(); if (num >= 1 && num <= 5 && !interactables.categories.Any((Category category) => category.cards.Any(IsHalcyonShrine))) { bool flag = num == 1; DirectorCard val3 = (flag ? (tier1Shrine ?? (tier1Shrine = NewCard("RoR2/DLC2/iscShrineHalcyoniteTier1.asset", 7))) : (shrine ?? (shrine = NewCard("RoR2/DLC2/iscShrineHalcyonite.asset", 1)))); if (val3.IsAvailable()) { int num2 = interactables.FindCategoryIndexByName("Storm Stuff"); if (num2 < 0) { num2 = interactables.AddCategory("Storm Stuff", flag ? 3f : 1.5f); } interactables.AddCard(num2, val3); Log.Info(SceneCatalog.mostRecentSceneDef.cachedName + ": a Halcyon Shrine can spawn."); } } } }; } private static bool IsWeakened() { if (EclipseStagePool.IsActive(Run.instance)) { return Run.instance.stageClearCount >= 3; } return false; } private static DirectorCard NewCard(string address, int weight) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown return new DirectorCard { spawnCard = Addressables.LoadAssetAsync<SpawnCard>((object)address).WaitForCompletion(), selectionWeight = weight }; } private static bool IsHalcyonShrine(DirectorCard card) { SpawnCard spawnCard = card.GetSpawnCard(); if (spawnCard != null) { return ((Object)spawnCard).name.StartsWith("iscShrineHalcyonite"); } return false; } private static int CurrentStage() { SceneDef mostRecentSceneDef = SceneCatalog.mostRecentSceneDef; AddedMap addedMap = AddedMaps.Of(mostRecentSceneDef); if (addedMap != null) { return addedMap.StageOf(SceneCatalog.FindSceneDef(addedMap.SceneName)); } if (!Object.op_Implicit((Object)(object)mostRecentSceneDef)) { return 0; } return mostRecentSceneDef.stageOrder; } } internal static class Log { private static ManualLogSource _source; internal static void Init(ManualLogSource source) { _source = source; } internal static void Debug(object data) { _source.LogDebug(data); } internal static void Info(object data) { _source.LogInfo(data); } internal static void Message(object data) { _source.LogMessage(data); } internal static void Warning(object data) { _source.LogWarning(data); } internal static void Error(object data) { _source.LogError(data); } internal static void Fatal(object data) { _source.LogFatal(data); } } internal static class ModSettings { internal static ConfigEntry<bool> AddAllMaps; internal static ConfigEntry<float> AddedMapChance; internal static ConfigEntry<bool> HalcyonShrineEveryStage; internal static ConfigEntry<bool> AlloyHunterBoss; internal static ConfigEntry<bool> OnlyAddedMaps; internal static ConfigEntry<bool> StartAtStageFive; internal static ConfigEntry<bool> StartAtPrimeMeridian; private static readonly List<(ConfigEntryBase entry, string label)> menu = new List<(ConfigEntryBase, string)>(); internal static IEnumerable<(ConfigEntryBase entry, string label)> Menu => menu; internal static void Bind(ConfigFile config) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Expected O, but got Unknown AddAllMaps = Bind(config, "General", "AddAllMapsToEclipse", "Add all maps to Eclipse", defaultValue: true, "The switch for the whole mod: adds Reformed Altar, Treeborn Colony, Conduit Canyon and Void Locus to the normal stage rotation of Eclipse runs, sends stage 5 to a random final stage, and applies every other change. Only the host's settings count, and a change applies from the next stage."); AddedMapChance = config.Bind<float>("General", "AddedMapChance", 1f, new ConfigDescription("How likely each added map is next to a usual map of its stage: 1 is as likely, 2 twice, 0.5 half. To keep one out, switch it off under Maps.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 5f), Array.Empty<object>())); menu.Add(((ConfigEntryBase)(object)AddedMapChance, "Added map chance")); HalcyonShrineEveryStage = Bind(config, "General", "HalcyonShrineEveryStage", "Halcyon Shrine on every stage", defaultValue: true, "Halcyon Shrines can spawn on every stage, as one of its interactables with their usual cost and odds. Vanilla only has them when a stage's Seekers of the Storm content is rolled in, and never on Conduit Canyon or Void Locus. Needs Seekers of the Storm."); AlloyHunterBoss = Bind(config, "General", "AlloyHunterBoss", "Alloy Hunter as a normal boss", defaultValue: true, "From stage 4 on the Alloy Hunter can be the teleporter boss on any map, as likely as any one of that map's own bosses. It comes one at a time: one, plus one per Shrine of the Mountain, with the total health of a normal boss fight. Off, it only comes as one of Conduit Canyon's robot bosses. Needs the Alloyed Collective."); StageMaps.Bind(config); menu.AddRange(StageMaps.All.Select((StageMap map) => ((ConfigEntryBase)(object)map.Enabled, Label: map.Label))); OnlyAddedMaps = Bind(config, "Debug", "OnlyAddedMaps", "Only added maps", defaultValue: false, "Gives every other map a 0% chance on the stages that gained a map, and keeps them off the Bazaar's Lunar Seers, so an Eclipse run with every map switched on always goes stage 1 -> Reformed Altar -> Treeborn Colony -> Conduit Canyon -> Void Locus -> a final stage. For testing the added maps; leave off for normal play."); StartAtStageFive = Bind(config, "Debug", "StartAtStageFive", "Start at stage 5", defaultValue: false, "The run starts on a stage 5 map, and loops back to one. Every player starts with 20 Mochas, 20 Hopoo Feathers, 10 Focused Convergences and god mode. For testing the final stages; with Only added maps on, stage 5 is always Void Locus. Leave off for normal play."); StartAtPrimeMeridian = Bind(config, "Debug", "StartAtPrimeMeridian", "Start at Prime Meridian", defaultValue: false, "The run starts on Prime Meridian as the final stage (stage 6), as if it came from stage 5, so False Son leaves the altar that ends the run. Every player starts with 20 Mochas, 20 Hopoo Feathers, 10 Focused Convergences and god mode. For testing the end altar; needs Seekers of the Storm. Leave off for normal play."); if (typeof(ConfigFile).GetProperty("OrphanedEntries", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue(config) is Dictionary<ConfigDefinition, string> { Count: >0 } dictionary) { Log.Info($"Dropping {dictionary.Count} settings this version no longer has from the config file."); dictionary.Clear(); config.Save(); } } internal static bool AppliesTo(Run run) { return run is EclipseRun; } private static ConfigEntry<bool> Bind(ConfigFile config, string section, string key, string label, bool defaultValue, string description) { ConfigEntry<bool> val = config.Bind<bool>(section, key, defaultValue, description); menu.Add(((ConfigEntryBase)(object)val, label)); return val; } } internal static class RiskOfOptionsCompat { internal const string PluginGuid = "com.rune580.riskofoptions"; internal static bool IsInstalled => Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions"); [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] internal static void AddOptions(IEnumerable<(ConfigEntryBase entry, string label)> options) { //IL_0057: 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_0068: Expected O, but got Unknown //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Expected O, but got Unknown //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_0090: 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_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_00c5: Expected O, but got Unknown //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Expected O, but got Unknown ModSettingsManager.SetModDescription("For more randomized Eclipse runs: every map in the stage rotation, and a random final boss after stage 5.", "chen-ror2.EclipseAllMaps", "EclipseAllMaps"); foreach (var option in options) { ConfigEntryBase item = option.entry; string item2 = option.label; ConfigEntryBase val = item; BaseOption val5; if (!(val is ConfigEntry<bool> val2)) { if (!(val is ConfigEntry<float> val3) || !(((ConfigEntryBase)val3).Description.AcceptableValues is AcceptableValueRange<float> val4)) { continue; } val5 = (BaseOption)new StepSliderOption(val3, new StepSliderConfig { name = item2, min = val4.MinValue, max = val4.MaxValue, increment = 0.1f, FormatString = "{0:0.0}x" }); } else { val5 = (BaseOption)new CheckBoxOption(val2, new CheckBoxConfig { name = item2 }); } ModSettingsManager.AddOption(val5, "chen-ror2.EclipseAllMaps", "EclipseAllMaps"); } } } internal sealed class SoloBoss { private static readonly List<SoloBoss> all = new List<SoloBoss>(); internal readonly string Name; private readonly string cardAddress; private readonly int? usualCostOverride; private CharacterSpawnCard card; private DirectorCard directorCard; private int usualCost; private float healthMultiplier = 1f; internal SoloBoss(string name, string cardAddress, int? usualCost = null) { Name = name; this.cardAddress = cardAddress; usualCostOverride = usualCost; all.Add(this); } internal static void Init() { SpawnCard.onSpawnedServerGlobal += delegate(SpawnResult result) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0015: 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_0059: Unknown result type (might be due to invalid IL or missing references) if (!result.success || !Object.op_Implicit((Object)(object)result.spawnedInstance) || result.spawnRequest == null) { return; } foreach (SoloBoss item in all) { if (Object.op_Implicit((Object)(object)item.card) && (Object)(object)result.spawnRequest.spawnCard == (Object)(object)item.card) { item.BoostHealth(result.spawnedInstance); break; } } }; } internal bool OverrideNextBoss(CombatDirector bossDirector, TeleporterInteraction teleporter) { if (!Load()) { return false; } float monsterCredit = bossDirector.monsterCredit; int num = 1 + teleporter.shrineBonusStacks + teleporter.hexBonusStacks; int num2 = Mathf.FloorToInt(monsterCredit / (float)num); ((SpawnCard)card).directorCreditCost = Mathf.Max(1, Mathf.Min(Mathf.Max(num2, usualCost), Mathf.FloorToInt(monsterCredit))); healthMultiplier = Mathf.Max(1f, (float)((SpawnCard)card).directorCreditCost / (float)usualCost); bossDirector.OverrideNextBossCard(directorCard, false); Log.Info($"Teleporter boss: {Name}, {Mathf.Max(1, Mathf.FloorToInt(monsterCredit / (float)((SpawnCard)card).directorCreditCost))} of them with x{healthMultiplier:0.00} health ({monsterCredit:0} credits, {num} share(s))."); return true; } private bool Load() { //IL_0016: Unknown result type (might be due to invalid IL or missing