using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using ModSaveBackups; using UnityEngine; using cakeslice; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("RadRefinements")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("raddude")] [assembly: AssemblyProduct("RadRefinements")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("c0c6b307-93f0-4209-8594-7f911e48e709")] [assembly: AssemblyFileVersion("1.3.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.3.0.0")] [module: UnverifiableCode] namespace RadRefinements { internal class PipePatches { [HarmonyPatch(typeof(ShipItem), "OnAltActivate")] private class ShipItemPatches { [CompilerGenerated] private sealed class d__1 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public ShipItemPipe pipe; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__1(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; break; } if (Object.op_Implicit((Object)(object)((PickupableItem)pipe).held) && (double)((PickupableItem)pipe).holdDistance > 0.25 && _clickedCount % 2 != 0 && ((ShipItem)pipe).amount > 0f) { ((PickupableItem)pipe).holdDistance = Mathf.Lerp(((PickupableItem)pipe).holdDistance, 0.25f, Time.deltaTime * 4.44f); ((PickupableItem)pipe).holdHeight = Mathf.Lerp(((PickupableItem)pipe).holdHeight, pipe.height, Time.deltaTime * 4.44f); ((PickupableItem)pipe).heldRotationOffset = Mathf.Lerp(((PickupableItem)pipe).heldRotationOffset, 0f - pipe.maxRot, Time.deltaTime * pipe.rotRate); pipe.SetPrivateField("inhaling", !PipeExhaleEffect.instance.exhaling); pipe.SetPrivateField("drinking", true); <>2__current = null; <>1__state = 1; return true; } if (!Object.op_Implicit((Object)(object)((PickupableItem)pipe).held) || ((ShipItem)pipe).amount <= 0f) { _clickedCount = 0; } 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(); } } public static void Postfix(ShipItem __instance) { if (Configs.enableSingleClickSmoking.Value) { ShipItemPipe val = (ShipItemPipe)(object)((__instance is ShipItemPipe) ? __instance : null); if (val != null && ((ShipItem)val).sold) { _clickedCount++; ((MonoBehaviour)__instance).StartCoroutine(MovePipe(val)); } } } [IteratorStateMachine(typeof(d__1))] private static IEnumerator MovePipe(ShipItemPipe pipe) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__1(0) { pipe = pipe }; } } [HarmonyPatch(typeof(ShipItemPipe), "OnAltHeld")] public class ShipItemPipePatches { public static bool Prefix() { if (Configs.enableSingleClickSmoking.Value) { return false; } return true; } } private static int _clickedCount; } internal class SunCompassPatches { [HarmonyPatch(typeof(ShipItemCompass))] private class ShipItemCompassPatches { [HarmonyPrefix] [HarmonyPatch("OnLoad")] public static void AddTextMesh(ShipItemCompass __instance) { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) if (!(((ShipItem)__instance).name != "sun compass")) { Transform val = Object.Instantiate(((Component)DayLogs.instance).transform.parent.GetChild(0).GetChild(1)); ((Object)val).name = "sun_compass_reading_text"; val.SetParent(((Component)__instance).transform); ((Component)val).gameObject.layer = 0; val.localEulerAngles = new Vector3(45f, 0f, 0f); val.localPosition = new Vector3(0f, 0f, 0.18f); TextMesh component = ((Component)val).GetComponent(); component.color = Color32.op_Implicit(new Color32((byte)219, (byte)214, (byte)201, (byte)136)); component.fontSize = 20; component.fontStyle = (FontStyle)0; component.anchor = (TextAnchor)7; component.lineSpacing = 0.7f; ((Component)val).gameObject.SetActive(false); SunCompassTextMeshes.Add(__instance, component); SunCompassesInSun.Add(__instance, value: false); ((MonoBehaviour)__instance).StartCoroutine(CheckItemInSunlight((ShipItem)(object)__instance)); } } [HarmonyPostfix] [HarmonyPatch("ExtraLateUpdate")] public static void AddReading(ShipItemCompass __instance) { //IL_0108: Unknown result type (might be due to invalid IL or missing references) if (!Configs.enableSunCompassText.Value || !GameState.playing || GameState.currentlyLoading || GameState.loadingBoatLocalItems || ((ShipItem)__instance).name != "sun compass" || !((ShipItem)__instance).sold) { return; } if (Input.GetKeyDown((KeyCode)112)) { for (int i = 0; i < Refs.islands.Count(); i++) { Transform val = Refs.islands[i]; RR_Plugin.LogDebug($"{((Object)val).name} index {i}"); } } if (SunCompassTextMeshes.TryGetValue(__instance, out var value)) { if ((Object)(object)((PickupableItem)__instance).held == (Object)null || ((Component)__instance).gameObject.layer == 5 || !SunCompassesInSun[__instance]) { ((Component)value).gameObject.SetActive(false); return; } float z = FloatingOriginManager.instance.GetGlobeCoords(((Component)__instance).transform).z; value.text = $"{Math.Round(z, 1)}°"; ((Component)value).gameObject.SetActive(true); } } } [CompilerGenerated] private sealed class d__8 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public ShipItem sunCompass; private ShipItemCompass 5__1; private float