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 BazaarExpansionFix v1.0.1
BazaarExpansion-Release-CauldronFixed.dll
Decompiled a day agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using Microsoft.CodeAnalysis; using On.RoR2; using RoR2; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; using UnityEngine.ResourceManagement.AsyncOperations; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")] [assembly: AssemblyCompany("BazaarExpansion-Release")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+3b7603e16e8fe61559c0af926133d9160f7b75c7")] [assembly: AssemblyProduct("BazaarExpansion-Release")] [assembly: AssemblyTitle("BazaarExpansion-Release")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.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 BazaarExpand { [BepInPlugin("com.Susciety.BazaarExpand", "BazaarExpand", "1.0.0")] public class BazaarExpand : BaseUnityPlugin { internal class PrinterInfo { public Vector3 position; public Vector3 rotation; } public static ConfigEntry<bool> cfgPot; public static ConfigEntry<bool> cfgScrapper; public static ConfigEntry<bool> cfgChest; public static ConfigEntry<bool> cfgEnableCadulron; public static ConfigEntry<bool> cfgGtoW; public static ConfigEntry<int> cfgAmountTraded; private static SpawnCard goldChestCard; private static SpawnCard shrineCleanseCard; private static SpawnCard scrapperCard; private static GameObject lunarCauldronPrefab; private static bool assetsLoadingStarted; private static bool assetsLoaded; private static bool spawnedOnce; public void Awake() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Expected O, but got Unknown ConfigFile val = new ConfigFile(Paths.ConfigPath + "\\BazaarExpand.cfg", true); cfgChest = val.Bind<bool>("General", "Enable Golden Chest", true, "If enabled, spawn a Golden Chest in the bazaar."); cfgPot = val.Bind<bool>("General", "Enable CleanPot", true, "If enabled, spawn a Cleansing Pool in the bazaar."); cfgScrapper = val.Bind<bool>("General", "Enable Scrapper", true, "If enabled, spawn a Scrapper in the bazaar."); cfgEnableCadulron = val.Bind<bool>("Lunar Cauldron", "Enable Reforge Cauldron", true, "If enabled, spawn a Special Cauldron in the bazaar."); cfgGtoW = val.Bind<bool>("Lunar Cauldron", "GreenToWhite", true, "If enabled, Green Items reforge into 3 White Items instead of a red item."); cfgAmountTraded = val.Bind<int>("Lunar Cauldron", "Items Amount Needed", 2, "Set the number of items needed to reforge."); if (!assetsLoadingStarted) { assetsLoadingStarted = true; ((MonoBehaviour)this).StartCoroutine(PreloadAssetsParallel()); } BazaarController.Start += new hook_Start(BazaarController_Start); } private void BazaarController_Start(orig_Start orig, BazaarController self) { orig.Invoke(self); if (assetsLoaded) { TrySpawnOnce(); } else { ((MonoBehaviour)this).StartCoroutine(SpawnWhenReady()); } } private IEnumerator PreloadAssetsParallel() { List<AsyncOperationHandle> handles = new List<AsyncOperationHandle>(); AsyncOperationHandle<SpawnCard> hGold = default(AsyncOperationHandle<SpawnCard>); AsyncOperationHandle<SpawnCard> hCleanse = default(AsyncOperationHandle<SpawnCard>); AsyncOperationHandle<SpawnCard> hScrapper = default(AsyncOperationHandle<SpawnCard>); AsyncOperationHandle<GameObject> hCauldron = default(AsyncOperationHandle<GameObject>); if (cfgChest.Value) { hGold = Addressables.LoadAssetAsync<SpawnCard>((object)"RoR2/Base/GoldChest/iscGoldChest.asset"); handles.Add(AsyncOperationHandle<SpawnCard>.op_Implicit(hGold)); } if (cfgPot.Value) { hCleanse = Addressables.LoadAssetAsync<SpawnCard>((object)"RoR2/Base/ShrineCleanse/iscShrineCleanse.asset"); handles.Add(AsyncOperationHandle<SpawnCard>.op_Implicit(hCleanse)); } if (cfgScrapper.Value) { hScrapper = Addressables.LoadAssetAsync<SpawnCard>((object)"RoR2/Base/Scrapper/iscScrapper.asset"); handles.Add(AsyncOperationHandle<SpawnCard>.op_Implicit(hScrapper)); } if (cfgEnableCadulron.Value) { hCauldron = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/LunarCauldrons/LunarCauldron, RedToWhite Variant.prefab"); handles.Add(AsyncOperationHandle<GameObject>.op_Implicit(hCauldron)); } yield return (object)new WaitUntil((Func<bool>)delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < handles.Count; i++) { AsyncOperationHandle val = handles[i]; if (!((AsyncOperationHandle)(ref val)).IsDone) { return false; } } return true; }); if (cfgChest.Value && (int)hGold.Status == 1) { goldChestCard = hGold.Result; } if (cfgPot.Value && (int)hCleanse.Status == 1) { shrineCleanseCard = hCleanse.Result; } if (cfgScrapper.Value && (int)hScrapper.Status == 1) { scrapperCard = hScrapper.Result; } if (cfgEnableCadulron.Value && (int)hCauldron.Status == 1) { lunarCauldronPrefab = hCauldron.Result; } assetsLoaded = true; } private IEnumerator SpawnWhenReady() { yield return (object)new WaitUntil((Func<bool>)(() => assetsLoaded)); TrySpawnOnce(); } private void TrySpawnOnce() { if (!spawnedOnce && !((Object)(object)Run.instance == (Object)null) && NetworkServer.active) { SpawnExpand(); } } private void SpawnExpand() { //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_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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_008a: 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_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_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Expected O, but got Unknown //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0176: 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_0188: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Expected O, but got Unknown //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_02ee: Expected O, but got Unknown //IL_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_03b9: Unknown result type (might be due to invalid IL or missing references) //IL_0399: Unknown result type (might be due to invalid IL or missing references) PrinterInfo printerInfo = new PrinterInfo { position = new Vector3(-87.1f, -24f, -7.2f), rotation = new Vector3(0f, 72.6f, 0f) }; PrinterInfo printerInfo2 = new PrinterInfo { position = new Vector3(-65.7f, -23.5f, -18.9f), rotation = new Vector3(0f, 72.6f, 0f) }; PrinterInfo printerInfo3 = new PrinterInfo { position = new Vector3(-82.1f, -23.7f, -5.2f), rotation = new Vector3(0f, 72.6f, 0f) }; PrinterInfo printerInfo4 = new PrinterInfo { position = new Vector3(-132f, -25f, -29.7f), rotation = new Vector3(0f, 72.6f, 0f) }; ArtifactDef val = ArtifactCatalog.FindArtifactDef("Sacrifice"); bool flag = false; if (Object.op_Implicit((Object)(object)RunArtifactManager.instance) && RunArtifactManager.instance.IsArtifactEnabled(val)) { RunArtifactManager.instance.SetArtifactEnabledServer(val, false); flag = true; } DirectorPlacementRule val2 = new DirectorPlacementRule { placementMode = (PlacementMode)0 }; if (cfgChest.Value && (Object)(object)goldChestCard != (Object)null) { DirectorSpawnRequest val3 = new DirectorSpawnRequest(goldChestCard, val2, Run.instance.runRNG); GameObject spawnedInstance = goldChestCard.DoSpawn(printerInfo.position, Quaternion.identity, val3).spawnedInstance; if (Object.op_Implicit((Object)(object)spawnedInstance)) { PurchaseInteraction component = spawnedInstance.GetComponent<PurchaseInteraction>(); if (Object.op_Implicit((Object)(object)component)) { component.Networkcost = 1; component.costType = (CostTypeIndex)8; } ChestBehavior component2 = spawnedInstance.GetComponent<ChestBehavior>(); if (Object.op_Implicit((Object)(object)component2)) { component2.tier1Chance = 0f; component2.tier2Chance = 0f; component2.tier3Chance = 1f; component2.lunarChance = 0f; } spawnedInstance.transform.eulerAngles = printerInfo.rotation; NetworkServer.Spawn(spawnedInstance); } } if (cfgPot.Value && (Object)(object)shrineCleanseCard != (Object)null) { DirectorSpawnRequest val4 = new DirectorSpawnRequest(shrineCleanseCard, val2, Run.instance.runRNG); GameObject spawnedInstance2 = shrineCleanseCard.DoSpawn(printerInfo2.position, Quaternion.identity, val4).spawnedInstance; if (Object.op_Implicit((Object)(object)spawnedInstance2)) { spawnedInstance2.transform.eulerAngles = printerInfo2.rotation; NetworkServer.Spawn(spawnedInstance2); } } if (cfgScrapper.Value && (Object)(object)scrapperCard != (Object)null) { DirectorSpawnRequest val5 = new DirectorSpawnRequest(scrapperCard, val2, Run.instance.runRNG); GameObject spawnedInstance3 = scrapperCard.DoSpawn(printerInfo3.position, Quaternion.identity, val5).spawnedInstance; if (Object.op_Implicit((Object)(object)spawnedInstance3)) { spawnedInstance3.transform.eulerAngles = printerInfo3.rotation; NetworkServer.Spawn(spawnedInstance3); } } if (cfgEnableCadulron.Value && (Object)(object)lunarCauldronPrefab != (Object)null) { GameObject val6 = Object.Instantiate<GameObject>(lunarCauldronPrefab, printerInfo4.position, Quaternion.identity); PurchaseInteraction component3 = val6.GetComponent<PurchaseInteraction>(); if (Object.op_Implicit((Object)(object)component3)) { if (cfgGtoW.Value) { component3.costType = (CostTypeIndex)5; } component3.Networkcost = cfgAmountTraded.Value; } val6.transform.eulerAngles = printerInfo4.rotation; NetworkServer.Spawn(val6); } if (flag && Object.op_Implicit((Object)(object)RunArtifactManager.instance)) { RunArtifactManager.instance.SetArtifactEnabledServer(val, true); } } } }