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 MoreVieldsOptions v1.7.2
MoreVieldsOptions.dll
Decompiled 3 days agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BelmontMod.Content.Enemies; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using DireseekerMod.Modules; using EnemiesReturns.Enemies.Judgement.Arraign; using EnforcerPlugin; using EntityStates; using EntityStates.SolusVendor; using FRCSharp; using HG.Reflection; using LunarConstruct.Enemies; using MSU.Config; using Microsoft.CodeAnalysis; using MonoMod.RuntimeDetour; using MysticsRisky2Utils.BaseAssetTypes; using R2API; using ROOU; using RaindropLobotomy; using RoR2; using RoR2.ContentManagement; using RoR2.ExpansionManagement; using RoR2.Navigation; using RoR2.UI.LogBook; using RoR2BepInExPack.GameAssetPathsBetter; using SM64BBF; using SS2; using Sandswept; using SimulacrumAdditions; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; using UnityEngine.ResourceManagement.AsyncOperations; using VanillaArtifactsPlus; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: OptIn] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("MoreVieldsOptions")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("MoreVieldsOptions")] [assembly: AssemblyTitle("MoreVieldsOptions")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: UnverifiableCode] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [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 MoreVieldsOptions { internal static class BodyFixes { private static BodyIndex newtBodyIndex = (BodyIndex)(-1); private static BodyIndex spexBodyIndex = (BodyIndex)(-1); private static GameObject spexDeathEffect; public static void Init() { ((ResourceAvailability)(ref BodyCatalog.availability)).CallWhenAvailable((Action)delegate { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) newtBodyIndex = BodyCatalog.FindBodyIndex("ShopkeeperBody"); spexBodyIndex = BodyCatalog.FindBodyIndex("SolusVendorBody"); }); CharacterBody.onBodyAwakeGlobal += OnBodyAwake; CharacterBody.onBodyStartGlobal += OnBodyStart; GlobalEventManager.onCharacterDeathServer += OnCharacterDeath; } public static bool IsNewtOrSpex(CharacterBody body) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Invalid comparison between Unknown and I4 //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_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) return Object.op_Implicit((Object)(object)body) && (int)body.bodyIndex != -1 && (body.bodyIndex == newtBodyIndex || body.bodyIndex == spexBodyIndex); } public static void ApplyVoidFieldsStats(CharacterBody body) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) if ((int)body.bodyIndex != -1) { if (body.bodyIndex == newtBodyIndex) { body.baseMaxHealth = 2800f; body.levelMaxHealth = 840f; body.baseArmor = 20f; body.levelArmor = 0f; } else if (body.bodyIndex == spexBodyIndex) { body.baseMaxHealth = 900f; body.levelMaxHealth = 270f; body.baseRegen = 0f; body.levelRegen = 0f; body.baseArmor = 20f; body.levelArmor = 0f; } } } private static bool InVoidFields() { return (Object)(object)SceneCatalog.mostRecentSceneDef != (Object)null && SceneCatalog.mostRecentSceneDef.cachedName == "arena"; } private static void OnBodyAwake(CharacterBody body) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: 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_0073: 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_008d: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) if ((int)body.bodyIndex == -1 || !InVoidFields()) { return; } ApplyVoidFieldsStats(body); if (body.bodyIndex == newtBodyIndex) { EntityStateMachine val = EntityStateMachine.FindByCustomName(((Component)body).gameObject, "Body"); if (Object.op_Implicit((Object)(object)val)) { val.mainStateType = new SerializableEntityStateType(typeof(GenericCharacterMain)); } } else if (body.bodyIndex == spexBodyIndex) { body.bodyFlags = (BodyFlags)(body.bodyFlags & -8388609); if (NetworkServer.active && !Object.op_Implicit((Object)(object)((Component)body).GetComponent<DeathRewards>())) { ((Component)body).gameObject.AddComponent<DeathRewards>(); } } } private static void OnBodyStart(CharacterBody body) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 //IL_000b: 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) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: 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_008a: Unknown result type (might be due to invalid IL or missing references) if ((int)body.bodyIndex == -1 || (body.bodyIndex != newtBodyIndex && body.bodyIndex != spexBodyIndex) || !InVoidFields()) { return; } GenericSkill val = (Object.op_Implicit((Object)(object)body.skillLocator) ? body.skillLocator.special : null); if (Object.op_Implicit((Object)(object)val)) { val.OverrideMaxStock(0); val.stock = 0; val.cooldownScale = 1E+09f; } if (NetworkServer.active && body.bodyIndex == spexBodyIndex) { if (Object.op_Implicit((Object)(object)body.master)) { body.master.destroyOnBodyDeath = true; } SolusVendorController component = ((Component)body).GetComponent<SolusVendorController>(); if (Object.op_Implicit((Object)(object)component)) { component.WakeUp(); } } } private static void OnCharacterDeath(DamageReport report) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Invalid comparison between Unknown and I4 //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: 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_005b: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Expected O, but got Unknown CharacterBody victimBody = report.victimBody; if (NetworkServer.active && Object.op_Implicit((Object)(object)victimBody) && (int)victimBody.bodyIndex != -1 && victimBody.bodyIndex == spexBodyIndex && InVoidFields()) { if (!Object.op_Implicit((Object)(object)spexDeathEffect)) { spexDeathEffect = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Common_VFX.OmniExplosionVFXDroneDeath_prefab).WaitForCompletion(); } if (Object.op_Implicit((Object)(object)spexDeathEffect)) { EffectManager.SpawnEffect(spexDeathEffect, new EffectData { origin = victimBody.corePosition, scale = victimBody.radius }, true); } Object.Destroy((Object)(object)((Component)victimBody).gameObject); } } } internal sealed class Logbook : IContentPackProvider { private sealed class MonsterLog { public string BodyPrefabPath; public string BodyName; public string NameToken; public string LogToken; public string PortraitResource; public UnlockableDef Unlockable; public CharacterBody BodyPrefab; } private readonly ContentPack contentPack = new ContentPack(); private readonly List<MonsterLog> logs = new List<MonsterLog>(); private static Logbook instance; private static Hook statsPanelHook; private static Hook monsterEntriesHook; public string identifier => "com.phreel.MoreVieldsOptions"; public static void Init(bool newtEnabled, bool spexEnabled) { //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Expected O, but got Unknown //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Expected O, but got Unknown //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Expected O, but got Unknown Logbook logbook = new Logbook(); if (newtEnabled) { logbook.logs.Add(new MonsterLog { BodyPrefabPath = RoR2_Base_Shopkeeper.ShopkeeperBody_prefab, BodyName = "ShopkeeperBody", NameToken = "SHOPKEEPER_BODY_NAME", LogToken = "MVO_UNLOCKABLE_LOG_SHOPKEEPER" }); } if (spexEnabled) { logbook.logs.Add(new MonsterLog { BodyPrefabPath = RoR2_DLC3.SolusVendorBody_prefab, BodyName = "SolusVendorBody", NameToken = "SOLUS_VENDOR_BODY_NAME", LogToken = "MVO_UNLOCKABLE_LOG_SOLUSVENDOR", PortraitResource = "texSpexIcon.png" }); } if (logbook.logs.Count != 0) { instance = logbook; ContentManager.collectContentPackProviders += (CollectContentPackProvidersDelegate)delegate(AddContentPackProviderDelegate add) { add.Invoke((IContentPackProvider)(object)logbook); }; Language.onCurrentLanguageChanged += logbook.AddLanguageTokens; statsPanelHook = new Hook((MethodBase)typeof(PageBuilder).GetMethod("AddBodyStatsPanel"), (Delegate)new Action<Action<PageBuilder, CharacterBody>, PageBuilder, CharacterBody>(ShowVoidFieldsStats)); monsterEntriesHook = new Hook((MethodBase)typeof(LogBookController).GetMethod("BuildMonsterEntries", BindingFlags.Static | BindingFlags.NonPublic), (Delegate)new Func<Func<Dictionary<ExpansionDef, bool>, Entry[]>, Dictionary<ExpansionDef, bool>, Entry[]>(SortByVoidFieldsStats)); } } public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args) { List<UnlockableDef> unlockables = new List<UnlockableDef>(); foreach (MonsterLog log in logs) { AsyncOperationHandle<GameObject> handle = Addressables.LoadAssetAsync<GameObject>((object)log.BodyPrefabPath); while (!handle.IsDone) { yield return null; } GameObject bodyPrefab = handle.Result; if (!Object.op_Implicit((Object)(object)bodyPrefab)) { continue; } log.Unlockable = ScriptableObject.CreateInstance<UnlockableDef>(); log.Unlockable.cachedName = "Logs." + log.BodyName + ".0"; log.Unlockable.nameToken = log.LogToken; unlockables.Add(log.Unlockable); DeathRewards deathRewards = bodyPrefab.GetComponent<DeathRewards>(); if (!Object.op_Implicit((Object)(object)deathRewards)) { deathRewards = bodyPrefab.AddComponent<DeathRewards>(); } deathRewards.logUnlockableDef = log.Unlockable; log.BodyPrefab = bodyPrefab.GetComponent<CharacterBody>(); if (log.PortraitResource != null && Object.op_Implicit((Object)(object)log.BodyPrefab)) { Texture2D portrait = LoadEmbeddedTexture(log.PortraitResource); if (Object.op_Implicit((Object)(object)portrait)) { log.BodyPrefab.portraitIcon = (Texture)(object)portrait; } } } contentPack.unlockableDefs.Add(unlockables.ToArray()); args.ReportProgress(1f); } public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args) { ContentPack.Copy(contentPack, args.output); args.ReportProgress(1f); yield break; } public IEnumerator FinalizeAsync(FinalizeAsyncArgs args) { args.ReportProgress(1f); yield break; } private void AddLanguageTokens() { foreach (MonsterLog log in logs) { Language english = Language.english; if (english != null) { english.SetStringByToken(log.LogToken, "Monster Log: " + Language.english.GetLocalizedStringByToken(log.NameToken)); } Language currentLanguage = Language.currentLanguage; if (currentLanguage != null) { currentLanguage.SetStringByToken(log.LogToken, "Monster Log: " + Language.currentLanguage.GetLocalizedStringByToken(log.NameToken)); } } } private static Texture2D LoadEmbeddedTexture(string resourceName) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown using Stream stream = typeof(Logbook).Assembly.GetManifestResourceStream(resourceName); if (stream == null) { return null; } byte[] array = new byte[stream.Length]; stream.Read(array, 0, array.Length); Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false); ((Object)val).name = Path.GetFileNameWithoutExtension(resourceName); ((Texture)val).wrapMode = (TextureWrapMode)1; return ImageConversion.LoadImage(val, array) ? val : null; } private static void ShowVoidFieldsStats(Action<PageBuilder, CharacterBody> orig, PageBuilder self, CharacterBody body) { if (!BodyFixes.IsNewtOrSpex(body)) { orig(self, body); return; } WithVoidFieldsStats((CharacterBody[])(object)new CharacterBody[1] { body }, delegate { orig(self, body); }); } private static Entry[] SortByVoidFieldsStats(Func<Dictionary<ExpansionDef, bool>, Entry[]> orig, Dictionary<ExpansionDef, bool> expansionAvailability) { Entry[] entries = null; CharacterBody[] bodies = (from log in instance.logs select log.BodyPrefab into body where Object.op_Implicit((Object)(object)body) select body).ToArray(); WithVoidFieldsStats(bodies, delegate { entries = orig(expansionAvailability); }); return entries; } private static void WithVoidFieldsStats(CharacterBody[] bodies, Action action) { float[][] array = bodies.Select((CharacterBody val) => new float[6] { val.baseMaxHealth, val.levelMaxHealth, val.baseRegen, val.levelRegen, val.baseArmor, val.levelArmor }).ToArray(); try { foreach (CharacterBody body in bodies) { BodyFixes.ApplyVoidFieldsStats(body); } action(); } finally { for (int num2 = 0; num2 < bodies.Length; num2++) { bodies[num2].baseMaxHealth = array[num2][0]; bodies[num2].levelMaxHealth = array[num2][1]; bodies[num2].baseRegen = array[num2][2]; bodies[num2].levelRegen = array[num2][3]; bodies[num2].baseArmor = array[num2][4]; bodies[num2].levelArmor = array[num2][5]; } } } } internal static class MonsterList { public static List<VoidFieldsMonster> Build(ConfigFile config) { List<VoidFieldsMonster> list = new List<VoidFieldsMonster>(); Add("Base Game Enemies", BaseGame()); Add("Survivors of the Void", SurvivorsOfTheVoid()); Add("Seekers of the Storm", SeekersOfTheStorm()); Add("Alloyed Collective", AlloyedCollective()); Add("Hallowed Concepts", HallowedConcepts()); Add("Buggy or unused", BuggyOrUnused()); if (IsLoaded("prodzpod.RecoveredAndReformed") || IsLoaded("Phreel.RecoveredAndReformedStripped")) { Add("Recovered and Reformed", RecoveredAndReformed()); } if (IsLoaded("com.rob.Direseeker")) { Add("Direseeker", Direseeker()); } if (IsLoaded("PlasmaCore.ForgottenRelics")) { Add("Forgotten Relics", ForgottenRelics()); } if (IsLoaded("HIFU.LunarConstruct")) { Add("Lunar Construct", LunarConstructMod()); } if (IsLoaded("com.TeamMoonstorm") && IsLoaded("com.TeamMoonstorm.MSU")) { Add("Starstorm 2", Starstorm2()); } if (IsLoaded("com.TeamSandswept.Sandswept")) { Add("Sandswept", Sandswept()); } if (IsLoaded("com.viliger.SM64BBF")) { Add("Bob-omb Battlefield", BobombBattlefield()); } if (IsLoaded("BALLS.RaindropLobotomy")) { Add("Raindrop Lobotomy", RaindropLobotomy()); } if (IsLoaded("com.themysticsword.risingtides")) { Add("Rising Tides", RisingTides()); } if (IsLoaded("com.Wolfo.VanillaArtifactsPlus")) { Add("VanillaArtifactsPlus", VanillaArtifactsPlus()); } if (IsLoaded("com.themysticsword.elitevariety")) { Add("EliteVariety", EliteVariety()); } if (IsLoaded("com.EnforcerGang.Enforcer")) { Add("Enforcer", Enforcer()); } if (IsLoaded("Wolfo.SimulacrumAdditions")) { Add("SimulacrumAdditions", SimulacrumAdditions()); } if (IsLoaded("com.rob.Belmont")) { Add("Belmont", Belmont()); } if (IsLoaded("com.Viliger.EnemiesReturns")) { Add("Enemies Returns", EnemiesReturns()); } if (IsLoaded("pseudopulse.ROOU")) { Add("Risk of Overuse", RiskOfOveruse()); } return list; void Add(string configSection, VoidFieldsMonster[] monsters) { foreach (VoidFieldsMonster voidFieldsMonster in monsters) { voidFieldsMonster.BindConfig(config, configSection); list.Add(voidFieldsMonster); } } } private static bool IsLoaded(string guid) { return Chainloader.PluginInfos.ContainsKey(guid); } private static VoidFieldsMonster[] BaseGame() { return new VoidFieldsMonster[8] { new VoidFieldsMonster("Lunar Exploder", (MonsterCategory)2, () => SpawnCards.Vanilla(RoR2_Base_LunarExploder.cscLunarExploder_asset)) { EnableKey = "Add Lunar Chimera (Exploder)" }, new VoidFieldsMonster("Lunar Golem", (MonsterCategory)3, () => SpawnCards.Vanilla(RoR2_Base_LunarGolem.cscLunarGolem_asset)) { EnableKey = "Add Lunar Chimera (Golem)" }, new VoidFieldsMonster("Lunar Wisp", (MonsterCategory)3, () => SpawnCards.Vanilla(RoR2_Base_LunarWisp.cscLunarWisp_asset)) { EnableKey = "Add Lunar Chimera (Wisp)" }, new VoidFieldsMonster("Void Reaver", (MonsterCategory)3, () => SpawnCards.Vanilla(RoR2_Base_Nullifier.cscNullifier_asset)), new VoidFieldsMonster("Alloy Worship Unit", (MonsterCategory)4, () => SpawnCards.Vanilla(RoR2_Base_RoboBallBoss.cscSuperRoboBallBoss_asset)) { MinStage = 4 }, new VoidFieldsMonster("Aurelionite", (MonsterCategory)4, () => SpawnCards.Vanilla(RoR2_Base_Titan.cscTitanGold_asset)) { MinStage = 5 }, new VoidFieldsMonster("Lunar Scavenger", (MonsterCategory)4, () => SpawnCards.Vanilla(RoR2_Base_ScavLunar.cscScavLunar_asset)) { EnabledByDefault = false, MinStage = 7 }, new VoidFieldsMonster("Mithrix", (MonsterCategory)4, () => SpawnCards.Vanilla(RoR2_Base_Brother.cscBrother_asset)) { EnabledByDefault = false, MinStage = 8 } }; } private static VoidFieldsMonster[] SurvivorsOfTheVoid() { return new VoidFieldsMonster[6] { new VoidFieldsMonster("Voidling", (MonsterCategory)4, () => SpawnCards.Vanilla(RoR2_DLC1_VoidRaidCrab.cscMiniVoidRaidCrabPhase1_asset)) { EnabledByDefault = false, MinStage = 9 }, new VoidFieldsMonster("Void Barnacle", (MonsterCategory)2, () => SpawnCards.Vanilla(RoR2_DLC1_VoidBarnacle.cscVoidBarnacle_asset)), new VoidFieldsMonster("Void Jailer", (MonsterCategory)2, () => SpawnCards.Vanilla(RoR2_DLC1_VoidJailer.cscVoidJailer_asset)), new VoidFieldsMonster("Void Devastator", (MonsterCategory)4, () => SpawnCards.Vanilla(RoR2_DLC1_VoidMegaCrab.cscVoidMegaCrab_asset)), new VoidFieldsMonster("Void Infestor", (MonsterCategory)2, () => SpawnCards.Vanilla(RoR2_DLC1_EliteVoid.cscVoidInfestor_asset)), new VoidFieldsMonster("Healing Core", (MonsterCategory)2, () => (SpawnCard)(object)SpawnCards.Custom("cscMVOHealingCore", SpawnCards.VanillaPrefab(RoR2_DLC1_EliteEarth.AffixEarthHealerMaster_prefab), 15, (HullClassification)0, (GraphType)1)) { EnabledByDefault = false } }; } private static VoidFieldsMonster[] SeekersOfTheStorm() { return new VoidFieldsMonster[4] { new VoidFieldsMonster("Child", (MonsterCategory)2, () => SpawnCards.Vanilla(RoR2_DLC2_Child.cscChild_asset)), new VoidFieldsMonster("Scorch Wurm", (MonsterCategory)2, () => SpawnCards.Vanilla(RoR2_DLC2_Scorchling.cscScorchling_asset)), new VoidFieldsMonster("Halcyonite", (MonsterCategory)3, () => SpawnCards.Vanilla(RoR2_DLC2_Halcyonite.cscHalcyonite_asset)), new VoidFieldsMonster("False Son", (MonsterCategory)4, () => SpawnCards.Vanilla(RoR2_DLC2_FalseSonBoss.cscFalseSonBoss_asset)) { EnabledByDefault = false, MinStage = 8 } }; } private static VoidFieldsMonster[] AlloyedCollective() { return new VoidFieldsMonster[13] { new VoidFieldsMonster("Solus Prospector", (MonsterCategory)2, () => SpawnCards.Vanilla(RoR2_DLC3_WorkerUnit.cscWorkerUnit_asset)), new VoidFieldsMonster("Solus Scorcher", (MonsterCategory)2, () => SpawnCards.Vanilla(RoR2_DLC3_Tanker.cscTanker_asset)), new VoidFieldsMonster("Solus Extractor", (MonsterCategory)2, () => SpawnCards.Vanilla(RoR2_DLC3_ExtractorUnit.cscExtractorUnit_asset)), new VoidFieldsMonster("Solus Mine", (MonsterCategory)2, () => SpawnCards.Vanilla(RoR2_DLC3_SolusMine.cscSolusMine_asset)) { EnabledByDefault = false }, new VoidFieldsMonster("Solus Distributor", (MonsterCategory)2, () => SpawnCards.Vanilla(RoR2_DLC3_MinePod.cscMinePod_asset)), new VoidFieldsMonster("Solus Transporter", (MonsterCategory)3, () => SpawnCards.Vanilla(RoR2_DLC3_IronHauler.cscIronHauler_asset)), new VoidFieldsMonster("Solus Invalidator", (MonsterCategory)3, () => SpawnCards.Vanilla(RoR2_DLC3_DefectiveUnit.cscDefectiveUnit_asset)), new VoidFieldsMonster("Severed Scorcher", (MonsterCategory)2, () => SpawnCards.Vanilla(RoR2_DLC3_SolusAmalgamator.cscSolusAmalgamatorFlamethrowerCannon_asset)), new VoidFieldsMonster("Severed Breaker", (MonsterCategory)2, () => SpawnCards.Vanilla(RoR2_DLC3_SolusAmalgamator.cscSolusAmalgamatorMissilePod_asset)), new VoidFieldsMonster("Severed Probe", (MonsterCategory)2, () => SpawnCards.Vanilla(RoR2_DLC3_SolusAmalgamator.cscSolusAmalgamatorThruster_asset)), new VoidFieldsMonster("Solus Amalgamator", (MonsterCategory)4, () => SpawnCards.Vanilla(RoR2_DLC3_SolusAmalgamator.cscSolusAmalgamator_asset)), new VoidFieldsMonster("Alloy Hunter", (MonsterCategory)4, () => SpawnCards.Vanilla(RoR2_DLC3_VultureHunter.cscVultureHunter_asset)), new VoidFieldsMonster("Solus Wing", (MonsterCategory)4, () => SpawnCards.Vanilla(RoR2_DLC3_SolusWing.cscSolusWing_asset)) { EnabledByDefault = false, MinStage = 8 } }; } private static VoidFieldsMonster[] HallowedConcepts() { return new VoidFieldsMonster[11] { new VoidFieldsMonster("Lynx Deadeye", (MonsterCategory)2, () => SpawnCards.Vanilla(RoR2_DLC4_LynxArcher.cscLynxArcher_asset)), new VoidFieldsMonster("Lynx Assassin", (MonsterCategory)2, () => SpawnCards.Vanilla(RoR2_DLC4_LynxAmbusher.cscLynxAmbusher_asset)), new VoidFieldsMonster("Lynx Berserker", (MonsterCategory)2, () => SpawnCards.Vanilla(RoR2_DLC4_Lynx2.cscLynx2_asset)), new VoidFieldsMonster("Mimic", (MonsterCategory)3, () => SpawnCards.Vanilla(RoR2_DLC4_Mimic.cscMimic_asset)), new VoidFieldsMonster("Echo of Providence", (MonsterCategory)4, () => SpawnCards.Vanilla(RoR2_DLC4.cscProvidenceDesperation_asset)) { EnabledByDefault = false, MinStage = 8 }, new VoidFieldsMonster("Corroded Wurm", (MonsterCategory)4, () => SpawnCards.Vanilla(RoR2_DLC4.cscGildedWurmLaser_asset)) { EnabledByDefault = false, MinStage = 5 }, new VoidFieldsMonster("Anima Harvester", (MonsterCategory)4, () => SpawnCards.Vanilla(RoR2_DLC4_ReaperBoss.cscReaperBoss_asset)) { EnabledByDefault = false, MinStage = 5 }, new VoidFieldsMonster("Shruum", (MonsterCategory)4, () => SpawnCards.Vanilla(RoR2_DLC4_BigMush.cscBigMush_asset)), new VoidFieldsMonster("Lynx Totem", (MonsterCategory)4, () => SpawnCards.Vanilla(RoR2_DLC4_Totem.cscTotem_asset)), new VoidFieldsMonster("Mushling", (MonsterCategory)2, () => SpawnCards.Vanilla(RoR2_DLC4.cscPlantMush_asset)) { EnabledByDefault = false }, new VoidFieldsMonster("Swift", (MonsterCategory)3, () => SpawnCards.Vanilla(RoR2_DLC4_Swift.cscSwift_asset)) { EnabledByDefault = false } }; } private static VoidFieldsMonster[] BuggyOrUnused() { return new VoidFieldsMonster[4] { new VoidFieldsMonster("Malachite Urchin", (MonsterCategory)3, () => (SpawnCard)(object)SpawnCards.Custom("cscMVOMalachiteUrchin", SpawnCards.VanillaPrefab(RoR2_Base_ElitePoison.UrchinTurretMaster_prefab), 15, (HullClassification)0, (GraphType)1)) { EnabledByDefault = false }, new VoidFieldsMonster("Newt", (MonsterCategory)4, () => (SpawnCard)(object)SpawnCards.Custom("cscMVONewt", SpawnCards.VanillaPrefab(RoR2_Base_Shopkeeper.ShopkeeperMaster_prefab), 235, (HullClassification)1, (GraphType)0)) { EnabledByDefault = false }, new VoidFieldsMonster("SPEX", (MonsterCategory)4, () => (SpawnCard)(object)SpawnCards.Custom("cscMVOSPEX", SpawnCards.VanillaPrefab(RoR2_DLC3.SolusVendorMaster_prefab), 235, (HullClassification)1, (GraphType)0)) { EnabledByDefault = false }, new VoidFieldsMonster("Solus Heart", (MonsterCategory)4, () => SpawnCards.Vanilla(RoR2_DLC3_SolusHeart.cscSolusHeart_asset)) { EnabledByDefault = false, BlockedReason = "its fight is built around Neural Sanctum's arena (the grid floor, the lava and the boss mission), so it breaks anywhere else" } }; } [MethodImpl(MethodImplOptions.NoInlining)] private static VoidFieldsMonster[] RecoveredAndReformed() { return new VoidFieldsMonster[2] { new VoidFieldsMonster("Iota Construct", (MonsterCategory)4, () => SpawnCards.Vanilla(RoR2_DLC1_MajorAndMinorConstruct.cscMajorConstruct_asset)), new VoidFieldsMonster("Assassin", (MonsterCategory)2, () => SpawnCards.Vanilla(RoR2_DLC1_Assassin2.cscAssassin2_asset)) }; } [MethodImpl(MethodImplOptions.NoInlining)] private static VoidFieldsMonster[] Direseeker() { return new VoidFieldsMonster[1] { new VoidFieldsMonster("Direseeker", (MonsterCategory)4, () => (SpawnCard)(object)SpawnCards.bossSpawnCard) { MinStage = 4 } }; } [MethodImpl(MethodImplOptions.NoInlining)] private static VoidFieldsMonster[] ForgottenRelics() { return new VoidFieldsMonster[4] { new VoidFieldsMonster("Brass Monolith", (MonsterCategory)4, () => (SpawnCard)(object)VF2ContentPackProvider.cscBrassMonolith), new VoidFieldsMonster("Frost Wisp", (MonsterCategory)3, () => (SpawnCard)(object)VF2ContentPackProvider.cscFrostWisp), new VoidFieldsMonster("Coil Golem", (MonsterCategory)3, () => (SpawnCard)(object)VF2ContentPackProvider.cscCoilGolem), new VoidFieldsMonster("Sanctum Wisp", (MonsterCategory)3, () => (SpawnCard)(object)VF2ContentPackProvider.cscSanctumWisp) }; } [MethodImpl(MethodImplOptions.NoInlining)] private static VoidFieldsMonster[] LunarConstructMod() { return new VoidFieldsMonster[1] { new VoidFieldsMonster("Lunar Construct", (MonsterCategory)2, () => (SpawnCard)(object)((EnemyBase)EnemyBase<LunarConstruct>.Instance).isc) { EnableKey = "Add Lunar Chimera (Construct)" } }; } [MethodImpl(MethodImplOptions.NoInlining)] private static VoidFieldsMonster[] Starstorm2() { return new VoidFieldsMonster[5] { new VoidFieldsMonster("Rushrum", (MonsterCategory)2, () => SS2Assets.LoadAsset<SpawnCard>("scRunshroom", (SS2Bundle)17)), new VoidFieldsMonster("Follower", (MonsterCategory)2, () => SS2Assets.LoadAsset<SpawnCard>("scLamp", (SS2Bundle)17)), new VoidFieldsMonster("Wayfarer", (MonsterCategory)4, () => SS2Assets.LoadAsset<SpawnCard>("scLampBoss", (SS2Bundle)17)), new VoidFieldsMonster("Security Chest", (MonsterCategory)3, () => SS2Assets.LoadAsset<SpawnCard>("scMimic", (SS2Bundle)17)), new VoidFieldsMonster("Clay Monger", (MonsterCategory)3, () => (SpawnCard)(object)(((ConfiguredVariable<bool>)(object)SS2Config.enableBeta).value ? SpawnCards.Custom("cscMVOClayMonger", SS2Assets.LoadAsset<GameObject>("ClayMongerMaster", (SS2Bundle)15), 45, (HullClassification)0, (GraphType)1) : null)) }; } [MethodImpl(MethodImplOptions.NoInlining)] private static VoidFieldsMonster[] Sandswept() { return new VoidFieldsMonster[4] { new VoidFieldsMonster("Cannonball Jellyfish", (MonsterCategory)2, () => (SpawnCard)(object)SpawnCards.Custom("cscMVOCannonballJellyfish", Main.assets.LoadAsset<GameObject>("CannonJellyMaster.prefab"), 30, (HullClassification)0, (GraphType)1)), new VoidFieldsMonster("Gamma Construct", (MonsterCategory)2, () => (SpawnCard)(object)SpawnCards.Custom("cscMVOGammaConstruct", Main.assets.LoadAsset<GameObject>("GammaConstructMaster.prefab"), 40, (HullClassification)0, (GraphType)1)), new VoidFieldsMonster("Delta Construct", (MonsterCategory)2, () => (SpawnCard)(object)SpawnCards.Custom("cscMVODeltaConstruct", Main.assets.LoadAsset<GameObject>("DeltaConstructMaster.prefab"), 45, (HullClassification)0, (GraphType)1)), new VoidFieldsMonster("Theta Construct", (MonsterCategory)3, () => (SpawnCard)(object)SpawnCards.Custom("cscMVOThetaConstruct", Main.assets.LoadAsset<GameObject>("ThetaConstructMaster.prefab"), 55, (HullClassification)1, (GraphType)1)) }; } [MethodImpl(MethodImplOptions.NoInlining)] private static VoidFieldsMonster[] BobombBattlefield() { return new VoidFieldsMonster[1] { new VoidFieldsMonster("King Bobomb", (MonsterCategory)4, () => (SpawnCard)(object)CharacterSpawnCards.cscKingBobomb) }; } [MethodImpl(MethodImplOptions.NoInlining)] private static VoidFieldsMonster[] RaindropLobotomy() { return new VoidFieldsMonster[6] { new VoidFieldsMonster("Steam Transport Machine", (MonsterCategory)4, () => (SpawnCard)(object)Main.MainAssets.LoadAsset<CharacterSpawnCard>("cscSteamMachine.asset")), new VoidFieldsMonster("Singing Machine", (MonsterCategory)3, () => (SpawnCard)(object)Main.MainAssets.LoadAsset<CharacterSpawnCard>("cscSingingMachine.asset")), new VoidFieldsMonster("Fragment of the Universe", (MonsterCategory)3, () => (SpawnCard)(object)Main.MainAssets.LoadAsset<CharacterSpawnCard>("cscFragment.asset")), new VoidFieldsMonster("A Sweeper", (MonsterCategory)3, () => (SpawnCard)(object)Main.MainAssets.LoadAsset<CharacterSpawnCard>("cscSweeper.asset")), new VoidFieldsMonster("Process of Understanding", (MonsterCategory)3, () => (SpawnCard)(object)Main.MainAssets.LoadAsset<CharacterSpawnCard>("cscGreenNoon.asset")), new VoidFieldsMonster("Four Hundred Roses", (MonsterCategory)4, () => (SpawnCard)(object)Main.MainAssets.LoadAsset<CharacterSpawnCard>("cscFHR.asset")) }; } [MethodImpl(MethodImplOptions.NoInlining)] private static VoidFieldsMonster[] RisingTides() { return new VoidFieldsMonster[1] { new VoidFieldsMonster("Mother Mushrum", (MonsterCategory)3, () => (SpawnCard)(object)BaseCharacterMaster.characterSpawnCards["RisingTides_MushSupporter"]) }; } [MethodImpl(MethodImplOptions.NoInlining)] private static VoidFieldsMonster[] VanillaArtifactsPlus() { return new VoidFieldsMonster[3] { new VoidFieldsMonster("Lesser Soul", (MonsterCategory)2, () => (SpawnCard)(object)SpawnCards.Custom("cscMVOLesserSoul", Soul.SoulLesserWispMaster, 15, (HullClassification)0, (GraphType)1)), new VoidFieldsMonster("Greater Soul", (MonsterCategory)3, () => (SpawnCard)(object)SpawnCards.Custom("cscMVOGreaterSoul", Soul.SoulGreaterWispMaster, 200, (HullClassification)1, (GraphType)1)), new VoidFieldsMonster("Archaic Soul", (MonsterCategory)3, () => (SpawnCard)(object)SpawnCards.Custom("cscMVOAbundantSoul", Soul.SoulLunarWispMaster, 240, (HullClassification)1, (GraphType)1)) }; } [MethodImpl(MethodImplOptions.NoInlining)] private static VoidFieldsMonster[] EliteVariety() { return new VoidFieldsMonster[1] { new VoidFieldsMonster("Tinkerers Drone", (MonsterCategory)2, () => (SpawnCard)(object)BaseCharacterMaster.characterSpawnCards["EliteVariety_TinkererDrone"]) }; } [MethodImpl(MethodImplOptions.NoInlining)] private static VoidFieldsMonster[] Enforcer() { return new VoidFieldsMonster[1] { new VoidFieldsMonster("Nemesis Enforcer", (MonsterCategory)4, () => (SpawnCard)(object)SpawnCards.Custom("cscMVONemforcer", NemforcerPlugin.bossMaster, 400, (HullClassification)0, (GraphType)1)) { EnabledByDefault = false, MinStage = 3 } }; } [MethodImpl(MethodImplOptions.NoInlining)] private static VoidFieldsMonster[] SimulacrumAdditions() { return new VoidFieldsMonster[2] { new VoidFieldsMonster("Deepend Void Devastator", (MonsterCategory)4, () => (SpawnCard)(object)SpawnCards.Custom("cscMVODeependVoidDevastator", SuperMegaCrab.SuperCrabMaster, SpawnCards.Vanilla(RoR2_DLC1_VoidMegaCrab.cscVoidMegaCrab_asset).directorCreditCost, (HullClassification)2, (GraphType)0)) { EnabledByDefault = false, MinStage = 10 }, new VoidFieldsMonster("Guap", (MonsterCategory)4, () => (SpawnCard)(object)SpawnCards.Custom("cscMVOGuap", GiantGup.GiantMaster, SpawnCards.Vanilla(RoR2_DLC1_VoidMegaCrab.cscVoidMegaCrab_asset).directorCreditCost, (HullClassification)2, (GraphType)0)) { EnabledByDefault = false, MinStage = 10 } }; } [MethodImpl(MethodImplOptions.NoInlining)] private static VoidFieldsMonster[] Belmont() { return new VoidFieldsMonster[2] { new VoidFieldsMonster("Gargoyle", (MonsterCategory)2, () => (SpawnCard)(object)Gargoyle.characterSpawnCard), new VoidFieldsMonster("Blue Fang", (MonsterCategory)4, () => (SpawnCard)(object)GreatGargoyle.characterSpawnCard) }; } [MethodImpl(MethodImplOptions.NoInlining)] private static VoidFieldsMonster[] EnemiesReturns() { return new VoidFieldsMonster[1] { new VoidFieldsMonster("Arraign", (MonsterCategory)3, () => (SpawnCard)(object)ArraignBody.cscArraignP1) { EnabledByDefault = false, MinStage = 10 } }; } [MethodImpl(MethodImplOptions.NoInlining)] private static VoidFieldsMonster[] RiskOfOveruse() { return new VoidFieldsMonster[3] { new VoidFieldsMonster("Toxapex", (MonsterCategory)3, () => (SpawnCard)(object)SpawnCards.Custom("cscMVOToxapex", ROOU.Load<GameObject>("ToxapexMaster.prefab"), 160, (HullClassification)1, (GraphType)0)), new VoidFieldsMonster("Kingambit", (MonsterCategory)3, () => (SpawnCard)(object)SpawnCards.Custom("cscMVOKingambit", ROOU.Load<GameObject>("KingambitMaster.prefab"), 250, (HullClassification)1, (GraphType)0)), new VoidFieldsMonster("Clodsire", (MonsterCategory)3, () => (SpawnCard)(object)SpawnCards.Custom("cscMVOClodsire", ROOU.Load<GameObject>("ClodsireMaster.prefab"), 140, (HullClassification)1, (GraphType)0)) }; } } [BepInPlugin("com.phreel.MoreVieldsOptions", "MoreVieldsOptions", "1.7.2")] [BepInDependency("com.bepis.r2api", "5.3.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class MoreVieldsOptions : BaseUnityPlugin { private ConfigEntry<bool> enableLogging; private List<VoidFieldsMonster> monsters; public void Awake() { enableLogging = ((BaseUnityPlugin)this).Config.Bind<bool>("Enable logging", "Do you want to see what enemies got added in the console?", false, "Enables BepInEx logging for registered enemies."); monsters = MonsterList.Build(((BaseUnityPlugin)this).Config); LogInfo("Found monsters from: " + string.Join(", ", monsters.Select((VoidFieldsMonster m) => m.Section).Distinct())); RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(AddMonstersToVoidFields)); BodyFixes.Init(); Logbook.Init(monsters.Any((VoidFieldsMonster m) => m.Name == "Newt" && m.Enabled.Value), monsters.Any((VoidFieldsMonster m) => m.Name == "SPEX" && m.Enabled.Value)); } private void AddMonstersToVoidFields() { //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Expected O, but got Unknown //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Expected O, but got Unknown foreach (VoidFieldsMonster monster in monsters) { if (!monster.Enabled.Value) { continue; } if (monster.BlockedReason != null) { ((BaseUnityPlugin)this).Logger.LogWarning((object)(monster.Name + " is turned on in the config, but it can't be added to Void Fields: " + monster.BlockedReason + ".")); continue; } SpawnCard spawnCard; try { spawnCard = monster.LoadSpawnCard(); } catch (Exception arg) { ((BaseUnityPlugin)this).Logger.LogError((object)$"Couldn't load {monster.Name}, so it won't be added to Void Fields. Its mod may have changed.\n{arg}"); continue; } if ((Object)(object)spawnCard == (Object)null) { LogInfo(monster.Name + " isn't available right now, so it won't be added to Void Fields."); continue; } DirectorCardHolder val = new DirectorCardHolder { Card = new DirectorCard { spawnCard = spawnCard, selectionWeight = 1, minimumStageCompletions = monster.MinimumStageCompletions.Value }, MonsterCategory = monster.Category }; Helpers.AddNewMonsterToStage(val, false, (Predicate<DirectorCardCategorySelection>)((DirectorCardCategorySelection dccs) => !AlreadyInSpawnPool(dccs, spawnCard, monster.Name)), (Stage)4096, ""); LogInfo(monster.Name + " was successfully added to Void Fields"); } } private bool AlreadyInSpawnPool(DirectorCardCategorySelection dccs, SpawnCard spawnCard, string monsterName) { //IL_0033: 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_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)dccs == (Object)null || dccs.categories == null) { return false; } Category[] categories = dccs.categories; foreach (Category val in categories) { if (val.cards == null) { continue; } DirectorCard[] cards = val.cards; for (int j = 0; j < cards.Length; j++) { SpawnCard val2 = cards[j]?.spawnCard; if (!((Object)(object)val2 == (Object)null) && ((Object)(object)val2 == (Object)(object)spawnCard || ((Object)(object)val2.prefab != (Object)null && (Object)(object)val2.prefab == (Object)(object)spawnCard.prefab))) { LogInfo("Skipped " + monsterName + " in " + ((Object)dccs).name + ": it's already in Void Fields' spawn pool (as " + ((Object)val2).name + ")"); return true; } } } return false; } private void LogInfo(string message) { if (enableLogging.Value) { ((BaseUnityPlugin)this).Logger.LogInfo((object)message); } } } internal sealed class VoidFieldsMonster { public readonly string Name; public readonly MonsterCategory Category; public readonly Func<SpawnCard> LoadSpawnCard; public bool EnabledByDefault = true; public int MinStage = 0; public string EnableKey; public string BlockedReason; public string Section { get; private set; } public ConfigEntry<bool> Enabled { get; private set; } public ConfigEntry<int> MinimumStageCompletions { get; private set; } public VoidFieldsMonster(string name, MonsterCategory category, Func<SpawnCard> loadSpawnCard) { //IL_001e: 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) Name = name; Category = category; LoadSpawnCard = loadSpawnCard; } public void BindConfig(ConfigFile config, string section) { Section = section; Enabled = config.Bind<bool>(section, EnableKey ?? ("Add " + Name), EnabledByDefault, "Allow the user to find this monster in Void Fields."); MinimumStageCompletions = config.Bind<int>(section, Name + " Minimum Stage Completions", MinStage, "Set the minimum stage completions required for " + Name + " to spawn in Void Fields."); } } internal static class SpawnCards { public static SpawnCard Vanilla(string path) { //IL_0002: 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) return Addressables.LoadAssetAsync<SpawnCard>((object)path).WaitForCompletion(); } public static GameObject VanillaPrefab(string path) { //IL_0002: 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) return Addressables.LoadAssetAsync<GameObject>((object)path).WaitForCompletion(); } public static CharacterSpawnCard Custom(string name, GameObject masterPrefab, int cost, HullClassification hull = (HullClassification)0, GraphType graph = (GraphType)1) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: 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_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Expected O, but got Unknown if ((Object)(object)masterPrefab == (Object)null) { return null; } CharacterSpawnCard val = ScriptableObject.CreateInstance<CharacterSpawnCard>(); ((Object)val).name = name; ((SpawnCard)val).prefab = masterPrefab; ((SpawnCard)val).sendOverNetwork = true; ((SpawnCard)val).hullSize = hull; ((SpawnCard)val).nodeGraphType = graph; ((SpawnCard)val).requiredFlags = (NodeFlags)0; ((SpawnCard)val).forbiddenFlags = (NodeFlags)2; ((SpawnCard)val).directorCreditCost = cost; ((SpawnCard)val).occupyPosition = false; val.loadout = new SerializableLoadout(); val.noElites = false; val.forbiddenAsBoss = false; return val; } } }