Decompiled source of ShrineOfRepair v2.0.1
plugins/viliger-ShrineOfRepair/ShrineOfRepair.dll
Decompiled 2 weeks ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using BubbetsItems; using HG; using HG.Reflection; using On.RoR2; using On.RoR2.Items; using R2API; using RiskOfOptions; using RiskOfOptions.OptionConfigs; using RiskOfOptions.Options; using RoR2; using RoR2.ContentManagement; using RoR2.Hologram; using RoR2.Items; using RoR2.Navigation; using RoR2.UI; using ShrineOfRepair.Behaviours; using ShrineOfRepair.ModCompat; using ShrineOfRepair.Modules; using ShrineOfRepairRewrite.Behaviours; using TMPro; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: OptIn] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("ShrineOfRepair")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("ShrineOfRepair")] [assembly: AssemblyTitle("ShrineOfRepair")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace ShrineOfRepair { public class ContentProvider : IContentPackProvider { private readonly ContentPack _contentPack = new ContentPack(); public const string AssetBundleName = "shrinerepair"; public const string AssetBundleFolder = "AssetBundles"; public static Dictionary<string, Material> MaterialCache = new Dictionary<string, Material>(); public static readonly Dictionary<string, string> ShaderLookup = new Dictionary<string, string> { { "stubbedror2/base/shaders/hgstandard", "RoR2/Base/Shaders/HGStandard.shader" }, { "stubbedror2/base/shaders/hgsnowtopped", "RoR2/Base/Shaders/HGSnowTopped.shader" }, { "stubbedror2/base/shaders/hgtriplanarterrainblend", "RoR2/Base/Shaders/HGTriplanarTerrainBlend.shader" }, { "stubbedror2/base/shaders/hgintersectioncloudremap", "RoR2/Base/Shaders/HGIntersectionCloudRemap.shader" }, { "stubbedror2/base/shaders/hgcloudremap", "RoR2/Base/Shaders/HGCloudRemap.shader" }, { "stubbedror2/base/shaders/hgopaquecloudremap", "RoR2/Base/Shaders/HGOpaqueCloudRemap.shader" }, { "stubbedror2/base/shaders/hgdistortion", "RoR2/Base/Shaders/HGDistortion.shader" }, { "stubbedcalm water/calmwater - dx11 - doublesided", "Calm Water/CalmWater - DX11 - DoubleSided.shader" }, { "stubbedcalm water/calmwater - dx11", "Calm Water/CalmWater - DX11.shader" }, { "stubbednature/speedtree", "RoR2/Base/Shaders/SpeedTreeCustom.shader" }, { "stubbeddecalicious/decaliciousdeferreddecal", "Decalicious/DecaliciousDeferredDecal.shader" }, { "stubbedror2/base/shaders/hgdamagenumber", "RoR2/Base/Shaders/HGDamageNumber.shader" }, { "stubbedror2/base/shaders/hguianimatealpha", "RoR2/Base/Shaders/HGUIAnimateAlpha.shader" } }; public string identifier => "com.Viliger.ShrineOfRepair.ContentProvider"; public IEnumerator FinalizeAsync(FinalizeAsyncArgs args) { args.ReportProgress(1f); yield break; } public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args) { ContentPack.Copy(_contentPack, args.output); args.ReportProgress(1f); yield break; } public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args) { _contentPack.identifier = identifier; string path = Path.Combine(Path.GetDirectoryName(typeof(ContentProvider).Assembly.Location), "AssetBundles"); AssetBundle assetbundle = null; yield return LoadAssetBundle(Path.Combine(path, "shrinerepair"), args.progressReceiver, delegate(AssetBundle resultAssetBundle) { assetbundle = resultAssetBundle; }); yield return LoadAllAssetsAsync<Sprite>(assetbundle, args.progressReceiver, (Action<Sprite[]>)delegate(Sprite[] assets) { if (RiskOfOptionsCompat.enabled) { RiskOfOptionsCompat.SetIcon(assets.First((Sprite asset) => ((Object)asset).name == "texRiskOfOptionsIcon")); } }); yield return LoadAllAssetsAsync<Material>(assetbundle, args.progressReceiver, (Action<Material[]>)delegate(Material[] assets) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) if (assets != null) { Material[] array = assets; foreach (Material val4 in array) { Shader val5 = Addressables.LoadAssetAsync<Shader>((object)ShaderLookup[((Object)val4.shader).name.ToLower()]).WaitForCompletion(); if (Object.op_Implicit((Object)(object)val5)) { val4.shader = val5; } else { Log.Info("Couldn't find replacement shader for " + ((Object)val4.shader).name.ToLower()); } MaterialCache.Add(((Object)val4).name, val4); } } }); yield return LoadAllAssetsAsync<GameObject>(assetbundle, args.progressReceiver, (Action<GameObject[]>)delegate(GameObject[] assets) { //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Expected O, but got Unknown //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) GameObject prefab = assets.First((GameObject assets) => ((Object)assets).name == "ShrineRepairGood"); GameObject prefab2 = assets.First((GameObject assets) => ((Object)assets).name == "ShrineRepairGood_snowy"); GameObject prefab3 = assets.First((GameObject assets) => ((Object)assets).name == "ShrineRepairGood_sandy"); if (ShrineOfRepairConfigManager.UseBadModel.Value) { prefab = assets.First((GameObject assets) => ((Object)assets).name == "ShrineRepair"); prefab2 = assets.First((GameObject assets) => ((Object)assets).name == "ShrineRepair"); prefab3 = assets.First((GameObject assets) => ((Object)assets).name == "ShrineRepair"); } ShrineOfRepairStuff shrineOfRepairStuff = new ShrineOfRepairStuff(); if (ShrineOfRepairConfigManager.UsePickupPickerPanel.Value) { prefab = shrineOfRepairStuff.CreateShrineOfRepairPickerPrefab(prefab); prefab2 = shrineOfRepairStuff.CreateShrineOfRepairPickerPrefab(prefab2); prefab3 = shrineOfRepairStuff.CreateShrineOfRepairPickerPrefab(prefab3); } else { prefab = shrineOfRepairStuff.CreateShrineOfRepairPurchasePrefab(prefab); prefab2 = shrineOfRepairStuff.CreateShrineOfRepairPurchasePrefab(prefab2); prefab3 = shrineOfRepairStuff.CreateShrineOfRepairPurchasePrefab(prefab3); } DirectorCardHolder val = shrineOfRepairStuff.CreateCardHolder(prefab, "ShrineOfRepair"); DirectorCardHolder val2 = shrineOfRepairStuff.CreateCardHolder(prefab2, "ShrineOfRepairSnowy"); DirectorCardHolder val3 = shrineOfRepairStuff.CreateCardHolder(prefab3, "ShrineOfRepairSandy"); ShrineOfRepairStuff.normalShrineSpawnCard = (InteractableSpawnCard)val.Card.spawnCard; foreach (Stage normalStage in shrineOfRepairStuff.GetNormalStageList()) { Helpers.AddNewInteractableToStage(val, normalStage, ""); } foreach (Stage sandyStage in shrineOfRepairStuff.GetSandyStageList()) { Helpers.AddNewInteractableToStage(val3, sandyStage, ""); } foreach (Stage snowyStage in shrineOfRepairStuff.GetSnowyStageList()) { Helpers.AddNewInteractableToStage(val2, snowyStage, ""); } _contentPack.networkedObjectPrefabs.Add((GameObject[])(object)new GameObject[3] { prefab, prefab3, prefab2 }); }); } private IEnumerator LoadAssetBundle(string assetBundleFullPath, IProgress<float> progress, Action<AssetBundle> onAssetBundleLoaded) { AssetBundleCreateRequest assetBundleCreateRequest = AssetBundle.LoadFromFileAsync(assetBundleFullPath); while (!((AsyncOperation)assetBundleCreateRequest).isDone) { progress.Report(((AsyncOperation)assetBundleCreateRequest).progress); yield return null; } onAssetBundleLoaded(assetBundleCreateRequest.assetBundle); } private static IEnumerator LoadAllAssetsAsync<T>(AssetBundle assetBundle, IProgress<float> progress, Action<T[]> onAssetsLoaded) where T : Object { AssetBundleRequest sceneDefsRequest = assetBundle.LoadAllAssetsAsync<T>(); while (!((AsyncOperation)sceneDefsRequest).isDone) { progress.Report(((AsyncOperation)sceneDefsRequest).progress); yield return null; } onAssetsLoaded(sceneDefsRequest.allAssets.Cast<T>().ToArray()); } } internal static class Log { private static ManualLogSource _logSource; internal static void Init(ManualLogSource logSource) { _logSource = logSource; } internal static void Debug(object data) { _logSource.LogDebug(data); } internal static void Error(object data) { _logSource.LogError(data); } internal static void Fatal(object data) { _logSource.LogFatal(data); } internal static void Info(object data) { _logSource.LogInfo(data); } internal static void Message(object data) { _logSource.LogMessage(data); } internal static void Warning(object data) { _logSource.LogWarning(data); } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.Viliger.ShrineOfRepair", "ShrineOfRepair", "2.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class ShrineOfRepairPlugin : BaseUnityPlugin { public const string Author = "Viliger"; public const string ModName = "ShrineOfRepair"; public const string Version = "2.0.0"; public const string GUID = "com.Viliger.ShrineOfRepair"; public const string LanguageFolder = "Language"; private void Awake() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown Log.Init(((BaseUnityPlugin)this).Logger); new ShrineOfRepairConfigManager().Init(Paths.ConfigPath); ShrineOfRepairStuff.Hooks(); ShrineOfRepairDictionary.Hooks(); ContentManager.collectContentPackProviders += new CollectContentPackProvidersDelegate(ContentManager_collectContentPackProviders); Language.collectLanguageRootFolders += Language_collectLanguageRootFolders; } private void Language_collectLanguageRootFolders(List<string> folders) { folders.Add(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "Language")); } private void ContentManager_collectContentPackProviders(AddContentPackProviderDelegate addContentPackProvider) { addContentPackProvider.Invoke((IContentPackProvider)(object)new ContentProvider()); } } public class ShrineOfRepairStuff { public enum CostTypes { Gold, VoidCoin, LunarCoin } public static InteractableSpawnCard normalShrineSpawnCard; public static void Hooks() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown SceneDirector.onPostPopulateSceneServer += SceneDirector_onPostPopulateSceneServer; Stage.onServerStageBegin += Stage_onServerStageBegin; PurchaseInteraction.GetInteractability += new hook_GetInteractability(PurchaseInteraction_GetInteractability); PickupPickerController.GetInteractability += new hook_GetInteractability(PickupPickerController_GetInteractability); } private static Interactability PickupPickerController_GetInteractability(orig_GetInteractability orig, PickupPickerController self, Interactor activator) { //IL_00d7: 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_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) if (((Object)self).name.Contains("ShrineRepair") && Object.op_Implicit((Object)(object)activator)) { CharacterBody component = ((Component)activator).GetComponent<CharacterBody>(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.master)) { bool flag = false; foreach (KeyValuePair<ItemIndex, ItemIndex> item in ShrineOfRepairDictionary.RepairItemsDictionary) { if (component.inventory.GetItemCount(item.Key) > 0) { flag = true; } } foreach (KeyValuePair<EquipmentIndex, EquipmentIndex> item2 in ShrineOfRepairDictionary.RepairEquipmentsDictionary) { if (component.equipmentSlot.equipmentIndex == item2.Key) { flag = true; } } if (!flag) { return (Interactability)1; } } } return orig.Invoke(self, activator); } private static Interactability PurchaseInteraction_GetInteractability(orig_GetInteractability orig, PurchaseInteraction self, Interactor activator) { //IL_00a4: 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_008e: Unknown result type (might be due to invalid IL or missing references) if (self.displayNameToken == "INTERACTABLE_SHRINE_REPAIR_NAME" && Object.op_Implicit((Object)(object)activator)) { CharacterBody component = ((Component)activator).GetComponent<CharacterBody>(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.master)) { bool flag = false; foreach (KeyValuePair<ItemIndex, ItemIndex> item in ShrineOfRepairDictionary.RepairItemsDictionary) { if (component.inventory.GetItemCount(item.Key) > 0) { flag = true; } } if (ShrineOfRepairDictionary.RepairEquipmentsDictionary.ContainsKey(component.equipmentSlot.equipmentIndex)) { flag = true; } if (!flag) { return (Interactability)1; } } } return orig.Invoke(self, activator); } private static void Stage_onServerStageBegin(Stage stage) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) if (!(stage.sceneDef.cachedName != "bazaar") && ShrineOfRepairConfigManager.SpawnInBazaar.Value) { SpawnShrine(ShrineOfRepairConfigManager.BazaarPosition.Value, ShrineOfRepairConfigManager.BazaarAngle.Value); } } private static void SceneDirector_onPostPopulateSceneServer(SceneDirector obj) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: 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_0061: Unknown result type (might be due to invalid IL or missing references) if (ShrineOfRepairConfigManager.SpawnInMoon.Value) { if ((Object)(object)SceneCatalog.GetSceneDefForCurrentScene() == (Object)(object)SceneCatalog.GetSceneDefFromSceneName("moon")) { SpawnShrine(ShrineOfRepairConfigManager.MoonPosition.Value, ShrineOfRepairConfigManager.MoonAngle.Value); } else if ((Object)(object)SceneCatalog.GetSceneDefForCurrentScene() == (Object)(object)SceneCatalog.GetSceneDefFromSceneName("moon2")) { SpawnShrine(ShrineOfRepairConfigManager.Moon2Position.Value, ShrineOfRepairConfigManager.Moon2Angle.Value); } } } protected static void SpawnShrine(Vector3 position, Vector3 angle) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_0010: 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_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_003a: Expected O, but got Unknown //IL_0035: 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) if (NetworkServer.active) { DirectorPlacementRule val = new DirectorPlacementRule(); val.placementMode = (PlacementMode)0; GameObject spawnedInstance = ((SpawnCard)normalShrineSpawnCard).DoSpawn(position, Quaternion.identity, new DirectorSpawnRequest((SpawnCard)(object)normalShrineSpawnCard, val, Run.instance.runRNG)).spawnedInstance; spawnedInstance.transform.eulerAngles = angle; NetworkServer.Spawn(spawnedInstance); } } public GameObject CreateShrineOfRepairPickerPrefab(GameObject prefab) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: 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_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: 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_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Expected O, but got Unknown prefab = CreateShrineOfRepairPrefabInternal(prefab); Transform iconTransform = prefab.transform.Find("Symbol"); prefab.AddComponent<NetworkUIPromptController>(); ShrineOfRepairPickerManager shrineOfRepairPickerManager = prefab.AddComponent<ShrineOfRepairPickerManager>(); shrineOfRepairPickerManager.iconTransform = iconTransform; PickupPickerController val = prefab.AddComponent<PickupPickerController>(); val.panelPrefab = CreateRepairPickerPanel(); val.onPickupSelected = new PickupIndexUnityEvent(); ((UnityEvent<int>)(object)val.onPickupSelected).AddPersistentListener(shrineOfRepairPickerManager.HandleSelection); val.onServerInteractionBegin = new InteractorUnityEvent(); ((UnityEvent<Interactor>)(object)val.onServerInteractionBegin).AddPersistentListener(shrineOfRepairPickerManager.HandleInteraction); val.cutoffDistance = 10f; val.contextString = "INTERACTABLE_SHRINE_REPAIR_CONTEXT"; shrineOfRepairPickerManager.pickerController = val; InspectDef val2 = ScriptableObject.CreateInstance<InspectDef>(); ((Object)val2).name = "idShrineOfRepair"; val2.Info = new InspectInfo { Visual = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/Common/MiscIcons/texShrineIconOutlined.png").WaitForCompletion(), TitleToken = "INTERACTABLE_SHRINE_REPAIR_NAME", DescriptionToken = "INTERACTABLE_SHRINE_REPAIR_DESCRIPTION_PICKER", FlavorToken = "INTERACTABLE_SHRINE_REPAIR_LORE", TitleColor = Color.white, isConsumedItem = false }; prefab.AddComponent<GenericInspectInfoProvider>().InspectInfo = val2; return prefab; } public GameObject CreateShrineOfRepairPurchasePrefab(GameObject prefab) { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0137: 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) //IL_014d: Expected O, but got Unknown prefab = CreateShrineOfRepairPrefabInternal(prefab); HologramProjector obj = prefab.AddComponent<HologramProjector>(); obj.hologramPivot = prefab.transform.Find("HologramPivot"); obj.displayDistance = 10f; obj.disableHologramRotation = false; PurchaseInteraction val = prefab.AddComponent<PurchaseInteraction>(); val.displayNameToken = "INTERACTABLE_SHRINE_REPAIR_NAME"; val.contextToken = "INTERACTABLE_SHRINE_REPAIR_CONTEXT"; val.costType = GetCostTypeFromConfig(ShrineOfRepairConfigManager.PurchaseInteractionCurrencyType.Value); val.automaticallyScaleCostWithDifficulty = ShrineOfRepairConfigManager.PurchaseInteractionCurrencyType.Value == CostTypes.Gold && ShrineOfRepairConfigManager.PurchaseInteractionGoldUseDefaultScaling.Value; val.cost = GetCostValueFromConfig(ShrineOfRepairConfigManager.PurchaseInteractionCurrencyType.Value); val.available = true; val.setUnavailableOnTeleporterActivated = false; val.isShrine = true; val.isGoldShrine = false; ShrineOfRepairPurchaseManager shrineOfRepairPurchaseManager = prefab.AddComponent<ShrineOfRepairPurchaseManager>(); shrineOfRepairPurchaseManager.PurchaseInteraction = val; shrineOfRepairPurchaseManager.ScalingModifier = ShrineOfRepairConfigManager.PurchaseInteractionGoldScalingModifier.Value; shrineOfRepairPurchaseManager.UseDefaultScaling = ShrineOfRepairConfigManager.PurchaseInteractionGoldUseDefaultScaling.Value; InspectDef val2 = ScriptableObject.CreateInstance<InspectDef>(); ((Object)val2).name = "idShrineOfRepair"; val2.Info = new InspectInfo { Visual = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/Common/MiscIcons/texShrineIconOutlined.png").WaitForCompletion(), TitleToken = "INTERACTABLE_SHRINE_REPAIR_NAME", DescriptionToken = "INTERACTABLE_SHRINE_REPAIR_DESCRIPTION_PURCHASE", FlavorToken = "INTERACTABLE_SHRINE_REPAIR_LORE", TitleColor = Color.white, isConsumedItem = false }; prefab.AddComponent<GenericInspectInfoProvider>().InspectInfo = val2; return prefab; } private GameObject CreateRepairPickerPanel() { //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) GameObject obj = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Scrapper/ScrapperPickerPanel.prefab").WaitForCompletion(), "RepairPickerPanel", false); Transform val = obj.transform.Find("MainPanel/Juice/Label"); if ((Object)(object)val != (Object)null) { LanguageTextMeshController component = ((Component)val).GetComponent<LanguageTextMeshController>(); if ((Object)(object)component != (Object)null) { component.token = "INTERACTABLE_SHRINE_REPAIR_PICKERPANEL_HEADER"; } } ScrapperInfoPanelHelper component2 = obj.GetComponent<ScrapperInfoPanelHelper>(); RepairInforPanelHelper repairInforPanelHelper = obj.AddComponent<RepairInforPanelHelper>(); repairInforPanelHelper.inspectPanelController = component2.inspectPanelController; repairInforPanelHelper.correspondingScrapImage = component2.correspondingScrapImage; Object.DestroyImmediate((Object)(object)component2); PickupPickerPanel component3 = obj.GetComponent<PickupPickerPanel>(); ((UnityEvent<MPButton, PickupDef>)(object)component3.pickupSelected).AddPersistentListener(repairInforPanelHelper.ShowInfo); ((UnityEvent<MPButton, PickupDef>)(object)component3.pickupBaseContentReady).AddPersistentListener(repairInforPanelHelper.AddQuantityToPickerButton); repairInforPanelHelper.panel = component3; return obj; } private GameObject CreateShrineOfRepairPrefabInternal(GameObject prefab) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) Transform val = prefab.transform.Find("Base/mdlRepairShrine"); Transform obj = prefab.transform.Find("Symbol"); prefab.AddComponent<NetworkIdentity>(); Highlight obj2 = prefab.AddComponent<Highlight>(); obj2.targetRenderer = ((Component)val).GetComponent<Renderer>(); obj2.strength = 1f; obj2.highlightColor = (HighlightColor)0; ModelLocator obj3 = prefab.AddComponent<ModelLocator>(); obj3.modelTransform = val; obj3.modelBaseTransform = prefab.transform.Find("Base"); obj3.autoUpdateModelTransform = true; obj3.dontDetatchFromParent = true; obj3.noCorpse = false; obj3.dontReleaseModelOnDeath = false; obj3.preserveModel = false; obj3.normalizeToFloor = false; prefab.AddComponent<GenericDisplayNameProvider>().displayToken = "INTERACTABLE_SHRINE_REPAIR_NAME"; ((Component)val).gameObject.AddComponent<EntityLocator>().entity = prefab; ((Component)obj).gameObject.AddComponent<Billboard>(); MeshRenderer component = ((Component)obj).gameObject.GetComponent<MeshRenderer>(); if (!ContentProvider.MaterialCache.TryGetValue("matShrineRepairSymbolCopy", out var value)) { value = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/ShrineBoss/matShrineBossSymbol.mat").WaitForCompletion()); ((Object)value).name = "matShrineRepairSymbolCopy"; value.mainTexture = ((Renderer)component).material.mainTexture; value.SetColor("_TintColor", ((Renderer)component).material.GetColor("_TintColor")); ContentProvider.MaterialCache.Add(((Object)value).name, value); } ((Renderer)component).material = value; DitherModel obj4 = prefab.AddComponent<DitherModel>(); obj4.bounds = ((Component)val).gameObject.GetComponent<Collider>(); obj4.renderers = prefab.GetComponentsInChildren<Renderer>(); PrefabAPI.RegisterNetworkPrefab(prefab); return prefab; } public DirectorCardHolder CreateCardHolder(GameObject prefab, string name) { //IL_0027: 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_0035: 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_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0084: 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_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Expected O, but got Unknown InteractableSpawnCard val = ScriptableObject.CreateInstance<InteractableSpawnCard>(); ((Object)val).name = "isc" + name; ((SpawnCard)val).prefab = prefab; ((SpawnCard)val).sendOverNetwork = true; ((SpawnCard)val).hullSize = (HullClassification)1; ((SpawnCard)val).nodeGraphType = (GraphType)0; ((SpawnCard)val).requiredFlags = (NodeFlags)0; ((SpawnCard)val).forbiddenFlags = (NodeFlags)16; ((SpawnCard)val).directorCreditCost = ShrineOfRepairConfigManager.DirectorCost.Value; ((SpawnCard)val).occupyPosition = true; val.orientToFloor = false; val.skipSpawnWhenSacrificeArtifactEnabled = false; DirectorCard card = new DirectorCard { selectionWeight = ShrineOfRepairConfigManager.DirectorWeight.Value, spawnCard = (SpawnCard)(object)val }; return new DirectorCardHolder { Card = card, InteractableCategory = ShrineOfRepairConfigManager.DirectorCategory.Value }; } public List<Stage> GetNormalStageList() { return new List<Stage> { (Stage)4, (Stage)128, (Stage)2, (Stage)131072, (Stage)256, (Stage)16384, (Stage)134217728, (Stage)64, (Stage)262144, (Stage)1048576, (Stage)4194304, (Stage)33554432, (Stage)524288 }; } public List<Stage> GetSnowyStageList() { return new List<Stage> { (Stage)67108864, (Stage)32, (Stage)2097152 }; } public List<Stage> GetSandyStageList() { return new List<Stage> { (Stage)16, (Stage)8388608 }; } private CostTypeIndex GetCostTypeFromConfig(CostTypes currency) { switch (currency) { case CostTypes.LunarCoin: if (ShrineOfRepairConfigManager.PurchaseInteractionLunarCoinCost.Value != 0) { return (CostTypeIndex)3; } return (CostTypeIndex)0; case CostTypes.VoidCoin: if (ShrineOfRepairConfigManager.PurchaseInteractionVoidCoinCost.Value != 0) { return (CostTypeIndex)14; } return (CostTypeIndex)0; default: if (ShrineOfRepairConfigManager.PurchaseInteractionGoldBaseCost.Value != 0) { return (CostTypeIndex)1; } return (CostTypeIndex)0; } } private int GetCostValueFromConfig(CostTypes currency) { return currency switch { CostTypes.LunarCoin => ShrineOfRepairConfigManager.PurchaseInteractionLunarCoinCost.Value, CostTypes.VoidCoin => ShrineOfRepairConfigManager.PurchaseInteractionVoidCoinCost.Value, _ => ShrineOfRepairConfigManager.PurchaseInteractionGoldBaseCost.Value, }; } } public static class Utils { public static void AddPersistentListener(this UnityEvent<MPButton, PickupDef> unityEvent, UnityAction<MPButton, PickupDef> action) { //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_001c: 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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown ((UnityEventBase)unityEvent).m_PersistentCalls.AddListener(new PersistentCall { m_Target = (Object)/*isinst with value type is only supported in some contexts*/, m_TargetAssemblyTypeName = UnityEventTools.TidyAssemblyTypeName(((Delegate)(object)action).Method.DeclaringType.AssemblyQualifiedName), m_MethodName = ((Delegate)(object)action).Method.Name, m_CallState = (UnityEventCallState)2, m_Mode = (PersistentListenerMode)0 }); } public static void AddPersistentListener(this UnityEvent<int> unityEvent, UnityAction<int> action) { //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_001c: 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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown ((UnityEventBase)unityEvent).m_PersistentCalls.AddListener(new PersistentCall { m_Target = (Object)/*isinst with value type is only supported in some contexts*/, m_TargetAssemblyTypeName = UnityEventTools.TidyAssemblyTypeName(((Delegate)(object)action).Method.DeclaringType.AssemblyQualifiedName), m_MethodName = ((Delegate)(object)action).Method.Name, m_CallState = (UnityEventCallState)2, m_Mode = (PersistentListenerMode)0 }); } public static void AddPersistentListener(this UnityEvent<Interactor> unityEvent, UnityAction<Interactor> action) { //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_001c: 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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown ((UnityEventBase)unityEvent).m_PersistentCalls.AddListener(new PersistentCall { m_Target = (Object)/*isinst with value type is only supported in some contexts*/, m_TargetAssemblyTypeName = UnityEventTools.TidyAssemblyTypeName(((Delegate)(object)action).Method.DeclaringType.AssemblyQualifiedName), m_MethodName = ((Delegate)(object)action).Method.Name, m_CallState = (UnityEventCallState)2, m_Mode = (PersistentListenerMode)0 }); } } } namespace ShrineOfRepair.Modules { public class ModExtension { public delegate void DictionaryFillItemsDelegate(); public delegate void DictionaryFillEquipmentDelegate(); private struct RepairableItemsNew { public ItemIndex brokenItem; public ItemIndex repairedItem; public string modName; } private struct RepairableEquipment { public EquipmentIndex brokenEquipment; public EquipmentIndex repairedEquipment; public string modName; } [Obsolete("Depricated, please use RepairableItemsNew")] public class RepairableItems { public ItemIndex brokenItem; public ItemIndex repairedItem; } [Obsolete("Deprecated, plese use DictionaryFillItemsDelegate or DictionaryFillEquipmentDelegate")] public delegate void DictionaryFillDelegate(ref List<RepairableItems> list); private static DictionaryFillItemsDelegate fillItemsDictionaryHandler; private static DictionaryFillEquipmentDelegate fillEquipmentDictionaryHandler; private static List<RepairableItemsNew> ModdedItemsListNew = new List<RepairableItemsNew>(); private static List<RepairableEquipment> ModdedEquipmentList = new List<RepairableEquipment>(); [Obsolete("Depricated, please use fillItemsDictionaryHandler or fillEquipmentDictionaryHandler")] public static DictionaryFillDelegate fillDictionaryHandler; [Obsolete("Depricated, please use ModdedItemsListNew or ModdedEquipmentList")] private static List<RepairableItems> ModdedItemsList = new List<RepairableItems>(); public static void AddItemsListener(DictionaryFillItemsDelegate callback) { fillItemsDictionaryHandler = (DictionaryFillItemsDelegate)Delegate.Combine(fillItemsDictionaryHandler, callback); Log.Info($"Added {callback.Method} to fillItemsDictionaryHandler"); } public static void AddItemsToList(ItemIndex brokentItem, ItemIndex repairedItem, string modName) { //IL_000f: 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_0017: 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) ModdedItemsListNew.Add(new RepairableItemsNew { brokenItem = brokentItem, repairedItem = repairedItem, modName = modName }); } public static void AddEquipmentListener(DictionaryFillEquipmentDelegate callback) { fillEquipmentDictionaryHandler = (DictionaryFillEquipmentDelegate)Delegate.Combine(fillEquipmentDictionaryHandler, callback); Log.Info($"Added {callback.Method} to fillEquipmentDictionaryHandler"); } public static void AddEquipmentToList(EquipmentIndex brokenEquipment, EquipmentIndex repairedEquipment, string modName) { //IL_000f: 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_0017: 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) ModdedEquipmentList.Add(new RepairableEquipment { brokenEquipment = brokenEquipment, repairedEquipment = repairedEquipment, modName = modName }); } internal static Dictionary<ItemIndex, ItemIndex> FillItemDictionaryFromMods(Dictionary<ItemIndex, ItemIndex> dictionary) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0047: 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_006e: Unknown result type (might be due to invalid IL or missing references) if (ModdedItemsListNew.Count == 0) { fillItemsDictionaryHandler?.Invoke(); } foreach (RepairableItemsNew item in ModdedItemsListNew) { if (!dictionary.ContainsKey(item.brokenItem)) { dictionary.Add(item.brokenItem, item.repairedItem); ItemDef itemDef = ItemCatalog.GetItemDef(item.brokenItem); string arg = ((itemDef != null) ? ((Object)itemDef).name : null); ItemDef itemDef2 = ItemCatalog.GetItemDef(item.repairedItem); Log.Info($"Added item repairs from {arg} to {((itemDef2 != null) ? ((Object)itemDef2).name : null)} from mod {item.modName}."); } } return dictionary; } internal static Dictionary<EquipmentIndex, EquipmentIndex> FillEquipmentDictionaryFromMods(Dictionary<EquipmentIndex, EquipmentIndex> dictionary) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0047: 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_006e: Unknown result type (might be due to invalid IL or missing references) if (ModdedEquipmentList.Count == 0) { fillEquipmentDictionaryHandler?.Invoke(); } foreach (RepairableEquipment moddedEquipment in ModdedEquipmentList) { if (!dictionary.ContainsKey(moddedEquipment.brokenEquipment)) { dictionary.Add(moddedEquipment.brokenEquipment, moddedEquipment.repairedEquipment); EquipmentDef equipmentDef = EquipmentCatalog.GetEquipmentDef(moddedEquipment.brokenEquipment); string arg = ((equipmentDef != null) ? ((Object)equipmentDef).name : null); EquipmentDef equipmentDef2 = EquipmentCatalog.GetEquipmentDef(moddedEquipment.repairedEquipment); Log.Info($"Added equipment repairs from {arg} to {((equipmentDef2 != null) ? ((Object)equipmentDef2).name : null)} from mod {moddedEquipment.modName}."); } } return dictionary; } [Obsolete("Depricated, please use AddItemsListener or AddEquipmentListener")] public static void AddListener(DictionaryFillDelegate callback) { fillDictionaryHandler = (DictionaryFillDelegate)Delegate.Combine(fillDictionaryHandler, callback); Log.Info($"Added {callback.Method} to dictionaryFillHandler"); } [Obsolete("Deprecated, only used for compatability with older versions.")] public static Dictionary<ItemIndex, ItemIndex> FillDictionaryFromMods(Dictionary<ItemIndex, ItemIndex> dictionary) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) if (ModdedItemsList.Count == 0) { fillDictionaryHandler?.Invoke(ref ModdedItemsList); } foreach (RepairableItems moddedItems in ModdedItemsList) { if (!dictionary.ContainsKey(moddedItems.brokenItem)) { dictionary.Add(moddedItems.brokenItem, moddedItems.repairedItem); ItemDef itemDef = ItemCatalog.GetItemDef(moddedItems.brokenItem); Log.Info($"Added repairs from {((itemDef != null) ? ((Object)itemDef).name : null)} to {((Object)ItemCatalog.GetItemDef(moddedItems.repairedItem)).name} from a mod."); } } return dictionary; } } public class ShrineOfRepairConfigManager { public static ConfigEntry<int> DirectorCost; public static ConfigEntry<int> DirectorWeight; public static ConfigEntry<InteractableCategory> DirectorCategory; public static ConfigEntry<bool> UseBadModel; public static ConfigEntry<string> RepairList; public static ConfigEntry<bool> UsePickupPickerPanel; public static ConfigEntry<bool> SpawnInBazaar; public static ConfigEntry<bool> SpawnInMoon; public static ConfigEntry<bool> UseLunarInMoon; public static ConfigEntry<int> MaxUses; public static ConfigEntry<Vector3> BazaarPosition; public static ConfigEntry<Vector3> BazaarAngle; public static ConfigEntry<Vector3> MoonPosition; public static ConfigEntry<Vector3> MoonAngle; public static ConfigEntry<Vector3> Moon2Position; public static ConfigEntry<Vector3> Moon2Angle; public static ConfigEntry<bool> RepairVoidItems; public static ConfigEntry<ShrineOfRepairStuff.CostTypes> PurchaseInteractionCurrencyType; public static ConfigEntry<int> PurchaseInteractionLunarCoinCost; public static ConfigEntry<int> PurchaseInteractionVoidCoinCost; public static ConfigEntry<int> PurchaseInteractionGoldBaseCost; public static ConfigEntry<bool> PurchaseInteractionGoldUseDefaultScaling; public static ConfigEntry<float> PurchaseInteractionGoldScalingModifier; public static ConfigEntry<int> PickerPanelGoldTier1Cost; public static ConfigEntry<int> PickerPanelGoldTier2Cost; public static ConfigEntry<int> PickerPanelGoldTier3Cost; public static ConfigEntry<int> PickerPanelGoldBossCost; public static ConfigEntry<int> PickerPanelGoldLunarCost; public static ConfigEntry<int> PickerPanelGoldEquipCost; public static ConfigEntry<bool> BazaarUseLunar; public static ConfigEntry<float> BazaarLunarMultiplier; public static ConfigEntry<bool> PickerUseLunarByDefault; public static ConfigEntry<bool> PickerShowFree; public void Init(string configPath) { //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) //IL_002c: 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_0063: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: 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_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0263: 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_0299: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_02d0: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Unknown result type (might be due to invalid IL or missing references) //IL_0336: Unknown result type (might be due to invalid IL or missing references) //IL_0352: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_03a9: Unknown result type (might be due to invalid IL or missing references) //IL_03c5: Unknown result type (might be due to invalid IL or missing references) //IL_03e0: Unknown result type (might be due to invalid IL or missing references) //IL_03ff: Unknown result type (might be due to invalid IL or missing references) ConfigFile val = new ConfigFile(Path.Combine(configPath, "viliger-ShrineOfRepair-General.cfg"), true); UseBadModel = val.Bind<bool>("Model", "Use Shitty Model", false, "Use shitty model that I made myself. If you want to see what bad modeling by bad programmer looks like - be my guest. I made it, so might as well put it here."); DirectorCost = val.Bind<int>("Director", "Director Cost", 20, "Cost of the shrine in director credits. By defeult equal to the cost of most shrines."); DirectorWeight = val.Bind<int>("Director", "Director Weight", 1, "Weight of the shrine for director. The lower the value, the more rare the shrine is. By default has the same weight as Shrine of Order, the only difference is that it can spawn anywhere."); DirectorCategory = val.Bind<InteractableCategory>("Director", "Director Category", (InteractableCategory)4, "Category of interactable. If you change this, then you should also change Director Cost and Director Weight, as default values for those are balanced around it being spawned as a shrine."); RepairList = val.Bind<string>("RepairList", "Repair List", "ExtraLifeConsumed - ExtraLife, ExtraLifeVoidConsumed - ExtraLifeVoid, FragileDamageBonusConsumed - FragileDamageBonus, HealingPotionConsumed - HealingPotion, RegeneratingScrapConsumed - RegeneratingScrap, BossHunterConsumed - BossHunter, LowerPricedChestsConsumed - LowerPricedChests, TeleportOnLowHealthConsumed - TeleportOnLowHealth, HealAndReviveConsumed - HealAndRevive", "Main Repair List, by default filled with pairs of breakable-original vanilla items, can be used to create custom pairs of brokenItem - repairedItem, including those from mods. Syntax: (broken) - (new), delimiter: ','"); UsePickupPickerPanel = val.Bind<bool>("Interactable Type", "Use Scrapper-like variation", true, "Use scrapper-like variant, with separate cost for each broken item and ability to select what you want to repair. Scrapper-like variant only works with gold. Setting this to false will return the mod to its pre 1.2.0 function. Each variant has its own config file, AllInOne for pre-1.2.0 version and PerItem for newer."); MaxUses = val.Bind<int>("General", "Max Uses", 1, "Amount of times a single shrine can repair before deactivating. Set to 0 for infinite."); UseLunarInMoon = val.Bind<bool>("General", "Use Lunar Coins in Moon", false, "Make the Commencement shrine act like Bazaar shrine."); SpawnInBazaar = val.Bind<bool>("Bazaar", "Spawn Shrine in Bazaar", false, "Spawn the shrine in the Bazaar Between Time."); BazaarPosition = val.Bind<Vector3>("Bazaar", "Shrine Position in Bazaar", new Vector3(-139.5f, -25.5f, -19.9f), "Position of the shrine in the Bazaar Between Time"); BazaarAngle = val.Bind<Vector3>("Bazaar", "Shrine Angle in Bazaar", new Vector3(0f, 0f, 0f), "Angle (rotation) of the shrine in the Bazaar Between Time"); SpawnInMoon = val.Bind<bool>("Commencement", "Spawn Shrine in Moon", true, "Spawn the shrine in Commencement."); MoonPosition = val.Bind<Vector3>("Commencement", "Shrine Position in Commencement (pre-Aniversary)", new Vector3(749.4f, 253f, -244.3f), "Position of the shrine in Commencement (pre-Aniversary)"); MoonAngle = val.Bind<Vector3>("Commencement", "Shrine Angle in Commencement (pre-Aniversary)", new Vector3(0f, 143.2f, 0f), "Angle (rotation) of the shrine in Commencement (pre-Aniversary)"); Moon2Position = val.Bind<Vector3>("Commencement", "Shrine Position in Commencement", new Vector3(-3.9f, -150.6f, -331.2f), "Position of the shrine in Commencement"); Moon2Angle = val.Bind<Vector3>("Commencement", "Shrine Angle in Commencement", new Vector3(-70f, 164f, 0f), "Angle (rotation) of the shrine in Commencement"); RepairVoidItems = val.Bind<bool>("Void Items", "Repair Void Items", true, "Enables the ability to repair void items back into their normal versions. If void item has multiple normal versions then it is skipped (like VoidRing or VoidBossItem). Items are filled dynamically from list of contagious items, so you don't need to fill the dictionary manually like with other breakable items."); ConfigFile val2 = new ConfigFile(Path.Combine(configPath, "viliger-ShrineOfRepair-AllInOne.cfg"), true); PurchaseInteractionCurrencyType = val2.Bind<ShrineOfRepairStuff.CostTypes>("Currency", "Currency Type", ShrineOfRepairStuff.CostTypes.Gold, "Type of currency used to purchase shrine. Using anything other than \"Gold\" disables price scaling over time. Each currency has its own options."); PurchaseInteractionLunarCoinCost = val2.Bind<int>("Lunar Coins", "Shrine Base Cost", 2, "Base cost of the interactable in lunar coins. Does not scale with time. Can be used with EphemeralCoins."); PurchaseInteractionVoidCoinCost = val2.Bind<int>("Void Coins", "Shrine Base Cost", 2, "Base cost of the interactable in void coins. Does not scale with time. To be used with ReleasedFromTheVoid."); PurchaseInteractionGoldBaseCost = val2.Bind<int>("Gold", "Shrine Base Cost", 12, "Base cost of the interactable in gold that is used for scaling. Will spawn with this cost at the start of the run."); PurchaseInteractionGoldUseDefaultScaling = val2.Bind<bool>("Gold", "Use Default Scaling", false, "Use default scaling formula instead of custom scaling formula for the shrine. Custom formula is diffCoef^customsScalingModifier * BaseCost, default formula is diffCoef^1.25 * BaseCost * ScalingModifier"); PurchaseInteractionGoldScalingModifier = val2.Bind<float>("Gold", "Scaling Modifier", 1.35f, "Used for defining how cost of shrine scales throughout the run for both default and custom scaling formulas."); ConfigFile val3 = new ConfigFile(Path.Combine(configPath, "viliger-ShrineOfRepair-PerItem.cfg"), true); PickerPanelGoldTier1Cost = val3.Bind<int>("Per Item Repairs", "Tier 1 cost", 12, "Base cost of tier 1 (white) item repair. By default the cost is equal to the half of normal chest price, rounded down."); PickerPanelGoldTier2Cost = val3.Bind<int>("Per Item Repairs", "Tier 2 cost", 25, "Base cost of tier 2 (green) item repair. By default the cost is equal to the half of large chest price."); PickerPanelGoldTier3Cost = val3.Bind<int>("Per Item Repairs", "Tier 3 cost", 200, "Base cost of tier 3 (red) item repair. By default the cost is equal to the half of legendary chest price."); PickerPanelGoldBossCost = val3.Bind<int>("Per Item Repairs", "Boss cost", 50, "Base cost of boss (yellow) item repair. By default the cost is equal to double tier 2 repair price."); PickerPanelGoldLunarCost = val3.Bind<int>("Per Item Repairs", "Lunar cost", 25, "Base cost of lunar (blue) item repair. By default the cost is equal to the half of large chest price."); PickerPanelGoldEquipCost = val3.Bind<int>("Per Item Repairs", "Equipment cost", 50, "Base cost of equipments (orange) repair. By default the cost is equal to double tier 2 repair price."); BazaarUseLunar = val3.Bind<bool>("Bazaar Shrines", "Use Lunar Coins in Bazaar", true, "Shrine spawned in Bazaar uses lunar coins. If disabled it will use gold instead."); BazaarLunarMultiplier = val3.Bind<float>("Bazaar Shrines", "Bazaar Lunar Coin Multiplier", 0.04f, "Lunar Coin cost multiplier for Bazaar shrines. Disabled if currency type is not gold. 25 gold per 1 coin by default. set to 0 for free."); PickerUseLunarByDefault = val3.Bind<bool>("Bazaar Shrines", "Use Lunar Coins by Default", false, "Set to true to make every shrine act like Bazaar's shrines."); PickerShowFree = val3.Bind<bool>("Display", "Display Cost for Free", false, "Set to true to display $0 for free entries."); if (RiskOfOptionsCompat.enabled) { RiskOfOptionsCompat.SetDescription(); RiskOfOptionsCompat.CreateNewOption(PickerPanelGoldTier1Cost); RiskOfOptionsCompat.CreateNewOption(PickerPanelGoldTier2Cost); RiskOfOptionsCompat.CreateNewOption(PickerPanelGoldTier3Cost, 0, 400); RiskOfOptionsCompat.CreateNewOption(PickerPanelGoldBossCost); RiskOfOptionsCompat.CreateNewOption(PickerPanelGoldLunarCost); RiskOfOptionsCompat.CreateNewOption(PickerPanelGoldEquipCost); RiskOfOptionsCompat.CreateNewOption(BazaarLunarMultiplier); RiskOfOptionsCompat.CreateNewOption(PickerUseLunarByDefault); RiskOfOptionsCompat.CreateNewOption(PickerShowFree); RiskOfOptionsCompat.CreateNewOption(MaxUses, 0, 50); RiskOfOptionsCompat.CreateNewOption(SpawnInBazaar); RiskOfOptionsCompat.CreateNewOption(SpawnInMoon); RiskOfOptionsCompat.CreateNewOption(BazaarUseLunar); } } } public static class ShrineOfRepairDictionary { public static Dictionary<ItemIndex, ItemIndex> RepairItemsDictionary = new Dictionary<ItemIndex, ItemIndex>(); public static Dictionary<EquipmentIndex, EquipmentIndex> RepairEquipmentsDictionary = new Dictionary<EquipmentIndex, EquipmentIndex>(); [SystemInitializer(new Type[] { typeof(ItemCatalog), typeof(EquipmentCatalog) })] public static void Init() { FillRepairItemsDictionary(); } public static void Hooks() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown if (ShrineOfRepairConfigManager.RepairVoidItems.Value) { ContagiousItemManager.Init += new hook_Init(ContagiousItemManager_Init); } } private static void ContagiousItemManager_Init(orig_Init orig) { //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_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) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0051: 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) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_0099: 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) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(); Enumerator<TransformationInfo> enumerator = ContagiousItemManager.transformationInfos.GetEnumerator(); try { while (enumerator.MoveNext()) { TransformationInfo current = enumerator.Current; if (!((Object)(object)ItemCatalog.GetItemDef(current.transformedItem) == (Object)(object)Items.VoidMegaCrabItem) && !((Object)(object)ItemCatalog.GetItemDef(current.transformedItem) == (Object)(object)Items.ElementalRingVoid)) { if (RepairItemsDictionary.TryGetValue(current.transformedItem, out var _)) { ItemDef itemDef = ItemCatalog.GetItemDef(current.transformedItem); ItemDef itemDef2 = ItemCatalog.GetItemDef(current.originalItem); Log.Warning($"RepairDictionary already has key {itemDef} and value {itemDef2}. Skipping..."); } else { RepairItemsDictionary.Add(current.transformedItem, current.originalItem); } } } } finally { ((IDisposable)enumerator).Dispose(); } } public static void FillRepairItemsDictionary() { //IL_0034: 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) //IL_0042: 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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Invalid comparison between Unknown and I4 //IL_0069: 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_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Invalid comparison between Unknown and I4 //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Invalid comparison between Unknown and I4 //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Invalid comparison between Unknown and I4 //IL_0057: 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_008e: 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) string[] array = ShrineOfRepairConfigManager.RepairList.Value.Split(','); for (int i = 0; i < array.Length; i++) { string[] array2 = array[i].Split('-'); if (array2.Length != 2) { continue; } ItemIndex val = ItemCatalog.FindItemIndex(array2[0].Trim()); ItemIndex val2 = ItemCatalog.FindItemIndex(array2[1].Trim()); if ((int)val != -1 && (int)val2 != -1) { RepairItemsDictionary.Add(val, val2); continue; } EquipmentIndex val3 = EquipmentCatalog.FindEquipmentIndex(array2[0].Trim()); EquipmentIndex val4 = EquipmentCatalog.FindEquipmentIndex(array2[1].Trim()); if ((int)val3 != -1 && (int)val4 != -1) { RepairEquipmentsDictionary.Add(val3, val4); } } RepairItemsDictionary = ModExtension.FillItemDictionaryFromMods(RepairItemsDictionary); RepairItemsDictionary = ModExtension.FillDictionaryFromMods(RepairItemsDictionary); RepairEquipmentsDictionary = ModExtension.FillEquipmentDictionaryFromMods(RepairEquipmentsDictionary); } } } namespace ShrineOfRepair.ModCompat { public static class BubbetItemsCompat { private static bool? _enabled; public static bool enabled { get { if (!_enabled.HasValue) { _enabled = Chainloader.PluginInfos.ContainsKey("bubbet.bubbetsitems"); } return _enabled.Value; } } public static bool IsVoidLunar(ItemTier tier) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) return tier == BubbetsItemsPlugin.VoidLunarTier.tier; } } public static class RiskOfOptionsCompat { private static bool? _enabled; public static bool enabled { get { if (!_enabled.HasValue) { _enabled = Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions"); } return _enabled.Value; } } public static void SetDescription() { ModSettingsManager.SetModDescription("Shrine to repair your broken items.", "com.Viliger.ShrineOfRepair", "ShrineOfRepair"); } public static void SetIcon(Sprite icon) { ModSettingsManager.SetModIcon(icon, "com.Viliger.ShrineOfRepair", "ShrineOfRepair"); } public static void CreateNewOption(ConfigEntry<float> entry) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: 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) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown ModSettingsManager.AddOption((BaseOption)new StepSliderOption(entry, new StepSliderConfig { min = 0f, max = 5f, increment = 0.01f })); } public static void CreateNewOption(ConfigEntry<bool> entry) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(entry)); } public static void CreateNewOption(ConfigEntry<int> entry, int min = 0, int max = 200) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown ModSettingsManager.AddOption((BaseOption)new IntSliderOption(entry, new IntSliderConfig { min = min, max = max })); } } } namespace ShrineOfRepair.Behaviours { public class ShrineOfRepairPickerManager : NetworkBehaviour { public PickupPickerController pickerController; public Transform iconTransform; [SyncVar] public float coefficient; private Interactor interactor; private int uses; private static int kRpcRpcHandleDeactivateClient; private static int kRpcRpcHandleDeactivateClient; private static int kRpcRpcHandleDeactivateClient; private static int kRpcRpcHandleDeactivateClient; private static int kRpcRpcHandleDeactivateClient; private static int kRpcRpcHandleDeactivateClient; private static int kRpcRpcHandleDeactivateClient; private static int kRpcRpcHandleDeactivateClient; private static int kRpcRpcHandleDeactivateClient; private static int kRpcRpcHandleDeactivateClient; public bool useLunarCoins { get; private set; } public float Networkcoefficient { get { return coefficient; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar<float>(value, ref coefficient, 1u); } } public float Networkcoefficient { get { return coefficient; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar<float>(value, ref coefficient, 1u); } } public float Networkcoefficient { get { return coefficient; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar<float>(value, ref coefficient, 1u); } } public float Networkcoefficient { get { return coefficient; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar<float>(value, ref coefficient, 1u); } } public float Networkcoefficient { get { return coefficient; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar<float>(value, ref coefficient, 1u); } } public float Networkcoefficient { get { return coefficient; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar<float>(value, ref coefficient, 1u); } } public float Networkcoefficient { get { return coefficient; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar<float>(value, ref coefficient, 1u); } } public float Networkcoefficient { get { return coefficient; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar<float>(value, ref coefficient, 1u); } } public float Networkcoefficient { get { return coefficient; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar<float>(value, ref coefficient, 1u); } } public float Networkcoefficient { get { return coefficient; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar<float>(value, ref coefficient, 1u); } } public void Start() { if (NetworkServer.active) { this.Networkcoefficient = Mathf.Pow(Run.instance.compensatedDifficultyCoefficient, 1.25f); } uses = 0; SceneDef sceneDefForCurrentScene = SceneCatalog.GetSceneDefForCurrentScene(); useLunarCoins = ShrineOfRepairConfigManager.PickerUseLunarByDefault.Value || (ShrineOfRepairConfigManager.BazaarUseLunar.Value && (Object)(object)sceneDefForCurrentScene == (Object)(object)SceneCatalog.GetSceneDefFromSceneName("bazaar")) || (ShrineOfRepairConfigManager.UseLunarInMoon.Value && ((Object)(object)sceneDefForCurrentScene == (Object)(object)SceneCatalog.GetSceneDefFromSceneName("moon") || (Object)(object)sceneDefForCurrentScene == (Object)(object)SceneCatalog.GetSceneDefFromSceneName("moon2"))); } public void HandleSelection(int selection) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0051: 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) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //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_0088: 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_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_029f: 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_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Expected O, but got Unknown //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Expected O, but got Unknown if (!NetworkServer.active) { return; } ((Component)this).GetComponent<NetworkUIPromptController>().ClearParticipant(); if (!Object.op_Implicit((Object)(object)interactor)) { return; } PickupDef pickupDef = PickupCatalog.GetPickupDef(new PickupIndex(selection)); CharacterBody component = ((Component)interactor).GetComponent<CharacterBody>(); bool flag = component.GetBuffCount(Buffs.FreeUnlocks) > 0; int itemCount = component.inventory.GetItemCount(pickupDef.itemIndex); ItemIndex value; bool flag2 = ShrineOfRepairDictionary.RepairItemsDictionary.TryGetValue(pickupDef.itemIndex, out value); ItemTier tier = ItemCatalog.GetItemDef(value).tier; if (!flag2 && !ShrineOfRepairDictionary.RepairEquipmentsDictionary.ContainsKey(pickupDef.equipmentIndex)) { return; } uint num = (flag2 ? GetTotalStackCost(tier, itemCount) : GetEquipmentCost()); if (num > (useLunarCoins ? component.master.playerCharacterMasterController.networkUser.lunarCoins : component.master.money) && !flag) { Log.Warning($"Somehow player {component.GetUserName()} ({((Object)component).name}) has less currency than price of {pickupDef.nameToken}x{itemCount}, yet it was available at the start of interaction. Doing nothing..."); return; } string colorHexString; string @string; string text; if (flag2) { component.inventory.RemoveItem(pickupDef.itemIndex, itemCount); component.inventory.GiveItem(value, itemCount); CharacterMasterNotificationQueue.SendTransformNotification(component.master, pickupDef.itemIndex, value, (TransformationType)0); colorHexString = ColorCatalog.GetColorHexString(ItemTierCatalog.GetItemTierDef(tier).colorIndex); @string = Language.GetString(ItemCatalog.GetItemDef(value).nameToken); text = ((itemCount == 1) ? "" : ("<style=\"cEvent\">(" + itemCount + ")</style>")); } else { component.inventory.SetEquipmentIndex(ShrineOfRepairDictionary.RepairEquipmentsDictionary[pickupDef.equipmentIndex]); CharacterMasterNotificationQueue.PushEquipmentTransformNotification(component.master, pickupDef.equipmentIndex, ShrineOfRepairDictionary.RepairEquipmentsDictionary[pickupDef.equipmentIndex], (TransformationType)0); colorHexString = ColorCatalog.GetColorHexString(EquipmentCatalog.GetEquipmentDef(pickupDef.equipmentIndex).colorIndex); @string = Language.GetString(EquipmentCatalog.GetEquipmentDef(pickupDef.equipmentIndex).nameToken); text = ""; } if (flag) { component.RemoveBuff(Buffs.FreeUnlocks); Util.PlaySound("Play_item_proc_onLevelUpFreeUnlock_activate", ((Component)this).gameObject); } else if (useLunarCoins) { component.master.playerCharacterMasterController.networkUser.DeductLunarCoins(num); } else { CharacterMaster master = component.master; master.money -= num; } EffectManager.SpawnEffect(Resources.Load<GameObject>("Prefabs/Effects/ShrineUseEffect"), new EffectData { origin = ((Component)this).gameObject.transform.position, rotation = Quaternion.identity, scale = 1f, color = Color32.op_Implicit(Color.red) }, true); SubjectFormatChatMessage val = new SubjectFormatChatMessage(); ((SubjectChatMessage)val).subjectAsCharacterBody = component; ((SubjectChatMessage)val).baseToken = "INTERACTABLE_SHRINE_REPAIR_INTERACT_PICKER"; val.paramTokens = new string[2] { "<color=#" + colorHexString + ">" + @string + "</color>", text }; Chat.SendBroadcastChat((ChatMessageBase)(object)val); uses++; if (uses == ShrineOfRepairConfigManager.MaxUses.Value) { this.CallRpcHandleDeactivateClient(); pickerController.SetAvailable(false); if (Object.op_Implicit((Object)(object)iconTransform)) { ((Component)iconTransform).gameObject.SetActive(false); } } } public void HandleInteraction(Interactor interactor) { //IL_0090: 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_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_0110: 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_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_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { return; } this.interactor = interactor; List<Option> list = new List<Option>(); CharacterBody component = ((Component)interactor).GetComponent<CharacterBody>(); bool flag = component.GetBuffCount(Buffs.FreeUnlocks) > 0; if (!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)component.master)) { return; } uint num = (useLunarCoins ? component.master.playerCharacterMasterController.networkUser.lunarCoins : component.master.money); foreach (KeyValuePair<ItemIndex, ItemIndex> item in ShrineOfRepairDictionary.RepairItemsDictionary) { int itemCount = component.inventory.GetItemCount(item.Key); if (itemCount > 0) { list.Add(new Option { available = (num >= GetTotalStackCost(ItemCatalog.GetItemDef(item.Value).tier, itemCount) || flag), pickupIndex = PickupCatalog.FindPickupIndex(item.Key) }); } } if (ShrineOfRepairDictionary.RepairEquipmentsDictionary.ContainsKey(component.equipmentSlot.equipmentIndex)) { list.Add(new Option { available = (num >= GetEquipmentCost() || flag), pickupIndex = PickupCatalog.FindPickupIndex(component.equipmentSlot.equipmentIndex) }); } pickerController.SetOptionsServer(list.ToArray()); } public uint GetTotalStackCost(ItemTier tier, int numberOfItems) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) if (GetCostFromItemTier(tier) <= 0) { return 0u; } uint num = (uint)((float)(GetCostFromItemTier(tier) * numberOfItems) * (useLunarCoins ? ShrineOfRepairConfigManager.BazaarLunarMultiplier.Value : coefficient)); if (num == 0) { return 1u; } return num; } public uint GetEquipmentCost() { if (ShrineOfRepairConfigManager.PickerPanelGoldEquipCost.Value <= 0) { return 0u; } uint num = (uint)((float)ShrineOfRepairConfigManager.PickerPanelGoldEquipCost.Value * (useLunarCoins ? ShrineOfRepairConfigManager.BazaarLunarMultiplier.Value : coefficient)); if (num == 0) { return 1u; } return num; } private int GetCostFromItemTier(ItemTier tier) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected I4, but got Unknown //IL_0007: Unknown result type (might be due to invalid IL or missing references) if (BubbetItemsCompat.enabled && BubbetItemsCompat.IsVoidLunar(tier)) { return ShrineOfRepairConfigManager.PickerPanelGoldLunarCost.Value; } switch ((int)tier) { case 0: case 6: return ShrineOfRepairConfigManager.PickerPanelGoldTier1Cost.Value; default: return ShrineOfRepairConfigManager.PickerPanelGoldTier2Cost.Value; case 2: case 8: return ShrineOfRepairConfigManager.PickerPanelGoldTier3Cost.Value; case 4: case 9: return ShrineOfRepairConfigManager.PickerPanelGoldBossCost.Value; case 3: return ShrineOfRepairConfigManager.PickerPanelGoldLunarCost.Value; } } [ClientRpc] public void RpcHandleDeactivateClient() { if (Object.op_Implicit((Object)(object)iconTransform)) { ((Component)iconTransform).gameObject.SetActive(false); } if (Object.op_Implicit((Object)(object)pickerController)) { pickerController.available = false; } } private void UNetVersion() { } protected static void InvokeRpcRpcHandleDeactivateClient(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkClient.active) { Debug.LogError((object)"RPC RpcHandleDeactivateClient called on server."); } else { ((ShrineOfRepairPickerManager)(object)obj).RpcHandleDeactivateClient(); } } public void CallRpcHandleDeactivateClient() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { Debug.LogError((object)"RPC Function RpcHandleDeactivateClient called on client."); return; } NetworkWriter val = new NetworkWriter(); val.Write((short)0); val.Write((short)2); val.WritePackedUInt32((uint)ShrineOfRepairPickerManager.kRpcRpcHandleDeactivateClient); val.Write(((Component)this).GetComponent<NetworkIdentity>().netId); ((NetworkBehaviour)this).SendRPCInternal(val, 0, "RpcHandleDeactivateClient"); } static ShrineOfRepairPickerManager() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Expected O, but got Unknown //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Expected O, but got Unknown //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Expected O, but got Unknown //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Expected O, but got Unknown //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Expected O, but got Unknown //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Expected O, but got Unknown //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Expected O, but got Unknown //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Expected O, but got Unknown //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Expected O, but got Unknown ShrineOfRepairPickerManager.kRpcRpcHandleDeactivateClient = 478062933; NetworkBehaviour.RegisterRpcDelegate(typeof(ShrineOfRepairPickerManager), ShrineOfRepairPickerManager.kRpcRpcHandleDeactivateClient, new CmdDelegate(InvokeRpcRpcHandleDeactivateClient)); NetworkCRC.RegisterBehaviour("ShrineOfRepairPickerManager", 0); ShrineOfRepairPickerManager.kRpcRpcHandleDeactivateClient = 478062933; NetworkBehaviour.RegisterRpcDelegate(typeof(ShrineOfRepairPickerManager), ShrineOfRepairPickerManager.kRpcRpcHandleDeactivateClient, new CmdDelegate(ShrineOfRepairPickerManager.InvokeRpcRpcHandleDeactivateClient)); NetworkCRC.RegisterBehaviour("ShrineOfRepairPickerManager", 0); ShrineOfRepairPickerManager.kRpcRpcHandleDeactivateClient = 478062933; NetworkBehaviour.RegisterRpcDelegate(typeof(ShrineOfRepairPickerManager), ShrineOfRepairPickerManager.kRpcRpcHandleDeactivateClient, new CmdDelegate(ShrineOfRepairPickerManager.InvokeRpcRpcHandleDeactivateClient)); NetworkCRC.RegisterBehaviour("ShrineOfRepairPickerManager", 0); ShrineOfRepairPickerManager.kRpcRpcHandleDeactivateClient = 478062933; NetworkBehaviour.RegisterRpcDelegate(typeof(ShrineOfRepairPickerManager), ShrineOfRepairPickerManager.kRpcRpcHandleDeactivateClient, new CmdDelegate(ShrineOfRepairPickerManager.InvokeRpcRpcHandleDeactivateClient)); NetworkCRC.RegisterBehaviour("ShrineOfRepairPickerManager", 0); ShrineOfRepairPickerManager.kRpcRpcHandleDeactivateClient = 478062933; NetworkBehaviour.RegisterRpcDelegate(typeof(ShrineOfRepairPickerManager), ShrineOfRepairPickerManager.kRpcRpcHandleDeactivateClient, new CmdDelegate(ShrineOfRepairPickerManager.InvokeRpcRpcHandleDeactivateClient)); NetworkCRC.RegisterBehaviour("ShrineOfRepairPickerManager", 0); ShrineOfRepairPickerManager.kRpcRpcHandleDeactivateClient = 478062933; NetworkBehaviour.RegisterRpcDelegate(typeof(ShrineOfRepairPickerManager), ShrineOfRepairPickerManager.kRpcRpcHandleDeactivateClient, new CmdDelegate(ShrineOfRepairPickerManager.InvokeRpcRpcHandleDeactivateClient)); NetworkCRC.RegisterBehaviour("ShrineOfRepairPickerManager", 0); ShrineOfRepairPickerManager.kRpcRpcHandleDeactivateClient = 478062933; NetworkBehaviour.RegisterRpcDelegate(typeof(ShrineOfRepairPickerManager), ShrineOfRepairPickerManager.kRpcRpcHandleDeactivateClient, new CmdDelegate(ShrineOfRepairPickerManager.InvokeRpcRpcHandleDeactivateClient)); NetworkCRC.RegisterBehaviour("ShrineOfRepairPickerManager", 0); ShrineOfRepairPickerManager.kRpcRpcHandleDeactivateClient = 478062933; NetworkBehaviour.RegisterRpcDelegate(typeof(ShrineOfRepairPickerManager), ShrineOfRepairPickerManager.kRpcRpcHandleDeactivateClient, new CmdDelegate(ShrineOfRepairPickerManager.InvokeRpcRpcHandleDeactivateClient)); NetworkCRC.RegisterBehaviour("ShrineOfRepairPickerManager", 0); ShrineOfRepairPickerManager.kRpcRpcHandleDeactivateClient = 478062933; NetworkBehaviour.RegisterRpcDelegate(typeof(ShrineOfRepairPickerManager), ShrineOfRepairPickerManager.kRpcRpcHandleDeactivateClient, new CmdDelegate(ShrineOfRepairPickerManager.InvokeRpcRpcHandleDeactivateClient)); NetworkCRC.RegisterBehaviour("ShrineOfRepairPickerManager", 0); ShrineOfRepairPickerManager.kRpcRpcHandleDeactivateClient = 478062933; NetworkBehaviour.RegisterRpcDelegate(typeof(ShrineOfRepairPickerManager), ShrineOfRepairPickerManager.kRpcRpcHandleDeactivateClient, new CmdDelegate(ShrineOfRepairPickerManager.InvokeRpcRpcHandleDeactivateClient)); NetworkCRC.RegisterBehaviour("ShrineOfRepairPickerManager", 0); } public override bool OnSerialize(NetworkWriter writer, bool forceAll) { if (forceAll) { writer.Write(coefficient); return true; } bool flag = false; if ((((NetworkBehaviour)this).syncVarDirtyBits & (true ? 1u : 0u)) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.Write(coefficient); } if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); } return flag; } public override void OnDeserialize(NetworkReader reader, bool initialState) { if (initialState) { coefficient = reader.ReadSingle(); return; } int num = (int)reader.ReadPackedUInt32(); if (((uint)num & (true ? 1u : 0u)) != 0) { coefficient = reader.ReadSingle(); } } protected static void InvokeRpcRpcHandleDeactivateClient(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkClient.active) { Debug.LogError((object)"RPC RpcHandleDeactivateClient called on server."); } else { ((ShrineOfRepairPickerManager)(object)obj).RpcHandleDeactivateClient(); } } public void CallRpcHandleDeactivateClient() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { Debug.LogError((object)"RPC Function RpcHandleDeactivateClient called on client."); return; } NetworkWriter val = new NetworkWriter(); val.Write((short)0); val.Write((short)2); val.WritePackedUInt32((uint)ShrineOfRepairPickerManager.kRpcRpcHandleDeactivateClient); val.Write(((Component)this).GetComponent<NetworkIdentity>().netId); ((NetworkBehaviour)this).SendRPCInternal(val, 0, "RpcHandleDeactivateClient"); } protected static void InvokeRpcRpcHandleDeactivateClient(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkClient.active) { Debug.LogError((object)"RPC RpcHandleDeactivateClient called on server."); } else { ((ShrineOfRepairPickerManager)(object)obj).RpcHandleDeactivateClient(); } } public void CallRpcHandleDeactivateClient() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { Debug.LogError((object)"RPC Function RpcHandleDeactivateClient called on client."); return; } NetworkWriter val = new NetworkWriter(); val.Write((short)0); val.Write((short)2); val.WritePackedUInt32((uint)ShrineOfRepairPickerManager.kRpcRpcHandleDeactivateClient); val.Write(((Component)this).GetComponent<NetworkIdentity>().netId); ((NetworkBehaviour)this).SendRPCInternal(val, 0, "RpcHandleDeactivateClient"); } protected static void InvokeRpcRpcHandleDeactivateClient(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkClient.active) { Debug.LogError((object)"RPC RpcHandleDeactivateClient called on server."); } else { ((ShrineOfRepairPickerManager)(object)obj).RpcHandleDeactivateClient(); } } public void CallRpcHandleDeactivateClient() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { Debug.LogError((object)"RPC Function RpcHandleDeactivateClient called on client."); return; } NetworkWriter val = new NetworkWriter(); val.Write((short)0); val.Write((short)2); val.WritePackedUInt32((uint)ShrineOfRepairPickerManager.kRpcRpcHandleDeactivateClient); val.Write(((Component)this).GetComponent<NetworkIdentity>().netId); ((NetworkBehaviour)this).SendRPCInternal(val, 0, "RpcHandleDeactivateClient"); } protected static void InvokeRpcRpcHandleDeactivateClient(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkClient.active) { Debug.LogError((object)"RPC RpcHandleDeactivateClient called on server."); } else { ((ShrineOfRepairPickerManager)(object)obj).RpcHandleDeactivateClient(); } } public void CallRpcHandleDeactivateClient() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { Debug.LogError((object)"RPC Function RpcHandleDeactivateClient called on client."); return; } NetworkWriter val = new NetworkWriter(); val.Write((short)0); val.Write((short)2); val.WritePackedUInt32((uint)ShrineOfRepairPickerManager.kRpcRpcHandleDeactivateClient); val.Write(((Component)this).GetComponent<NetworkIdentity>().netId); ((NetworkBehaviour)this).SendRPCInternal(val, 0, "RpcHandleDeactivateClient"); } protected static void InvokeRpcRpcHandleDeactivateClient(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkClient.active) { Debug.LogError((object)"RPC RpcHandleDeactivateClient called on server."); } else { ((ShrineOfRepairPickerManager)(object)obj).RpcHandleDeactivateClient(); } } public void CallRpcHandleDeactivateClient() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { Debug.LogError((object)"RPC Function RpcHandleDeactivateClient called on client."); return; } NetworkWriter val = new NetworkWriter(); val.Write((short)0); val.Write((short)2); val.WritePackedUInt32((uint)ShrineOfRepairPickerManager.kRpcRpcHandleDeactivateClient); val.Write(((Component)this).GetComponent<NetworkIdentity>().netId); ((NetworkBehaviour)this).SendRPCInternal(val, 0, "RpcHandleDeactivateClient"); } protected static void InvokeRpcRpcHandleDeactivateClient(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkClient.active) { Debug.LogError((object)"RPC RpcHandleDeactivateClient called on server."); } else { ((ShrineOfRepairPickerManager)(object)obj).RpcHandleDeactivateClient(); } } public void CallRpcHandleDeactivateClient() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { Debug.LogError((object)"RPC Function RpcHandleDeactivateClient called on client."); return; } NetworkWriter val = new NetworkWriter(); val.Write((short)0); val.Write((short)2); val.WritePackedUInt32((uint)ShrineOfRepairPickerManager.kRpcRpcHandleDeactivateClient); val.Write(((Component)this).GetComponent<NetworkIdentity>().netId); ((NetworkBehaviour)this).SendRPCInternal(val, 0, "RpcHandleDeactivateClient"); } protected static void InvokeRpcRpcHandleDeactivateClient(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkClient.active) { Debug.LogError((object)"RPC RpcHandleDeactivateClient called on server."); } else { ((ShrineOfRepairPickerManager)(object)obj).RpcHandleDeactivateClient(); } } public void CallRpcHandleDeactivateClient() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { Debug.LogError((object)"RPC Function RpcHandleDeactivateClient called on client."); return; } NetworkWriter val = new NetworkWriter(); val.Write((short)0); val.Write((short)2); val.WritePackedUInt32((uint)ShrineOfRepairPickerManager.kRpcRpcHandleDeactivateClient); val.Write(((Component)this).GetComponent<NetworkIdentity>().netId); ((NetworkBehaviour)this).SendRPCInternal(val, 0, "RpcHandleDeactivateClient"); } protected static void InvokeRpcRpcHandleDeactivateClient(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkClient.active) { Debug.LogError((object)"RPC RpcHandleDeactivateClient called on server."); } else { ((ShrineOfRepairPickerManager)(object)obj).RpcHandleDeactivateClient(); } } public void CallRpcHandleDeactivateClient() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { Debug.LogError((object)"RPC Function RpcHandleDeactivateClient called on client."); return; } NetworkWriter val = new NetworkWriter(); val.Write((short)0); val.Write((short)2); val.WritePackedUInt32((uint)ShrineOfRepairPickerManager.kRpcRpcHandleDeactivateClient); val.Write(((Component)this).GetComponent<NetworkIdentity>().netId); ((NetworkBehaviour)this).SendRPCInternal(val, 0, "RpcHandleDeactivateClient"); } protected static void InvokeRpcRpcHandleDeactivateClient(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkClient.active) { Debug.LogError((object)"RPC RpcHandleDeactivateClient called on server."); } else { ((ShrineOfRepairPickerManager)(object)obj).RpcHandleDeactivateClient(); } } public void CallRpcHandleDeactivateClient() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { Debug.LogError((object)"RPC Function RpcHandleDeactivateClient called on client."); return; } NetworkWriter val = new NetworkWriter(); val.Write((short)0); val.Write((short)2); val.WritePackedUInt32((uint)kRpcRpcHandleDeactivateClient); val.Write(((Component)this).GetComponent<NetworkIdentity>().netId); ((NetworkBehaviour)this).SendRPCInternal(val, 0, "RpcHandleDeactivateClient"); } } public class ShrineOfRepairPurchaseManager : NetworkBehaviour { public PurchaseInteraction PurchaseInteraction; public float ScalingModifier; public bool UseDefaultScaling; [SyncVar] public int BaseCostDetermination; public int uses; public int NetworkBaseCostDetermination { get { return BaseCostDetermination; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar<int>(value, ref BaseCostDetermination, 1u); } } public int NetworkBaseCostDetermination { get { return BaseCostDetermination; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar<int>(value, ref BaseCostDetermination, 1u); } } public int NetworkBaseCostDetermination { get { return BaseCostDetermination; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar<int>(value, ref BaseCostDetermination, 1u); } } public int NetworkBaseCostDetermination { get { return BaseCostDetermination; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar<int>(value, ref BaseCostDetermination, 1u); } } public int NetworkBaseCostDetermination { get { return BaseCostDetermination; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar<int>(value, ref BaseCostDetermination, 1u); } } public int NetworkBaseCostDetermination { get { return BaseCostDetermination; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar<int>(value, ref BaseCostDetermination, 1u); } } public int NetworkBaseCostDetermination { get { return BaseCostDetermination; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar<int>(value, ref BaseCostDetermination, 1u); } } public int NetworkBaseCostDetermination { get { return BaseCostDetermination; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar<int>(value, ref BaseCostDetermination, 1u); } } public int NetworkBaseCostDetermination { get { return BaseCostDetermination; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar<int>(value, ref BaseCostDetermination, 1u); } } public int NetworkBaseCostDetermination { get { return BaseCostDetermination; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar<int>(value, ref BaseCostDetermination, 1u); } } public void Start() { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active && Object.op_Implicit((Object)(object)Run.instance)) { PurchaseInteraction.SetAvailable(true); } ((UnityEvent<Interactor>)(object)PurchaseInteraction.onPurchase).AddListener((UnityAction<Interactor>)RepairPurchaseAttempt); if ((int)PurchaseInteraction.costType == 1) { SceneDef sceneDefForCurrentScene = SceneCatalog.GetSceneDefForCurrentScene(); if ((ShrineOfRepairConfigManager.BazaarUseLunar.Value && (Object)(object)sceneDefForCurrentScene == (Object)(object)SceneCatalog.GetSceneDefFromSceneName("bazaar")) || (ShrineOfRepairConfigManager.UseLunarInMoon.Value && ((Object)(object)sceneDefForCurrentScene == (Object)(object)SceneCatalog.GetSceneDefFromSceneName("moon") || (Object)(object)sceneDefForCurrentScene == (Object)(object)SceneCatalog.GetSceneDefFromSceneName("moon2")))) { PurchaseInteraction.costType = (CostTypeIndex)3; PurchaseInteraction.automaticallyScaleCostWithDifficulty = false; this.NetworkBaseCostDetermination = ShrineOfRepairConfigManager.PurchaseInteractionLunarCoinCost.Value; PurchaseInteraction.cost = BaseCostDetermination; } else { this.NetworkBaseCostDetermination = (UseDefaultScaling ? ((int)((float)PurchaseInteraction.cost * ScalingModifier)) : ((int)(Mathf.Pow(Run.instance.compensatedDifficultyCoefficient, ScalingModifier) * (float)PurchaseInteraction.cost))); PurchaseInteraction.cost = BaseCostDetermination; } } else { this.NetworkBaseCostDetermination = PurchaseInteraction.cost; PurchaseInteraction.cost = BaseCostDetermination; } uses = 0; } [Server] public void RepairPurchaseAttempt(Interactor interactor) { //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0138: 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_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (mig