using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using ExitGames.Client.Photon; using HarmonyLib; using Microsoft.CodeAnalysis; using Photon.Pun; using Photon.Realtime; using TMPro; using UnityEngine; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyCompany("binaryn3xus")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("R.E.P.O. Omni-Extraction Toolkit Mod")] [assembly: AssemblyFileVersion("1.0.6.0")] [assembly: AssemblyInformationalVersion("1.0.6+344f37a6beb9b18ad9af89c3357d8fbd1592f3c4")] [assembly: AssemblyProduct("Omni-Extraction Toolkit")] [assembly: AssemblyTitle("OmniExtractionToolkit")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.6.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace OmniExtractionToolkit { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.binaryn3xus.repo.omniextraction", "Omni-Extraction Toolkit", "1.0.6")] public class OmniExtractionToolkitPlugin : BaseUnityPlugin { public static ConfigEntry ScanKey; public static ConfigEntry ScanRadius; public static ConfigEntry ScanCooldown; public static ConfigEntry HUDX; public static ConfigEntry HUDY; public static ConfigEntry ShowHeldItem; public static ConfigEntry ShareUpgrades; public static ConfigEntry ShareHealth; public static ConfigEntry ShareEnergy; public static ConfigEntry ShareSprint; public static ConfigEntry ShareGrabStrength; public static ConfigEntry ShareGrabRange; public static ConfigEntry ShareExtraJump; public static ConfigEntry ShareTumble; public static ConfigEntry ShareTumbleClimb; public static ConfigEntry ShareTumbleWings; public static ConfigEntry ShareCrouchRest; public static ConfigEntry ShareThrowStrength; public static ConfigEntry InfiniteHealth; public static ConfigEntry HealKey; public static ConfigEntry InfiniteBattery; public static ConfigEntry InfiniteStamina; public static ConfigEntry JumpHeightMultiplier; public static ConfigEntry DamageMultiplier; public static ConfigEntry EnableCartShrink; public static ConfigEntry CartShrinkFactor; public static ConfigEntry CartShrinkSpeed; public static ConfigEntry CartShrinkFieldSize; public static ConfigEntry EnableWeightReduction; public static ManualLogSource ModLogger; private void Awake() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown ModLogger = ((BaseUnityPlugin)this).Logger; ((BaseUnityPlugin)this).Logger.LogInfo((object)"================================================"); ((BaseUnityPlugin)this).Logger.LogInfo((object)" OMNI-EXTRACTION TOOLKIT LOADED! "); ((BaseUnityPlugin)this).Logger.LogInfo((object)"================================================"); InitConfig(); Harmony val = new Harmony("com.binaryn3xus.repo.omniextraction"); val.PatchAll(); } private void InitConfig() { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Expected O, but got Unknown //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Expected O, but got Unknown //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Expected O, but got Unknown //IL_0339: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Expected O, but got Unknown //IL_0376: Unknown result type (might be due to invalid IL or missing references) //IL_0380: Expected O, but got Unknown //IL_03d3: Unknown result type (might be due to invalid IL or missing references) //IL_03dd: Expected O, but got Unknown //IL_0410: Unknown result type (might be due to invalid IL or missing references) //IL_041a: Expected O, but got Unknown //IL_044d: Unknown result type (might be due to invalid IL or missing references) //IL_0457: Expected O, but got Unknown ScanKey = ((BaseUnityPlugin)this).Config.Bind("Scanner", "ScanKey", (KeyCode)102, "Key to trigger a manual scan"); ScanRadius = ((BaseUnityPlugin)this).Config.Bind("Scanner", "ScanRadius", 50f, new ConfigDescription("Radius", (AcceptableValueBase)(object)new AcceptableValueRange(1f, 100f), Array.Empty())); ScanCooldown = ((BaseUnityPlugin)this).Config.Bind("Scanner", "ScanCooldown", 5f, new ConfigDescription("Cooldown", (AcceptableValueBase)(object)new AcceptableValueRange(0.1f, 30f), Array.Empty())); HUDX = ((BaseUnityPlugin)this).Config.Bind("HUD", "Horizontal Position", 100f, new ConfigDescription("X% (0=Left, 100=Right)", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 100f), Array.Empty())); HUDY = ((BaseUnityPlugin)this).Config.Bind("HUD", "Vertical Position", 5f, new ConfigDescription("Y% (0=Bottom, 100=Top)", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 100f), Array.Empty())); ShowHeldItem = ((BaseUnityPlugin)this).Config.Bind("HUD", "Show Held Item Value", true, "Show the name and value of the item you are currently holding (Valuables only)."); ShareUpgrades = ((BaseUnityPlugin)this).Config.Bind("Team Upgrades (Host Only)", "Master Toggle", true, "When enabled, any upgrade anyone buys is shared with everyone."); ShareHealth = ((BaseUnityPlugin)this).Config.Bind("Team Upgrades (Host Only)", "Health Upgrade", true, (ConfigDescription)null); ShareEnergy = ((BaseUnityPlugin)this).Config.Bind("Team Upgrades (Host Only)", "Energy Upgrade", true, (ConfigDescription)null); ShareSprint = ((BaseUnityPlugin)this).Config.Bind("Team Upgrades (Host Only)", "Sprint Speed Upgrade", true, (ConfigDescription)null); ShareGrabStrength = ((BaseUnityPlugin)this).Config.Bind("Team Upgrades (Host Only)", "Grab Strength Upgrade", true, (ConfigDescription)null); ShareGrabRange = ((BaseUnityPlugin)this).Config.Bind("Team Upgrades (Host Only)", "Grab Range Upgrade", true, (ConfigDescription)null); ShareExtraJump = ((BaseUnityPlugin)this).Config.Bind("Team Upgrades (Host Only)", "Extra Jump Upgrade", true, (ConfigDescription)null); ShareTumble = ((BaseUnityPlugin)this).Config.Bind("Team Upgrades (Host Only)", "Tumble Launch Upgrade", true, (ConfigDescription)null); ShareTumbleClimb = ((BaseUnityPlugin)this).Config.Bind("Team Upgrades (Host Only)", "Tumble Climb Upgrade", true, (ConfigDescription)null); ShareTumbleWings = ((BaseUnityPlugin)this).Config.Bind("Team Upgrades (Host Only)", "Tumble Wings Upgrade", true, (ConfigDescription)null); ShareCrouchRest = ((BaseUnityPlugin)this).Config.Bind("Team Upgrades (Host Only)", "Crouch Rest Upgrade", true, (ConfigDescription)null); ShareThrowStrength = ((BaseUnityPlugin)this).Config.Bind("Team Upgrades (Host Only)", "Throw Strength Upgrade", true, (ConfigDescription)null); InfiniteHealth = ((BaseUnityPlugin)this).Config.Bind("Cheats (Client-Side)", "Infinite Health", false, "Health bar stays at 100%. (Still feel damage effects)"); HealKey = ((BaseUnityPlugin)this).Config.Bind("Cheats (Client-Side)", "Heal Hotkey", (KeyCode)104, "Key to instantly refill health to 100%."); InfiniteBattery = ((BaseUnityPlugin)this).Config.Bind("Cheats (Client-Side)", "Infinite Battery & Ammo", false, "All tools and weapons stay at 100% charge."); InfiniteStamina = ((BaseUnityPlugin)this).Config.Bind("Cheats (Client-Side)", "Infinite Stamina", false, "Never run out of energy while sprinting."); JumpHeightMultiplier = ((BaseUnityPlugin)this).Config.Bind("Cheats (Client-Side)", "Jump Height Multiplier", 1f, new ConfigDescription("Increase player jump height.", (AcceptableValueBase)(object)new AcceptableValueRange(1f, 5f), Array.Empty())); DamageMultiplier = ((BaseUnityPlugin)this).Config.Bind("Cheats (Host Only)", "Loot Damage Multiplier", 1f, new ConfigDescription("Negative = increase value! Only works if YOU are the host.", (AcceptableValueBase)(object)new AcceptableValueRange(-5f, 10f), Array.Empty())); EnableCartShrink = ((BaseUnityPlugin)this).Config.Bind("Cart Shrink (Host Only)", "Enable Cart Shrink", false, "Shrink items when they are placed in a cart."); CartShrinkFactor = ((BaseUnityPlugin)this).Config.Bind("Cart Shrink (Host Only)", "Shrink Factor", 0.3f, new ConfigDescription("How much to shrink items (0.1 = tiny, 1.0 = normal).", (AcceptableValueBase)(object)new AcceptableValueRange(0.1f, 1f), Array.Empty())); CartShrinkSpeed = ((BaseUnityPlugin)this).Config.Bind("Cart Shrink (Host Only)", "Shrink Speed", 3f, new ConfigDescription("How fast items transition between sizes (1 = slow, 20 = instant).", (AcceptableValueBase)(object)new AcceptableValueRange(1f, 20f), Array.Empty())); CartShrinkFieldSize = ((BaseUnityPlugin)this).Config.Bind("Cart Shrink (Host Only)", "Shrink Field Size", 1.25f, new ConfigDescription("Multiplier for the storage box detection area (1.0 = normal).", (AcceptableValueBase)(object)new AcceptableValueRange(0.1f, 5f), Array.Empty())); EnableWeightReduction = ((BaseUnityPlugin)this).Config.Bind("Cart Shrink (Host Only)", "Reduce Item Weight", true, "When enabled, weight is reduced proportionally to the Shrink Factor."); } public static string GetBindingPath(KeyCode keyCode) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Invalid comparison between Unknown and I4 //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Invalid comparison between Unknown and I4 //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Invalid comparison between Unknown and I4 //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Invalid comparison between Unknown and I4 //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Invalid comparison between Unknown and I4 if ((int)keyCode >= 48 && (int)keyCode <= 57) { return "/" + ((object)(KeyCode)(ref keyCode)).ToString().Replace("Alpha", ""); } if ((int)keyCode == 323) { return "/leftButton"; } if ((int)keyCode == 324) { return "/rightButton"; } if ((int)keyCode == 325) { return "/middleButton"; } string text = ((object)(KeyCode)(ref keyCode)).ToString(); if (text.Length > 0) { text = char.ToLower(text[0]) + text.Substring(1); } return "/" + text; } } public static class ModInput { public const InputKey ScanInputKey = 327; } } namespace OmniExtractionToolkit.Features { public class CartShrinkComponent : MonoBehaviour { private PhysGrabObject pObj; private PhysGrabObjectImpactDetector impactDetector; private RoomVolumeCheck roomVolumeCheck; private Vector3 originalScale; private Vector3 originalDetectionSize; private bool isShrunk = false; private bool massModified = false; private Rigidbody rb; private float originalDrag; private float originalAngularDrag; private List colliders = new List(); private static List activeCarts = new List(); private static float lastCartScan = 0f; private void Start() { //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_005a: 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) pObj = ((Component)this).GetComponent(); rb = ((Component)this).GetComponent(); impactDetector = ((Component)this).GetComponent(); roomVolumeCheck = ((Component)this).GetComponent(); originalScale = ((Component)this).transform.localScale; if ((Object)(object)roomVolumeCheck != (Object)null) { originalDetectionSize = roomVolumeCheck.currentSize; } if ((Object)(object)rb != (Object)null) { originalDrag = rb.drag; originalAngularDrag = rb.angularDrag; } colliders.AddRange(((Component)this).GetComponentsInChildren()); } private void Update() { //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)pObj == (Object)null || pObj.dead || (PhotonNetwork.InRoom && !PhotonNetwork.IsMasterClient)) { return; } if (Time.time - lastCartScan > 3f) { activeCarts.Clear(); activeCarts.AddRange(Object.FindObjectsOfType()); lastCartScan = Time.time; } bool flag = false; foreach (PhysGrabCart activeCart in activeCarts) { if ((Object)(object)activeCart == (Object)null || (Object)(object)((Component)activeCart).gameObject == (Object)null) { continue; } Transform value = Traverse.Create((object)activeCart).Field("inCart").Value; if (!((Object)(object)value == (Object)null) && !(Vector3.Distance(((Component)this).transform.position, value.position) > 6f)) { Vector3 val = value.InverseTransformPoint(((Component)this).transform.position); float value2 = OmniExtractionToolkitPlugin.CartShrinkFieldSize.Value; if (Mathf.Abs(val.x) <= 1.2f * value2 && Mathf.Abs(val.z) <= 1.5f * value2 && val.y >= -0.5f * value2 && val.y <= 5f * value2) { flag = true; break; } } } if (OmniExtractionToolkitPlugin.EnableCartShrink.Value && flag) { ApplyShrink(); } else if (isShrunk) { ResetScale(); } if (OmniExtractionToolkitPlugin.EnableWeightReduction.Value && flag) { ApplyWeightReduction(); } else if (massModified) { ResetMass(); } } private void ApplyShrink() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: 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_007f: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) float value = OmniExtractionToolkitPlugin.CartShrinkFactor.Value; float value2 = OmniExtractionToolkitPlugin.CartShrinkSpeed.Value; Vector3 val = originalScale * value; if (Vector3.Distance(((Component)this).transform.localScale, val) > 0.001f) { ((Component)this).transform.localScale = Vector3.Lerp(((Component)this).transform.localScale, val, Time.deltaTime * value2); if ((Object)(object)roomVolumeCheck != (Object)null) { roomVolumeCheck.currentSize = originalDetectionSize * (((Component)this).transform.localScale.x / originalScale.x); } isShrunk = true; } } private void ResetScale() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) float value = OmniExtractionToolkitPlugin.CartShrinkSpeed.Value; if (Vector3.Distance(((Component)this).transform.localScale, originalScale) > 0.001f) { ((Component)this).transform.localScale = Vector3.Lerp(((Component)this).transform.localScale, originalScale, Time.deltaTime * value); if ((Object)(object)roomVolumeCheck != (Object)null) { roomVolumeCheck.currentSize = originalDetectionSize * (((Component)this).transform.localScale.x / originalScale.x); } return; } ((Component)this).transform.localScale = originalScale; if ((Object)(object)roomVolumeCheck != (Object)null) { roomVolumeCheck.currentSize = originalDetectionSize; } isShrunk = false; } private void ApplyWeightReduction() { if (!((Object)(object)rb != (Object)null)) { return; } float value = OmniExtractionToolkitPlugin.CartShrinkFactor.Value; float num = pObj.massOriginal * value; if (!(Mathf.Abs(rb.mass - num) > 0.01f)) { return; } rb.mass = num; rb.drag = originalDrag + 1f / value * 5f; rb.angularDrag = originalAngularDrag + 1f / value * 5f; foreach (Collider collider in colliders) { if ((Object)(object)collider != (Object)null && (Object)(object)collider.material != (Object)null) { collider.material.bounciness = 0f; collider.material.bounceCombine = (PhysicMaterialCombine)2; } } massModified = true; } private void FixedUpdate() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) if (isShrunk && (Object)(object)rb != (Object)null && !pObj.grabbed) { float num = 1.5f; Vector3 velocity = rb.velocity; if (((Vector3)(ref velocity)).magnitude > num) { rb.velocity = Vector3.ClampMagnitude(rb.velocity, num); } } } private void ResetMass() { if (!((Object)(object)rb != (Object)null)) { return; } rb.mass = pObj.massOriginal; rb.drag = originalDrag; rb.angularDrag = originalAngularDrag; foreach (Collider collider in colliders) { if ((Object)(object)collider != (Object)null && (Object)(object)collider.material != (Object)null) { collider.material.bounciness = 0.4f; collider.material.bounceCombine = (PhysicMaterialCombine)0; } } massModified = false; } } [HarmonyPatch(typeof(PhysGrabObject), "Start")] public static class CartShrink_Patch { private static void Postfix(PhysGrabObject __instance) { if (((Object)(object)((Component)__instance).GetComponent() != (Object)null || (Object)(object)((Component)__instance).GetComponent() != (Object)null) && (Object)(object)((Component)__instance).gameObject.GetComponent() == (Object)null) { ((Component)__instance).gameObject.AddComponent(); } } } public static class CheatPatches { [HarmonyPatch(typeof(PlayerHealth), "Update")] public static class InfiniteHealth_Patch { private static void Postfix(PlayerHealth __instance) { //IL_004f: Unknown result type (might be due to invalid IL or missing references) Traverse val = Traverse.Create((object)__instance); PlayerAvatar value = val.Field("playerAvatar").Value; if (!((Object)(object)value != (Object)null) || !Traverse.Create((object)value).Field("isLocal").Value) { return; } bool value2 = OmniExtractionToolkitPlugin.InfiniteHealth.Value; bool keyDown = Input.GetKeyDown(OmniExtractionToolkitPlugin.HealKey.Value); if (value2 || keyDown) { int value3 = val.Field("health").Value; int value4 = val.Field("maxHealth").Value; if (value3 < value4) { val.Field("health").SetValue((object)value4); } } } } [HarmonyPatch(typeof(PhysGrabObjectImpactDetector), "BreakRPC")] public static class LootDamage_Patch { private static void Prefix(PhysGrabObjectImpactDetector __instance, ref float valueLost, bool _loseValue, PhotonMessageInfo _info) { if (!(PhotonNetwork.IsMasterClient && _loseValue)) { return; } ValuableObject value = Traverse.Create((object)__instance).Field("valuableObject").Value; if (!((Object)(object)value != (Object)null)) { return; } float value2 = OmniExtractionToolkitPlugin.DamageMultiplier.Value; Traverse val = Traverse.Create((object)value); float value3 = val.Field("dollarValueCurrent").Value; float value4 = val.Field("dollarValueOriginal").Value; if (value2 < 0f) { float num = ((value4 > 0f) ? (value3 / value4) : 1f); valueLost *= num * value2; } else { valueLost *= value2; } float num2 = value3 - valueLost; if (num2 > 1E+09f) { valueLost = value3 - 1E+09f; } if ((Object)(object)RoundDirector.instance != (Object)null) { Traverse val2 = Traverse.Create((object)RoundDirector.instance); long num3 = val2.Field("haulGoalMax").Value; long num4 = num3 - (int)valueLost; if (num4 > 2100000000) { num4 = 2100000000L; } if (num4 < 0) { num4 = 0L; } val2.Field("haulGoalMax").SetValue((object)(int)num4); } } } [HarmonyPatch(typeof(PlayerController), "Update")] public static class JumpHeight_Patch { private static void Postfix(PlayerController __instance) { float num = 20f; __instance.JumpForce = num * OmniExtractionToolkitPlugin.JumpHeightMultiplier.Value; } } [HarmonyPatch(typeof(RoundDirector), "Update")] public static class InfiniteBattery_Patch { private static void Postfix(RoundDirector __instance) { if (OmniExtractionToolkitPlugin.InfiniteBattery.Value) { Traverse.Create((object)__instance).Field("debugInfiniteBattery").SetValue((object)true); } } } [HarmonyPatch(typeof(PlayerController), "Update")] public static class InfiniteStamina_Patch { private static void Postfix(PlayerController __instance) { if (OmniExtractionToolkitPlugin.InfiniteStamina.Value) { __instance.DebugEnergy = true; } } } [HarmonyPatch(typeof(PunManager))] public static class SharedUpgrades_Patch { private static bool _syncing; private static bool ShouldSync => OmniExtractionToolkitPlugin.ShareUpgrades.Value && !_syncing && PhotonNetwork.InRoom && PhotonNetwork.IsMasterClient; private static void SyncToAll(string _steamID, int value, string rpcMethodName) { if (string.IsNullOrEmpty(_steamID) || (Object)(object)PunManager.instance == (Object)null) { return; } PhotonView component = ((Component)PunManager.instance).GetComponent(); if ((Object)(object)component == (Object)null) { return; } _syncing = true; try { PlayerAvatar[] array = Object.FindObjectsOfType(); foreach (PlayerAvatar val in array) { string text = SemiFunc.PlayerGetSteamID(val); if (!string.IsNullOrEmpty(text) && text != _steamID) { MethodInfo method = typeof(PunManager).GetMethod(rpcMethodName); if (method != null) { method.Invoke(PunManager.instance, new object[2] { text, value }); } component.RPC(rpcMethodName, (RpcTarget)1, new object[2] { text, value }); } } } finally { _syncing = false; } } [HarmonyPostfix] [HarmonyPatch("UpgradePlayerHealth")] private static void H_P(string _steamID, int value) { if (ShouldSync && OmniExtractionToolkitPlugin.ShareHealth.Value) { SyncToAll(_steamID, value, "UpgradePlayerHealth"); } } [HarmonyPostfix] [HarmonyPatch("UpgradePlayerEnergy")] private static void E_P(string _steamID, int value) { if (ShouldSync && OmniExtractionToolkitPlugin.ShareEnergy.Value) { SyncToAll(_steamID, value, "UpgradePlayerEnergy"); } } [HarmonyPostfix] [HarmonyPatch("UpgradePlayerSprintSpeed")] private static void S_P(string _steamID, int value) { if (ShouldSync && OmniExtractionToolkitPlugin.ShareSprint.Value) { SyncToAll(_steamID, value, "UpgradePlayerSprintSpeed"); } } [HarmonyPostfix] [HarmonyPatch("UpgradePlayerGrabStrength")] private static void GS_P(string _steamID, int value) { if (ShouldSync && OmniExtractionToolkitPlugin.ShareGrabStrength.Value) { SyncToAll(_steamID, value, "UpgradePlayerGrabStrength"); } } [HarmonyPostfix] [HarmonyPatch("UpgradePlayerGrabRange")] private static void GR_P(string _steamID, int value) { if (ShouldSync && OmniExtractionToolkitPlugin.ShareGrabRange.Value) { SyncToAll(_steamID, value, "UpgradePlayerGrabRange"); } } [HarmonyPostfix] [HarmonyPatch("UpgradePlayerExtraJump")] private static void J_P(string _steamID, int value) { if (ShouldSync && OmniExtractionToolkitPlugin.ShareExtraJump.Value) { SyncToAll(_steamID, value, "UpgradePlayerExtraJump"); } } [HarmonyPostfix] [HarmonyPatch("UpgradePlayerTumbleLaunch")] private static void T_P(string _steamID, int value) { if (ShouldSync && OmniExtractionToolkitPlugin.ShareTumble.Value) { SyncToAll(_steamID, value, "UpgradePlayerTumbleLaunch"); } } [HarmonyPostfix] [HarmonyPatch("UpgradePlayerTumbleClimb")] private static void TC_P(string _steamID, int value) { if (ShouldSync && OmniExtractionToolkitPlugin.ShareTumbleClimb.Value) { SyncToAll(_steamID, value, "UpgradePlayerTumbleClimb"); } } [HarmonyPostfix] [HarmonyPatch("UpgradePlayerTumbleWings")] private static void TW_P(string _steamID, int value) { if (ShouldSync && OmniExtractionToolkitPlugin.ShareTumbleWings.Value) { SyncToAll(_steamID, value, "UpgradePlayerTumbleWings"); } } [HarmonyPostfix] [HarmonyPatch("UpgradePlayerCrouchRest")] private static void CR_P(string _steamID, int value) { if (ShouldSync && OmniExtractionToolkitPlugin.ShareCrouchRest.Value) { SyncToAll(_steamID, value, "UpgradePlayerCrouchRest"); } } [HarmonyPostfix] [HarmonyPatch("UpgradePlayerThrowStrength")] private static void TS_P(string _steamID, int value) { if (ShouldSync && OmniExtractionToolkitPlugin.ShareThrowStrength.Value) { SyncToAll(_steamID, value, "UpgradePlayerThrowStrength"); } } } } public class EnhancedHUD : MonoBehaviour { [CompilerGenerated] private sealed class d__8 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public EnhancedHUD <>4__this; private TMP_FontAsset 5__1; private RectTransform 5__2; private GameObject 5__3; private GameObject 5__4; private RectTransform 5__5; private Image 5__6; private GameObject 5__7; private Image 5__8; private GameObject 5__9; private TextMeshProUGUI 5__10; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__8(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__2 = null; 5__3 = null; 5__4 = null; 5__5 = null; 5__6 = null; 5__7 = null; 5__8 = null; 5__9 = null; 5__10 = null; <>1__state = -2; } private bool MoveNext() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Expected O, but got Unknown //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Expected O, but got Unknown //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0217: 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_0248: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Expected O, but got Unknown //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: Expected O, but got Unknown //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Unknown result type (might be due to invalid IL or missing references) //IL_037a: 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_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03cb: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(1f); <>1__state = 1; return true; case 1: { <>1__state = -1; 5__1 = null; if ((Object)(object)ItemInfoUI.instance != (Object)null) { 5__10 = ((Component)ItemInfoUI.instance).GetComponent(); if ((Object)(object)5__10 != (Object)null) { 5__1 = ((TMP_Text)5__10).font; } 5__10 = null; } 5__2 = ((Component)HUDCanvas.instance).GetComponent(); 5__3 = new GameObject("EnhancedMapTracker"); 5__3.transform.SetParent((Transform)(object)5__2, false); <>4__this.mapText = 5__3.AddComponent(); if ((Object)(object)5__1 != (Object)null) { ((TMP_Text)<>4__this.mapText).font = 5__1; } ((TMP_Text)<>4__this.mapText).fontSize = 20f; 5__4 = new GameObject("EnhancedHeldItem"); 5__4.transform.SetParent((Transform)(object)5__2, false); <>4__this.heldItemText = 5__4.AddComponent(); if ((Object)(object)5__1 != (Object)null) { ((TMP_Text)<>4__this.heldItemText).font = 5__1; } ((TMP_Text)<>4__this.heldItemText).fontSize = 22f; ((TMP_Text)<>4__this.heldItemText).alignment = (TextAlignmentOptions)1026; 5__5 = 5__4.GetComponent(); RectTransform obj = 5__5; RectTransform obj2 = 5__5; Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(0.5f, 0f); obj2.anchorMax = val; obj.anchorMin = val; 5__5.pivot = new Vector2(0.5f, 0f); 5__5.anchoredPosition = new Vector2(0f, 50f); 5__5.sizeDelta = new Vector2(600f, 50f); <>4__this.cooldownBar = new GameObject("EnhancedCooldownBar"); <>4__this.cooldownBar.transform.SetParent((Transform)(object)5__2, false); <>4__this.cooldownBar.AddComponent(); 5__6 = <>4__this.cooldownBar.AddComponent(); ((Graphic)5__6).color = new Color(0f, 0f, 0f, 0.7f); 5__7 = new GameObject("Fill"); 5__7.transform.SetParent(<>4__this.cooldownBar.transform, false); <>4__this.cooldownFill = 5__7.AddComponent(); <>4__this.cooldownFill.anchorMin = Vector2.zero; <>4__this.cooldownFill.anchorMax = new Vector2(0f, 1f); <>4__this.cooldownFill.pivot = new Vector2(0f, 0.5f); <>4__this.cooldownFill.anchoredPosition = Vector2.zero; <>4__this.cooldownFill.sizeDelta = Vector2.zero; 5__8 = 5__7.AddComponent(); ((Graphic)5__8).color = new Color(1f, 0.84f, 0f, 1f); 5__9 = new GameObject("Label"); 5__9.transform.SetParent(<>4__this.cooldownBar.transform, false); <>4__this.cooldownLabel = 5__9.AddComponent(); if ((Object)(object)5__1 != (Object)null) { ((TMP_Text)<>4__this.cooldownLabel).font = 5__1; } ((TMP_Text)<>4__this.cooldownLabel).fontSize = 11f; ((TMP_Text)<>4__this.cooldownLabel).text = "RECHARGING SCANNER"; <>4__this.UpdatePosition(); <>4__this.cooldownBar.SetActive(false); return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private TextMeshProUGUI mapText; private TextMeshProUGUI heldItemText; private GameObject cooldownBar; private RectTransform cooldownFill; private TextMeshProUGUI cooldownLabel; private float lastX; private float lastY; private void Start() { ((MonoBehaviour)this).StartCoroutine(CreateUI()); } [IteratorStateMachine(typeof(d__8))] private IEnumerator CreateUI() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__8(0) { <>4__this = this }; } private void UpdatePosition() { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006b: 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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: 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_0127: 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_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0132: 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_016f: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)mapText == (Object)null) && !((Object)(object)cooldownBar == (Object)null)) { float num = OmniExtractionToolkitPlugin.HUDX.Value / 100f; float num2 = OmniExtractionToolkitPlugin.HUDY.Value / 100f; RectTransform component = ((Component)mapText).GetComponent(); Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(num, num2); component.pivot = val; Vector2 val4 = (component.anchorMin = (component.anchorMax = val)); float num3 = Mathf.Lerp(20f, -20f, num); float num4 = Mathf.Lerp(20f, -20f, num2); component.anchoredPosition = new Vector2(num3, num4); if (num < 0.33f) { ((TMP_Text)mapText).alignment = (TextAlignmentOptions)513; } else if (num > 0.66f) { ((TMP_Text)mapText).alignment = (TextAlignmentOptions)516; } else { ((TMP_Text)mapText).alignment = (TextAlignmentOptions)514; } RectTransform component2 = cooldownBar.GetComponent(); ((Vector2)(ref val))..ctor(num, num2); component2.pivot = val; val4 = (component2.anchorMin = (component2.anchorMax = val)); component2.sizeDelta = new Vector2(135f, 8f); float num5 = ((num2 > 0.5f) ? (-110f) : 110f); component2.anchoredPosition = new Vector2(num3, num4 + num5); RectTransform component3 = ((Component)cooldownLabel).GetComponent(); ((Vector2)(ref val4))..ctor(num, (float)((!(num2 > 0.5f)) ? 1 : 0)); component3.anchorMax = val4; component3.anchorMin = val4; component3.pivot = new Vector2(num, 0f); component3.anchoredPosition = new Vector2(0f, (float)((num2 > 0.5f) ? (-24) : 4)); component3.sizeDelta = new Vector2(200f, 18f); if (num < 0.33f) { ((TMP_Text)cooldownLabel).alignment = (TextAlignmentOptions)513; } else if (num > 0.66f) { ((TMP_Text)cooldownLabel).alignment = (TextAlignmentOptions)516; } else { ((TMP_Text)cooldownLabel).alignment = (TextAlignmentOptions)514; } lastX = OmniExtractionToolkitPlugin.HUDX.Value; lastY = OmniExtractionToolkitPlugin.HUDY.Value; } } private void Update() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Invalid comparison between Unknown and I4 //IL_04ba: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Expected O, but got Unknown if ((Object)(object)this == (Object)null || !((Component)this).gameObject.activeInHierarchy) { return; } bool flag = (Object)(object)GameDirector.instance != (Object)null && (int)GameDirector.instance.currentState == 2; bool flag2 = true; if ((Object)(object)MenuManager.instance != (Object)null) { flag2 = Traverse.Create((object)MenuManager.instance).Field("currentMenuState").Value == 1; } bool flag3 = flag && flag2 && !SemiFunc.MenuLevel(); if (lastX != OmniExtractionToolkitPlugin.HUDX.Value || lastY != OmniExtractionToolkitPlugin.HUDY.Value) { UpdatePosition(); } if ((Object)(object)mapText != (Object)null) { ((Component)mapText).gameObject.SetActive(flag3); if (flag3 && (Object)(object)RoundDirector.instance != (Object)null) { Traverse val = Traverse.Create((object)RoundDirector.instance); object value = val.Field("currentHaul").GetValue(); object obj = val.Field("haulGoalMax").GetValue(); object obj2 = val.Field("extractionHaulGoal").GetValue(); if (obj2 == null || (int)obj2 == 0) { obj2 = val.Field("haulGoal").GetValue(); } if (PhotonNetwork.InRoom) { if (PhotonNetwork.IsMasterClient) { int num = ((obj is int) ? ((int)obj) : 0); int num2 = ((obj2 is int) ? ((int)obj2) : 0); bool flag4 = false; Hashtable val2 = new Hashtable(); if (!((Dictionary)(object)((RoomInfo)PhotonNetwork.CurrentRoom).CustomProperties).ContainsKey((object)"OmniMapTotal") || (int)((RoomInfo)PhotonNetwork.CurrentRoom).CustomProperties[(object)"OmniMapTotal"] != num) { val2[(object)"OmniMapTotal"] = num; flag4 = true; } if (!((Dictionary)(object)((RoomInfo)PhotonNetwork.CurrentRoom).CustomProperties).ContainsKey((object)"OmniMapGoal") || (int)((RoomInfo)PhotonNetwork.CurrentRoom).CustomProperties[(object)"OmniMapGoal"] != num2) { val2[(object)"OmniMapGoal"] = num2; flag4 = true; } if (flag4) { PhotonNetwork.CurrentRoom.SetCustomProperties(val2, (Hashtable)null, (WebFlags)null); } } else { if (((Dictionary)(object)((RoomInfo)PhotonNetwork.CurrentRoom).CustomProperties).TryGetValue((object)"OmniMapTotal", out object value2)) { obj = value2; } if (((Dictionary)(object)((RoomInfo)PhotonNetwork.CurrentRoom).CustomProperties).TryGetValue((object)"OmniMapGoal", out object value3)) { obj2 = value3; } } } if (value != null && obj != null && obj2 != null) { ((TMP_Text)mapText).text = $"Haul: ${value} / Goal: ${obj2}\nMap Total: ${obj}"; } } else { ((TMP_Text)mapText).text = ""; } } if ((Object)(object)heldItemText != (Object)null) { PhysGrabObject val3 = null; if ((Object)(object)PhysGrabber.instance != (Object)null) { val3 = Traverse.Create((object)PhysGrabber.instance).Field("grabbedPhysGrabObject").Value; } bool flag5 = false; float num3 = 0f; string arg = ""; if ((Object)(object)val3 != (Object)null) { ValuableObject component = ((Component)val3).GetComponent(); bool flag6 = (Object)(object)((Component)val3).GetComponent() != (Object)null; bool flag7 = SemiFunc.RunIsShop(); if ((Object)(object)component != (Object)null && (!flag6 || flag7)) { flag5 = true; arg = ((Object)((Component)val3).gameObject).name.Replace("(Clone)", "").Trim(); num3 = Traverse.Create((object)component).Field("dollarValueCurrent").Value; } } bool flag8 = flag3 && OmniExtractionToolkitPlugin.ShowHeldItem.Value && flag5; ((Component)heldItemText).gameObject.SetActive(flag8); if (flag8) { ((TMP_Text)heldItemText).text = $"{arg} (${num3:F0})"; } else { ((TMP_Text)heldItemText).text = ""; } } if ((Object)(object)cooldownBar != (Object)null) { float num4 = Time.time - ScannerPatches.lastScanTime; float value4 = OmniExtractionToolkitPlugin.ScanCooldown.Value; if (flag3 && num4 < value4) { cooldownBar.SetActive(true); cooldownFill.anchorMax = new Vector2(num4 / value4, 1f); } else { cooldownBar.SetActive(false); } } } } [HarmonyPatch(typeof(HUDCanvas), "Awake")] public static class HUDCanvas_Patch { private static void Postfix(HUDCanvas __instance) { if ((Object)(object)((Component)__instance).gameObject.GetComponent() == (Object)null) { ((Component)__instance).gameObject.AddComponent(); } } } public static class ScannerPatches { [HarmonyPatch(typeof(PlayerController), "Update")] public static class PlayerScan_Patch { private static void Postfix() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) if ((SemiFunc.InputDown((InputKey)327) || Input.GetKeyDown(OmniExtractionToolkitPlugin.ScanKey.Value)) && !(Time.time - lastScanTime < OmniExtractionToolkitPlugin.ScanCooldown.Value)) { DoLocalScan(); lastScanTime = Time.time; } } } [HarmonyPatch(typeof(ItemTracker), "ValuableTarget")] public static class TrackerRange_Patch { private static bool Prefix(ItemTracker __instance) { //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) object value = Traverse.Create((object)__instance).Field("trackerType").GetValue(); if (value == null || value.ToString() != "Valuable") { return true; } Traverse val = Traverse.Create((object)__instance); Transform value2 = val.Field("nozzleTransform").GetValue(); if ((Object)(object)value2 == (Object)null) { return true; } Vector3 position = value2.position; float num = 500f; Collider[] array = Physics.OverlapSphere(position, num, LayerMask.op_Implicit(SemiFunc.LayerMaskGetPhysGrabObject())); PhysGrabObject val2 = null; ValuableObject value3 = null; ValuableDiscoverCustom value4 = null; float num2 = float.MaxValue; Collider[] array2 = array; foreach (Collider val3 in array2) { PhysGrabObject val4 = null; ValuableObject componentInParent = ((Component)val3).GetComponentInParent(); ValuableDiscoverCustom val5 = null; if ((Object)(object)componentInParent != (Object)null) { if (!Traverse.Create((object)componentInParent).Field("discovered").Value) { val4 = Traverse.Create((object)componentInParent).Field("physGrabObject").Value; } } else { val5 = ((Component)val3).GetComponentInParent(); if ((Object)(object)val5 != (Object)null && !Traverse.Create((object)val5).Field("discovered").Value) { val4 = Traverse.Create((object)val5).Field("physGrabObject").Value; } } if ((Object)(object)val4 != (Object)null) { float num3 = Vector3.Distance(position, val4.midPoint); PhysGrabObjectImpactDetector value5 = Traverse.Create((object)val4).Field("impactDetector").Value; if (num3 < num2 && !val4.grabbed && (Object)(object)value5 != (Object)null && !value5.inCart) { num2 = num3; val2 = val4; value3 = componentInParent; value4 = val5; } } } if ((Object)(object)val2 != (Object)null) { val.Field("currentTarget").SetValue((object)((Component)val2).transform); val.Field("currentTargetPhysGrabObject").SetValue((object)val2); val.Field("currentTargetValuable").SetValue((object)value3); val.Field("currentTargetValuableCustom").SetValue((object)value4); val.Field("hasTarget").SetValue((object)true); PhotonView value6 = Traverse.Create((object)val2).Field("photonView").Value; if ((Object)(object)value6 != (Object)null) { val.Method("SetTarget", new object[1] { value6.ViewID }).GetValue(); } } else { val.Field("hasTarget").SetValue((object)false); } return false; } } public static float lastScanTime = -100f; public static void DoLocalScan() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)PlayerController.instance == (Object)null) { return; } Vector3 position = ((Component)PlayerController.instance).transform.position; float value = OmniExtractionToolkitPlugin.ScanRadius.Value; int num = 0; int num2 = LayerMask.op_Implicit(SemiFunc.LayerMaskGetPhysGrabObject()); Collider[] array = Physics.OverlapSphere(position, value, num2); Collider[] array2 = array; foreach (Collider val in array2) { ValuableObject componentInParent = ((Component)val).GetComponentInParent(); if ((Object)(object)componentInParent != (Object)null) { PhysGrabObject value2 = Traverse.Create((object)componentInParent).Field("physGrabObject").Value; if ((Object)(object)value2 != (Object)null && (Object)(object)ValuableDiscover.instance != (Object)null) { ValuableDiscover.instance.New(value2, (State)0, (ValuableDiscoverCustom)null); num++; } continue; } ValuableDiscoverCustom componentInParent2 = ((Component)val).GetComponentInParent(); if ((Object)(object)componentInParent2 != (Object)null) { PhysGrabObject value3 = Traverse.Create((object)componentInParent2).Field("physGrabObject").Value; if ((Object)(object)value3 != (Object)null && (Object)(object)ValuableDiscover.instance != (Object)null) { ValuableDiscover.instance.New(value3, (State)0, componentInParent2); num++; } } } if (num > 0) { SemiFunc.UIItemInfoText((ItemAttributes)null, $"Area scanned. (Found {num} items)"); } else { SemiFunc.UIItemInfoText((ItemAttributes)null, "Area scanned. No new items found."); } } } public static class UIPatches { [HarmonyPatch(typeof(ItemInfoUI), "ItemInfoText")] public static class ItemInfoUI_Patch { private static void Prefix(ref string message, ItemAttributes _itemAttributes) { if (!((Object)(object)_itemAttributes != (Object)null)) { return; } ValuableObject componentInParent = ((Component)_itemAttributes).GetComponentInParent(); bool flag = (Object)(object)((Component)_itemAttributes).GetComponent() != (Object)null; bool flag2 = SemiFunc.RunIsShop(); if ((Object)(object)componentInParent != (Object)null && (!flag || flag2)) { float value = Traverse.Create((object)componentInParent).Field("dollarValueCurrent").Value; message += $" (${value:F0})"; } else if (flag2) { int value2 = Traverse.Create((object)_itemAttributes).Field("value").Value; if (value2 > 0) { message += $" (${value2:F0})"; } } } } [HarmonyPatch(typeof(PhysGrabber), "RayCheck")] public static class PhysGrabber_RayCheck_Patch { private static void Prefix(PhysGrabber __instance) { Traverse val = Traverse.Create((object)__instance); val.Field("currentlyLookingAtPhysGrabObject").SetValue((object)null); val.Field("currentlyLookingAtItemAttributes").SetValue((object)null); } private static void Postfix(PhysGrabber __instance) { Traverse val = Traverse.Create((object)__instance); PhysGrabObject value = val.Field("currentlyLookingAtPhysGrabObject").Value; ItemAttributes value2 = val.Field("currentlyLookingAtItemAttributes").Value; if ((Object)(object)value != (Object)null && (Object)(object)value2 == (Object)null) { ValuableObject component = ((Component)value).GetComponent(); if ((Object)(object)component != (Object)null) { float value3 = Traverse.Create((object)component).Field("dollarValueCurrent").Value; string arg = ((Object)((Component)value).gameObject).name.Replace("(Clone)", "").Trim(); SemiFunc.UIItemInfoText((ItemAttributes)null, $"{arg} (${value3:F0})"); } } } } } public static class VanillaFixPatches { [HarmonyPatch(typeof(ShopRadio), "Update")] public static class ShopRadio_Update_Patch { private static bool Prefix(ShopRadio __instance) { PhysGrabObject value = Traverse.Create((object)__instance).Field("physGrabObject").Value; if ((Object)(object)value != (Object)null && value.dead) { return false; } ParticleSystem value2 = Traverse.Create((object)__instance).Field("smoke").Value; if ((Object)(object)value2 == (Object)null || (Object)(object)((Component)value2).gameObject == (Object)null) { return false; } return true; } } } }