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 PeasFishing v0.6.2
BepInEx/plugins/PeasFishing/PeasFishing.dll
Decompiled 4 hours agousing System; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using Microsoft.CodeAnalysis; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyCompany("PeasFishing")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("PeasFishing")] [assembly: AssemblyTitle("PeasFishing")] [assembly: AssemblyVersion("1.0.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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 PeasFishing { [BepInPlugin("peaskeepers.peasfishing", "PeasFishing", "0.6.1")] public sealed class PeasFishingPlugin : BaseUnityPlugin { public const string PluginGuid = "peaskeepers.peasfishing"; public const string PluginName = "PeasFishing"; public const string PluginVersion = "0.6.1"; internal static PeasFishingPlugin Instance; internal static ConfigEntry<bool> Enabled; internal static ConfigEntry<KeyCode> RaiseKey; internal static ConfigEntry<float> Difficulty; internal static ConfigEntry<float> BarSize; internal static ConfigEntry<float> FillSeconds; internal static ConfigEntry<float> DrainSeconds; internal static ConfigEntry<float> CatchSpeedMultiplier; internal static ConfigEntry<float> LiftAcceleration; internal static ConfigEntry<float> GravityAcceleration; internal static ConfigEntry<float> MaxBarSpeed; internal static ConfigEntry<float> BarDamping; internal static ConfigEntry<float> BottomBounce; internal static ConfigEntry<bool> ShowUI; internal static ConfigEntry<float> UIScale; internal static ConfigEntry<float> NearbyFishRadius; internal static ConfigEntry<bool> ShiftHookAssist; internal static ConfigEntry<bool> ShowWorldClock; private FishingFloat _bobber; private Fish _fish; private bool _active; private float _scanTimer; private float _fishY = 0.65f; private float _fishVelocity; private float _fishTarget = 0.65f; private float _targetTimer; private float _barY = 0.35f; private float _barVelocity; private float _progress = 0.25f; private float _resultTimer; private string _resultText = ""; private string _caughtName = ""; private float _biteFlashTimer; private int _nearbyFishCount; private int _interestedFishCount; private float _fishScanTimer; private float _barVisualY; private Texture2D _circleTex; private float _worldClockScanTimer; private float _worldDayFraction = -1f; private int _worldDay = -1; private float _oldHookedStamina = -1f; private float _oldPullStamina = -1f; private float _oldFishStamina = -1f; private float _oldFishEscapeStamina = -1f; private void Awake() { //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Expected O, but got Unknown //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Expected O, but got Unknown //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Expected O, but got Unknown //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Expected O, but got Unknown //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Expected O, but got Unknown //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Expected O, but got Unknown //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Expected O, but got Unknown //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Expected O, but got Unknown //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Expected O, but got Unknown //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Expected O, but got Unknown //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Expected O, but got Unknown //IL_0345: Unknown result type (might be due to invalid IL or missing references) //IL_034f: Expected O, but got Unknown Instance = this; _circleTex = CreateCircleTexture(64); Enabled = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Enabled", true, "Enable PeasFishing."); RaiseKey = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Controls", "Raise Bar Key", (KeyCode)304, "Hold this key to raise the green catch bar; release it to let the bar fall."); Difficulty = ((BaseUnityPlugin)this).Config.Bind<float>("Gameplay", "Difficulty", 0.75f, new ConfigDescription("Fish movement difficulty. Lower is easier.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.25f, 2f), Array.Empty<object>())); BarSize = ((BaseUnityPlugin)this).Config.Bind<float>("Gameplay", "Bar Size", 0.3f, new ConfigDescription("Height of the green catch bar (0-1 of track).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.15f, 0.6f), Array.Empty<object>())); FillSeconds = ((BaseUnityPlugin)this).Config.Bind<float>("Gameplay", "Seconds To Catch", 5f, new ConfigDescription("Approximate time inside the bar needed for a catch.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(2f, 15f), Array.Empty<object>())); DrainSeconds = ((BaseUnityPlugin)this).Config.Bind<float>("Gameplay", "Seconds To Lose", 8f, new ConfigDescription("Approximate time outside the bar needed to lose from full meter.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(3f, 30f), Array.Empty<object>())); CatchSpeedMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("Gameplay", "Catch Speed Multiplier", 1.35f, new ConfigDescription("How quickly the catch meter fills while the fish is inside the bar.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.5f, 3f), Array.Empty<object>())); LiftAcceleration = ((BaseUnityPlugin)this).Config.Bind<float>("Bar Physics", "Lift Acceleration", 2.15f, new ConfigDescription("Upward acceleration while holding the raise key. Lower feels heavier.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.75f, 5f), Array.Empty<object>())); GravityAcceleration = ((BaseUnityPlugin)this).Config.Bind<float>("Bar Physics", "Gravity Acceleration", 2.75f, new ConfigDescription("Downward acceleration after releasing the key.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.75f, 6f), Array.Empty<object>())); MaxBarSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("Bar Physics", "Max Bar Speed", 0.92f, new ConfigDescription("Maximum bar movement speed.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.35f, 2f), Array.Empty<object>())); BarDamping = ((BaseUnityPlugin)this).Config.Bind<float>("Bar Physics", "Bar Damping", 0.55f, new ConfigDescription("Resistance applied to the bar velocity. Higher values feel heavier and smoother.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 2.5f), Array.Empty<object>())); BottomBounce = ((BaseUnityPlugin)this).Config.Bind<float>("Bar Physics", "Bottom Bounce", 0.26f, new ConfigDescription("Bounce strength when the bar hits the bottom, Stardew-style.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 0.75f), Array.Empty<object>())); ShowUI = ((BaseUnityPlugin)this).Config.Bind<bool>("UI", "Show UI", true, "Show the PeasFishing minigame interface."); UIScale = ((BaseUnityPlugin)this).Config.Bind<float>("UI", "UI Scale", 1f, new ConfigDescription("Scale of the fishing minigame interface.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.75f, 1.5f), Array.Empty<object>())); NearbyFishRadius = ((BaseUnityPlugin)this).Config.Bind<float>("Fishing Info", "Nearby Fish Radius", 20f, new ConfigDescription("Radius used by the nearby-fish display.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(5f, 40f), Array.Empty<object>())); ShiftHookAssist = ((BaseUnityPlugin)this).Config.Bind<bool>("Controls", "Shift Hook Assist", true, "Allows the same raise key to help hook/reel once a fish is on the float."); ShowWorldClock = ((BaseUnityPlugin)this).Config.Bind<bool>("World Clock", "Show World Clock", true, "Always show the Valheim world day/time clock at the top-centre of the screen."); ((BaseUnityPlugin)this).Logger.LogInfo((object)"PeasFishing 0.6.1 loaded."); } private void OnDestroy() { EndSession(); if ((Object)(object)_circleTex != (Object)null) { Object.Destroy((Object)(object)_circleTex); } } private void Update() { UpdateWorldClock(); UpdateFishingAwareness(); TryShiftHookAssist(); if (_resultTimer > 0f) { _resultTimer -= Time.deltaTime; if (_resultTimer <= 0f) { _resultText = ""; _caughtName = ""; } } if (_biteFlashTimer > 0f) { _biteFlashTimer -= Time.deltaTime; } if (!_active) { _scanTimer -= Time.deltaTime; if (_scanTimer <= 0f) { _scanTimer = 0.2f; TryFindHookedFish(); } return; } if (!Enabled.Value || (Object)(object)Player.m_localPlayer == (Object)null || (Object)(object)_bobber == (Object)null || (Object)(object)_fish == (Object)null) { EndSession(); return; } Fish val = null; try { val = _bobber.GetCatch(); } catch { } if ((Object)(object)val == (Object)null) { EndSession(); return; } float num = Mathf.Min(Time.deltaTime, 0.05f); UpdateFish(num); UpdateBar(num); float num2 = BarSize.Value * 0.5f; bool flag = Mathf.Abs(_fishY - _barY) <= num2; float num3 = num / Mathf.Max(0.1f, FillSeconds.Value) * CatchSpeedMultiplier.Value; float num4 = num / Mathf.Max(0.1f, DrainSeconds.Value); _progress = Mathf.Clamp01(_progress + (flag ? num3 : (0f - num4))); if (_progress >= 1f) { CatchFish(); } else if (_progress <= 0f) { LoseFish(); } } private void TryFindHookedFish() { //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) if (!Enabled.Value || (Object)(object)Player.m_localPlayer == (Object)null) { return; } FishingFloat[] array = Object.FindObjectsByType<FishingFloat>((FindObjectsSortMode)0); foreach (FishingFloat val in array) { if ((Object)(object)val == (Object)null) { continue; } Character val2 = null; Fish val3 = null; try { MethodInfo methodInfo = ((object)val).GetType().GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).FirstOrDefault((MethodInfo m) => m.GetParameters().Length == 0 && typeof(Character).IsAssignableFrom(m.ReturnType) && (m.Name.IndexOf("owner", StringComparison.OrdinalIgnoreCase) >= 0 || m.Name.IndexOf("character", StringComparison.OrdinalIgnoreCase) >= 0)); if (methodInfo != null) { object? obj = methodInfo.Invoke(val, null); val2 = (Character)((obj is Character) ? obj : null); } if ((Object)(object)val2 == (Object)null) { FieldInfo fieldInfo = ((object)val).GetType().GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).FirstOrDefault((FieldInfo f) => typeof(Character).IsAssignableFrom(f.FieldType) && f.Name.IndexOf("owner", StringComparison.OrdinalIgnoreCase) >= 0); if (fieldInfo != null) { object? value = fieldInfo.GetValue(val); val2 = (Character)((value is Character) ? value : null); } } } catch { } if ((Object)(object)val2 != (Object)null && (Object)(object)val2 != (Object)(object)Player.m_localPlayer) { continue; } if ((Object)(object)val2 == (Object)null) { try { if (Vector3.Distance(((Component)val).transform.position, ((Component)Player.m_localPlayer).transform.position) > 80f) { continue; } } catch { continue; } } try { val3 = val.GetCatch(); } catch { } if (!((Object)(object)val3 == (Object)null)) { BeginSession(val, val3); break; } } } private void BeginSession(FishingFloat bobber, Fish fish) { if (!_active && !((Object)(object)bobber == (Object)null) && !((Object)(object)fish == (Object)null)) { _bobber = bobber; _fish = fish; _active = true; _progress = 0.25f; _fishY = Random.Range(0.35f, 0.75f); _fishTarget = Random.Range(0.2f, 0.85f); _fishVelocity = 0f; _barY = 0.35f; _barVelocity = 0f; _targetTimer = 0f; _resultText = ""; _caughtName = ""; _resultTimer = 0f; _biteFlashTimer = 1.15f; try { _oldHookedStamina = bobber.m_hookedStaminaPerSec; _oldPullStamina = bobber.m_pullStaminaUse; bobber.m_hookedStaminaPerSec = 0f; bobber.m_pullStaminaUse = 0f; } catch { } try { _oldFishStamina = fish.m_staminaUse; _oldFishEscapeStamina = fish.m_escapeStaminaUse; fish.m_staminaUse = 0f; fish.m_escapeStaminaUse = 0f; } catch { } ((BaseUnityPlugin)this).Logger.LogInfo((object)"Fishing minigame started."); } } private void UpdateFish(float dt) { _targetTimer -= dt; float value = Difficulty.Value; if (_targetTimer <= 0f) { _targetTimer = Random.Range(0.25f, 0.75f) / Mathf.Max(0.25f, value); float num = Mathf.Clamp01(0.32f + value * 0.18f); _fishTarget = Mathf.Clamp01(_fishY + Random.Range(0f - num, num)); if (Random.value < 0.18f * value) { _fishTarget = ((Random.value < 0.5f) ? 0.08f : 0.92f); } } float num2 = Mathf.Lerp(2.4f, 8.5f, Mathf.InverseLerp(0.25f, 2f, value)); _fishVelocity += Mathf.Sign(_fishTarget - _fishY) * num2 * dt; _fishVelocity *= Mathf.Pow(0.25f, dt); _fishVelocity = Mathf.Clamp(_fishVelocity, -1.8f * value, 1.8f * value); _fishY = Mathf.Clamp01(_fishY + _fishVelocity * dt); if (_fishY <= 0f || _fishY >= 1f) { _fishVelocity *= -0.45f; } } private void UpdateBar(float dt) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) float num = (Input.GetKey(RaiseKey.Value) ? LiftAcceleration.Value : (0f - GravityAcceleration.Value)); _barVelocity += num * dt; _barVelocity = Mathf.MoveTowards(_barVelocity, 0f, BarDamping.Value * dt); _barVelocity = Mathf.Clamp(_barVelocity, 0f - MaxBarSpeed.Value, MaxBarSpeed.Value); float num2 = Mathf.Clamp(BarSize.Value * 0.5f, 0.02f, 0.48f); _barY += _barVelocity * dt; if (_barY <= num2) { _barY = num2; if (_barVelocity < 0f) { _barVelocity = (0f - _barVelocity) * BottomBounce.Value; } } else if (_barY >= 1f - num2) { _barY = 1f - num2; if (_barVelocity > 0f) { _barVelocity *= -0.08f; } } } private void CatchFish() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0066: 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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) _caughtName = GetFishDisplayName(_fish); bool flag = TryPickupFish(_fish); if (!flag && (Object)(object)Player.m_localPlayer != (Object)null) { Vector3 position = ((Component)Player.m_localPlayer).transform.position + ((Component)Player.m_localPlayer).transform.forward * 1.1f + Vector3.up * 0.8f; try { ((Component)_fish).transform.position = position; } catch { } try { ((Component)_bobber).transform.position = position; } catch { } } _resultText = (flag ? "You caught:" : "Catch complete:"); _resultTimer = 2.8f; EndSession(); } private string GetFishDisplayName(Fish fish) { if ((Object)(object)fish == (Object)null) { return "Fish"; } try { FieldInfo field = ((object)fish).GetType().GetField("m_itemDrop", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); object obj = ((field != null) ? field.GetValue(fish) : null); if (obj != null) { FieldInfo field2 = obj.GetType().GetField("m_itemData", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); object obj2 = ((field2 != null) ? field2.GetValue(obj) : null); if (obj2 != null) { FieldInfo field3 = obj2.GetType().GetField("m_shared", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); object obj3 = ((field3 != null) ? field3.GetValue(obj2) : null); if (obj3 != null) { FieldInfo field4 = obj3.GetType().GetField("m_name", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); string text = ((field4 != null) ? (field4.GetValue(obj3) as string) : null); if (!string.IsNullOrEmpty(text)) { string text2 = text.TrimStart(new char[1] { '$' }).Replace("_", " ").Trim(); if (!string.IsNullOrEmpty(text2)) { return text2; } } } } } } catch { } try { string text3 = ((Object)((Component)fish).gameObject).name; int num = text3.IndexOf("(Clone)", StringComparison.OrdinalIgnoreCase); if (num >= 0) { text3 = text3.Substring(0, num); } text3 = text3.Replace("_", " ").Trim(); if (!string.IsNullOrEmpty(text3)) { return text3; } } catch { } return "Fish"; } private bool TryPickupFish(Fish fish) { try { Player player = Player.m_localPlayer; if ((Object)(object)player == (Object)null || (Object)(object)fish == (Object)null) { return false; } MethodInfo methodInfo = ((object)fish).GetType().GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).FirstOrDefault(delegate(MethodInfo m) { if (m.Name != "Pickup") { return false; } ParameterInfo[] parameters = m.GetParameters(); return parameters.Length == 1 && parameters[0].ParameterType.IsAssignableFrom(((object)player).GetType()); }); if (methodInfo == null) { return false; } object obj = methodInfo.Invoke(fish, new object[1] { player }); return !(obj is bool) || (bool)obj; } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("Direct fish pickup failed; using reel-in fallback: " + ex.Message)); return false; } } private void LoseFish() { try { if ((Object)(object)_bobber != (Object)null) { MethodInfo methodInfo = ((object)_bobber).GetType().GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).FirstOrDefault(delegate(MethodInfo m) { if (m.Name != "SetCatch") { return false; } ParameterInfo[] parameters = m.GetParameters(); return parameters.Length == 1 && typeof(Fish).IsAssignableFrom(parameters[0].ParameterType); }); if (methodInfo != null) { methodInfo.Invoke(_bobber, new object[1]); } } } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("Could not release fish cleanly: " + ex.Message)); } _resultText = "The fish got away!"; _resultTimer = 2f; EndSession(); } private void EndSession() { if ((Object)(object)_bobber != (Object)null) { try { if (_oldHookedStamina >= 0f) { _bobber.m_hookedStaminaPerSec = _oldHookedStamina; } if (_oldPullStamina >= 0f) { _bobber.m_pullStaminaUse = _oldPullStamina; } } catch { } } if ((Object)(object)_fish != (Object)null) { try { if (_oldFishStamina >= 0f) { _fish.m_staminaUse = _oldFishStamina; } if (_oldFishEscapeStamina >= 0f) { _fish.m_escapeStaminaUse = _oldFishEscapeStamina; } } catch { } } _active = false; _bobber = null; _fish = null; _oldHookedStamina = -1f; _oldPullStamina = -1f; _oldFishStamina = -1f; _oldFishEscapeStamina = -1f; } private void UpdateFishingAwareness() { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Player.m_localPlayer == (Object)null) { _nearbyFishCount = 0; _interestedFishCount = 0; return; } _fishScanTimer -= Time.deltaTime; if (_fishScanTimer > 0f) { return; } _fishScanTimer = 0.35f; try { Fish[] source = Object.FindObjectsByType<Fish>((FindObjectsSortMode)0); Vector3 playerPos = ((Component)Player.m_localPlayer).transform.position; float radius = NearbyFishRadius.Value; _nearbyFishCount = source.Count((Fish f) => (Object)(object)f != (Object)null && Vector3.Distance(((Component)f).transform.position, playerPos) <= radius); _interestedFishCount = 0; FishingFloat val = (from f in Object.FindObjectsByType<FishingFloat>((FindObjectsSortMode)0) where (Object)(object)f != (Object)null orderby Vector3.Distance(((Component)f).transform.position, playerPos) select f).FirstOrDefault(); if ((Object)(object)val != (Object)null && Vector3.Distance(((Component)val).transform.position, playerPos) <= 80f) { Vector3 baitPos = ((Component)val).transform.position; _interestedFishCount = source.Count((Fish f) => (Object)(object)f != (Object)null && Vector3.Distance(((Component)f).transform.position, baitPos) <= 6f); } } catch { _nearbyFishCount = 0; _interestedFishCount = 0; } } private bool TryShiftHookAssist() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) if (!ShiftHookAssist.Value || (Object)(object)Player.m_localPlayer == (Object)null || _active) { return false; } if (!Input.GetKeyDown(RaiseKey.Value)) { return false; } try { FishingFloat[] source = Object.FindObjectsByType<FishingFloat>((FindObjectsSortMode)0); Vector3 pos = ((Component)Player.m_localPlayer).transform.position; FishingFloat val = (from f in source where (Object)(object)f != (Object)null orderby Vector3.Distance(((Component)f).transform.position, pos) select f).FirstOrDefault(); if ((Object)(object)val == (Object)null || Vector3.Distance(((Component)val).transform.position, pos) > 80f) { return false; } MethodInfo methodInfo = ((object)val).GetType().GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).FirstOrDefault((MethodInfo m) => m.GetParameters().Length == 0 && (m.Name.IndexOf("hook", StringComparison.OrdinalIgnoreCase) >= 0 || m.Name.IndexOf("reel", StringComparison.OrdinalIgnoreCase) >= 0 || m.Name.IndexOf("pull", StringComparison.OrdinalIgnoreCase) >= 0)); if (methodInfo != null) { methodInfo.Invoke(val, null); return true; } } catch { } return false; } private void UpdateWorldClock() { _worldClockScanTimer -= Time.deltaTime; if (_worldClockScanTimer > 0f) { return; } _worldClockScanTimer = 0.35f; try { Type type = typeof(Player).Assembly.GetType("EnvMan"); if (type == null) { return; } object obj = null; FieldInfo field = type.GetField("instance", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); if (field != null) { obj = field.GetValue(null); } if (obj == null) { PropertyInfo property = type.GetProperty("instance", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); if (property != null) { obj = property.GetValue(null, null); } } if (obj == null) { return; } MethodInfo methodInfo = type.GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).FirstOrDefault((MethodInfo m) => m.GetParameters().Length == 0 && (m.Name.Equals("GetDayFraction", StringComparison.OrdinalIgnoreCase) || m.Name.IndexOf("dayfraction", StringComparison.OrdinalIgnoreCase) >= 0)); if (methodInfo != null) { object obj2 = methodInfo.Invoke(obj, null); if (obj2 != null) { _worldDayFraction = Mathf.Repeat(Convert.ToSingle(obj2), 1f); } } MethodInfo methodInfo2 = type.GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).FirstOrDefault((MethodInfo m) => m.GetParameters().Length == 0 && (m.Name.Equals("GetCurrentDay", StringComparison.OrdinalIgnoreCase) || m.Name.Equals("GetDay", StringComparison.OrdinalIgnoreCase))); if (methodInfo2 != null) { object obj3 = methodInfo2.Invoke(obj, null); if (obj3 != null) { _worldDay = Convert.ToInt32(obj3); } return; } FieldInfo fieldInfo = type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).FirstOrDefault((FieldInfo f) => (f.FieldType == typeof(int) || f.FieldType == typeof(long)) && f.Name.IndexOf("day", StringComparison.OrdinalIgnoreCase) >= 0); if (fieldInfo != null) { object value = fieldInfo.GetValue(obj); if (value != null) { _worldDay = Convert.ToInt32(value); } } } catch { } } private void DrawSunIcon(Rect r) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) Color color = default(Color); ((Color)(ref color))..ctor(1f, 0.72f, 0.16f, 1f); float num = Mathf.Max(2f, ((Rect)(ref r)).width * 0.07f); DrawRect(new Rect(((Rect)(ref r)).center.x - num * 0.5f, ((Rect)(ref r)).y, num, ((Rect)(ref r)).height * 0.2f), color); DrawRect(new Rect(((Rect)(ref r)).center.x - num * 0.5f, ((Rect)(ref r)).yMax - ((Rect)(ref r)).height * 0.2f, num, ((Rect)(ref r)).height * 0.2f), color); DrawRect(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).center.y - num * 0.5f, ((Rect)(ref r)).width * 0.2f, num), color); DrawRect(new Rect(((Rect)(ref r)).xMax - ((Rect)(ref r)).width * 0.2f, ((Rect)(ref r)).center.y - num * 0.5f, ((Rect)(ref r)).width * 0.2f, num), color); DrawEllipse(new Rect(((Rect)(ref r)).x + ((Rect)(ref r)).width * 0.22f, ((Rect)(ref r)).y + ((Rect)(ref r)).height * 0.22f, ((Rect)(ref r)).width * 0.56f, ((Rect)(ref r)).height * 0.56f), color); } private void DrawMoonIcon(Rect r, Color cutout) { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) Color color = default(Color); ((Color)(ref color))..ctor(0.78f, 0.88f, 1f, 1f); DrawEllipse(new Rect(((Rect)(ref r)).x + ((Rect)(ref r)).width * 0.12f, ((Rect)(ref r)).y + ((Rect)(ref r)).height * 0.1f, ((Rect)(ref r)).width * 0.72f, ((Rect)(ref r)).height * 0.78f), color); DrawEllipse(new Rect(((Rect)(ref r)).x + ((Rect)(ref r)).width * 0.35f, ((Rect)(ref r)).y + ((Rect)(ref r)).height * 0.02f, ((Rect)(ref r)).width * 0.65f, ((Rect)(ref r)).height * 0.72f), cutout); } private void DrawWorldClockGUI() { //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_0167: 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) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) if (ShowWorldClock.Value && !((Object)(object)Player.m_localPlayer == (Object)null)) { float num = Mathf.Clamp(UIScale.Value, 0.75f, 1.5f); float num2 = (float)Screen.width / num; Color woodDark = default(Color); ((Color)(ref woodDark))..ctor(0.105f, 0.055f, 0.02f, 0.96f); Color val = default(Color); ((Color)(ref val))..ctor(0.3f, 0.155f, 0.055f, 0.96f); Color woodLight = default(Color); ((Color)(ref woodLight))..ctor(0.73f, 0.43f, 0.16f, 1f); Color color = default(Color); ((Color)(ref color))..ctor(0.98f, 0.89f, 0.69f, 1f); Rect r = default(Rect); ((Rect)(ref r))..ctor(num2 * 0.5f - 118f, 14f, 236f, 48f); DrawWoodPanel(r, woodDark, val, woodLight); float num3 = ((_worldDayFraction >= 0f) ? _worldDayFraction : 0f); int num4 = Mathf.FloorToInt(num3 * 24f * 60f); int num5 = num4 / 60 % 24; int num6 = num4 % 60; bool flag = num3 >= 0.19f && num3 < 0.79f; Rect r2 = default(Rect); ((Rect)(ref r2))..ctor(((Rect)(ref r)).x + 12f, ((Rect)(ref r)).y + 8f, 32f, 32f); if (flag) { DrawSunIcon(r2); } else { DrawMoonIcon(r2, val); } string text = ((_worldDay >= 0) ? ("DAY " + _worldDay) : "WORLD"); string text2 = ((_worldDayFraction >= 0f) ? (num5.ToString("00") + ":" + num6.ToString("00")) : "--:--"); GUIStyle val2 = MakeStyle(11, (TextAnchor)4, (FontStyle)1, color); val2.wordWrap = false; GUIStyle val3 = MakeStyle(19, (TextAnchor)4, (FontStyle)1, Color.white); val3.wordWrap = false; GUI.Label(new Rect(((Rect)(ref r)).x + 50f, ((Rect)(ref r)).y + 4f, 78f, 18f), text, val2); GUI.Label(new Rect(((Rect)(ref r)).x + 48f, ((Rect)(ref r)).y + 20f, 82f, 24f), text2, val3); string text3 = (flag ? "DAYLIGHT" : "NIGHT"); GUIStyle val4 = MakeStyle(10, (TextAnchor)4, (FontStyle)1, flag ? new Color(1f, 0.76f, 0.24f, 1f) : new Color(0.72f, 0.84f, 1f, 1f)); val4.wordWrap = false; GUI.Label(new Rect(((Rect)(ref r)).x + 136f, ((Rect)(ref r)).y + 13f, 88f, 22f), text3, val4); } } private Texture2D CreateCircleTexture(int size) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(size, size, (TextureFormat)5, false); ((Texture)val).wrapMode = (TextureWrapMode)1; ((Texture)val).filterMode = (FilterMode)1; Color[] array = (Color[])(object)new Color[size * size]; float num = (float)(size - 1) * 0.5f; float num2 = num - 1f; for (int i = 0; i < size; i++) { for (int j = 0; j < size; j++) { float num3 = (float)j - num; float num4 = (float)i - num; float num5 = Mathf.Sqrt(num3 * num3 + num4 * num4); float num6 = Mathf.Clamp01(num2 - num5 + 1f); array[i * size + j] = new Color(1f, 1f, 1f, num6); } } val.SetPixels(array); val.Apply(); return val; } private void DrawEllipse(Rect r, Color color) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_circleTex == (Object)null)) { Color color2 = GUI.color; GUI.color = color; GUI.DrawTexture(r, (Texture)(object)_circleTex, (ScaleMode)0, true); GUI.color = color2; } } private void DrawStud(Rect area, float xNorm, float yNorm, Color metal) { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Min(((Rect)(ref area)).width, ((Rect)(ref area)).height) * 0.045f; num = Mathf.Clamp(num, 5f, 10f); Rect r = default(Rect); ((Rect)(ref r))..ctor(((Rect)(ref area)).x + ((Rect)(ref area)).width * xNorm - num * 0.5f, ((Rect)(ref area)).y + ((Rect)(ref area)).height * yNorm - num * 0.5f, num, num); DrawEllipse(r, new Color(0.05f, 0.04f, 0.025f, 1f)); Rect r2 = default(Rect); ((Rect)(ref r2))..ctor(((Rect)(ref r)).x + 1f, ((Rect)(ref r)).y + 1f, ((Rect)(ref r)).width - 2f, ((Rect)(ref r)).height - 2f); DrawEllipse(r2, metal); } private void DrawPeaVikingIcon(Rect r) { //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02fe: Unknown result type (might be due to invalid IL or missing references) //IL_0317: Unknown result type (might be due to invalid IL or missing references) //IL_0366: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_0409: Unknown result type (might be due to invalid IL or missing references) //IL_040e: Unknown result type (might be due to invalid IL or missing references) //IL_0415: Unknown result type (might be due to invalid IL or missing references) //IL_0417: Unknown result type (might be due to invalid IL or missing references) //IL_0462: Unknown result type (might be due to invalid IL or missing references) //IL_0467: Unknown result type (might be due to invalid IL or missing references) //IL_04b2: Unknown result type (might be due to invalid IL or missing references) //IL_04b7: Unknown result type (might be due to invalid IL or missing references) //IL_04fd: Unknown result type (might be due to invalid IL or missing references) //IL_0502: Unknown result type (might be due to invalid IL or missing references) //IL_0550: Unknown result type (might be due to invalid IL or missing references) //IL_0555: Unknown result type (might be due to invalid IL or missing references) //IL_058d: Unknown result type (might be due to invalid IL or missing references) //IL_0592: Unknown result type (might be due to invalid IL or missing references) //IL_05d6: Unknown result type (might be due to invalid IL or missing references) //IL_0603: Unknown result type (might be due to invalid IL or missing references) Color color = default(Color); ((Color)(ref color))..ctor(0.18f, 0.46f, 0.12f, 1f); Color color2 = default(Color); ((Color)(ref color2))..ctor(0.08f, 0.24f, 0.06f, 1f); Color color3 = default(Color); ((Color)(ref color3))..ctor(0.42f, 0.86f, 0.1f, 1f); Color color4 = default(Color); ((Color)(ref color4))..ctor(0.12f, 0.3f, 0.04f, 1f); Color color5 = default(Color); ((Color)(ref color5))..ctor(0.45f, 0.24f, 0.09f, 1f); Color color6 = default(Color); ((Color)(ref color6))..ctor(0.68f, 0.39f, 0.15f, 1f); Color color7 = default(Color); ((Color)(ref color7))..ctor(0.93f, 0.9f, 0.8f, 1f); float num = ((Rect)(ref r)).x + ((Rect)(ref r)).width * 0.5f; float num2 = ((Rect)(ref r)).y + ((Rect)(ref r)).height * 0.57f; DrawEllipse(new Rect(((Rect)(ref r)).x + ((Rect)(ref r)).width * 0.02f, num2 - ((Rect)(ref r)).height * 0.08f, ((Rect)(ref r)).width * 0.3f, ((Rect)(ref r)).height * 0.16f), color2); DrawEllipse(new Rect(((Rect)(ref r)).x + ((Rect)(ref r)).width * 0.68f, num2 - ((Rect)(ref r)).height * 0.08f, ((Rect)(ref r)).width * 0.3f, ((Rect)(ref r)).height * 0.16f), color2); DrawEllipse(new Rect(((Rect)(ref r)).x + ((Rect)(ref r)).width * 0.1f, num2 + ((Rect)(ref r)).height * 0.06f, ((Rect)(ref r)).width * 0.28f, ((Rect)(ref r)).height * 0.14f), color); DrawEllipse(new Rect(((Rect)(ref r)).x + ((Rect)(ref r)).width * 0.62f, num2 + ((Rect)(ref r)).height * 0.06f, ((Rect)(ref r)).width * 0.28f, ((Rect)(ref r)).height * 0.14f), color); DrawEllipse(new Rect(((Rect)(ref r)).x + ((Rect)(ref r)).width * 0.05f, ((Rect)(ref r)).y + ((Rect)(ref r)).height * 0.13f, ((Rect)(ref r)).width * 0.28f, ((Rect)(ref r)).height * 0.26f), color7); DrawEllipse(new Rect(((Rect)(ref r)).x + ((Rect)(ref r)).width * 0.67f, ((Rect)(ref r)).y + ((Rect)(ref r)).height * 0.13f, ((Rect)(ref r)).width * 0.28f, ((Rect)(ref r)).height * 0.26f), color7); DrawEllipse(new Rect(((Rect)(ref r)).x + ((Rect)(ref r)).width * 0.1f, ((Rect)(ref r)).y + ((Rect)(ref r)).height * 0.18f, ((Rect)(ref r)).width * 0.24f, ((Rect)(ref r)).height * 0.24f), new Color(0.2f, 0.12f, 0.06f, 1f)); DrawEllipse(new Rect(((Rect)(ref r)).x + ((Rect)(ref r)).width * 0.66f, ((Rect)(ref r)).y + ((Rect)(ref r)).height * 0.18f, ((Rect)(ref r)).width * 0.24f, ((Rect)(ref r)).height * 0.24f), new Color(0.2f, 0.12f, 0.06f, 1f)); Rect r2 = default(Rect); ((Rect)(ref r2))..ctor(((Rect)(ref r)).x + ((Rect)(ref r)).width * 0.19f, ((Rect)(ref r)).y + ((Rect)(ref r)).height * 0.34f, ((Rect)(ref r)).width * 0.62f, ((Rect)(ref r)).height * 0.55f); DrawEllipse(new Rect(((Rect)(ref r2)).x - 2f, ((Rect)(ref r2)).y + 2f, ((Rect)(ref r2)).width + 4f, ((Rect)(ref r2)).height + 4f), color4); DrawEllipse(r2, color3); DrawEllipse(new Rect(((Rect)(ref r)).x + ((Rect)(ref r)).width * 0.2f, ((Rect)(ref r)).y + ((Rect)(ref r)).height * 0.12f, ((Rect)(ref r)).width * 0.6f, ((Rect)(ref r)).height * 0.48f), color5); DrawRect(new Rect(((Rect)(ref r)).x + ((Rect)(ref r)).width * 0.18f, ((Rect)(ref r)).y + ((Rect)(ref r)).height * 0.38f, ((Rect)(ref r)).width * 0.64f, ((Rect)(ref r)).height * 0.09f), color6); DrawRect(new Rect(num - ((Rect)(ref r)).width * 0.055f, ((Rect)(ref r)).y + ((Rect)(ref r)).height * 0.12f, ((Rect)(ref r)).width * 0.11f, ((Rect)(ref r)).height * 0.35f), color6); float num3 = Mathf.Max(2f, ((Rect)(ref r)).width * 0.045f); DrawEllipse(new Rect(num - ((Rect)(ref r)).width * 0.14f - num3 * 0.5f, num2 - ((Rect)(ref r)).height * 0.01f, num3, num3), Color.black); DrawEllipse(new Rect(num + ((Rect)(ref r)).width * 0.14f - num3 * 0.5f, num2 - ((Rect)(ref r)).height * 0.01f, num3, num3), Color.black); GUI.Label(new Rect(num - ((Rect)(ref r)).width * 0.13f, num2 + ((Rect)(ref r)).height * 0.035f, ((Rect)(ref r)).width * 0.26f, ((Rect)(ref r)).height * 0.16f), "⌣", MakeStyle(Mathf.RoundToInt(Mathf.Clamp(((Rect)(ref r)).width * 0.16f, 10f, 24f)), (TextAnchor)4, (FontStyle)1, Color.black)); } private void DrawFishIcon(Rect r, Color body) { //IL_009b: 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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_0111: 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_0166: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) Color color = default(Color); ((Color)(ref color))..ctor(0.03f, 0.08f, 0.11f, 1f); Rect r2 = default(Rect); ((Rect)(ref r2))..ctor(((Rect)(ref r)).x + ((Rect)(ref r)).width * 0.22f, ((Rect)(ref r)).y + ((Rect)(ref r)).height * 0.24f, ((Rect)(ref r)).width * 0.58f, ((Rect)(ref r)).height * 0.52f); DrawEllipse(new Rect(((Rect)(ref r2)).x - 2f, ((Rect)(ref r2)).y - 2f, ((Rect)(ref r2)).width + 4f, ((Rect)(ref r2)).height + 4f), color); DrawEllipse(r2, body); GUI.Label(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).y + ((Rect)(ref r)).height * 0.15f, ((Rect)(ref r)).width * 0.34f, ((Rect)(ref r)).height * 0.7f), "◀", MakeStyle(Mathf.RoundToInt(Mathf.Clamp(((Rect)(ref r)).height * 0.48f, 12f, 32f)), (TextAnchor)4, (FontStyle)1, body)); float num = Mathf.Max(2f, ((Rect)(ref r)).height * 0.075f); DrawEllipse(new Rect(((Rect)(ref r2)).xMax - ((Rect)(ref r2)).width * 0.2f, ((Rect)(ref r2)).y + ((Rect)(ref r2)).height * 0.28f, num, num), Color.black); DrawRect(new Rect(((Rect)(ref r2)).x + ((Rect)(ref r2)).width * 0.28f, ((Rect)(ref r2)).y + ((Rect)(ref r2)).height * 0.46f, ((Rect)(ref r2)).width * 0.26f, Mathf.Max(1f, ((Rect)(ref r2)).height * 0.05f)), new Color(1f, 1f, 1f, 0.55f)); } private void DrawWoodPanel(Rect r, Color woodDark, Color woodMid, Color woodLight) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) DrawRect(r, woodDark); DrawRect(new Rect(((Rect)(ref r)).x + 5f, ((Rect)(ref r)).y + 5f, ((Rect)(ref r)).width - 10f, ((Rect)(ref r)).height - 10f), woodMid); DrawBorder(r, 3f, woodLight); for (int i = 1; i < 4; i++) { float num = ((Rect)(ref r)).y + ((Rect)(ref r)).height * (float)i / 4f; DrawRect(new Rect(((Rect)(ref r)).x + 7f, num, ((Rect)(ref r)).width - 14f, 1f), new Color(0.08f, 0.04f, 0.015f, 0.35f)); } Color metal = default(Color); ((Color)(ref metal))..ctor(0.48f, 0.4f, 0.29f, 1f); DrawStud(r, 0.035f, 0.12f, metal); DrawStud(r, 0.965f, 0.12f, metal); DrawStud(r, 0.035f, 0.88f, metal); DrawStud(r, 0.965f, 0.88f, metal); } private static void DrawRect(Rect r, Color color) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) Color color2 = GUI.color; GUI.color = color; GUI.DrawTexture(r, (Texture)(object)Texture2D.whiteTexture); GUI.color = color2; } private static void DrawBorder(Rect r, float thickness, Color color) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) DrawRect(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).y, ((Rect)(ref r)).width, thickness), color); DrawRect(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).yMax - thickness, ((Rect)(ref r)).width, thickness), color); DrawRect(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).y, thickness, ((Rect)(ref r)).height), color); DrawRect(new Rect(((Rect)(ref r)).xMax - thickness, ((Rect)(ref r)).y, thickness, ((Rect)(ref r)).height), color); } private static GUIStyle MakeStyle(int size, TextAnchor alignment, FontStyle fontStyle, Color color) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown GUIStyle val = new GUIStyle(GUI.skin.label) { fontSize = size, alignment = alignment, fontStyle = fontStyle }; val.normal.textColor = color; val.wordWrap = true; return val; } private void OnGUI() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_030b: Unknown result type (might be due to invalid IL or missing references) //IL_033e: Unknown result type (might be due to invalid IL or missing references) //IL_034d: Unknown result type (might be due to invalid IL or missing references) //IL_0385: Unknown result type (might be due to invalid IL or missing references) //IL_0455: Unknown result type (might be due to invalid IL or missing references) //IL_0457: Unknown result type (might be due to invalid IL or missing references) //IL_046d: Unknown result type (might be due to invalid IL or missing references) //IL_0472: Unknown result type (might be due to invalid IL or missing references) //IL_049e: Unknown result type (might be due to invalid IL or missing references) //IL_04cd: Unknown result type (might be due to invalid IL or missing references) //IL_04d2: Unknown result type (might be due to invalid IL or missing references) //IL_0505: Unknown result type (might be due to invalid IL or missing references) //IL_0523: Unknown result type (might be due to invalid IL or missing references) //IL_0650: Unknown result type (might be due to invalid IL or missing references) //IL_0652: Unknown result type (might be due to invalid IL or missing references) //IL_0654: Unknown result type (might be due to invalid IL or missing references) //IL_0656: Unknown result type (might be due to invalid IL or missing references) //IL_0697: Unknown result type (might be due to invalid IL or missing references) //IL_06a7: Unknown result type (might be due to invalid IL or missing references) //IL_06ce: Unknown result type (might be due to invalid IL or missing references) //IL_06d3: Unknown result type (might be due to invalid IL or missing references) //IL_06e8: Unknown result type (might be due to invalid IL or missing references) //IL_06f2: Unknown result type (might be due to invalid IL or missing references) //IL_06f8: Unknown result type (might be due to invalid IL or missing references) //IL_0703: Unknown result type (might be due to invalid IL or missing references) //IL_0740: Unknown result type (might be due to invalid IL or missing references) //IL_0745: Unknown result type (might be due to invalid IL or missing references) //IL_075a: Unknown result type (might be due to invalid IL or missing references) //IL_0769: Unknown result type (might be due to invalid IL or missing references) //IL_0778: Unknown result type (might be due to invalid IL or missing references) //IL_077d: Unknown result type (might be due to invalid IL or missing references) //IL_077e: Unknown result type (might be due to invalid IL or missing references) //IL_079e: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: Unknown result type (might be due to invalid IL or missing references) //IL_03a8: Unknown result type (might be due to invalid IL or missing references) //IL_03d8: Unknown result type (might be due to invalid IL or missing references) //IL_03dd: Unknown result type (might be due to invalid IL or missing references) //IL_03f2: Unknown result type (might be due to invalid IL or missing references) //IL_03fc: Unknown result type (might be due to invalid IL or missing references) //IL_0402: Unknown result type (might be due to invalid IL or missing references) //IL_0412: Unknown result type (might be due to invalid IL or missing references) //IL_0592: Unknown result type (might be due to invalid IL or missing references) //IL_07eb: Unknown result type (might be due to invalid IL or missing references) //IL_07f0: Unknown result type (might be due to invalid IL or missing references) //IL_07f7: Unknown result type (might be due to invalid IL or missing references) //IL_07fe: Unknown result type (might be due to invalid IL or missing references) //IL_0807: Unknown result type (might be due to invalid IL or missing references) //IL_05ad: Unknown result type (might be due to invalid IL or missing references) //IL_05a6: Unknown result type (might be due to invalid IL or missing references) //IL_0877: Unknown result type (might be due to invalid IL or missing references) //IL_0890: Unknown result type (might be due to invalid IL or missing references) //IL_0955: Unknown result type (might be due to invalid IL or missing references) //IL_096e: Unknown result type (might be due to invalid IL or missing references) //IL_099c: Unknown result type (might be due to invalid IL or missing references) //IL_099e: Unknown result type (might be due to invalid IL or missing references) //IL_09a5: Unknown result type (might be due to invalid IL or missing references) //IL_09c0: Unknown result type (might be due to invalid IL or missing references) //IL_0a0f: Unknown result type (might be due to invalid IL or missing references) //IL_0a11: Unknown result type (might be due to invalid IL or missing references) //IL_0a4e: Unknown result type (might be due to invalid IL or missing references) //IL_0a67: Unknown result type (might be due to invalid IL or missing references) //IL_0aaa: Unknown result type (might be due to invalid IL or missing references) //IL_0ac0: Unknown result type (might be due to invalid IL or missing references) //IL_0ae8: Unknown result type (might be due to invalid IL or missing references) //IL_0aed: Unknown result type (might be due to invalid IL or missing references) //IL_0b06: Unknown result type (might be due to invalid IL or missing references) //IL_0b0b: Unknown result type (might be due to invalid IL or missing references) //IL_0b20: Unknown result type (might be due to invalid IL or missing references) //IL_0b2f: Unknown result type (might be due to invalid IL or missing references) //IL_0b71: Unknown result type (might be due to invalid IL or missing references) //IL_0b8a: Unknown result type (might be due to invalid IL or missing references) //IL_0bd1: Unknown result type (might be due to invalid IL or missing references) //IL_0bd3: Unknown result type (might be due to invalid IL or missing references) //IL_0bda: Unknown result type (might be due to invalid IL or missing references) //IL_0be1: Unknown result type (might be due to invalid IL or missing references) //IL_0c0d: Unknown result type (might be due to invalid IL or missing references) //IL_0c12: Unknown result type (might be due to invalid IL or missing references) //IL_0c40: Unknown result type (might be due to invalid IL or missing references) //IL_0c78: Unknown result type (might be due to invalid IL or missing references) //IL_0c86: Unknown result type (might be due to invalid IL or missing references) //IL_0cb0: Unknown result type (might be due to invalid IL or missing references) //IL_0cb2: Unknown result type (might be due to invalid IL or missing references) //IL_0cb9: Unknown result type (might be due to invalid IL or missing references) //IL_0cc0: Unknown result type (might be due to invalid IL or missing references) //IL_0cf2: Unknown result type (might be due to invalid IL or missing references) //IL_0cf4: Unknown result type (might be due to invalid IL or missing references) //IL_0d2f: Unknown result type (might be due to invalid IL or missing references) //IL_0d34: Unknown result type (might be due to invalid IL or missing references) //IL_0d62: Unknown result type (might be due to invalid IL or missing references) //IL_0d9a: Unknown result type (might be due to invalid IL or missing references) //IL_0da9: Unknown result type (might be due to invalid IL or missing references) //IL_0dae: Unknown result type (might be due to invalid IL or missing references) //IL_0dcb: Unknown result type (might be due to invalid IL or missing references) //IL_0df5: Unknown result type (might be due to invalid IL or missing references) //IL_0df7: Unknown result type (might be due to invalid IL or missing references) //IL_0dfe: Unknown result type (might be due to invalid IL or missing references) //IL_0e05: Unknown result type (might be due to invalid IL or missing references) //IL_0e37: Unknown result type (might be due to invalid IL or missing references) //IL_0e4d: Unknown result type (might be due to invalid IL or missing references) //IL_0e89: Unknown result type (might be due to invalid IL or missing references) //IL_0ea2: Unknown result type (might be due to invalid IL or missing references) //IL_0ed3: Unknown result type (might be due to invalid IL or missing references) //IL_0f2f: Unknown result type (might be due to invalid IL or missing references) //IL_0f3d: Unknown result type (might be due to invalid IL or missing references) //IL_0f77: Unknown result type (might be due to invalid IL or missing references) //IL_0f79: Unknown result type (might be due to invalid IL or missing references) //IL_0f80: Unknown result type (might be due to invalid IL or missing references) //IL_0f87: Unknown result type (might be due to invalid IL or missing references) //IL_0fba: Unknown result type (might be due to invalid IL or missing references) //IL_0fc9: Unknown result type (might be due to invalid IL or missing references) //IL_0fce: Unknown result type (might be due to invalid IL or missing references) //IL_0feb: Unknown result type (might be due to invalid IL or missing references) //IL_1023: Unknown result type (might be due to invalid IL or missing references) //IL_1031: Unknown result type (might be due to invalid IL or missing references) //IL_10a6: Unknown result type (might be due to invalid IL or missing references) //IL_1060: Unknown result type (might be due to invalid IL or missing references) //IL_1062: Unknown result type (might be due to invalid IL or missing references) //IL_108c: Unknown result type (might be due to invalid IL or missing references) //IL_109a: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Clamp(UIScale.Value, 0.75f, 1.5f); GUI.matrix = Matrix4x4.TRS(Vector3.zero, Quaternion.identity, new Vector3(num, num, 1f)); DrawWorldClockGUI(); GUI.matrix = Matrix4x4.identity; if (!ShowUI.Value) { return; } bool flag = (Object)(object)Player.m_localPlayer != (Object)null && (_nearbyFishCount > 0 || _interestedFishCount > 0); if (!_active && string.IsNullOrEmpty(_resultText) && !flag) { return; } float num2 = Mathf.Clamp(UIScale.Value, 0.75f, 1.5f); GUI.matrix = Matrix4x4.TRS(Vector3.zero, Quaternion.identity, new Vector3(num2, num2, 1f)); float num3 = (float)Screen.width / num2; float num4 = (float)Screen.height / num2; Color woodDark = default(Color); ((Color)(ref woodDark))..ctor(0.105f, 0.055f, 0.02f, 0.985f); Color woodMid = default(Color); ((Color)(ref woodMid))..ctor(0.3f, 0.155f, 0.055f, 0.985f); Color val = default(Color); ((Color)(ref val))..ctor(0.73f, 0.43f, 0.16f, 1f); Color color = default(Color); ((Color)(ref color))..ctor(0.025f, 0.033f, 0.04f, 0.955f); Color color2 = default(Color); ((Color)(ref color2))..ctor(0.44f, 0.28f, 0.12f, 1f); Color color3 = default(Color); ((Color)(ref color3))..ctor(0.035f, 0.2f, 0.31f, 0.985f); Color val2 = default(Color); ((Color)(ref val2))..ctor(0.055f, 0.31f, 0.45f, 0.68f); Color color4 = default(Color); ((Color)(ref color4))..ctor(0.37f, 0.94f, 0.18f, 1f); Color color5 = default(Color); ((Color)(ref color5))..ctor(0.07f, 0.28f, 0.035f, 1f); Color color6 = default(Color); ((Color)(ref color6))..ctor(0.98f, 0.89f, 0.69f, 1f); Color val3 = default(Color); ((Color)(ref val3))..ctor(1f, 0.7f, 0.19f, 1f); Color body = default(Color); ((Color)(ref body))..ctor(0.68f, 0.86f, 0.98f, 1f); MakeStyle(17, (TextAnchor)4, (FontStyle)1, color6); MakeStyle(11, (TextAnchor)4, (FontStyle)0, Color.white); MakeStyle(13, (TextAnchor)4, (FontStyle)0, Color.white); GUIStyle val4 = MakeStyle(14, (TextAnchor)3, (FontStyle)1, color6); if (!string.IsNullOrEmpty(_resultText)) { Rect r = default(Rect); ((Rect)(ref r))..ctor(num3 * 0.5f - 225f, num4 * 0.7f, 450f, 116f); DrawWoodPanel(r, woodDark, woodMid, val); Rect r2 = default(Rect); ((Rect)(ref r2))..ctor(((Rect)(ref r)).x + 18f, ((Rect)(ref r)).y + 13f, 88f, 88f); DrawPeaVikingIcon(r2); Rect r3 = default(Rect); ((Rect)(ref r3))..ctor(((Rect)(ref r)).x + ((Rect)(ref r)).width - 105f, ((Rect)(ref r)).y + 21f, 78f, 70f); DrawFishIcon(r3, body); GUI.Label(new Rect(((Rect)(ref r)).x + 118f, ((Rect)(ref r)).y + 13f, ((Rect)(ref r)).width - 230f, 25f), _resultText, MakeStyle(14, (TextAnchor)4, (FontStyle)0, color6)); GUI.Label(new Rect(((Rect)(ref r)).x + 112f, ((Rect)(ref r)).y + 36f, ((Rect)(ref r)).width - 220f, 42f), string.IsNullOrEmpty(_caughtName) ? "Fish" : _caughtName, MakeStyle(25, (TextAnchor)4, (FontStyle)1, val3)); Rect val5 = new Rect(((Rect)(ref r)).x + 144f, ((Rect)(ref r)).y + 82f, 162f, 24f); DrawRect(val5, new Color(0.12f, 0.065f, 0.025f, 0.92f)); DrawBorder(val5, 1f, val); GUI.Label(val5, "PEAS KEEPERS", MakeStyle(11, (TextAnchor)4, (FontStyle)1, color6)); } if (!_active && flag) { Rect r4 = default(Rect); ((Rect)(ref r4))..ctor(num3 * 0.5f - 155f, num4 * 0.78f, 310f, 76f); DrawWoodPanel(r4, woodDark, new Color(0.43f, 0.3f, 0.15f, 0.98f), val); DrawPeaVikingIcon(new Rect(((Rect)(ref r4)).x + 10f, ((Rect)(ref r4)).y + 8f, 58f, 58f)); DrawFishIcon(new Rect(((Rect)(ref r4)).x + 74f, ((Rect)(ref r4)).y + 17f, 42f, 38f), body); GUI.Label(new Rect(((Rect)(ref r4)).x + 118f, ((Rect)(ref r4)).y + 8f, ((Rect)(ref r4)).width - 128f, 24f), "FISH NEARBY " + _nearbyFishCount, MakeStyle(14, (TextAnchor)3, (FontStyle)1, color6)); string text = ((_interestedFishCount <= 0) ? "Waiting for interest..." : ((_interestedFishCount == 1) ? "A fish is checking the bait..." : (_interestedFishCount + " fish are checking the bait..."))); GUI.Label(new Rect(((Rect)(ref r4)).x + 118f, ((Rect)(ref r4)).y + 32f, ((Rect)(ref r4)).width - 128f, 34f), text, MakeStyle(12, (TextAnchor)3, (FontStyle)0, (_interestedFishCount > 0) ? val3 : Color.white)); } if (!_active) { GUI.matrix = Matrix4x4.identity; return; } float num5 = 88f; float num6 = Mathf.Min(545f, num4 * 0.62f); float num7 = 10f; float num8 = 10f; float num9 = 19f; float num10 = num5 + num8 + num9 + num7 * 2f; float num11 = num3 * 0.715f; float num12 = (num4 - num6) * 0.5f; Rect r5 = default(Rect); ((Rect)(ref r5))..ctor(num11 - num7, num12 - num7 - 52f, num10, num6 + num7 * 2f + 52f); DrawWoodPanel(r5, woodDark, woodMid, val); Rect r6 = default(Rect); ((Rect)(ref r6))..ctor(((Rect)(ref r5)).x + ((Rect)(ref r5)).width * 0.5f - 29f, ((Rect)(ref r5)).y - 62f, 58f, 58f); DrawPeaVikingIcon(r6); float num13 = 166f; Rect val6 = new Rect(((Rect)(ref r5)).center.x - num13 * 0.5f, ((Rect)(ref r5)).y + 7f, num13, 28f); DrawRect(val6, new Color(0.12f, 0.065f, 0.025f, 0.97f)); DrawBorder(val6, 2f, val); GUIStyle val7 = MakeStyle(13, (TextAnchor)4, (FontStyle)1, color6); val7.wordWrap = false; GUI.Label(val6, "PEAS FISHING", val7); Rect r7 = new Rect(num11 - 5f, num12 - 5f, num5 + 10f, num6 + 10f); DrawRect(r7, new Color(0.1f, 0.055f, 0.022f, 1f)); DrawBorder(r7, 2f, val); Rect r8 = new Rect(num11, num12, num5, num6); DrawRect(r8, color3); DrawBorder(r8, 2f, new Color(0.36f, 0.23f, 0.1f, 1f)); for (int i = 0; i < 10; i++) { float num14 = num12 + num6 / 10f * (float)i; float num15 = 0.12f + 0.05f * (float)(i % 2); DrawRect(new Rect(num11 + 4f, num14, num5 - 8f, num6 / 10f), new Color(val2.r, val2.g, val2.b, num15)); } for (int j = 0; j < 7; j++) { float num16 = num11 + 12f + (float)j * 17f % (num5 - 24f); float num17 = num12 + 22f + (float)j * 67f % (num6 - 44f); DrawEllipse(new Rect(num16, num17, 4f + (float)(j % 3), 4f + (float)(j % 3)), new Color(0.75f, 0.93f, 1f, 0.2f)); } float num18 = num6 * BarSize.Value; _barVisualY = Mathf.Lerp(_barVisualY, _barY, 1f - Mathf.Exp(-14f * Time.deltaTime)); float num19 = Mathf.Clamp(BarSize.Value * 0.5f, 0.02f, 0.48f); float num20 = Mathf.Clamp(_barVisualY, num19, 1f - num19); float num21 = num12 + (1f - num20) * num6; DrawRect(new Rect(num11 + 9f, num21 - num18 / 2f - 3f, num5 - 18f, num18 + 6f), new Color(0.4f, 1f, 0.18f, 0.15f)); Rect r9 = default(Rect); ((Rect)(ref r9))..ctor(num11 + 13f, num21 - num18 / 2f, num5 - 26f, num18); DrawRect(r9, color5); DrawBorder(r9, 2f, new Color(0.025f, 0.12f, 0.01f, 1f)); Rect r10 = default(Rect); ((Rect)(ref r10))..ctor(((Rect)(ref r9)).x + 4f, ((Rect)(ref r9)).y + 4f, ((Rect)(ref r9)).width - 8f, Mathf.Max(1f, ((Rect)(ref r9)).height - 8f)); DrawRect(r10, color4); DrawRect(new Rect(((Rect)(ref r10)).x + 3f, ((Rect)(ref r10)).y + 3f, 4f, Mathf.Max(1f, ((Rect)(ref r10)).height - 6f)), new Color(1f, 1f, 1f, 0.34f)); float num22 = num12 + (1f - _fishY) * num6; Rect r11 = default(Rect); ((Rect)(ref r11))..ctor(num11 + 11f, num22 - 27f, num5 - 22f, 54f); DrawEllipse(r11, new Color(1f, 0.66f, 0.2f, 0.14f)); DrawFishIcon(new Rect(num11 + 13f, num22 - 24f, num5 - 26f, 48f), body); float num23 = num11 + num5 + num8; Rect r12 = new Rect(num23, num12, num9, num6); DrawRect(r12, new Color(0.035f, 0.04f, 0.045f, 0.98f)); DrawBorder(r12, 2f, val); float num24 = num6 * _progress; DrawRect(new Rect(num23 + 3f, num12 + num6 - num24 + 3f, num9 - 6f, Mathf.Max(0f, num24 - 6f)), new Color(0.63f, 0.86f, 0.98f, 1f)); float num25 = ((Rect)(ref r5)).xMax + 18f; float num26 = Mathf.Min(230f, num3 - num25 - 12f); Rect r13 = default(Rect); ((Rect)(ref r13))..ctor(num25, num12 + 20f, num26, 70f); DrawRect(r13, color); DrawBorder(r13, 2f, color2); DrawFishIcon(new Rect(((Rect)(ref r13)).x + 7f, ((Rect)(ref r13)).y + 13f, 44f, 42f), body); GUI.Label(new Rect(((Rect)(ref r13)).x + 57f, ((Rect)(ref r13)).y + 7f, num26 - 64f, 22f), "FISH", val4); GUI.Label(new Rect(((Rect)(ref r13)).x + 57f, ((Rect)(ref r13)).y + 28f, num26 - 64f, 36f), "Keep it inside your green bar.", MakeStyle(12, (TextAnchor)3, (FontStyle)0, Color.white)); Rect r14 = default(Rect); ((Rect)(ref r14))..ctor(num25, num12 + num6 * 0.43f, num26, 86f); DrawRect(r14, color); DrawBorder(r14, 2f, color2); Rect r15 = default(Rect); ((Rect)(ref r15))..ctor(((Rect)(ref r14)).x + 13f, ((Rect)(ref r14)).y + 17f, 24f, 52f); DrawRect(r15, color5); DrawRect(new Rect(((Rect)(ref r15)).x + 3f, ((Rect)(ref r15)).y + 3f, ((Rect)(ref r15)).width - 6f, ((Rect)(ref r15)).height - 6f), color4); GUI.Label(new Rect(((Rect)(ref r14)).x + 50f, ((Rect)(ref r14)).y + 7f, num26 - 58f, 22f), "YOUR BAR", val4); GUI.Label(new Rect(((Rect)(ref r14)).x + 50f, ((Rect)(ref r14)).y + 28f, num26 - 58f, 52f), "Hold " + ((object)RaiseKey.Value/*cast due to .constrained prefix*/).ToString() + " to raise.\nRelease to let it fall.", MakeStyle(12, (TextAnchor)3, (FontStyle)0, Color.white)); Rect r16 = default(Rect); ((Rect)(ref r16))..ctor(num25, num12 + num6 - 82f, num26, 74f); DrawRect(r16, color); DrawBorder(r16, 2f, color2); Rect r17 = default(Rect); ((Rect)(ref r17))..ctor(((Rect)(ref r16)).x + 15f, ((Rect)(ref r16)).y + 12f, 17f, 50f); DrawRect(r17, new Color(0.08f, 0.09f, 0.1f, 1f)); float num27 = 44f * _progress; DrawRect(new Rect(((Rect)(ref r17)).x + 3f, ((Rect)(ref r17)).y + 47f - num27, 11f, num27), new Color(0.63f, 0.86f, 0.98f, 1f)); GUI.Label(new Rect(((Rect)(ref r16)).x + 45f, ((Rect)(ref r16)).y + 7f, num26 - 53f, 22f), "CATCH " + Mathf.RoundToInt(_progress * 100f) + "%", val4); GUI.Label(new Rect(((Rect)(ref r16)).x + 45f, ((Rect)(ref r16)).y + 29f, num26 - 53f, 36f), "Fill the meter to land it.", MakeStyle(12, (TextAnchor)3, (FontStyle)0, Color.white)); Rect r18 = default(Rect); ((Rect)(ref r18))..ctor(((Rect)(ref r5)).x - 22f, ((Rect)(ref r5)).yMax + 10f, 205f, 54f); DrawRect(r18, color); DrawBorder(r18, 2f, color2); GUI.Label(new Rect(((Rect)(ref r18)).x + 8f, ((Rect)(ref r18)).y + 5f, ((Rect)(ref r18)).width - 16f, 20f), "HOLD " + ((object)RaiseKey.Value/*cast due to .constrained prefix*/).ToString() + " • RAISE", MakeStyle(12, (TextAnchor)4, (FontStyle)1, color6)); GUI.Label(new Rect(((Rect)(ref r18)).x + 8f, ((Rect)(ref r18)).y + 27f, ((Rect)(ref r18)).width - 16f, 18f), "RELEASE • DROP", MakeStyle(11, (TextAnchor)4, (FontStyle)0, Color.white)); if (_biteFlashTimer > 0f) { float a = Mathf.Clamp01(_biteFlashTimer / 0.35f); Color color7 = val3; color7.a = a; GUI.Label(new Rect(num3 * 0.5f - 120f, num4 * 0.18f, 240f, 56f), "BITE!", MakeStyle(32, (TextAnchor)4, (FontStyle)1, color7)); } GUI.matrix = Matrix4x4.identity; } } }