Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of ShareSuite v2.12.0
BepInEx/plugins/ShareSuite/ShareSuite.dll
Decompiled 3 weeks ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Timers; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using EntityStates.GoldGat; using EntityStates.ScavBackpack; using HG.Reflection; using IL.EntityStates.GoldGat; using IL.RoR2; using Mono.Cecil; using Mono.Cecil.Cil; using MonoMod.Cil; using On.EntityStates.GoldGat; using On.EntityStates.ScavBackpack; using On.RoR2; using On.RoR2.Artifacts; using On.RoR2.Networking; using R2API.Utils; using RoR2; using RoR2.Networking; using ShareSuite.Networking; using UnityEngine; using UnityEngine.Networking; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: OptIn] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("ShareSuite")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+6c8eda0fca4b6eb400b062cb5904543f950a9303")] [assembly: AssemblyProduct("ShareSuite")] [assembly: AssemblyTitle("ShareSuite")] [assembly: AssemblyVersion("1.0.0.0")] namespace ShareSuite { public static class Blacklist { private static ItemMask _cachedAvailableItems = new ItemMask(); private static ItemMask _items = new ItemMask(); private static EquipmentMask _equipment = new EquipmentMask(); private static readonly List<PickupIndex> _availableTier1DropList = new List<PickupIndex>(); private static readonly List<PickupIndex> _availableTier2DropList = new List<PickupIndex>(); private static readonly List<PickupIndex> _availableTier3DropList = new List<PickupIndex>(); private static readonly List<PickupIndex> _availableLunarDropList = new List<PickupIndex>(); private static readonly List<PickupIndex> _availableBossDropList = new List<PickupIndex>(); private static readonly List<PickupIndex> _availableVoidDropList = new List<PickupIndex>(); public static List<PickupIndex> AvailableTier1DropList => Get(_availableTier1DropList); public static List<PickupIndex> AvailableTier2DropList => Get(_availableTier2DropList); public static List<PickupIndex> AvailableTier3DropList => Get(_availableTier3DropList); public static List<PickupIndex> AvailableLunarDropList => Get(_availableLunarDropList); public static List<PickupIndex> AvailableBossDropList => Get(_availableBossDropList); public static List<PickupIndex> AvailableVoidDropList => Get(_availableVoidDropList); private static void LoadBlackListItems() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Invalid comparison between Unknown and I4 //IL_0040: Unknown result type (might be due to invalid IL or missing references) _items = new ItemMask(); string[] array = ShareSuite.ItemBlacklist.Value.Split(','); foreach (string text in array) { ItemIndex val = ItemCatalog.FindItemIndex(text); if ((int)val != -1) { _items.Add(val); } } } private static void LoadBlackListEquipment() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Invalid comparison between Unknown and I4 //IL_0040: Unknown result type (might be due to invalid IL or missing references) _equipment = new EquipmentMask(); string[] array = ShareSuite.EquipmentBlacklist.Value.Split(','); foreach (string text in array) { EquipmentIndex val = EquipmentCatalog.FindEquipmentIndex(text); if ((int)val != -1) { _equipment.Add(val); } } } public static bool HasItem(ItemIndex itemIndex) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) ValidateItemCache(); return _items.Contains(itemIndex); } public static bool HasEquipment(EquipmentIndex equipmentIndex) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) ValidateItemCache(); return _equipment.Contains(equipmentIndex); } public static void Recalculate() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Expected O, but got Unknown _cachedAvailableItems = new ItemMask(); } private static void ValidateItemCache() { if ((Object)(object)Run.instance == (Object)null) { Recalculate(); } else { if (((object)_cachedAvailableItems).Equals((object?)Run.instance.availableItems)) { return; } _cachedAvailableItems = Run.instance.availableItems; LoadBlackListItems(); LoadBlackListEquipment(); IEnumerable<PickupIndex> item = new List<PickupIndex>().Concat(Run.instance.availableVoidTier1DropList).Concat(Run.instance.availableVoidTier2DropList).Concat(Run.instance.availableVoidTier3DropList) .Concat(Run.instance.availableVoidBossDropList); (List<PickupIndex>, IEnumerable<PickupIndex>)[] array = new(List<PickupIndex>, IEnumerable<PickupIndex>)[6] { (_availableTier1DropList, Run.instance.availableTier1DropList), (_availableTier2DropList, Run.instance.availableTier2DropList), (_availableTier3DropList, Run.instance.availableTier3DropList), (_availableLunarDropList, Run.instance.availableLunarItemDropList), (_availableBossDropList, Run.instance.availableBossDropList), (_availableVoidDropList, item) }; (List<PickupIndex>, IEnumerable<PickupIndex>)[] array2 = array; for (int i = 0; i < array2.Length; i++) { var (list, source) = array2[i]; list.Clear(); list.AddRange(source.Where(delegate(PickupIndex pickupIndex) { //IL_0001: 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) PickupDef pickupDef = PickupCatalog.GetPickupDef(pickupIndex); return pickupDef != null && !_items.Contains(pickupDef.itemIndex); })); } } } private static List<PickupIndex> Get(List<PickupIndex> list) { ValidateItemCache(); return list; } } public static class ChatHandler { public delegate void SendPickupMessageDelegate(CharacterMaster master, UniquePickup pickupIndex); private const string GrayColor = "7e91af"; private const string RedColor = "ed4c40"; private const string LinkColor = "5cb1ed"; private const string ErrorColor = "ff0000"; private const string NotSharingColor = "f07d6e"; private static readonly string[] PlayerColors = new string[8] { "f23030", "2083fc", "f1f41a", "4dc344", "f27b0c", "3cdede", "db46bd", "9400ea" }; public static readonly SendPickupMessageDelegate SendPickupMessage = GenericPickupController.SendPickupMessage; public static void UnHook() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown GenericPickupController.SendPickupMessage_CharacterMaster_UniquePickup -= new hook_SendPickupMessage_CharacterMaster_UniquePickup(RemoveDefaultPickupMessage); Chat.SendPlayerConnectedMessage -= new hook_SendPlayerConnectedMessage(SendIntroMessage); } public static void Hook() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown GenericPickupController.SendPickupMessage_CharacterMaster_UniquePickup += new hook_SendPickupMessage_CharacterMaster_UniquePickup(RemoveDefaultPickupMessage); Chat.SendPlayerConnectedMessage += new hook_SendPlayerConnectedMessage(SendIntroMessage); } public static void SendIntroMessage(orig_SendPlayerConnectedMessage orig, NetworkUser user) { orig.Invoke(user); if (!ShareSuite.LastMessageSent.Value.Equals(ShareSuite.MessageSendVer)) { ShareSuite.LastMessageSent.Value = ShareSuite.MessageSendVer; string notRepeatedMessage = "<color=#7e91af>(This message will </color><color=#ed4c40>NOT</color><color=#7e91af> display again!) </color>"; string message = "<color=#7e91af>Hey there! Thanks for installing </color><color=#ed4c40>ShareSuite 2.12.0</color><color=#7e91af>! <color=#7e91af>This release contains</color> <color=#ed4c40>SEVERE</color> <color=#7e91af>KNOWN ISSUES. Check our Discord for up-to-date info!</color>"; string clickChatBox = "<color=#ed4c40>(Click the chat box to view the full message)</color>"; Timer timer = new Timer(5000.0); timer.Elapsed += delegate { //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_0017: Expected O, but got Unknown //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_002e: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage { baseToken = notRepeatedMessage }); Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage { baseToken = message }); Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage { baseToken = clickChatBox }); }; timer.AutoReset = false; timer.Start(); } } public static void RemoveDefaultPickupMessage(orig_SendPickupMessage_CharacterMaster_UniquePickup orig, CharacterMaster master, UniquePickup pickupIndex) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) if (!GeneralHooks.IsMultiplayer() || !ShareSuite.RichMessagesEnabled.Value) { orig.Invoke(master, pickupIndex); } } public static void SendRichPickupMessage(CharacterMaster player, PickupDef pickupDef, bool temporary, bool rental) { //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: 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_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_03c9: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Expected O, but got Unknown //IL_03d6: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Expected O, but got Unknown //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Expected O, but got Unknown //IL_0492: Unknown result type (might be due to invalid IL or missing references) //IL_041b: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: Unknown result type (might be due to invalid IL or missing references) //IL_03b5: Unknown result type (might be due to invalid IL or missing references) //IL_03c2: Expected O, but got Unknown //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_0327: Unknown result type (might be due to invalid IL or missing references) //IL_0334: Expected O, but got Unknown //IL_04e3: Unknown result type (might be due to invalid IL or missing references) //IL_04e8: Unknown result type (might be due to invalid IL or missing references) //IL_04f5: Expected O, but got Unknown //IL_044c: Unknown result type (might be due to invalid IL or missing references) //IL_0451: Unknown result type (might be due to invalid IL or missing references) //IL_045e: Expected O, but got Unknown if (!GeneralHooks.IsMultiplayer()) { return; } CharacterBody val = (player.hasBody ? player.GetBody() : null); if ((Object)(object)val == (Object)null || !ShareSuite.RichMessagesEnabled.Value) { if (ShareSuite.RichMessagesEnabled.Value) { SendPickupMessage(player, new UniquePickup(pickupDef.pickupIndex)); } return; } Color baseColor = pickupDef.baseColor; string text = Language.GetString(pickupDef.nameToken); string playerColor = GetPlayerColor(player.playerCharacterMasterController); int itemCountEffective = player.inventory.GetItemCountEffective(pickupDef.itemIndex); if (pickupDef.coinValue != 0) { string baseToken = "<color=#" + playerColor + ">" + val.GetUserName() + "</color> <color=#7e91af>picked up</color> <color=#" + ColorUtility.ToHtmlStringRGB(baseColor) + ">" + string.Format("{0} ({1})</color> <color=#{2}>for themselves.</color>", string.IsNullOrEmpty(text) ? "???" : text, pickupDef.coinValue, "7e91af"); Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage { baseToken = baseToken }); } else if (temporary) { if (ShareSuite.TemporaryItemsShared.Value) { string baseToken2 = "<color=#" + playerColor + ">" + val.GetUserName() + "</color> <color=#7e91af>picked up temporary</color> <color=#" + ColorUtility.ToHtmlStringRGB(baseColor) + ">" + string.Format("{0} ({1})</color> <color=#{2}>for everyone</color>", string.IsNullOrEmpty(text) ? "???" : text, itemCountEffective, "7e91af") + ItemPickupFormatter(val) + "<color=#7e91af>.</color>"; Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage { baseToken = baseToken2 }); } else { string baseToken3 = "<color=#" + playerColor + ">" + val.GetUserName() + "</color> <color=#7e91af>picked up</color> <color=#" + ColorUtility.ToHtmlStringRGB(baseColor) + ">" + string.Format("{0} ({1})</color> <color=#{2}>for themselves. </color>", string.IsNullOrEmpty(text) ? "???" : text, itemCountEffective, "7e91af") + "<color=#f07d6e>(Item is temporary, so not shared)</color>"; Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage { baseToken = baseToken3 }); } } else if (rental) { if (ShareSuite.RentalItemsShared.Value) { string baseToken4 = "<color=#" + playerColor + ">" + val.GetUserName() + "</color> <color=#7e91af>picked up Ethereal</color> <color=#" + ColorUtility.ToHtmlStringRGB(baseColor) + ">" + string.Format("{0} ({1})</color> <color=#{2}>for everyone</color>", string.IsNullOrEmpty(text) ? "???" : text, itemCountEffective, "7e91af") + ItemPickupFormatter(val) + "<color=#7e91af>.</color>"; Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage { baseToken = baseToken4 }); } else { string baseToken5 = "<color=#" + playerColor + ">" + val.GetUserName() + "</color> <color=#7e91af>picked up</color> <color=#" + ColorUtility.ToHtmlStringRGB(baseColor) + ">" + string.Format("{0} ({1})</color> <color=#{2}>for themselves. </color>", string.IsNullOrEmpty(text) ? "???" : text, itemCountEffective, "7e91af") + "<color=#f07d6e>(Item is ethereal, so not shared)</color>"; Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage { baseToken = baseToken5 }); } } else if (Blacklist.HasItem(pickupDef.itemIndex) || !ItemSharingHooks.IsValidItemPickup(pickupDef.pickupIndex)) { string baseToken6 = "<color=#" + playerColor + ">" + val.GetUserName() + "</color> <color=#7e91af>picked up</color> <color=#" + ColorUtility.ToHtmlStringRGB(baseColor) + ">" + (string.IsNullOrEmpty(text) ? "???" : text) + "</color> <color=#7e91af>for themselves. </color><color=#f07d6e>(Item Set to NOT be Shared)</color>"; Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage { baseToken = baseToken6 }); } else { string baseToken7 = "<color=#" + playerColor + ">" + val.GetUserName() + "</color> <color=#7e91af>picked up</color> <color=#" + ColorUtility.ToHtmlStringRGB(baseColor) + ">" + string.Format("{0} ({1})</color> <color=#{2}>for themselves</color>", string.IsNullOrEmpty(text) ? "???" : text, itemCountEffective, "7e91af") + ItemPickupFormatter(val) + "<color=#7e91af>.</color>"; Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage { baseToken = baseToken7 }); } } public static void SendRichCauldronMessage(CharacterMaster player, PickupIndex index) { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0051: 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_010d: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Expected O, but got Unknown CharacterBody val = (player.hasBody ? player.GetBody() : null); if (!GeneralHooks.IsMultiplayer() || (Object)(object)val == (Object)null || !ShareSuite.RichMessagesEnabled.Value) { if (ShareSuite.RichMessagesEnabled.Value) { SendPickupMessage(player, new UniquePickup(index)); } return; } PickupDef pickupDef = PickupCatalog.GetPickupDef(index); Color baseColor = pickupDef.baseColor; string text = Language.GetString(pickupDef.nameToken); string playerColor = GetPlayerColor(player.playerCharacterMasterController); int itemCountEffective = player.inventory.GetItemCountEffective(pickupDef.itemIndex); string baseToken = "<color=#" + playerColor + ">" + val.GetUserName() + "</color> <color=#7e91af>traded for</color> <color=#" + ColorUtility.ToHtmlStringRGB(baseColor) + ">" + string.Format("{0} ({1})</color><color=#{2}>.</color>", string.IsNullOrEmpty(text) ? "???" : text, itemCountEffective, "7e91af"); Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage { baseToken = baseToken }); } public static void SendRichRandomizedPickupMessage(CharacterMaster origPlayer, PickupDef origPickup, Dictionary<CharacterMaster, PickupDef> pickupIndices, bool temporary, bool rental) { //IL_0032: 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_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_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Expected O, but got Unknown if (!GeneralHooks.IsMultiplayer() || !ShareSuite.RichMessagesEnabled.Value) { if (ShareSuite.RichMessagesEnabled.Value) { SendPickupMessage(origPlayer, new UniquePickup(origPickup.pickupIndex)); } return; } if (pickupIndices.Count == 1) { SendRichPickupMessage(origPlayer, origPickup, temporary, rental); return; } int num = pickupIndices.Count; string text = ""; foreach (KeyValuePair<CharacterMaster, PickupDef> pickupIndex in pickupIndices) { Color baseColor = pickupIndex.Value.baseColor; string text2 = Language.GetString(pickupIndex.Value.nameToken); string playerColor = GetPlayerColor(pickupIndex.Key.playerCharacterMasterController); int itemCountEffective = pickupIndex.Key.playerCharacterMasterController.master.inventory.GetItemCountEffective(pickupIndex.Value.itemIndex); if (num != pickupIndices.Count) { if (num > 1) { text += "<color=#7e91af>,</color> "; } else if (num == 1) { text += "<color=#7e91af>, and</color> "; } } num--; text = text + "<color=#" + playerColor + ">" + pickupIndex.Key.playerCharacterMasterController.GetDisplayName() + "</color> <color=#7e91af>got</color> <color=#" + ColorUtility.ToHtmlStringRGB(baseColor) + ">" + string.Format("{0} ({1})</color>", string.IsNullOrEmpty(text2) ? "???" : text2, itemCountEffective); } Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage { baseToken = text }); } private static string ItemPickupFormatter(CharacterBody body) { int num = GetEligiblePlayers(body); if (num < 1) { return " <color=#7e91af>and no-one else</color>"; } if (num == 1) { foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances) { CharacterMaster master = instance.master; if (!master.hasBody || (Object)(object)master.GetBody() == (Object)(object)body) { continue; } string playerColor = GetPlayerColor(instance); return " <color=#7e91af>and</color> <color=#" + playerColor + ">" + instance.GetDisplayName() + "</color>"; } return "<color=#ff0000>???</color>"; } string text = ""; foreach (PlayerCharacterMasterController instance2 in PlayerCharacterMasterController.instances) { CharacterMaster master2 = instance2.master; if (master2.hasBody && !((Object)(object)master2.GetBody() == (Object)(object)body) && (!ItemSharingHooks.IsDeadAndNotADrone(master2) || ShareSuite.DeadPlayersGetItems.Value)) { string playerColor2 = GetPlayerColor(instance2); if (num > 1) { text += "<color=#7e91af>,</color> "; } else if (num == 1) { text += "<color=#7e91af>, and</color> "; } num--; text = text + "<color=#" + playerColor2 + ">" + instance2.GetDisplayName() + "</color>"; } } return text; } private static string GetPlayerColor(PlayerCharacterMasterController controllerMaster) { int num = PlayerCharacterMasterController.instances.IndexOf(controllerMaster); return PlayerColors[num % 8]; } private static int GetEligiblePlayers(CharacterBody body) { int num = 0; foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances) { CharacterMaster master = instance.master; if (Object.op_Implicit((Object)(object)master.inventory) && !((Object)(object)master.GetBody() == (Object)(object)body) && (!ItemSharingHooks.IsDeadAndNotADrone(master) || ShareSuite.DeadPlayersGetItems.Value)) { num++; } } return num; } } internal class DebugTools { internal static void Hook() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown HealthComponent.TakeDamage += new hook_TakeDamage(DontTakeDamage); SceneDirector.PopulateScene += new hook_PopulateScene(OverridePopulateScene); } internal static void UnHook() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown HealthComponent.TakeDamage -= new hook_TakeDamage(DontTakeDamage); SceneDirector.PopulateScene -= new hook_PopulateScene(OverridePopulateScene); } private static void DontTakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { if (!ShareSuite.GodMode.Value || !self.body.isPlayerControlled) { orig.Invoke(self, damageInfo); } } private static void OverridePopulateScene(orig_PopulateScene orig, SceneDirector self) { Log.Debug($"Populator has Credit value: {self.interactableCredit}"); orig.Invoke(self); } } public static class EquipmentSharingHooks { public static void UnHook() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown GenericPickupController.AttemptGrant -= new hook_AttemptGrant(OnGrantEquipment); } public static void Hook() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown GenericPickupController.AttemptGrant += new hook_AttemptGrant(OnGrantEquipment); } private static void OnGrantEquipment(orig_AttemptGrant orig, GenericPickupController self, CharacterBody body) { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: 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_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0106: 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_010e: 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_0135: 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_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) if (!ShareSuite.EquipmentShared.Value || !GeneralHooks.IsMultiplayer() || !NetworkServer.active) { orig.Invoke(self, body); return; } EquipmentIndex currentEquipmentIndex = body.inventory.currentEquipmentIndex; PickupIndex pickupIndex = GetPickupIndex(currentEquipmentIndex); EquipmentIndex equip = PickupCatalog.GetPickupDef(self.pickupIndex).equipmentIndex; if (!IsEquipment(equip)) { return; } ChatHandler.SendPickupMessage(body.master, new UniquePickup(self.pickupIndex)); body.inventory.SetEquipmentIndex(equip); Object.Destroy((Object)(object)((Component)self).gameObject); if (!EquipmentShared(currentEquipmentIndex) && EquipmentShared(equip)) { CreateDropletIfExists(pickupIndex, ((Component)self).transform.position); DropAllOtherSharedEquipment(self, body, currentEquipmentIndex); } else { if ((EquipmentShared(currentEquipmentIndex) && !EquipmentShared(equip) && GetLivingPlayersWithEquipment(currentEquipmentIndex) < 1) || (!EquipmentShared(currentEquipmentIndex) && !EquipmentShared(equip))) { CreateDropletIfExists(pickupIndex, ((Component)self).transform.position); return; } if (!EquipmentShared(equip)) { return; } CreateDropletIfExists(pickupIndex, ((Component)self).transform.position); } foreach (CharacterMaster item in from p in PlayerCharacterMasterController.instances select p.master into p where Object.op_Implicit((Object)(object)p.inventory) && (Object)(object)p != (Object)(object)body.master select p) { Inventory inventory = item.inventory; EquipmentIndex currentEquipmentIndex2 = inventory.currentEquipmentIndex; if (!EquipmentShared(currentEquipmentIndex2)) { if (!ShareSuite.DropBlacklistedEquipmentOnShare.Value) { continue; } Transform transform = item.GetBodyObject().transform; PickupIndex val = PickupCatalog.FindPickupIndex(currentEquipmentIndex2); PickupDropletController.CreatePickupDroplet(val, transform.position, transform.forward * 20f); } inventory.SetEquipmentIndex(equip, true); SyncToolbotEquip(item, ref equip); } } private static void DropAllOtherSharedEquipment(GenericPickupController self, CharacterBody body, EquipmentIndex originalEquip) { //IL_007a: 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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0094: 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_00a4: 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_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) List<EquipmentIndex> list = new List<EquipmentIndex>(); foreach (CharacterMaster item in from p in PlayerCharacterMasterController.instances select p.master into p where Object.op_Implicit((Object)(object)p.inventory) && (Object)(object)p != (Object)(object)body.master select p) { EquipmentIndex equipmentIndex = item.inventory.GetEquipmentIndex(); if (EquipmentShared(equipmentIndex) && !list.Contains(equipmentIndex) && equipmentIndex != originalEquip) { CreateDropletIfExists(GetPickupIndex(equipmentIndex), ((Component)self).transform.position); list.Add(equipmentIndex); } } } private static PickupIndex GetPickupIndex(EquipmentIndex originalEquip) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Invalid comparison between Unknown and I4 //IL_000c: 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_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_001c: 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) return ((int)originalEquip != -1) ? PickupCatalog.GetPickupDef(PickupCatalog.FindPickupIndex(originalEquip)).pickupIndex : PickupIndex.none; } public static void RemoveAllUnBlacklistedEquipment() { //IL_0065: Unknown result type (might be due to invalid IL or missing references) foreach (CharacterMaster item in from p in PlayerCharacterMasterController.instances select p.master into p where Object.op_Implicit((Object)(object)p.inventory) select p) { if (!Blacklist.HasEquipment(item.inventory.currentEquipmentIndex)) { item.inventory.SetEquipmentIndex((EquipmentIndex)(-1)); } } } private static void SetEquipmentIndex(Inventory self, EquipmentIndex newEquipmentIndex, uint slot) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Invalid comparison between Unknown and I4 //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active && self.currentEquipmentIndex != newEquipmentIndex) { EquipmentState equipment = self.GetEquipment(0u); byte b = equipment.charges; if ((int)equipment.equipmentIndex == -1) { b = 1; } self.SetEquipment(new EquipmentState(newEquipmentIndex, equipment.chargeFinishTime, b, false), slot); } } private static void SyncToolbotEquip(CharacterMaster characterMaster, ref EquipmentIndex equip) { if (!(((Object)characterMaster.bodyPrefab).name != "ToolbotBody")) { SetEquipmentIndex(characterMaster.inventory, equip, (uint)(characterMaster.inventory.activeEquipmentSlot + 1) % 2u); } } private static void CreateDropletIfExists(PickupIndex pickupIndex, Vector3 position) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: 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_0012: 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) if (pickupIndex != PickupIndex.none) { PickupDropletController.CreatePickupDroplet(pickupIndex, position, new Vector3(Random.Range(-200f, 200f), 50f, Random.Range(-200f, 200f))); } } private static int GetLivingPlayersWithEquipment(EquipmentIndex originalEquip) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) return (from p in PlayerCharacterMasterController.instances select p.master into p where Object.op_Implicit((Object)(object)p.inventory) && !ItemSharingHooks.IsDeadAndNotADrone(p) select p).Count((CharacterMaster master) => master.inventory.currentEquipmentIndex == originalEquip); } private static bool EquipmentShared(EquipmentIndex pickup) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Invalid comparison between Unknown and I4 //IL_000d: Unknown result type (might be due to invalid IL or missing references) if ((int)pickup == -1) { return true; } return !Blacklist.HasEquipment(pickup); } private static bool IsEquipment(EquipmentIndex index) { //IL_0001: 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) return ((IEnumerable<EquipmentIndex>)(object)EquipmentCatalog.allEquipment).Contains(index); } } public static class GeneralHooks { private static int _sacrificeOffset = 1; private static int _bossItems = 1; private static List<string> NoInteractibleOverrideScenes = new List<string> { "MAP_BAZAAR_TITLE", "MAP_ARENA_TITLE", "MAP_LIMBO_TITLE", "MAP_MYSTERYSPACE_TITLE" }; internal static void Hook() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown BossGroup.DropRewards += new hook_DropRewards(BossGroup_DropRewards); SceneDirector.PlaceTeleporter += new hook_PlaceTeleporter(InteractibleCreditOverride); TeleporterInteraction.OnInteractionBegin += new hook_OnInteractionBegin(OverrideBossLootScaling); SacrificeArtifactManager.OnPrePopulateSceneServer += new hook_OnPrePopulateSceneServer(SetSacrificeOffset); Util.GetExpAdjustedDropChancePercent += new hook_GetExpAdjustedDropChancePercent(GetExpAdjustedDropChancePercent); } internal static void UnHook() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown BossGroup.DropRewards -= new hook_DropRewards(BossGroup_DropRewards); SceneDirector.PlaceTeleporter -= new hook_PlaceTeleporter(InteractibleCreditOverride); TeleporterInteraction.OnInteractionBegin -= new hook_OnInteractionBegin(OverrideBossLootScaling); SacrificeArtifactManager.OnPrePopulateSceneServer -= new hook_OnPrePopulateSceneServer(SetSacrificeOffset); Util.GetExpAdjustedDropChancePercent -= new hook_GetExpAdjustedDropChancePercent(GetExpAdjustedDropChancePercent); } private static void BossGroup_DropRewards(orig_DropRewards orig, BossGroup group) { group.scaleRewardsByPlayerCount = false; group.bonusRewardCount += _bossItems - 1; orig.Invoke(group); } private static void SetSacrificeOffset(orig_OnPrePopulateSceneServer orig, SceneDirector sceneDirector) { _sacrificeOffset = 2; orig.Invoke(sceneDirector); } private static void OverrideBossLootScaling(orig_OnInteractionBegin orig, TeleporterInteraction self, Interactor activator) { _bossItems = (ShareSuite.OverrideBossLootScalingEnabled.Value ? ShareSuite.BossLootCredit.Value : Run.instance.participatingPlayerCount); orig.Invoke(self, activator); } public static bool IsMultiplayer() { return ShareSuite.OverrideMultiplayerCheck.Value || PlayerCharacterMasterController.instances.Count > 1; } private static void InteractibleCreditOverride(orig_PlaceTeleporter orig, SceneDirector self) { //IL_0047: 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_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); Debug.Log((object)SceneInfo.instance.sceneDef.nameToken); int num = 200; ClassicStageInfo component = ((Component)SceneInfo.instance).GetComponent<ClassicStageInfo>(); if (Object.op_Implicit((Object)(object)component)) { Log.Debug("Current gamemode; " + GameModeCatalog.GetGameModeName(Run.instance.gameModeIndex)); num = ((!(GameModeCatalog.GetGameModeName(Run.instance.gameModeIndex) == "InfiniteTowerRun")) ? component.sceneDirectorInteractibleCredits : 600); int num2 = Math.Min(Run.instance.participatingPlayerCount, 8); float num3 = (float)(0.95 + (double)num2 * 0.05); num3 *= (float)Math.Max(1.0 + 0.1 * (double)Math.Min(Run.instance.participatingPlayerCount * 2 - Run.instance.stageClearCount - 2, 3), 1.0); num = (int)((float)num / num3); if (component.bonusInteractibleCreditObjects != null) { BonusInteractibleCreditObject[] bonusInteractibleCreditObjects = component.bonusInteractibleCreditObjects; foreach (BonusInteractibleCreditObject val in bonusInteractibleCreditObjects) { if (val.objectThatGrantsPointsIfEnabled.activeSelf) { num += val.points / num2; } } } } if (ShareSuite.OverridePlayerScalingEnabled.Value && (!Object.op_Implicit((Object)(object)SceneInfo.instance) || !NoInteractibleOverrideScenes.Contains(SceneInfo.instance.sceneDef.nameToken))) { self.interactableCredit = (int)((double)num * ShareSuite.InteractablesCredit.Value / (double)_sacrificeOffset) + ShareSuite.InteractablesOffset.Value; } _sacrificeOffset = 1; } private static float GetExpAdjustedDropChancePercent(orig_GetExpAdjustedDropChancePercent orig, float baseChancePercent, GameObject characterBodyObject) { if (ShareSuite.SacrificeFixEnabled.Value) { baseChancePercent /= (float)PlayerCharacterMasterController.instances.Count; } return orig.Invoke(baseChancePercent, characterBodyObject); } } public static class ItemSharingHooks { private static bool _itemLock = false; private static readonly List<CostTypeIndex> PrinterCosts = new List<CostTypeIndex> { (CostTypeIndex)4, (CostTypeIndex)5, (CostTypeIndex)6, (CostTypeIndex)10, (CostTypeIndex)9 }; public static event Func<GenericPickupController, CharacterBody, bool> AdditionalPickupValidityChecks; public static void UnHook() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Expected O, but got Unknown //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Expected O, but got Unknown PurchaseInteraction.OnInteractionBegin -= new hook_OnInteractionBegin(OnShopPurchase); ShopTerminalBehavior.DropPickup_bool -= new hook_DropPickup_bool(OnPurchaseDrop); GenericPickupController.AttemptGrant -= new hook_AttemptGrant(OnGrantItem); Opening.OnEnter -= new hook_OnEnter(OnScavengerDrop); PlayerPickupChatMessage.ConstructChatString -= new hook_ConstructChatString(FixZeroItemCount); HalcyoniteShrineInteractable.DropRewards -= new hook_DropRewards(HalcyoniteShrineDropRewards); ArenaMissionController.EndRound -= new Manipulator(ArenaDropEnable); InfiniteTowerWaveController.DropRewards -= new Manipulator(SimulacrumArenaDropEnable); } public static void Hook() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Expected O, but got Unknown //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Expected O, but got Unknown //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Expected O, but got Unknown Log.Debug("Sharesuite: Hooking itemsharing"); PurchaseInteraction.OnInteractionBegin += new hook_OnInteractionBegin(OnShopPurchase); ShopTerminalBehavior.DropPickup_bool += new hook_DropPickup_bool(OnPurchaseDrop); GenericPickupController.AttemptGrant += new hook_AttemptGrant(OnGrantItem); Opening.OnEnter += new hook_OnEnter(OnScavengerDrop); PlayerPickupChatMessage.ConstructChatString += new hook_ConstructChatString(FixZeroItemCount); HalcyoniteShrineInteractable.DropRewards += new hook_DropRewards(HalcyoniteShrineDropRewards); if (ShareSuite.OverrideVoidFieldLootScalingEnabled.Value) { ArenaMissionController.EndRound += new Manipulator(ArenaDropEnable); InfiniteTowerWaveController.DropRewards += new Manipulator(SimulacrumArenaDropEnable); } } private static void OnGrantItem(orig_AttemptGrant orig, GenericPickupController self, CharacterBody body) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000e: 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_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_03b5: Unknown result type (might be due to invalid IL or missing references) //IL_03ba: Unknown result type (might be due to invalid IL or missing references) //IL_03c4: Unknown result type (might be due to invalid IL or missing references) //IL_03d6: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0387: Unknown result type (might be due to invalid IL or missing references) //IL_038c: Unknown result type (might be due to invalid IL or missing references) //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: Unknown result type (might be due to invalid IL or missing references) //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Unknown result type (might be due to invalid IL or missing references) PickupDef pickupDef = PickupCatalog.GetPickupDef(self.pickupIndex); ItemDef itemDef = ItemCatalog.GetItemDef(pickupDef.itemIndex); Dictionary<CharacterMaster, PickupDef> dictionary = new Dictionary<CharacterMaster, PickupDef>(); object obj = ((body != null) ? body.master : null); if (obj == null) { Inventory inventory = body.inventory; obj = ((inventory != null) ? ((Component)inventory).GetComponent<CharacterMaster>() : null); } CharacterMaster val = (CharacterMaster)obj; Scene activeScene = SceneManager.GetActiveScene(); bool flag = true; Log.Debug("ActiveScene: " + ((Scene)(ref activeScene)).name); if (((Scene)(ref activeScene)).name == "computationalexchange") { Log.Debug("Sharesuite: Computational Exchange detected, skipping item sharing."); orig.Invoke(self, body); return; } EquipmentIndex equipmentIndex = pickupDef.equipmentIndex; UniquePickup pickup; if (!((IEnumerable<EquipmentIndex>)(object)EquipmentCatalog.allEquipment).Contains(equipmentIndex)) { pickup = self.pickup; if (((UniquePickup)(ref pickup)).isTempItem) { Log.Debug("I am a temp item"); } if (self.pickup.isRental) { Log.Debug("I am a rent item"); } if ((Object)(object)itemDef != (Object)null) { if (itemDef != null) { _ = itemDef.tier; if (true) { Log.Debug($"Tier: {itemDef.tier}"); } } Log.Debug("Name Token: " + itemDef.nameToken); Log.Debug("Name: " + ((Object)itemDef).name); } } if (!Blacklist.HasItem(pickupDef.itemIndex) && NetworkServer.active && IsValidItemPickup(self.pickupIndex) && IsValidPickupObject(self, body) && GeneralHooks.IsMultiplayer()) { pickup = self.pickup; if ((!((UniquePickup)(ref pickup)).isTempItem || ShareSuite.TemporaryItemsShared.Value) && (!self.pickup.isRental || ShareSuite.RentalItemsShared.Value)) { if (ShareSuite.RandomizeSharedPickups.Value) { dictionary.Add(val, pickupDef); } foreach (CharacterMaster item in PlayerCharacterMasterController.instances.Select((PlayerCharacterMasterController p) => p.master)) { if (!ShareSuite.DeadPlayersGetItems.Value && IsDeadAndNotADrone(item)) { continue; } if ((Object)(object)item.inventory == (Object)(object)body.inventory) { if (!((NetworkBehaviour)item).isLocalPlayer) { NetworkHandler.SendItemPickupMessage(((NetworkBehaviour)item.playerCharacterMasterController.networkUser).connectionToClient.connectionId, pickupDef.pickupIndex); } } else if (ShareSuite.RandomizeSharedPickups.Value) { PickupIndex? randomItemOfTier = GetRandomItemOfTier(itemDef.tier, pickupDef.pickupIndex); if (randomItemOfTier.HasValue) { PickupDef pickupDef2 = PickupCatalog.GetPickupDef(randomItemOfTier.Value); pickup = self.pickup; HandleGiveItem(item, pickupDef2, ((UniquePickup)(ref pickup)).isTempItem, self.pickup.isRental); dictionary.Add(item, pickupDef2); } } else { pickup = self.pickup; HandleGiveItem(item, pickupDef, ((UniquePickup)(ref pickup)).isTempItem, self.pickup.isRental); } } if (ShareSuite.RandomizeSharedPickups.Value) { orig.Invoke(self, body); pickup = self.pickup; ChatHandler.SendRichRandomizedPickupMessage(val, pickupDef, dictionary, ((UniquePickup)(ref pickup)).isTempItem, self.pickup.isRental); return; } } } orig.Invoke(self, body); pickup = self.pickup; ChatHandler.SendRichPickupMessage(val, pickupDef, ((UniquePickup)(ref pickup)).isTempItem, self.pickup.isRental); HandleRichMessageUnlockAndNotification(val, pickupDef.pickupIndex); } private static void HalcyoniteShrineDropRewards(orig_DropRewards orig, HalcyoniteShrineInteractable self) { Log.Debug("Sharesuite: HalcyoniteShrineDropRewards triggered"); if (!NetworkServer.active) { Log.Debug("Sharesuite: Not server, returning"); orig.Invoke(self); return; } if (!GeneralHooks.IsMultiplayer() || !ShareSuite.HalcyoniteShrineDropModified.Value) { Log.Debug("Sharesuite: Not multiplayer or HalcyoniteDropModified not enabled, returning"); orig.Invoke(self); return; } HalcyoniteShrineInteractable componentInParent = ((Component)self).GetComponentInParent<HalcyoniteShrineInteractable>(); if (!Object.op_Implicit((Object)(object)componentInParent)) { orig.Invoke(self); return; } int fieldValue = Reflection.GetFieldValue<int>((object)componentInParent, "rewardOptionCount"); int fieldValue2 = Reflection.GetFieldValue<int>((object)componentInParent, "quantityIncreaseFromBuyIn"); Log.Debug($"Sharesuite: rewardOptionCount: {fieldValue}"); Log.Debug($"Sharesuite: quantityIncreaseFromBuyIn: {fieldValue2}"); orig.Invoke(self); } public static bool IsDeadAndNotADrone(CharacterMaster master) { if ((Object)(object)master == (Object)null || (Object)(object)master.GetBody() == (Object)null) { return true; } return master.IsDeadAndOutOfLivesServer() && !master.GetBody().IsDrone; } private static string FixZeroItemCount(orig_ConstructChatString orig, PlayerPickupChatMessage self) { self.pickupQuantity = Math.Max(1u, self.pickupQuantity); return orig.Invoke(self); } private unsafe static void OnPurchaseDrop(orig_DropPickup_bool orig, ShopTerminalBehavior self, bool isDuplicated) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Invalid comparison between Unknown and I4 //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Invalid comparison between Unknown and I4 //IL_0120: 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_00ee: Invalid comparison between Unknown and I4 Log.Debug("Sharesuite: OnPurchaseDrop triggered"); if (!NetworkServer.active) { Log.Debug("Sharesuite: Not server, returning"); orig.Invoke(self, isDuplicated); return; } CostTypeIndex costType = ((Component)self).GetComponent<PurchaseInteraction>().costType; Log.Debug("Sharesuite: CostType: " + ((object)(*(CostTypeIndex*)(&costType))/*cast due to .constrained prefix*/).ToString()); Log.Debug("Sharesuite: Multiplayer: " + GeneralHooks.IsMultiplayer() + " | ValidItemPickup: " + IsValidItemPickup(self.CurrentPickupIndex()) + " | PrinterCauldronFixEnabled: " + ShareSuite.PrinterCauldronFixEnabled.Value); if (!GeneralHooks.IsMultiplayer() || (!IsValidItemPickup(self.CurrentPickupIndex()) && !ShareSuite.PrinterCauldronFixEnabled.Value) || (int)self.itemTier == 3 || (int)costType == 1 || (int)costType == 0) { Log.Debug("Sharesuite: Origin branch 1"); orig.Invoke(self, isDuplicated); } else if (!ShareSuite.PrinterCauldronFixEnabled.Value && PrinterCosts.Contains(costType)) { Log.Debug("Sharesuite: Origin branch 2"); orig.Invoke(self, isDuplicated); } } private static void OnShopPurchase(orig_OnInteractionBegin orig, PurchaseInteraction self, Interactor activator) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Invalid comparison between Unknown and I4 //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Invalid comparison between Unknown and I4 //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) Log.Debug("Sharesuite: OnShopPurchase triggered"); if (!self.CanBeAffordedByInteractor(activator)) { return; } if (!GeneralHooks.IsMultiplayer() || (int)self.costType == 0) { orig.Invoke(self, activator); return; } ShopTerminalBehavior component = ((Component)self).GetComponent<ShopTerminalBehavior>(); if (PrinterCosts.Contains(self.costType)) { Log.Debug("Sharesuite: PrinterCauldronfix branch"); if (ShareSuite.PrinterCauldronFixEnabled.Value) { CharacterBody component2 = ((Component)activator).GetComponent<CharacterBody>(); Inventory inventory = component2.inventory; if (!(PickupCatalog.GetPickupDef(component.CurrentPickupIndex())?.itemIndex).HasValue) { Log.Debug("ShareSuite: PickupCatalog is null."); } else { Log.Debug("Sharesuite: handling give item"); HandleGiveItem(component2.master, PickupCatalog.GetPickupDef(component.CurrentPickupIndex()), tempItem: false, rentalItem: false); } Log.Debug("Sharesuite: orig"); orig.Invoke(self, activator); Log.Debug("Sharesuite: rich cauldron message"); ChatHandler.SendRichCauldronMessage(((Component)inventory).GetComponent<CharacterMaster>(), component.CurrentPickupIndex()); return; } } if (ShareSuite.EquipmentShared.Value && (int)self.costType == 7) { Log.Debug("Sharesuite: equipment drone fix thing"); orig.Invoke(self, activator); EquipmentSharingHooks.RemoveAllUnBlacklistedEquipment(); } Log.Debug("Sharesuite: ending orig call"); orig.Invoke(self, activator); } private static void OnScavengerDrop(orig_OnEnter orig, Opening self) { orig.Invoke(self); ShareSuite.DefaultMaxScavItemDropCount = Math.Max(Opening.maxItemDropCount, ShareSuite.DefaultMaxScavItemDropCount); ChestBehavior fieldValue = Reflection.GetFieldValue<ChestBehavior>((object)self, "chestBehavior"); if (fieldValue.tier1Chance > 0f) { int val = Math.Max((int)Math.Ceiling((double)ShareSuite.DefaultMaxScavItemDropCount / (double)Run.instance.participatingPlayerCount), 2); Opening.maxItemDropCount = Math.Min(val, ShareSuite.DefaultMaxScavItemDropCount); } else { Opening.maxItemDropCount = ShareSuite.DefaultMaxScavItemDropCount; } } public static void ArenaDropEnable(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); int num = default(int); val.GotoNext(new Func<Instruction, bool>[4] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 1), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref num), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num) }); int index = val.Index; val.Index = index + 1; val.EmitDelegate<Func<int, int>>((Func<int, int>)((int i) => ShareSuite.VoidFieldLootCredit.Value)); } public static void SimulacrumArenaDropEnable(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); float num = default(float); val.GotoNext(new Func<Instruction, bool>[4] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 0), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 1), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 1) }); int index = val.Index; val.Index = index + 1; val.EmitDelegate<Func<int, int>>((Func<int, int>)((int i) => ShareSuite.SimulacrumLootCredit.Value)); } public static bool IsValidItemPickup(PickupIndex pickup) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Invalid comparison between Unknown and I4 //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: 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_0038: 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_0077: Expected I4, but got Unknown //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Invalid comparison between Unknown and I4 //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Invalid comparison between Unknown and I4 PickupDef pickupDef = PickupCatalog.GetPickupDef(pickup); if (pickupDef != null && (int)pickupDef.itemIndex != -1) { ItemDef itemDef = ItemCatalog.GetItemDef(pickupDef.itemIndex); ItemTier tier = itemDef.tier; ItemTier val = tier; switch ((int)val) { default: if ((int)val != 1000) { goto case 10; } return true; case 0: return ShareSuite.WhiteItemsShared.Value; case 1: return ShareSuite.GreenItemsShared.Value; case 2: return ShareSuite.RedItemsShared.Value; case 3: return ShareSuite.LunarItemsShared.Value; case 4: return ShareSuite.BossItemsShared.Value; case 6: return ShareSuite.VoidItemsShared.Value; case 7: return ShareSuite.VoidItemsShared.Value; case 8: return ShareSuite.VoidItemsShared.Value; case 9: return ShareSuite.VoidItemsShared.Value; case 11: return ShareSuite.CursedItemsShared.Value; case 12: return ShareSuite.PageItemsShared.Value; case 13: return ShareSuite.HexItemsShared.Value; case 10: return false; case 5: break; } } if (pickupDef != null && (int)pickupDef.equipmentIndex != -1) { return false; } return false; } public static bool IsValidPickupObject(GenericPickupController pickup, CharacterBody picker) { if (ItemSharingHooks.AdditionalPickupValidityChecks == null) { return true; } bool flag = true; Delegate[] invocationList = ItemSharingHooks.AdditionalPickupValidityChecks.GetInvocationList(); for (int i = 0; i < invocationList.Length; i++) { Func<GenericPickupController, CharacterBody, bool> func = (Func<GenericPickupController, CharacterBody, bool>)invocationList[i]; flag &= func(pickup, picker); } return flag; } private static PickupIndex? GetRandomItemOfTier(ItemTier tier, PickupIndex orDefault) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected I4, but got Unknown //IL_012e: 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_0153: Unknown result type (might be due to invalid IL or missing references) switch ((int)tier) { case 0: return PickRandomOf<PickupIndex>((IList<PickupIndex>)Blacklist.AvailableTier1DropList); case 1: return PickRandomOf<PickupIndex>((IList<PickupIndex>)Blacklist.AvailableTier2DropList); case 2: return PickRandomOf<PickupIndex>((IList<PickupIndex>)Blacklist.AvailableTier3DropList); case 3: if (ShareSuite.LunarItemsRandomized.Value) { return PickRandomOf<PickupIndex>((IList<PickupIndex>)Blacklist.AvailableLunarDropList); } break; case 4: if (ShareSuite.BossItemsRandomized.Value) { return PickRandomOf<PickupIndex>((IList<PickupIndex>)Blacklist.AvailableBossDropList); } break; case 9: if (ShareSuite.VoidItemsRandomized.Value) { return PickRandomOf<PickupIndex>((IList<PickupIndex>)Blacklist.AvailableVoidDropList); } break; case 6: if (ShareSuite.VoidItemsRandomized.Value) { return PickRandomOf<PickupIndex>((IList<PickupIndex>)Blacklist.AvailableVoidDropList); } break; case 7: if (ShareSuite.VoidItemsRandomized.Value) { return PickRandomOf<PickupIndex>((IList<PickupIndex>)Blacklist.AvailableVoidDropList); } break; case 8: if (ShareSuite.VoidItemsRandomized.Value) { return PickRandomOf<PickupIndex>((IList<PickupIndex>)Blacklist.AvailableVoidDropList); } break; } PickupDef pickupDef = PickupCatalog.GetPickupDef(orDefault); if (Blacklist.HasItem(pickupDef.itemIndex)) { return null; } return orDefault; } internal static object GetInstanceField(Type type, object instance, string fieldName) { BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.GetField; FieldInfo field = type.GetField(fieldName, bindingAttr); return field.GetValue(instance); } internal static void SetInstanceField(Type type, object instance, string fieldName, object value) { BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic; FieldInfo field = type.GetField(fieldName, bindingAttr); field.SetValue(instance, value); } private static T? PickRandomOf<T>(IList<T> collection) where T : struct { return (collection.Count > 0) ? new T?(collection[Random.Range(0, collection.Count)]) : ((T?)null); } private static void HandleGiveItem(CharacterMaster characterMaster, PickupDef pickupDef, bool tempItem, bool rentalItem) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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_00ca: Unknown result type (might be due to invalid IL or missing references) if (tempItem && rentalItem) { Log.Debug("Both tempItem and rentalItem are true. The fudge? Resorting to temp item."); characterMaster.inventory.GiveItemTemp(pickupDef.itemIndex, 1f); } else if (tempItem) { characterMaster.inventory.GiveItemTemp(pickupDef.itemIndex, 1f); } else if (rentalItem) { characterMaster.inventory.GiveItemRented(pickupDef.itemIndex, 1); } else { characterMaster.inventory.GiveItemPermanent(pickupDef.itemIndex, 1); } NetworkUser networkUser = characterMaster.playerCharacterMasterController.networkUser; int? num = ((networkUser == null) ? ((int?)null) : ((NetworkBehaviour)networkUser).connectionToClient?.connectionId); if (num.HasValue) { NetworkHandler.SendItemPickupMessage(num.Value, pickupDef.pickupIndex); } } public static void HandleRichMessageUnlockAndNotification(CharacterMaster characterMaster, PickupIndex pickupIndex) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005a: 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_0070: Unknown result type (might be due to invalid IL or missing references) if (!ShareSuite.RichMessagesEnabled.Value || !((NetworkBehaviour)characterMaster).isLocalPlayer) { return; } PlayerCharacterMasterController playerCharacterMasterController = characterMaster.playerCharacterMasterController; if (playerCharacterMasterController != null) { NetworkUser networkUser = playerCharacterMasterController.networkUser; if (networkUser != null) { LocalUser localUser = networkUser.localUser; if (localUser != null) { localUser.userProfile.DiscoverPickup(pickupIndex); } } } if (characterMaster.inventory.GetItemCount(PickupCatalog.GetPickupDef(pickupIndex).itemIndex) <= 1) { CharacterMasterNotificationQueue.PushPickupNotification(characterMaster, pickupIndex); } } } 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); } } public static class MoneySharingHooks { public static bool MapTransitionActive; public static int SharedMoneyValue; internal static void UnHook() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Expected O, but got Unknown //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Expected O, but got Unknown //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Expected O, but got Unknown //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Expected O, but got Unknown //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Expected O, but got Unknown //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Expected O, but got Unknown //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown SceneDirector.Start -= new hook_Start(ResetClassValues); HealthComponent.TakeDamage -= new hook_TakeDamage(BrittleCrownDamageHook); GlobalEventManager.OnHitEnemy -= new hook_OnHitEnemy(BrittleCrownOnHitHook); DeathRewards.OnKilledServer -= new hook_OnKilledServer(ShareKillMoney); BarrelInteraction.OnInteractionBegin -= new hook_OnInteractionBegin(ShareBarrelMoney); MoneyPickup.OnTriggerStay -= new hook_OnTriggerStay(ShareTomeMoney); SceneExitController.Begin -= new hook_Begin(SplitExitMoney); PurchaseInteraction.OnInteractionBegin -= new hook_OnInteractionBegin(OnShopPurchase); GoldGatFire.FireBullet -= new hook_FireBullet(GoldGatFireHook); NetworkManagerSystem.OnClientConnect -= new hook_OnClientConnect(GoldGatConnect); NetworkManagerSystem.OnClientDisconnect -= new hook_OnClientDisconnect(GoldGatDisconnect); HealthComponent.TakeDamage -= new hook_TakeDamage(RollOfPenniesDamageHook); GoldSiphonNearbyBodyController.DrainGold -= new hook_DrainGold(SiphonGold); GoldGatFire.FireBullet -= new Manipulator(RemoveGoldGatMoneyLine); } internal static void Hook() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Expected O, but got Unknown //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Expected O, but got Unknown //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Expected O, but got Unknown //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Expected O, but got Unknown //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Expected O, but got Unknown //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Expected O, but got Unknown //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Expected O, but got Unknown SceneDirector.Start += new hook_Start(ResetClassValues); HealthComponent.TakeDamage += new hook_TakeDamage(BrittleCrownDamageHook); GlobalEventManager.OnHitEnemy += new hook_OnHitEnemy(BrittleCrownOnHitHook); DeathRewards.OnKilledServer += new hook_OnKilledServer(ShareKillMoney); BarrelInteraction.OnInteractionBegin += new hook_OnInteractionBegin(ShareBarrelMoney); MoneyPickup.OnTriggerStay += new hook_OnTriggerStay(ShareTomeMoney); SceneExitController.Begin += new hook_Begin(SplitExitMoney); PurchaseInteraction.OnInteractionBegin += new hook_OnInteractionBegin(OnShopPurchase); GoldGatFire.FireBullet += new hook_FireBullet(GoldGatFireHook); NetworkManagerSystem.OnClientConnect += new hook_OnClientConnect(GoldGatConnect); NetworkManagerSystem.OnClientDisconnect += new hook_OnClientDisconnect(GoldGatDisconnect); HealthComponent.TakeDamage += new hook_TakeDamage(RollOfPenniesDamageHook); GoldSiphonNearbyBodyController.DrainGold += new hook_DrainGold(SiphonGold); if (ShareSuite.MoneyIsShared.Value && GeneralHooks.IsMultiplayer()) { GoldGatFire.FireBullet += new Manipulator(RemoveGoldGatMoneyLine); } } private static void ShareTomeMoney(orig_OnTriggerStay orig, MoneyPickup self, Collider other) { if ((Object)(object)self.baseObject == (Object)null || !ShareSuite.MoneyIsShared.Value) { orig.Invoke(self, other); return; } int num = ((!self.shouldScale) ? self.baseGoldReward : ((int)((float)self.baseGoldReward * Mathf.Pow(Run.instance.difficultyCoefficient, 1.25f)))); orig.Invoke(self, other); if (!Reflection.GetFieldValue<bool>((object)self, "alive")) { SharedMoneyValue += num; if (ShareSuite.MoneyScalarEnabled.Value && NetworkServer.active) { AddToSharedMoneyValue(num); } } } public static void AddMoneyExternal(int amount) { if (ShareSuite.MoneyIsShared.Value) { SharedMoneyValue += amount; return; } foreach (CharacterMaster item in PlayerCharacterMasterController.instances.Select((PlayerCharacterMasterController p) => p.master)) { item.money += (uint)amount; } } public static bool SharedMoneyEnabled() { return ShareSuite.MoneyIsShared.Value; } private static void SiphonGold(orig_DrainGold orig, GoldSiphonNearbyBodyController self) { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_00bb: 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) if (!GeneralHooks.IsMultiplayer() || !ShareSuite.MoneyIsShared.Value) { orig.Invoke(self); return; } HalcyoniteShrineInteractable componentInParent = ((Component)self).GetComponentInParent<HalcyoniteShrineInteractable>(); if (!Object.op_Implicit((Object)(object)componentInParent)) { orig.Invoke(self); return; } int num = 0; Vector3 position = ((Component)self).transform.position; float num2 = componentInParent.radius * componentInParent.radius; int num3 = 0; foreach (TeamComponent teamMember in TeamComponent.GetTeamMembers(self.siphonTeamIndex)) { if (Object.op_Implicit((Object)(object)((teamMember != null) ? teamMember.body : null))) { CharacterBody body = teamMember.body; Vector3 val = position - body.corePosition; if (!(((Vector3)(ref val)).sqrMagnitude > num2) && body.healthComponent.alive && Object.op_Implicit((Object)(object)body.master) && body.isPlayerControlled) { num3 = num3++; num += (int)Math.Min(body.master.money, (uint)componentInParent.goldDrainValue); } } } if (num == 0) { Debug.Log((object)"Drain is 0"); orig.Invoke(self); } else if (SharedMoneyValue < num) { Debug.Log((object)"Not Draining due to too little money"); } else { SharedMoneyValue -= num; orig.Invoke(self); } } private static void OnShopPurchase(orig_OnInteractionBegin orig, PurchaseInteraction self, Interactor activator) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002f: 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_0034: Invalid comparison between Unknown and I4 //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Invalid comparison between Unknown and I4 //IL_0191: Unknown result type (might be due to invalid IL or missing references) if (ShareSuite.MoneyIsShared.Value && GeneralHooks.IsMultiplayer() && Object.op_Implicit((Object)(object)self)) { CostTypeIndex costType = self.costType; CostTypeIndex val = costType; if ((int)val == 1) { if (self.cost <= SharedMoneyValue) { orig.Invoke(self, activator); SharedMoneyValue -= self.cost; } return; } if ((int)val == 2) { orig.Invoke(self, activator); int num = 0; foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances) { float maxHealth = instance.master.GetBody().maxHealth; if (maxHealth > (float)num) { num = (int)maxHealth; } } PurchaseInteraction component = ((Component)self).GetComponent<PurchaseInteraction>(); ShrineBloodBehavior component2 = ((Component)self).GetComponent<ShrineBloodBehavior>(); if ((Object)(object)component != (Object)null && (Object)(object)component2 != (Object)null) { uint num2 = (uint)((double)(num * component.cost) / 100.0 * (double)component2.goldToPaidHpRatio); if (ShareSuite.MoneyScalarEnabled.Value) { num2 = (uint)((double)num2 * ShareSuite.MoneyScalar.Value); } SharedMoneyValue += (int)num2; } else if ((Object)(object)component != (Object)null) { Log.Debug("PurchaseInteraction is not null, but ShrineBloodBehavior is null. What is happening?"); } else if ((Object)(object)component2 != (Object)null) { Log.Debug("ShrineBloodBehavior is not null, but PurchaseInteraction is null. What is happening?"); } return; } Debug.LogWarning((object)$"Unhandled cost type: {self.costType}."); } orig.Invoke(self, activator); } private static void SplitExitMoney(orig_Begin orig, SceneExitController self) { MapTransitionActive = true; if (!ShareSuite.MoneyIsShared.Value || !GeneralHooks.IsMultiplayer()) { orig.Invoke(self); return; } int count = PlayerCharacterMasterController.instances.Count; foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances) { instance.master.money = (uint)Mathf.FloorToInt((float)(instance.master.money / count)); } orig.Invoke(self); } private static void ShareBarrelMoney(orig_OnInteractionBegin orig, BarrelInteraction self, Interactor activator) { orig.Invoke(self, activator); if (GeneralHooks.IsMultiplayer()) { SharedMoneyValue += self.goldReward; if (ShareSuite.MoneyScalarEnabled.Value && NetworkServer.active) { AddToSharedMoneyValue(self.goldReward); } } } private static void ShareKillMoney(orig_OnKilledServer orig, DeathRewards self, DamageReport damageReport) { orig.Invoke(self, damageReport); if (GeneralHooks.IsMultiplayer()) { SharedMoneyValue += (int)self.goldReward; if (ShareSuite.MoneyScalarEnabled.Value && NetworkServer.active) { AddToSharedMoneyValue(self.goldReward); } } } private static void ResetClassValues(orig_Start orig, SceneDirector self) { SetTeleporterActive(active: false); if (ShareSuite.MoneyIsShared.Value && GeneralHooks.IsMultiplayer()) { SharedMoneyValue = 15; } orig.Invoke(self); } private static void GoldGatFireHook(orig_FireBullet orig, GoldGatFire self) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (!GeneralHooks.IsMultiplayer() || !ShareSuite.MoneyIsShared.Value) { orig.Invoke(self); return; } CharacterMaster fieldValue = Reflection.GetFieldValue<CharacterMaster>((object)self, "bodyMaster"); int num = (int)((float)GoldGatFire.baseMoneyCostPerBullet * (1f + ((float)TeamManager.instance.GetTeamLevel(fieldValue.teamIndex) - 1f) * 0.25f)); SharedMoneyValue = Math.Max(SharedMoneyValue - num, 0); orig.Invoke(self); } public static void RemoveGoldGatMoneyLine(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); float num = default(float); MethodReference val2 = default(MethodReference); val.GotoNext(new Func<Instruction, bool>[6] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, ref val2), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, ref val2), (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, ref val2) }); val.RemoveRange(14); } private static void GoldGatDisconnect(orig_OnClientDisconnect orig, NetworkManagerSystem self, NetworkConnection conn) { bool wasMultiplayer = GeneralHooks.IsMultiplayer(); orig.Invoke(self, conn); ToggleGoldGat(wasMultiplayer); } private static void GoldGatConnect(orig_OnClientConnect orig, NetworkManagerSystem self, NetworkConnection conn) { bool wasMultiplayer = GeneralHooks.IsMultiplayer(); orig.Invoke(self, conn); ToggleGoldGat(wasMultiplayer); } private static void ToggleGoldGat(bool wasMultiplayer) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown bool flag = GeneralHooks.IsMultiplayer(); if (wasMultiplayer != flag) { if (ShareSuite.MoneyIsShared.Value && flag) { GoldGatFire.FireBullet += new Manipulator(RemoveGoldGatMoneyLine); } else { GoldGatFire.FireBullet -= new Manipulator(RemoveGoldGatMoneyLine); } } } private static void BrittleCrownDamageHook(orig_TakeDamage orig, HealthComponent self, DamageInfo info) { //IL_00b9: 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_0146: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { orig.Invoke(self, info); return; } if (!ShareSuite.MoneyIsShared.Value || !GeneralHooks.IsMultiplayer() || !Object.op_Implicit((Object)(object)self.body) || !Object.op_Implicit((Object)(object)self.body.inventory)) { orig.Invoke(self, info); return; } CharacterBody body = self.body; uint money = self.body.master.money; orig.Invoke(self, info); if (!self.alive) { return; } uint money2 = self.body.master.money; if (body.inventory.GetItemCount(ItemCatalog.FindItemIndex("GoldOnHit")) <= 0) { return; } SharedMoneyValue += (int)(money2 - money); foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances) { if (Object.op_Implicit((Object)(object)instance.master.GetBody()) && !((Object)(object)instance.master.GetBody() == (Object)(object)body)) { EffectManager.SimpleImpactEffect(Resources.Load<GameObject>("Prefabs/Effects/ImpactEffects/CoinImpact"), instance.master.GetBody().corePosition, Vector3.up, true); } } } private static void RollOfPenniesDamageHook(orig_TakeDamage orig, HealthComponent self, DamageInfo info) { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, info); if (!NetworkServer.active || !ShareSuite.MoneyIsShared.Value || !GeneralHooks.IsMultiplayer() || !self.alive) { return; } CharacterBody body = self.body; if (!Object.op_Implicit((Object)(object)((body != null) ? body.inventory : null))) { return; } int itemCount = self.body.inventory.GetItemCount(ItemCatalog.FindItemIndex("GoldOnHurt")); if (itemCount <= 0) { return; } CharacterBody val = null; if (Object.op_Implicit((Object)(object)info.attacker)) { val = info.attacker.GetComponent<CharacterBody>(); } if ((Object)(object)val == (Object)null || (Object)(object)val == (Object)(object)self.body) { return; } SharedMoneyValue += Mathf.FloorToInt((float)(itemCount * 3) * Run.instance.difficultyCoefficient); foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances) { if (Object.op_Implicit((Object)(object)instance.master.GetBody()) && !((Object)(object)instance.master.GetBody() == (Object)(object)self.body)) { EffectManager.SimpleImpactEffect(Resources.Load<GameObject>("Prefabs/Effects/ImpactEffects/CoinImpact"), instance.master.GetBody().corePosition, Vector3.up, true); } } } private static void BrittleCrownOnHitHook(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo info, GameObject victim) { //IL_00a5: Unknown result type (might be due to invalid IL or missing references) if (!ShareSuite.MoneyIsShared.Value || !GeneralHooks.IsMultiplayer() || !Object.op_Implicit((Object)(object)info.attacker) || !Object.op_Implicit((Object)(object)info.attacker.GetComponent<CharacterBody>()) || !Object.op_Implicit((Object)(object)info.attacker.GetComponent<CharacterBody>().master)) { orig.Invoke(self, info, victim); return; } CharacterBody component = info.attacker.GetComponent<CharacterBody>(); uint money = component.master.money; orig.Invoke(self, info, victim); uint money2 = component.master.money; if (Object.op_Implicit((Object)(object)component.inventory) && component.inventory.GetItemCount(ItemCatalog.FindItemIndex("GoldOnHit")) > 0) { SharedMoneyValue += (int)(money2 - money); } } private static void AddToSharedMoneyValue(float goldReward) { SharedMoneyValue = Math.Max(SharedMoneyValue + (int)Mathf.Floor(goldReward * (float)ShareSuite.MoneyScalar.Value - goldReward), 0); } public static void SetTeleporterActive(bool active) { MapTransitionActive = active; } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.funkfrog_sipondo.sharesuite", "ShareSuite", "2.12.0")] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] public class ShareSuite : BaseUnityPlugin { public static string MessageSendVer = "2.10.1"; public static ConfigEntry<bool> ModIsEnabled; public static ConfigEntry<bool> MoneyIsShared; public static ConfigEntry<bool> WhiteItemsShared; public static ConfigEntry<bool> GreenItemsShared; public static ConfigEntry<bool> RedItemsShared; public static ConfigEntry<bool> EquipmentShared; public static ConfigEntry<bool> LunarItemsShared; public static ConfigEntry<bool> BossItemsShared; public static ConfigEntry<bool> VoidItemsShared; public static ConfigEntry<bool> CursedItemsShared; public static ConfigEntry<bool> PageItemsShared; public static ConfigEntry<bool> HexItemsShared; public static ConfigEntry<bool> TemporaryItemsShared; public static ConfigEntry<bool> RentalItemsShared; public static ConfigEntry<bool> RichMessagesEnabled; public static ConfigEntry<bool> DropBlacklistedEquipmentOnShare; public static ConfigEntry<bool> PrinterCauldronFixEnabled; public static ConfigEntry<bool> DeadPlayersGetItems; public static ConfigEntry<bool> OverridePlayerScalingEnabled; public static ConfigEntry<bool> OverrideBossLootScalingEnabled; public static ConfigEntry<bool> OverrideVoidFieldLootScalingEnabled; public static ConfigEntry<bool> OverrideSimulacrumLootScalingEnabled; public static ConfigEntry<bool> SacrificeFixEnabled; public static ConfigEntry<bool> MoneyScalarEnabled; public static ConfigEntry<bool> RandomizeSharedPickups; public static ConfigEntry<bool> LunarItemsRandomized; public static ConfigEntry<bool> BossItemsRandomized; public static ConfigEntry<bool> VoidItemsRandomized; public static ConfigEntry<bool> OverrideMultiplayerCheck; public static ConfigEntry<bool> HalcyoniteShrineDropModified; public static ConfigEntry<int> BossLootCredit; public static ConfigEntry<int> VoidFieldLootCredit; public static ConfigEntry<int> SimulacrumLootCredit; public static ConfigEntry<int> InteractablesOffset; public static ConfigEntry<double> InteractablesCredit; public static ConfigEntry<double> MoneyScalar; public static ConfigEntry<string> ItemBlacklist; public static ConfigEntry<string> EquipmentBlacklist; public static ConfigEntry<string> LastMessageSent; public static ConfigEntry<short> NetworkMessageType; public static ConfigEntry<bool> GodMode; private bool _previouslyEnabled; public static int DefaultMaxScavItemDropCount = 0; public static int playerCount = PlayerCharacterMasterController.instances.Count; public void Awake() { Log.Init(((BaseUnityPlugin)this).Logger); InitConfig(); CommandHelper.AddToConsoleWhenReady(); ReloadHooks(); MoneySharingHooks.SharedMoneyValue = 15; } public void Update() { if (!ModIsEnabled.Value || !MoneyIsShared.Value || MoneySharingHooks.MapTransitionActive || !GeneralHooks.IsMultiplayer()) { return; } NetworkHandler.RegisterHandlers(); if (!NetworkServer.active) { return; } foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances) { if (!ItemSharingHooks.IsDeadAndNotADrone(instance.master) && instance.master.money != MoneySharingHooks.SharedMoneyValue) { instance.master.money = (uint)MoneySharingHooks.SharedMoneyValue; } } } private void ReloadHooks(object _ = null, EventArgs __ = null) { if (_previouslyEnabled && !ModIsEnabled.Value) { GeneralHooks.UnHook(); MoneySharingHooks.UnHook(); ItemSharingHooks.UnHook(); EquipmentSharingHooks.UnHook(); ChatHandler.UnHook(); _previouslyEnabled = false; DebugTools.UnHook(); } if (!_previouslyEnabled && ModIsEnabled.Value) { _previouslyEnabled = true; GeneralHooks.Hook(); MoneySharingHooks.Hook(); ItemSharingHooks.Hook(); EquipmentSharingHooks.Hook(); ChatHandler.Hook(); DebugTools.Hook(); } } private void InitConfig() { ModIsEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings", "ModEnabled", true, "Toggles whether or not the mod is enabled. If turned off while in-game, it will unhook everything and reset the game to it's default behaviors."); ModIsEnabled.SettingChanged += ReloadHooks; MoneyIsShared = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings", "MoneyShared", true, "Toggles money sharing between teammates. Every player gains money together and spends it from one central pool of money."); WhiteItemsShared = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings", "WhiteItemsShared", true, "Toggles item sharing for common (white color) items."); GreenItemsShared = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings", "GreenItemsShared", true, "Toggles item sharing for rare (green color) items."); RedItemsShared = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings", "RedItemsShared", true, "Toggles item sharing for legendary (red color) items."); EquipmentShared = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings", "EquipmentShared", false, "Toggles item sharing for equipment."); LunarItemsShared = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings", "LunarItemsShared", false, "Toggles item sharing for Lunar (blue color) items."); BossItemsShared = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings", "BossItemsShared", true, "Toggles item sharing for boss (yellow color) items."); VoidItemsShared = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings", "VoidItemsShared", false, "Toggles item sharing for void (purple/corrupted) items."); CursedItemsShared = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings", "CursedItemsShared", false, "Toggles item sharing for cursed (Purple) items."); PageItemsShared = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings", "PageItemsShared", false, "Toggles item sharing for page (Blue) items."); HexItemsShared = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings", "HexItemsShared", false, "Toggles item sharing for hex (Yellowish) items."); TemporaryItemsShared = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings", "TemporaryItemsShared", false, "Toggles item sharing for temporary items."); RentalItemsShared = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings", "RentalItemsShared", false, "Toggles item sharing for rental items."); RichMessagesEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings", "RichMessagesEnabled", true, "Toggles detailed item pickup messages with information on who picked the item up and who all received the item."); DropBlacklistedEquipmentOnShare = ((BaseUnityPlugin)this).Config.Bind<bool>("Balance", "DropBlacklistedEquipmentOnShare", false, "Changes the way shared equipment handles blacklisted equipment. If true, blacklisted equipment will be dropped on the ground once a new equipment is shared. If false, blacklisted equipment is left untouched when new equipment is shared."); RandomizeSharedPickups = ((BaseUnityPlugin)this).Config.Bind<bool>("Balance", "RandomizeSharedPickups", false, "When enabled each player (except the player who picked up the item) will get a randomized item of the same rarity."); LunarItemsRandomized = ((BaseUnityPlugin)this).Config.Bind<bool>("Balance", "LunarItemsRandomized", true, "Toggles randomizing Lunar items in RandomizeSharedPickups mode."); BossItemsRandomized = ((BaseUnityPlugin)this).Config.Bind<bool>("Balance", "BossItemsRandomized", false, "Toggles randomizing Boss items in RandomizeSharedPickups mode."); VoidItemsRandomized = ((BaseUnityPlugin)this).Config.Bind<bool>("Balance", "VoidItemsRandomized", false, "Toggles randomizing Void items in RandomizeSharedPickups mode."); PrinterCauldronFixEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Balance", "PrinterCauldronFix", true, "Toggles 3D printer and Cauldron item dupe fix by giving the item directly instead of dropping it on the ground."); DeadPlayersGetItems = ((BaseUnityPlugin)this).Config.Bind<bool>("Balance", "DeadPlayersGetItems", false, "Toggles whether or not dead players should get copies of picked up items."); OverridePlayerScalingEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Balance", "OverridePlayerScaling", true, "Toggles override of the scalar of interactables (chests, shrines, etc) that spawn in the world to your configured credit."); InteractablesCredit = ((BaseUnityPlugin)this).Config.Bind<double>("Balance", "InteractablesCredit", 1.0, "If player scaling vi