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 Omni Extraction Toolkit v1.0.6
plugins/OmniExtractionToolkit.dll
Decompiled 2 weeks agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using 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<KeyCode> ScanKey; public static ConfigEntry<float> ScanRadius; public static ConfigEntry<float> ScanCooldown; public static ConfigEntry<float> HUDX; public static ConfigEntry<float> HUDY; public static ConfigEntry<bool> ShowHeldItem; public static ConfigEntry<bool> ShareUpgrades; public static ConfigEntry<bool> ShareHealth; public static ConfigEntry<bool> ShareEnergy; public static ConfigEntry<bool> ShareSprint; public static ConfigEntry<bool> ShareGrabStrength; public static ConfigEntry<bool> ShareGrabRange; public static ConfigEntry<bool> ShareExtraJump; public static ConfigEntry<bool> ShareTumble; public static ConfigEntry<bool> ShareTumbleClimb; public static ConfigEntry<bool> ShareTumbleWings; public static ConfigEntry<bool> ShareCrouchRest; public static ConfigEntry<bool> ShareThrowStrength; public static ConfigEntry<bool> InfiniteHealth; public static ConfigEntry<KeyCode> HealKey; public static ConfigEntry<bool> InfiniteBattery; public static ConfigEntry<bool> InfiniteStamina; public static ConfigEntry<float> JumpHeightMultiplier; public static ConfigEntry<float> DamageMultiplier; public static ConfigEntry<bool> EnableCartShrink; public static ConfigEntry<float> CartShrinkFactor; public static ConfigEntry<float> CartShrinkSpeed; public static ConfigEntry<float> CartShrinkFieldSize; public static ConfigEntry<bool> 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<KeyCode>("Scanner", "ScanKey", (KeyCode)102, "Key to trigger a manual scan"); ScanRadius = ((BaseUnityPlugin)this).Config.Bind<float>("Scanner", "ScanRadius", 50f, new ConfigDescription("Radius", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 100f), Array.Empty<object>())); ScanCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("Scanner", "ScanCooldown", 5f, new ConfigDescription("Cooldown", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 30f), Array.Empty<object>())); HUDX = ((BaseUnityPlugin)this).Config.Bind<float>("HUD", "Horizontal Position", 100f, new ConfigDescription("X% (0=Left, 100=Right)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 100f), Array.Empty<object>())); HUDY = ((BaseUnityPlugin)this).Config.Bind<float>("HUD", "Vertical Position", 5f, new ConfigDescription("Y% (0=Bottom, 100=Top)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 100f), Array.Empty<object>())); ShowHeldItem = ((BaseUnityPlugin)this).Config.Bind<bool>("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<bool>("Team Upgrades (Host Only)", "Master Toggle", true, "When enabled, any upgrade anyone buys is shared with everyone."); ShareHealth = ((BaseUnityPlugin)this).Config.Bind<bool>("Team Upgrades (Host Only)", "Health Upgrade", true, (ConfigDescription)null); ShareEnergy = ((BaseUnityPlugin)this).Config.Bind<bool>("Team Upgrades (Host Only)", "Energy Upgrade", true, (ConfigDescription)null); ShareSprint = ((BaseUnityPlugin)this).Config.Bind<bool>("Team Upgrades (Host Only)", "Sprint Speed Upgrade", true, (ConfigDescription)null); ShareGrabStrength = ((BaseUnityPlugin)this).Config.Bind<bool>("Team Upgrades (Host Only)", "Grab Strength Upgrade", true, (ConfigDescription)null); ShareGrabRange = ((BaseUnityPlugin)this).Config.Bind<bool>("Team Upgrades (Host Only)", "Grab Range Upgrade", true, (ConfigDescription)null); ShareExtraJump = ((BaseUnityPlugin)this).Config.Bind<bool>("Team Upgrades (Host Only)", "Extra Jump Upgrade", true, (ConfigDescription)null); ShareTumble = ((BaseUnityPlugin)this).Config.Bind<bool>("Team Upgrades (Host Only)", "Tumble Launch Upgrade", true, (ConfigDescription)null); ShareTumbleClimb = ((BaseUnityPlugin)this).Config.Bind<bool>("Team Upgrades (Host Only)", "Tumble Climb Upgrade", true, (ConfigDescription)null); ShareTumbleWings = ((BaseUnityPlugin)this).Config.Bind<bool>("Team Upgrades (Host Only)", "Tumble Wings Upgrade", true, (ConfigDescription)null); ShareCrouchRest = ((BaseUnityPlugin)this).Config.Bind<bool>("Team Upgrades (Host Only)", "Crouch Rest Upgrade", true, (ConfigDescription)null); ShareThrowStrength = ((BaseUnityPlugin)this).Config.Bind<bool>("Team Upgrades (Host Only)", "Throw Strength Upgrade", true, (ConfigDescription)null); InfiniteHealth = ((BaseUnityPlugin)this).Config.Bind<bool>("Cheats (Client-Side)", "Infinite Health", false, "Health bar stays at 100%. (Still feel damage effects)"); HealKey = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Cheats (Client-Side)", "Heal Hotkey", (KeyCode)104, "Key to instantly refill health to 100%."); InfiniteBattery = ((BaseUnityPlugin)this).Config.Bind<bool>("Cheats (Client-Side)", "Infinite Battery & Ammo", false, "All tools and weapons stay at 100% charge."); InfiniteStamina = ((BaseUnityPlugin)this).Config.Bind<bool>("Cheats (Client-Side)", "Infinite Stamina", false, "Never run out of energy while sprinting."); JumpHeightMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("Cheats (Client-Side)", "Jump Height Multiplier", 1f, new ConfigDescription("Increase player jump height.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 5f), Array.Empty<object>())); DamageMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("Cheats (Host Only)", "Loot Damage Multiplier", 1f, new ConfigDescription("Negative = increase value! Only works if YOU are the host.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(-5f, 10f), Array.Empty<object>())); EnableCartShrink = ((BaseUnityPlugin)this).Config.Bind<bool>("Cart Shrink (Host Only)", "Enable Cart Shrink", false, "Shrink items when they are placed in a cart."); CartShrinkFactor = ((BaseUnityPlugin)this).Config.Bind<float>("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<float>(0.1f, 1f), Array.Empty<object>())); CartShrinkSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("Cart Shrink (Host Only)", "Shrink Speed", 3f, new ConfigDescription("How fast items transition between sizes (1 = slow, 20 = instant).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 20f), Array.Empty<object>())); CartShrinkFieldSize = ((BaseUnityPlugin)this).Config.Bind<float>("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<float>(0.1f, 5f), Array.Empty<object>())); EnableWeightReduction = ((BaseUnityPlugin)this).Config.Bind<bool>("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 "<Keyboard>/" + ((object)(KeyCode)(ref keyCode)).ToString().Replace("Alpha", ""); } if ((int)keyCode == 323) { return "<Mouse>/leftButton"; } if ((int)keyCode == 324) { return "<Mouse>/rightButton"; } if ((int)keyCode == 325) { return "<Mouse>/middleButton"; } string text = ((object)(KeyCode)(ref keyCode)).ToString(); if (text.Length > 0) { text = char.ToLower(text[0]) + text.Substring(1); } return "<Keyboard>/" + 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<Collider> colliders = new List<Collider>(); private static List<PhysGrabCart> activeCarts = new List<PhysGrabCart>(); 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<PhysGrabObject>(); rb = ((Component)this).GetComponent<Rigidbody>(); impactDetector = ((Component)this).GetComponent<PhysGrabObjectImpactDetector>(); roomVolumeCheck = ((Component)this).GetComponent<RoomVolumeCheck>(); 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<Collider>()); } 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<PhysGrabCart>()); 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<Transform>("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<ValuableObject>() != (Object)null || (Object)(object)((Component)__instance).GetComponent<ValuableDiscoverCustom>() != (Object)null) && (Object)(object)((Component)__instance).gameObject.GetComponent<CartShrinkComponent>() == (Object)null) { ((Component)__instance).gameObject.AddComponent<CartShrinkComponent>(); } } } 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>("playerAvatar").Value; if (!((Object)(object)value != (Object)null) || !Traverse.Create((object)value).Field<bool>("isLocal").Value) { return; } bool value2 = OmniExtractionToolkitPlugin.InfiniteHealth.Value; bool keyDown = Input.GetKeyDown(OmniExtractionToolkitPlugin.HealKey.Value); if (value2 || keyDown) { int value3 = val.Field<int>("health").Value; int value4 = val.Field<int>("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>("valuableObject").Value; if (!((Object)(object)value != (Object)null)) { return; } float value2 = OmniExtractionToolkitPlugin.DamageMultiplier.Value; Traverse val = Traverse.Create((object)value); float value3 = val.Field<float>("dollarValueCurrent").Value; float value4 = val.Field<float>("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<int>("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<PhotonView>(); if ((Object)(object)component == (Object)null) { return; } _syncing = true; try { PlayerAvatar[] array = Object.FindObjectsOfType<PlayerAvatar>(); 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 <CreateUI>d__8 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public EnhancedHUD <>4__this; private TMP_FontAsset <font>5__1; private RectTransform <canvasRect>5__2; private GameObject <go>5__3; private GameObject <heldGo>5__4; private RectTransform <heldRt>5__5; private Image <bg>5__6; private GameObject <fill>5__7; private Image <img>5__8; private GameObject <lblGo>5__9; private TextMeshProUGUI <tmp>5__10; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <CreateUI>d__8(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <font>5__1 = null; <canvasRect>5__2 = null; <go>5__3 = null; <heldGo>5__4 = null; <heldRt>5__5 = null; <bg>5__6 = null; <fill>5__7 = null; <img>5__8 = null; <lblGo>5__9 = null; <tmp>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; <font>5__1 = null; if ((Object)(object)ItemInfoUI.instance != (Object)null) { <tmp>5__10 = ((Component)ItemInfoUI.instance).GetComponent<TextMeshProUGUI>(); if ((Object)(object)<tmp>5__10 != (Object)null) { <font>5__1 = ((TMP_Text)<tmp>5__10).font; } <tmp>5__10 = null; } <canvasRect>5__2 = ((Component)HUDCanvas.instance).GetComponent<RectTransform>(); <go>5__3 = new GameObject("EnhancedMapTracker"); <go>5__3.transform.SetParent((Transform)(object)<canvasRect>5__2, false); <>4__this.mapText = <go>5__3.AddComponent<TextMeshProUGUI>(); if ((Object)(object)<font>5__1 != (Object)null) { ((TMP_Text)<>4__this.mapText).font = <font>5__1; } ((TMP_Text)<>4__this.mapText).fontSize = 20f; <heldGo>5__4 = new GameObject("EnhancedHeldItem"); <heldGo>5__4.transform.SetParent((Transform)(object)<canvasRect>5__2, false); <>4__this.heldItemText = <heldGo>5__4.AddComponent<TextMeshProUGUI>(); if ((Object)(object)<font>5__1 != (Object)null) { ((TMP_Text)<>4__this.heldItemText).font = <font>5__1; } ((TMP_Text)<>4__this.heldItemText).fontSize = 22f; ((TMP_Text)<>4__this.heldItemText).alignment = (TextAlignmentOptions)1026; <heldRt>5__5 = <heldGo>5__4.GetComponent<RectTransform>(); RectTransform obj = <heldRt>5__5; RectTransform obj2 = <heldRt>5__5; Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(0.5f, 0f); obj2.anchorMax = val; obj.anchorMin = val; <heldRt>5__5.pivot = new Vector2(0.5f, 0f); <heldRt>5__5.anchoredPosition = new Vector2(0f, 50f); <heldRt>5__5.sizeDelta = new Vector2(600f, 50f); <>4__this.cooldownBar = new GameObject("EnhancedCooldownBar"); <>4__this.cooldownBar.transform.SetParent((Transform)(object)<canvasRect>5__2, false); <>4__this.cooldownBar.AddComponent<RectTransform>(); <bg>5__6 = <>4__this.cooldownBar.AddComponent<Image>(); ((Graphic)<bg>5__6).color = new Color(0f, 0f, 0f, 0.7f); <fill>5__7 = new GameObject("Fill"); <fill>5__7.transform.SetParent(<>4__this.cooldownBar.transform, false); <>4__this.cooldownFill = <fill>5__7.AddComponent<RectTransform>(); <>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; <img>5__8 = <fill>5__7.AddComponent<Image>(); ((Graphic)<img>5__8).color = new Color(1f, 0.84f, 0f, 1f); <lblGo>5__9 = new GameObject("Label"); <lblGo>5__9.transform.SetParent(<>4__this.cooldownBar.transform, false); <>4__this.cooldownLabel = <lblGo>5__9.AddComponent<TextMeshProUGUI>(); if ((Object)(object)<font>5__1 != (Object)null) { ((TMP_Text)<>4__this.cooldownLabel).font = <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(<CreateUI>d__8))] private IEnumerator CreateUI() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <CreateUI>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<RectTransform>(); 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<RectTransform>(); ((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<RectTransform>(); ((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<int>("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, object>)(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, object>)(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, object>)(object)((RoomInfo)PhotonNetwork.CurrentRoom).CustomProperties).TryGetValue((object)"OmniMapTotal", out object value2)) { obj = value2; } if (((Dictionary<object, object>)(object)((RoomInfo)PhotonNetwork.CurrentRoom).CustomProperties).TryGetValue((object)"OmniMapGoal", out object value3)) { obj2 = value3; } } } if (value != null && obj != null && obj2 != null) { ((TMP_Text)mapText).text = $"<color=white>Haul: <color=yellow>${value}</color> / Goal: ${obj2}\nMap Total: <color=green>${obj}</color></color>"; } } 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<PhysGrabObject>("grabbedPhysGrabObject").Value; } bool flag5 = false; float num3 = 0f; string arg = ""; if ((Object)(object)val3 != (Object)null) { ValuableObject component = ((Component)val3).GetComponent<ValuableObject>(); bool flag6 = (Object)(object)((Component)val3).GetComponent<ItemEquippable>() != (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<float>("dollarValueCurrent").Value; } } bool flag8 = flag3 && OmniExtractionToolkitPlugin.ShowHeldItem.Value && flag5; ((Component)heldItemText).gameObject.SetActive(flag8); if (flag8) { ((TMP_Text)heldItemText).text = $"{arg} <color=#00FF00>(${num3:F0})</color>"; } 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<EnhancedHUD>() == (Object)null) { ((Component)__instance).gameObject.AddComponent<EnhancedHUD>(); } } } 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<Transform>(); 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<ValuableObject>(); ValuableDiscoverCustom val5 = null; if ((Object)(object)componentInParent != (Object)null) { if (!Traverse.Create((object)componentInParent).Field<bool>("discovered").Value) { val4 = Traverse.Create((object)componentInParent).Field<PhysGrabObject>("physGrabObject").Value; } } else { val5 = ((Component)val3).GetComponentInParent<ValuableDiscoverCustom>(); if ((Object)(object)val5 != (Object)null && !Traverse.Create((object)val5).Field<bool>("discovered").Value) { val4 = Traverse.Create((object)val5).Field<PhysGrabObject>("physGrabObject").Value; } } if ((Object)(object)val4 != (Object)null) { float num3 = Vector3.Distance(position, val4.midPoint); PhysGrabObjectImpactDetector value5 = Traverse.Create((object)val4).Field<PhysGrabObjectImpactDetector>("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>("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<ValuableObject>(); if ((Object)(object)componentInParent != (Object)null) { PhysGrabObject value2 = Traverse.Create((object)componentInParent).Field<PhysGrabObject>("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<ValuableDiscoverCustom>(); if ((Object)(object)componentInParent2 != (Object)null) { PhysGrabObject value3 = Traverse.Create((object)componentInParent2).Field<PhysGrabObject>("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<ValuableObject>(); bool flag = (Object)(object)((Component)_itemAttributes).GetComponent<ItemEquippable>() != (Object)null; bool flag2 = SemiFunc.RunIsShop(); if ((Object)(object)componentInParent != (Object)null && (!flag || flag2)) { float value = Traverse.Create((object)componentInParent).Field<float>("dollarValueCurrent").Value; message += $" <color=#00FF00>(${value:F0})</color>"; } else if (flag2) { int value2 = Traverse.Create((object)_itemAttributes).Field<int>("value").Value; if (value2 > 0) { message += $" <color=#00FF00>(${value2:F0})</color>"; } } } } [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<PhysGrabObject>("currentlyLookingAtPhysGrabObject").Value; ItemAttributes value2 = val.Field<ItemAttributes>("currentlyLookingAtItemAttributes").Value; if ((Object)(object)value != (Object)null && (Object)(object)value2 == (Object)null) { ValuableObject component = ((Component)value).GetComponent<ValuableObject>(); if ((Object)(object)component != (Object)null) { float value3 = Traverse.Create((object)component).Field<float>("dollarValueCurrent").Value; string arg = ((Object)((Component)value).gameObject).name.Replace("(Clone)", "").Trim(); SemiFunc.UIItemInfoText((ItemAttributes)null, $"{arg} <color=#00FF00>(${value3:F0})</color>"); } } } } } 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>("physGrabObject").Value; if ((Object)(object)value != (Object)null && value.dead) { return false; } ParticleSystem value2 = Traverse.Create((object)__instance).Field<ParticleSystem>("smoke").Value; if ((Object)(object)value2 == (Object)null || (Object)(object)((Component)value2).gameObject == (Object)null) { return false; } return true; } } } }