using System; using System.Collections.Generic; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using BepInEx; using BepInEx.Logging; using HarmonyLib; using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.UI; using UnityEngine.Video; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: AssemblyVersion("0.0.0.0")] namespace FishermanMastery; [BepInPlugin("com.max.fishermanmastery", "FishermanMastery", "1.0.2")] public class FishermanMasteryPlugin : BaseUnityPlugin { public struct LevelReward { public int level; public string rank; public string buffLine; } [Serializable] public class SaveSlotData { public string saveName = "Default"; public int level = 1; public int exp = 0; } [Serializable] public class MultiSaveContainer { public List slots = new List(); } public const string MOD_GUID = "com.max.fishermanmastery"; public const string MOD_NAME = "FishermanMastery"; public const string MOD_VERSION = "1.0.2"; public static FishermanMasteryPlugin Instance; public static ManualLogSource ModLogger; private Harmony harmony; private static AudioSource sfxSource; private static AudioClip sndLevelUp; private static AudioClip sndCatch; public static bool showLevelTable = false; private Rect tableRect = new Rect(0f, 0f, 740f, 620f); private Vector2 scrollPos = Vector2.zero; private bool wasTableOpen = false; public static int currentLevel = 1; public static int currentExp = 0; private static float displayedExp = 0f; public static int recentExpGain = 0; public static float recentExpTimer = 0f; public static bool showLevelUpBanner = false; public static float levelUpBannerTimer = 0f; public static int newLevel = 1; public static string savePath; private static string iconsDir; public static readonly HashSet ProcessedFishIds = new HashSet(); public static readonly LevelReward[] Rewards = new LevelReward[20] { new LevelReward { level = 1, rank = "Deckhand", buffLine = "Start — welcome aboard!" }, new LevelReward { level = 2, rank = "Deckhand", buffLine = "+10% Food Fullness" }, new LevelReward { level = 3, rank = "Sailor", buffLine = "+10% Reel Speed" }, new LevelReward { level = 4, rank = "Sailor", buffLine = "+10% Cast Distance" }, new LevelReward { level = 5, rank = "Sailor", buffLine = "+10% Fish Sell Price" }, new LevelReward { level = 6, rank = "Bosun", buffLine = "+15% Oxygen Time" }, new LevelReward { level = 7, rank = "Bosun", buffLine = "5% Shop Discount" }, new LevelReward { level = 8, rank = "Bosun", buffLine = "+20% Reel Speed (cumulative)" }, new LevelReward { level = 9, rank = "Skipper", buffLine = "+10% Fish Sell Price (cumulative)" }, new LevelReward { level = 10, rank = "Skipper", buffLine = "+10% Boat Speed" }, new LevelReward { level = 11, rank = "Skipper", buffLine = "+30% Oxygen Time (cumulative)" }, new LevelReward { level = 12, rank = "Skipper", buffLine = "+10% Cast Distance (cumulative)" }, new LevelReward { level = 13, rank = "Captain", buffLine = "10% Shop Discount (cumulative)" }, new LevelReward { level = 14, rank = "Captain", buffLine = "+20% Fish Sell Price (cumulative)" }, new LevelReward { level = 15, rank = "Captain", buffLine = "+20% Boat Speed (cumulative)" }, new LevelReward { level = 16, rank = "Sea Wolf", buffLine = "+20% Food Fullness (cumulative)" }, new LevelReward { level = 17, rank = "Sea Wolf", buffLine = "15% Shop Discount (cumulative)" }, new LevelReward { level = 18, rank = "Sea Wolf", buffLine = "5% Treasure Find Chance (fishing)" }, new LevelReward { level = 19, rank = "Legend", buffLine = "+30% Fish Sell Price (cumulative)" }, new LevelReward { level = 20, rank = "Legend of the Seas", buffLine = "ULTIMATE — All bonuses x1.5!" } }; private bool uiInit = false; private Font uiFont; private Texture2D txHudFrame; private Texture2D txHudHex; private Texture2D txHudBarBg; private Texture2D txHudBarFill; private Texture2D txLevelupArrow; private Texture2D txWindowBg; private Texture2D txExpBg; private Texture2D txExpFill; private Texture2D txBadgeBg; private Texture2D txRowUnlocked; private Texture2D txRowLocked; private Texture2D txRowCurrent; private Texture2D txBtnDark; private Texture2D txBtnHover; private Texture2D txSummaryBg; private Texture2D txCardCurrent; private Texture2D txCardUnlocked; private Texture2D txCardLocked; private Texture2D txPillCurrent; private Texture2D txPillUnlocked; private Texture2D txPillLocked; private Texture2D txSummaryRibbon; private GUIStyle stWindow; private GUIStyle stTitle; private GUIStyle stSub; private GUIStyle stExpLabel; private GUIStyle stLvlBadge; private GUIStyle stRankBadge; private GUIStyle stRowUnlocked; private GUIStyle stRowLocked; private GUIStyle stRowCurrent; private GUIStyle stBtnClose; private GUIStyle stColBuff; private GUIStyle stColLvl; private GUIStyle stColRank; private GUIStyle stMuted; private GUIStyle stGold; private GUIStyle stSummaryBox; private GUIStyle stActiveBuff; private GUIStyle stHudBarText; private GUIStyle stHudGain; private GUIStyle stPillText; private GUIStyle stCardRank; private GUIStyle stCardReward; private GUIStyle stBtnDiscord; private static VideoPlayer menuVideoPlayer; private static RenderTexture menuVideoTexture; private static GameObject menuCanvasGo; private static RawImage menuRawImage; public static float GetSellBonus() { float num = 0f; for (int i = 1; i <= currentLevel && i <= 20; i++) { if (i == 5 || i == 9 || i == 14 || i == 19) { num += 0.1f; } } if (currentLevel >= 20) { num *= 1.5f; } return num; } public static float GetReelBonus() { float num = 0f; for (int i = 1; i <= currentLevel && i <= 20; i++) { if (i == 3) { num += 0.1f; } if (i == 8) { num += 0.2f; } } if (currentLevel >= 20) { num *= 1.5f; } return num; } public static float GetCastBonus() { float num = 0f; for (int i = 1; i <= currentLevel && i <= 20; i++) { if (i == 4 || i == 12) { num += 0.1f; } } if (currentLevel >= 20) { num *= 1.5f; } return num; } public static float GetOxyBonus() { float num = 0f; for (int i = 1; i <= currentLevel && i <= 20; i++) { if (i == 6) { num += 0.15f; } if (i == 11) { num += 0.3f; } } if (currentLevel >= 20) { num *= 1.5f; } return num; } public static float GetDiscountBonus() { float num = 0f; for (int i = 1; i <= currentLevel && i <= 20; i++) { if (i == 7) { num += 0.05f; } if (i == 13) { num += 0.1f; } if (i == 17) { num += 0.15f; } } if (currentLevel >= 20) { num *= 1.5f; } return num; } public static float GetBoatBonus() { float num = 0f; for (int i = 1; i <= currentLevel && i <= 20; i++) { if (i == 10) { num += 0.1f; } if (i == 15) { num += 0.2f; } } if (currentLevel >= 20) { num *= 1.5f; } return num; } public static float GetFoodBonus() { float num = 0f; for (int i = 1; i <= currentLevel && i <= 20; i++) { if (i == 2) { num += 0.1f; } if (i == 16) { num += 0.2f; } } if (currentLevel >= 20) { num *= 1.5f; } return num; } public static bool HasTreasureFind() { return currentLevel >= 18; } public static int ExpRequired(int lvl) { return 300 + lvl * 220 + lvl * lvl * 60; } public static string GetRank(int lvl) { if (lvl >= 20) { return "Legend of the Seas"; } if (lvl >= 18) { return "Legend"; } if (lvl >= 15) { return "Sea Wolf"; } if (lvl >= 12) { return "Captain"; } if (lvl >= 9) { return "Skipper"; } if (lvl >= 6) { return "Bosun"; } if (lvl >= 3) { return "Sailor"; } return "Deckhand"; } private void Awake() { //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Expected O, but got Unknown Instance = this; ModLogger = ((BaseUnityPlugin)this).Logger; savePath = Path.Combine(Paths.ConfigPath, "FishermanMastery_Save.json"); string directoryName = Path.GetDirectoryName(typeof(FishermanMasteryPlugin).Assembly.Location); iconsDir = Path.Combine(directoryName, "icons"); if (!Directory.Exists(iconsDir)) { iconsDir = Path.Combine(Paths.PluginPath, "417-FishermanMastery", "icons"); } if (!Directory.Exists(iconsDir)) { iconsDir = Path.Combine(Paths.PluginPath, "FishermanMastery", "icons"); } InitAudio(); LoadProgress(); try { harmony = new Harmony("com.max.fishermanmastery"); harmony.PatchAll(); } catch (Exception ex) { ModLogger.LogError((object)("Harmony: " + ex)); } ModLogger.LogInfo((object)"FishermanMastery v1.0.2 loaded."); } private void InitAudio() { try { sfxSource = ((Component)this).gameObject.AddComponent(); sfxSource.playOnAwake = false; sfxSource.volume = 0.7f; sndLevelUp = CreateArpeggioClip(new float[4] { 523.25f, 659.25f, 783.99f, 1046.5f }, 0.12f); sndCatch = CreateArpeggioClip(new float[2] { 659.25f, 987.77f }, 0.08f); } catch { } } private static AudioClip CreateArpeggioClip(float[] freqs, float noteLen) { int num = 44100; int num2 = (int)((float)freqs.Length * noteLen * (float)num); float[] array = new float[num2]; for (int i = 0; i < freqs.Length; i++) { float num3 = freqs[i]; int num4 = (int)((float)i * noteLen * (float)num); int num5 = (int)((float)(i + 1) * noteLen * (float)num); for (int j = num4; j < num5 && j < num2; j++) { float num6 = (float)(j - num4) / (float)num; float num7 = 1f - (float)(j - num4) / (float)(num5 - num4); array[j] = Mathf.Sin((float)Math.PI * 2f * num3 * num6) * num7 * 0.45f; } } AudioClip val = AudioClip.Create("sfx_rpg", num2, 1, num, false); val.SetData(array, 0); return val; } public static void PlaySfx(AudioClip clip) { if ((Object)(object)sfxSource != (Object)null && (Object)(object)clip != (Object)null) { sfxSource.PlayOneShot(clip); } } private Texture2D LoadPng(string filename, Texture2D fallback) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown try { string path = Path.Combine(iconsDir, filename); if (File.Exists(path)) { byte[] array = File.ReadAllBytes(path); Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false); if (ImageConversion.LoadImage(val, array)) { return val; } } } catch { } return fallback; } public void SetupMenuVideo() { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Expected O, but got Unknown //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Expected O, but got Unknown //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Expected O, but got Unknown //IL_0151: 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_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Expected O, but got Unknown try { string text = Path.Combine(Paths.PluginPath, "FishermanMastery", "mopsik_menu.mp4"); if (!File.Exists(text)) { text = Path.Combine(Paths.GameRootPath, "mopsik_menu.mp4"); } if (!File.Exists(text)) { return; } if ((Object)(object)menuVideoTexture == (Object)null) { menuVideoTexture = new RenderTexture(1920, 1080, 0, (RenderTextureFormat)0); ((Texture)menuVideoTexture).wrapMode = (TextureWrapMode)1; menuVideoTexture.Create(); } if ((Object)(object)menuCanvasGo == (Object)null) { menuCanvasGo = new GameObject("MopsikVideoCanvas"); Object.DontDestroyOnLoad((Object)(object)menuCanvasGo); Canvas val = menuCanvasGo.AddComponent(); val.renderMode = (RenderMode)0; val.sortingOrder = -100; CanvasScaler val2 = menuCanvasGo.AddComponent(); val2.uiScaleMode = (ScaleMode)1; val2.referenceResolution = new Vector2(1920f, 1080f); val2.matchWidthOrHeight = 0.5f; GameObject val3 = new GameObject("MopsikVideoImage"); val3.transform.SetParent(menuCanvasGo.transform, false); menuRawImage = val3.AddComponent(); menuRawImage.texture = (Texture)(object)menuVideoTexture; ((Graphic)menuRawImage).rectTransform.anchorMin = Vector2.zero; ((Graphic)menuRawImage).rectTransform.anchorMax = Vector2.one; ((Graphic)menuRawImage).rectTransform.sizeDelta = Vector2.zero; ((Graphic)menuRawImage).rectTransform.anchoredPosition = Vector2.zero; } if ((Object)(object)menuVideoPlayer == (Object)null) { GameObject val4 = new GameObject("MopsikVideoPlayer"); Object.DontDestroyOnLoad((Object)(object)val4); menuVideoPlayer = val4.AddComponent(); menuVideoPlayer.playOnAwake = false; menuVideoPlayer.renderMode = (VideoRenderMode)2; menuVideoPlayer.targetTexture = menuVideoTexture; menuVideoPlayer.isLooping = true; menuVideoPlayer.url = text; menuVideoPlayer.audioOutputMode = (VideoAudioOutputMode)0; menuVideoPlayer.aspectRatio = (VideoAspectRatio)4; } if (!IsInGame()) { if ((Object)(object)menuCanvasGo != (Object)null) { menuCanvasGo.SetActive(true); } if ((Object)(object)menuVideoPlayer != (Object)null && !menuVideoPlayer.isPlaying) { menuVideoPlayer.Play(); } } } catch { } } private static bool IsInGame() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) Scene activeScene = SceneManager.GetActiveScene(); string name = ((Scene)(ref activeScene)).name; if (name.IndexOf("Menu", StringComparison.OrdinalIgnoreCase) >= 0) { return false; } if (name.IndexOf("Loading", StringComparison.OrdinalIgnoreCase) >= 0) { return false; } try { return PlayerManager.AlivePlayers != null && PlayerManager.AlivePlayers.Count > 0; } catch { return false; } } private void Update() { bool flag = false; if (Input.GetKeyDown((KeyCode)108)) { showLevelTable = !showLevelTable; if (!showLevelTable) { flag = true; } } if (showLevelTable && Input.GetKeyDown((KeyCode)27)) { showLevelTable = false; flag = true; } if (flag && IsInGame()) { Cursor.lockState = (CursorLockMode)1; Cursor.visible = false; } displayedExp = Mathf.MoveTowards(displayedExp, (float)currentExp, Time.deltaTime * Mathf.Max(60f, Mathf.Abs((float)currentExp - displayedExp) * 6f)); if (recentExpTimer > 0f) { recentExpTimer -= Time.deltaTime; } if (showLevelUpBanner) { levelUpBannerTimer -= Time.deltaTime; if (levelUpBannerTimer <= 0f) { showLevelUpBanner = false; } } if (IsInGame()) { if ((Object)(object)menuCanvasGo != (Object)null && menuCanvasGo.activeSelf) { menuCanvasGo.SetActive(false); } if ((Object)(object)menuVideoPlayer != (Object)null && menuVideoPlayer.isPlaying) { menuVideoPlayer.Pause(); } if (GetBoatBonus() > 0f && Input.GetKey((KeyCode)119)) { ApplyBoatPassive(); } return; } if ((Object)(object)menuCanvasGo == (Object)null || (Object)(object)menuVideoPlayer == (Object)null) { SetupMenuVideo(); } else { if (!menuCanvasGo.activeSelf) { menuCanvasGo.SetActive(true); } if (!menuVideoPlayer.isPlaying) { menuVideoPlayer.Play(); } } try { MainMenuManager val = Object.FindObjectOfType(); if ((Object)(object)val != (Object)null) { Traverse.Create((object)val).Method("HideBoat", new object[0]).GetValue(); } } catch { } } private void ApplyBoatPassive() { //IL_0043: 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_005d: Unknown result type (might be due to invalid IL or missing references) try { Boat[] array = Object.FindObjectsOfType(); if (array.Length > 0 && (Object)(object)array[0] != (Object)null) { Rigidbody componentInChildren = ((Component)array[0]).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.AddForce(((Component)array[0]).transform.forward * (GetBoatBonus() * 18000f) * Time.deltaTime, (ForceMode)5); } } } catch { } } public static void AddExp(int amount) { if (amount > 0) { currentExp += amount; recentExpGain = amount; recentExpTimer = 3.5f; while (currentLevel < 20 && currentExp >= ExpRequired(currentLevel)) { currentExp -= ExpRequired(currentLevel); displayedExp = 0f; currentLevel++; newLevel = currentLevel; showLevelUpBanner = true; levelUpBannerTimer = 5.5f; PlaySfx(sndLevelUp); ModLogger.LogInfo((object)("Level Up: " + currentLevel + " (" + GetRank(currentLevel) + ")")); } SaveProgress(); } } public static void ProcessCaughtItem(Item item, string source) { if ((Object)(object)item == (Object)null) { return; } try { int instanceID = ((Object)item).GetInstanceID(); if (!ProcessedFishIds.Contains(instanceID) && ((Object)(object)item.Creature != (Object)null || (Object)(object)item.Fish != (Object)null || item is Creature || item is Fish)) { ProcessedFishIds.Add(instanceID); float randomizedWeight = item.RandomizedWeight; int totalWorth = item.TotalWorth; int num; string text; if (randomizedWeight >= 20f || totalWorth >= 250) { num = Random.Range(350, 450); text = "LEGENDARY"; } else if (randomizedWeight >= 10f || totalWorth >= 100) { num = Random.Range(160, 220); text = "EPIC"; } else if (randomizedWeight >= 4f || totalWorth >= 40) { num = Random.Range(70, 95); text = "RARE"; } else if (randomizedWeight >= 1.5f || totalWorth >= 15) { num = Random.Range(28, 42); text = "UNCOMMON"; } else { num = Random.Range(12, 18); text = "COMMON"; } PlaySfx(sndCatch); AddExp(num); ModLogger.LogInfo((object)("[Catch] " + text + " (" + randomizedWeight.ToString("F1") + "kg / $" + totalWorth + ") -> +" + num + " EXP")); } } catch (Exception ex) { ModLogger.LogWarning((object)("ProcessCaughtItem error: " + ex.Message)); } } public static string GetCurrentSaveName() { try { if (SaveManager.CurServerSave != null && !string.IsNullOrEmpty(SaveManager.CurServerSave.Name)) { return SaveManager.CurServerSave.Name; } } catch { } return "Default"; } public static void SaveProgress() { try { string curName = GetCurrentSaveName(); MultiSaveContainer multiSaveContainer = new MultiSaveContainer(); if (File.Exists(savePath)) { try { multiSaveContainer = JsonUtility.FromJson(File.ReadAllText(savePath)) ?? new MultiSaveContainer(); } catch { } } if (multiSaveContainer.slots == null) { multiSaveContainer.slots = new List(); } SaveSlotData saveSlotData = multiSaveContainer.slots.Find((SaveSlotData s) => s.saveName == curName); if (saveSlotData == null) { SaveSlotData saveSlotData2 = new SaveSlotData(); saveSlotData2.saveName = curName; saveSlotData = saveSlotData2; multiSaveContainer.slots.Add(saveSlotData); } saveSlotData.level = currentLevel; saveSlotData.exp = currentExp; File.WriteAllText(savePath, JsonUtility.ToJson((object)multiSaveContainer, true)); } catch { } } public static void LoadProgress() { try { string curName = GetCurrentSaveName(); if (File.Exists(savePath)) { MultiSaveContainer multiSaveContainer = JsonUtility.FromJson(File.ReadAllText(savePath)); if (multiSaveContainer != null && multiSaveContainer.slots != null) { SaveSlotData saveSlotData = multiSaveContainer.slots.Find((SaveSlotData s) => s.saveName == curName); if (saveSlotData != null) { currentLevel = Mathf.Max(1, saveSlotData.level); currentExp = Mathf.Max(0, saveSlotData.exp); displayedExp = currentExp; return; } } } currentLevel = 1; currentExp = 0; displayedExp = 0f; } catch { } } private Texture2D MakeSolid(Color c) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: 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) //IL_0040: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(2, 2); val.SetPixels((Color[])(object)new Color[4] { c, c, c, c }); val.Apply(); return val; } private Texture2D MakeBorder(Color bg, Color br, int bw) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0045: 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) int num = 16; Texture2D val = new Texture2D(num, num); Color[] array = (Color[])(object)new Color[num * num]; for (int i = 0; i < num; i++) { for (int j = 0; j < num; j++) { array[i * num + j] = ((j < bw || j >= num - bw || i < bw || i >= num - bw) ? br : bg); } } val.SetPixels(array); val.Apply(); return val; } private static Texture2D CreateHexagonTexture(int size, Color fill, Color border, float borderWidth) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(size, size, (TextureFormat)4, false); Color[] array = (Color[])(object)new Color[size * size]; float num = (float)(size - 1) / 2f; float num2 = (float)(size - 1) / 2f; float num3 = (float)(size - 4) / 2f; for (int i = 0; i < size; i++) { for (int j = 0; j < size; j++) { float num4 = Mathf.Abs((float)j - num); float num5 = Mathf.Abs((float)i - num2); float num6 = num4 * 0.866025f + num5 * 0.5f; float num7 = Mathf.Max(num5, num6); if (num7 <= num3 - borderWidth) { array[i * size + j] = fill; continue; } if (num7 <= num3) { array[i * size + j] = border; continue; } ref Color reference = ref array[i * size + j]; reference = Color.clear; } } val.SetPixels(array); val.Apply(); return val; } private GUIStyle MakeLabel(int size, Color col, FontStyle fs) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown GUIStyle val = new GUIStyle(GUI.skin.label); if ((Object)(object)uiFont != (Object)null) { val.font = uiFont; } val.fontSize = size; val.fontStyle = fs; val.normal.textColor = col; val.clipping = (TextClipping)0; val.padding = new RectOffset(0, 0, 0, 0); return val; } private GUIStyle MakeBox(Texture2D bg, int pad) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown GUIStyle val = new GUIStyle(GUI.skin.box); if ((Object)(object)uiFont != (Object)null) { val.font = uiFont; } val.normal.background = bg; val.padding = new RectOffset(pad, pad, pad, pad); val.margin = new RectOffset(0, 0, 2, 2); return val; } private void InitGUI() { //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_0319: Expected O, but got Unknown //IL_037c: Unknown result type (might be due to invalid IL or missing references) //IL_0386: Expected O, but got Unknown //IL_0391: Unknown result type (might be due to invalid IL or missing references) //IL_039b: Expected O, but got Unknown //IL_03a0: Unknown result type (might be due to invalid IL or missing references) //IL_03b1: Unknown result type (might be due to invalid IL or missing references) //IL_03c2: Unknown result type (might be due to invalid IL or missing references) //IL_03d3: Unknown result type (might be due to invalid IL or missing references) //IL_03e4: Unknown result type (might be due to invalid IL or missing references) //IL_03f5: Unknown result type (might be due to invalid IL or missing references) //IL_0406: Unknown result type (might be due to invalid IL or missing references) //IL_0424: Unknown result type (might be due to invalid IL or missing references) //IL_048f: Unknown result type (might be due to invalid IL or missing references) //IL_04ad: 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_04e1: Unknown result type (might be due to invalid IL or missing references) //IL_04ff: Unknown result type (might be due to invalid IL or missing references) //IL_0524: Unknown result type (might be due to invalid IL or missing references) //IL_052e: Expected O, but got Unknown //IL_058e: Unknown result type (might be due to invalid IL or missing references) //IL_05bb: Unknown result type (might be due to invalid IL or missing references) //IL_05c5: Expected O, but got Unknown //IL_05ca: Unknown result type (might be due to invalid IL or missing references) //IL_05db: Unknown result type (might be due to invalid IL or missing references) //IL_05ec: Unknown result type (might be due to invalid IL or missing references) //IL_0611: Unknown result type (might be due to invalid IL or missing references) //IL_061b: Expected O, but got Unknown //IL_0662: Unknown result type (might be due to invalid IL or missing references) //IL_0692: Unknown result type (might be due to invalid IL or missing references) //IL_06ad: Unknown result type (might be due to invalid IL or missing references) //IL_06ea: Unknown result type (might be due to invalid IL or missing references) //IL_06f4: Expected O, but got Unknown if (!uiInit) { try { uiFont = Font.CreateDynamicFontFromOSFont(new string[3] { "Segoe UI", "Arial", "Tahoma" }, 14); } catch { } Color bg = default(Color); ((Color)(ref bg))..ctor(0.06f, 0.08f, 0.13f, 0.98f); Color br = default(Color); ((Color)(ref br))..ctor(0.15f, 0.22f, 0.35f, 0.95f); Color c = default(Color); ((Color)(ref c))..ctor(0.04f, 0.05f, 0.09f, 0.95f); Color c2 = default(Color); ((Color)(ref c2))..ctor(0f, 0.62f, 1f, 0.95f); Color fill = default(Color); ((Color)(ref fill))..ctor(0.06f, 0.12f, 0.22f, 0.95f); Color border = default(Color); ((Color)(ref border))..ctor(0f, 0.68f, 1f, 0.95f); Color bg2 = default(Color); ((Color)(ref bg2))..ctor(0.08f, 0.14f, 0.22f, 0.9f); Color bg3 = default(Color); ((Color)(ref bg3))..ctor(0.07f, 0.09f, 0.14f, 0.85f); Color bg4 = default(Color); ((Color)(ref bg4))..ctor(0f, 0.28f, 0.5f, 0.9f); Color c3 = default(Color); ((Color)(ref c3))..ctor(0.13f, 0.17f, 0.25f, 0.9f); Color c4 = default(Color); ((Color)(ref c4))..ctor(0.2f, 0.27f, 0.4f, 0.95f); Color bg5 = default(Color); ((Color)(ref bg5))..ctor(0.04f, 0.1f, 0.18f, 0.92f); Color br2 = default(Color); ((Color)(ref br2))..ctor(0f, 0.68f, 1f, 0.6f); txWindowBg = MakeBorder(bg, br, 2); txExpBg = MakeSolid(c); txExpFill = MakeSolid(c2); txBadgeBg = CreateHexagonTexture(64, fill, border, 3f); txRowUnlocked = MakeBorder(bg2, new Color(0.1f, 0.6f, 1f, 0.4f), 1); txRowLocked = MakeBorder(bg3, new Color(0.18f, 0.22f, 0.32f, 0.5f), 1); txRowCurrent = MakeBorder(bg4, new Color(0f, 0.85f, 1f, 0.9f), 2); txBtnDark = MakeSolid(c3); txBtnHover = MakeSolid(c4); txSummaryBg = MakeBorder(bg5, br2, 1); Color col = default(Color); ((Color)(ref col))..ctor(0f, 0.85f, 1f); Color white = Color.white; Color col2 = default(Color); ((Color)(ref col2))..ctor(0.6f, 0.7f, 0.8f); Color col3 = default(Color); ((Color)(ref col3))..ctor(1f, 0.82f, 0.15f); Color col4 = default(Color); ((Color)(ref col4))..ctor(0.25f, 1f, 0.6f); stWindow = new GUIStyle(GUI.skin.window); if ((Object)(object)uiFont != (Object)null) { stWindow.font = uiFont; } stWindow.normal.background = txWindowBg; stWindow.onNormal.background = txWindowBg; stWindow.padding = new RectOffset(18, 18, 14, 14); stWindow.border = new RectOffset(4, 4, 4, 4); stTitle = MakeLabel(18, white, (FontStyle)1); stSub = MakeLabel(12, col2, (FontStyle)0); stExpLabel = MakeLabel(13, col, (FontStyle)1); stGold = MakeLabel(14, col3, (FontStyle)1); stMuted = MakeLabel(12, col2, (FontStyle)0); stActiveBuff = MakeLabel(13, col4, (FontStyle)1); stLvlBadge = MakeLabel(16, white, (FontStyle)1); stLvlBadge.alignment = (TextAnchor)4; stRankBadge = MakeLabel(11, col, (FontStyle)0); stRankBadge.alignment = (TextAnchor)4; stRowUnlocked = MakeBox(txRowUnlocked, 6); stRowLocked = MakeBox(txRowLocked, 6); stRowCurrent = MakeBox(txRowCurrent, 6); stSummaryBox = MakeBox(txSummaryBg, 10); stColLvl = MakeLabel(14, white, (FontStyle)1); stColLvl.alignment = (TextAnchor)4; stColRank = MakeLabel(13, col, (FontStyle)0); stColBuff = MakeLabel(13, new Color(0.88f, 0.94f, 1f), (FontStyle)0); stHudBarText = MakeLabel(13, white, (FontStyle)1); stHudBarText.alignment = (TextAnchor)4; stHudGain = MakeLabel(14, col3, (FontStyle)1); stHudGain.alignment = (TextAnchor)3; stBtnClose = new GUIStyle(GUI.skin.button); if ((Object)(object)uiFont != (Object)null) { stBtnClose.font = uiFont; } stBtnClose.normal.background = txBtnDark; stBtnClose.hover.background = txBtnHover; stBtnClose.normal.textColor = white; stBtnClose.fontStyle = (FontStyle)1; stBtnClose.fontSize = 14; stBtnClose.padding = new RectOffset(8, 8, 4, 4); stCardRank = MakeLabel(11, col, (FontStyle)1); stCardReward = MakeLabel(13, white, (FontStyle)1); stPillText = MakeLabel(11, white, (FontStyle)1); stPillText.alignment = (TextAnchor)4; stBtnDiscord = new GUIStyle(GUI.skin.button); if ((Object)(object)uiFont != (Object)null) { stBtnDiscord.font = uiFont; } stBtnDiscord.normal.background = MakeSolid(new Color(0.345f, 0.396f, 0.949f, 0.95f)); stBtnDiscord.hover.background = MakeSolid(new Color(0.278f, 0.322f, 0.769f, 0.98f)); stBtnDiscord.normal.textColor = Color.white; stBtnDiscord.fontStyle = (FontStyle)1; stBtnDiscord.fontSize = 12; stBtnDiscord.alignment = (TextAnchor)4; stBtnDiscord.padding = new RectOffset(6, 6, 2, 2); txHudFrame = LoadPng("hud_frame.png", txWindowBg); txHudHex = LoadPng("hud_hex_badge.png", txBadgeBg); txHudBarBg = LoadPng("hud_bar_bg.png", txExpBg); txHudBarFill = LoadPng("hud_bar_fill.png", txExpFill); txLevelupArrow = LoadPng("levelup_arrow.png", null); txCardCurrent = LoadPng("card_current.png", txRowCurrent); txCardUnlocked = LoadPng("card_unlocked.png", txRowUnlocked); txCardLocked = LoadPng("card_locked.png", txRowLocked); txPillCurrent = LoadPng("pill_current.png", null); txPillUnlocked = LoadPng("pill_unlocked.png", null); txPillLocked = LoadPng("pill_locked.png", null); txSummaryRibbon = LoadPng("summary_ribbon.png", txSummaryBg); uiInit = true; } } private void OnGUI() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: 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_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_015b: 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_017c: Expected O, but got Unknown //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) InitGUI(); Color color = GUI.color; Color backgroundColor = GUI.backgroundColor; Color contentColor = GUI.contentColor; try { if (!IsInGame()) { Rect val = default(Rect); ((Rect)(ref val))..ctor(20f, (float)Screen.height - 46f, 190f, 32f); if (GUI.Button(val, "\ud83d\udcac Discord Community", stBtnDiscord)) { Application.OpenURL("https://discord.gg/4bmDYANzGj"); } return; } DrawExpHUD(); if (showLevelUpBanner) { DrawLevelUpBanner(); } if (showLevelTable) { Cursor.lockState = (CursorLockMode)0; Cursor.visible = true; if (!wasTableOpen || ((Rect)(ref tableRect)).width != 740f) { ((Rect)(ref tableRect)).width = 740f; ((Rect)(ref tableRect)).height = 620f; ((Rect)(ref tableRect)).x = ((float)Screen.width - ((Rect)(ref tableRect)).width) / 2f; ((Rect)(ref tableRect)).y = ((float)Screen.height - ((Rect)(ref tableRect)).height) / 2f; wasTableOpen = true; } GUI.backgroundColor = Color.white; tableRect = GUI.Window(7001, tableRect, new WindowFunction(DrawTable), "", stWindow); } else { wasTableOpen = false; } } finally { GUI.color = color; GUI.backgroundColor = backgroundColor; GUI.contentColor = contentColor; } } private void DrawOutlinedLabel(Rect rect, string text, GUIStyle style, Color textColor, Color outlineColor, int outlineDist = 1) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) GUIStyle val = new GUIStyle(style); val.normal.textColor = outlineColor; for (int i = -outlineDist; i <= outlineDist; i++) { for (int j = -outlineDist; j <= outlineDist; j++) { if (i != 0 || j != 0) { GUI.Label(new Rect(((Rect)(ref rect)).x + (float)i, ((Rect)(ref rect)).y + (float)j, ((Rect)(ref rect)).width, ((Rect)(ref rect)).height), text, val); } } } GUIStyle val2 = new GUIStyle(style); val2.normal.textColor = textColor; GUI.Label(rect, text, val2); } private void DrawExpHUD() { //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0087: 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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: 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_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01db: 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_0279: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) float num = 54f; float num2 = 380f; float num3 = 30f; float num4 = 8f; float num5 = num + num4 + num2; float num6 = 24f; float num7 = 16f; float num8 = (float)Screen.width - num5 - num6; float num9 = num7; Rect val = default(Rect); ((Rect)(ref val))..ctor(num8, num9, num, num); if ((Object)(object)txHudHex != (Object)null) { GUI.DrawTexture(val, (Texture)(object)txHudHex, (ScaleMode)2); } DrawOutlinedLabel(val, currentLevel.ToString(), stLvlBadge, Color.white, new Color(0f, 0f, 0f, 0.95f)); float num10 = num8 + num + num4; float num11 = num9 + (num - num3) / 2f; Rect val2 = default(Rect); ((Rect)(ref val2))..ctor(num10, num11, num2, num3); if ((Object)(object)txHudBarBg != (Object)null) { GUI.DrawTexture(val2, (Texture)(object)txHudBarBg, (ScaleMode)0); } int num12 = ExpRequired(currentLevel); float num13 = ((currentLevel >= 20) ? 1f : Mathf.Clamp01(displayedExp / (float)num12)); if (num13 > 0.001f && (Object)(object)txHudBarFill != (Object)null) { GUI.DrawTexture(new Rect(num10 + 3f, num11 + 3f, (num2 - 6f) * num13, num3 - 6f), (Texture)(object)txHudBarFill, (ScaleMode)0); } string text = ((currentLevel >= 20) ? "MAX LEVEL" : (currentExp.ToString("N0") + " / " + num12.ToString("N0") + " XP")); DrawOutlinedLabel(val2, text, stHudBarText, Color.white, new Color(0f, 0.05f, 0.15f, 0.95f)); if (recentExpTimer > 0f) { float num14 = Mathf.Clamp01(recentExpTimer); Color textColor = default(Color); ((Color)(ref textColor))..ctor(1f, 0.85f, 0.2f, num14); Color outlineColor = default(Color); ((Color)(ref outlineColor))..ctor(0f, 0f, 0f, num14 * 0.9f); DrawOutlinedLabel(new Rect(num8 - 95f, num11, 90f, num3), "+" + recentExpGain + " EXP", stHudGain, textColor, outlineColor); } } private void DrawLevelUpBanner() { //IL_007d: 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_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Expected O, but got Unknown //IL_012e: 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_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_020d: 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_0269: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_028b: 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) float num = 500f; float num2 = 92f; float num3 = ((float)Screen.width - num) / 2f; float num4 = (float)Screen.height - num2 - 200f; float num5 = Mathf.Clamp01(levelUpBannerTimer / 0.8f); if (levelUpBannerTimer > 4.5f) { num5 = Mathf.Clamp01((5.5f - levelUpBannerTimer) / 1f); } GUI.color = new Color(1f, 1f, 1f, num5); GUI.DrawTexture(new Rect(num3, num4, num, num2), (Texture)(object)(((Object)(object)txHudFrame != (Object)null) ? txHudFrame : txWindowBg)); if ((Object)(object)txLevelupArrow != (Object)null) { GUI.DrawTexture(new Rect(num3 + 16f, num4 + 18f, 56f, 56f), (Texture)(object)txLevelupArrow, (ScaleMode)2); } GUIStyle val = new GUIStyle(stGold); val.fontSize = 19; val.fontStyle = (FontStyle)1; DrawOutlinedLabel(new Rect(num3 + 84f, num4 + 10f, 400f, 26f), "LEVEL UP!", val, new Color(1f, 0.82f, 0.15f, num5), new Color(0f, 0f, 0f, num5)); int num6 = Mathf.Clamp(newLevel - 1, 0, Rewards.Length - 1); DrawOutlinedLabel(new Rect(num3 + 84f, num4 + 36f, 400f, 22f), "Level " + newLevel + " — " + GetRank(newLevel), stColRank, new Color(1f, 1f, 1f, num5), new Color(0f, 0f, 0f, num5)); DrawOutlinedLabel(new Rect(num3 + 84f, num4 + 58f, 400f, 24f), "Unlocked: " + Rewards[num6].buffLine, stActiveBuff, new Color(0.25f, 1f, 0.6f, num5), new Color(0f, 0f, 0f, num5)); GUI.color = Color.white; } private void DrawTable(int id) { //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) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0092: 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_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_04ec: 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_050a: Unknown result type (might be due to invalid IL or missing references) //IL_09bd: Unknown result type (might be due to invalid IL or missing references) //IL_059e: Unknown result type (might be due to invalid IL or missing references) //IL_05a3: Unknown result type (might be due to invalid IL or missing references) //IL_05b7: Unknown result type (might be due to invalid IL or missing references) //IL_0689: Unknown result type (might be due to invalid IL or missing references) //IL_06d5: Unknown result type (might be due to invalid IL or missing references) //IL_0661: Unknown result type (might be due to invalid IL or missing references) //IL_06db: Unknown result type (might be due to invalid IL or missing references) //IL_06be: Unknown result type (might be due to invalid IL or missing references) //IL_06b7: Unknown result type (might be due to invalid IL or missing references) //IL_066d: Unknown result type (might be due to invalid IL or missing references) //IL_067c: Unknown result type (might be due to invalid IL or missing references) //IL_0645: Unknown result type (might be due to invalid IL or missing references) //IL_062a: Unknown result type (might be due to invalid IL or missing references) //IL_0748: Unknown result type (might be due to invalid IL or missing references) //IL_074e: Unknown result type (might be due to invalid IL or missing references) //IL_0731: Unknown result type (might be due to invalid IL or missing references) //IL_071b: Unknown result type (might be due to invalid IL or missing references) //IL_0784: Unknown result type (might be due to invalid IL or missing references) //IL_078a: Unknown result type (might be due to invalid IL or missing references) //IL_07a3: Unknown result type (might be due to invalid IL or missing references) //IL_07ba: Unknown result type (might be due to invalid IL or missing references) //IL_07bc: Unknown result type (might be due to invalid IL or missing references) //IL_07df: Unknown result type (might be due to invalid IL or missing references) //IL_07f1: Unknown result type (might be due to invalid IL or missing references) //IL_07f3: Unknown result type (might be due to invalid IL or missing references) //IL_077c: Unknown result type (might be due to invalid IL or missing references) //IL_0766: Unknown result type (might be due to invalid IL or missing references) //IL_0866: Unknown result type (might be due to invalid IL or missing references) //IL_08d3: Unknown result type (might be due to invalid IL or missing references) //IL_08d9: Unknown result type (might be due to invalid IL or missing references) //IL_08dc: Unknown result type (might be due to invalid IL or missing references) //IL_08e6: Unknown result type (might be due to invalid IL or missing references) //IL_08e8: Unknown result type (might be due to invalid IL or missing references) //IL_08bc: Unknown result type (might be due to invalid IL or missing references) //IL_08a6: Unknown result type (might be due to invalid IL or missing references) GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[0]); GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[0]); GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(520f) }); if ((Object)(object)txHudHex != (Object)null) { Rect rect = GUILayoutUtility.GetRect(44f, 44f, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(44f), GUILayout.Height(44f) }); GUI.DrawTexture(rect, (Texture)(object)txHudHex, (ScaleMode)2); DrawOutlinedLabel(rect, currentLevel.ToString(), stLvlBadge, Color.white, Color.black); } GUILayout.Space(8f); GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[0]); GUILayout.Label("FISHERMAN MASTERY ROADMAP", stTitle, (GUILayoutOption[])(object)new GUILayoutOption[0]); GUILayout.Label("Rank: " + GetRank(currentLevel).ToUpper() + " • Level " + currentLevel + " / 20 • [L] or [ESC] to close", stSub, (GUILayoutOption[])(object)new GUILayoutOption[0]); GUILayout.EndVertical(); GUILayout.EndHorizontal(); GUILayout.FlexibleSpace(); if (GUILayout.Button("✕", stBtnClose, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(34f), GUILayout.Height(30f) })) { showLevelTable = false; } GUILayout.EndHorizontal(); GUILayout.Space(8f); GUILayout.BeginVertical(stSummaryBox, (GUILayoutOption[])(object)new GUILayoutOption[0]); GUILayout.Label("CURRENT ACTIVE BONUSES — Level " + currentLevel + " (" + GetRank(currentLevel) + ")", stExpLabel, (GUILayoutOption[])(object)new GUILayoutOption[0]); GUILayout.Space(4f); string text = ""; if (GetSellBonus() > 0f) { object obj = text; text = string.Concat(obj, "[PRICE +", Mathf.RoundToInt(GetSellBonus() * 100f), "%] "); } if (GetReelBonus() > 0f) { object obj = text; text = string.Concat(obj, "[REEL +", Mathf.RoundToInt(GetReelBonus() * 100f), "%] "); } if (GetCastBonus() > 0f) { object obj = text; text = string.Concat(obj, "[CAST +", Mathf.RoundToInt(GetCastBonus() * 100f), "%] "); } if (GetOxyBonus() > 0f) { object obj = text; text = string.Concat(obj, "[OXYGEN +", Mathf.RoundToInt(GetOxyBonus() * 100f), "%] "); } if (GetDiscountBonus() > 0f) { object obj = text; text = string.Concat(obj, "[SHOP -", Mathf.RoundToInt(GetDiscountBonus() * 100f), "%] "); } if (GetBoatBonus() > 0f) { object obj = text; text = string.Concat(obj, "[BOAT SPEED +", Mathf.RoundToInt(GetBoatBonus() * 100f), "%] "); } if (GetFoodBonus() > 0f) { object obj = text; text = string.Concat(obj, "[FOOD +", Mathf.RoundToInt(GetFoodBonus() * 100f), "%] "); } if (HasTreasureFind()) { text += "[TREASURE 5%] "; } if (text.Length == 0) { text = "No perks unlocked yet — catch fish to start leveling up!"; } GUILayout.Label(text, stActiveBuff, (GUILayoutOption[])(object)new GUILayoutOption[0]); GUILayout.EndVertical(); GUILayout.Space(6f); scrollPos = GUILayout.BeginScrollView(scrollPos, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandHeight(true) }); LevelReward[] rewards = Rewards; Rect val2 = default(Rect); Rect val3 = default(Rect); for (int i = 0; i < rewards.Length; i++) { LevelReward levelReward = rewards[i]; bool flag = levelReward.level == currentLevel; bool flag2 = levelReward.level <= currentLevel; Texture2D val = (flag ? txCardCurrent : (flag2 ? txCardUnlocked : txCardLocked)); Rect rect2 = GUILayoutUtility.GetRect(670f, 58f, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.ExpandWidth(true), GUILayout.Height(58f) }); if ((Object)(object)val != (Object)null) { GUI.DrawTexture(rect2, (Texture)(object)val, (ScaleMode)0); } float num = 38f; ((Rect)(ref val2))..ctor(((Rect)(ref rect2)).x + 10f, ((Rect)(ref rect2)).y + (58f - num) / 2f, num, num); if ((Object)(object)txHudHex != (Object)null) { GUI.color = (flag ? new Color(1f, 0.82f, 0.15f, 1f) : (flag2 ? new Color(0f, 0.85f, 1f, 0.9f) : new Color(0.4f, 0.5f, 0.6f, 0.5f))); GUI.DrawTexture(val2, (Texture)(object)txHudHex, (ScaleMode)2); GUI.color = Color.white; } Rect rect3 = val2; int level = levelReward.level; DrawOutlinedLabel(rect3, level.ToString(), stLvlBadge, (Color)(flag ? new Color(1f, 0.9f, 0.2f) : (flag2 ? Color.white : new Color(0.6f, 0.65f, 0.7f))), Color.black); float num2 = ((Rect)(ref rect2)).x + 56f; float num3 = ((Rect)(ref rect2)).width - 175f; Color textColor = (flag ? new Color(1f, 0.85f, 0.2f) : (flag2 ? new Color(0f, 0.85f, 1f) : new Color(0.5f, 0.55f, 0.65f))); Color textColor2 = (Color)(flag ? Color.white : (flag2 ? new Color(0.92f, 0.96f, 1f) : new Color(0.45f, 0.5f, 0.58f))); DrawOutlinedLabel(new Rect(num2, ((Rect)(ref rect2)).y + 7f, num3, 20f), levelReward.rank.ToUpper(), stCardRank, textColor, Color.black); DrawOutlinedLabel(new Rect(num2, ((Rect)(ref rect2)).y + 28f, num3, 24f), levelReward.buffLine, stCardReward, textColor2, Color.black); ((Rect)(ref val3))..ctor(((Rect)(ref rect2)).x + ((Rect)(ref rect2)).width - 110f, ((Rect)(ref rect2)).y + 16f, 100f, 26f); Texture2D val4 = (flag ? txPillCurrent : (flag2 ? txPillUnlocked : txPillLocked)); if ((Object)(object)val4 != (Object)null) { GUI.DrawTexture(val3, (Texture)(object)val4, (ScaleMode)0); } string text2 = (flag ? "★ CURRENT" : (flag2 ? "✓ UNLOCKED" : "LOCKED")); Color textColor3 = (flag ? new Color(1f, 0.85f, 0.2f) : (flag2 ? new Color(0.2f, 1f, 0.6f) : new Color(0.5f, 0.55f, 0.65f))); DrawOutlinedLabel(val3, text2, stPillText, textColor3, Color.black); GUILayout.Space(4f); } GUILayout.EndScrollView(); GUILayout.Space(6f); GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[0]); GUILayout.Label("EXP: Catch fish • Sea bosses • Sell haul • Exploration", stMuted, (GUILayoutOption[])(object)new GUILayoutOption[0]); GUILayout.FlexibleSpace(); if (GUILayout.Button("\ud83d\udcac Discord Community", stBtnDiscord, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(170f), GUILayout.Height(24f) })) { Application.OpenURL("https://discord.gg/4bmDYANzGj"); } GUILayout.EndHorizontal(); GUILayout.EndVertical(); GUI.DragWindow(new Rect(0f, 0f, 10000f, 40f)); } } [HarmonyPatch(typeof(MoneyManager), "SellItem")] internal static class PatchMoneySell { private static void Prefix(Item item) { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)item == (Object)null) { return; } try { int totalWorth = item.TotalWorth; if (totalWorth <= 0) { return; } float sellBonus = FishermanMasteryPlugin.GetSellBonus(); if (sellBonus > 0f) { int num = Mathf.RoundToInt((float)totalWorth * sellBonus); if (num > 0) { MoneyManager.AddMoney(num, ((Component)item).transform.position); FishermanMasteryPlugin.ModLogger.LogInfo((object)("[Sell Bonus] +$" + num + " (" + Mathf.RoundToInt(sellBonus * 100f) + "%)")); } } int amount = Mathf.Clamp(totalWorth / 3, 8, 300); FishermanMasteryPlugin.AddExp(amount); if (FishermanMasteryPlugin.HasTreasureFind() && Random.value < 0.05f) { int num2 = Random.Range(25, 100); MoneyManager.AddMoney(num2, ((Component)item).transform.position); FishermanMasteryPlugin.ModLogger.LogInfo((object)("[Treasure] +$" + num2)); } } catch (Exception ex) { FishermanMasteryPlugin.ModLogger.LogWarning((object)("PatchMoneySell error: " + ex.Message)); } } } [HarmonyPatch(typeof(PlayerEating), "FinishEating")] internal static class PatchFood { private static void Postfix(PlayerEating __instance) { if ((Object)(object)__instance == (Object)null) { return; } try { float foodBonus = FishermanMasteryPlugin.GetFoodBonus(); if (foodBonus > 0f) { Player value = Traverse.Create((object)__instance).Field("_player").GetValue(); if ((Object)(object)value != (Object)null && (Object)(object)value.Vitals != (Object)null) { int num = Mathf.Max(5, Mathf.RoundToInt(25f * foodBonus)); value.Vitals.RestoreFullness(num); } } } catch { } } } [HarmonyPatch(typeof(Purchasable), "Hover")] internal static class PatchShopHover { public static readonly Dictionary BaseItemCosts = new Dictionary(); private static void Prefix(Purchasable __instance) { if ((Object)(object)__instance == (Object)null) { return; } try { int instanceID = ((Object)__instance).GetInstanceID(); int value = Traverse.Create((object)__instance).Field("_customCost").GetValue(); if (!BaseItemCosts.ContainsKey(instanceID) && value > 0) { BaseItemCosts[instanceID] = value; } if (BaseItemCosts.TryGetValue(instanceID, out var value2)) { float discountBonus = FishermanMasteryPlugin.GetDiscountBonus(); if (discountBonus > 0f) { int num = Mathf.Max(1, Mathf.RoundToInt((float)value2 * (1f - discountBonus))); Traverse.Create((object)__instance).Field("_customCost").SetValue((object)num); } else { Traverse.Create((object)__instance).Field("_customCost").SetValue((object)value2); } } } catch { } } } [HarmonyPatch(typeof(FishingRod), "PrimaryInput")] internal static class PatchCast { public static readonly Dictionary BaseThrowSpeeds = new Dictionary(); private static void Prefix(FishingRod __instance) { if ((Object)(object)__instance == (Object)null) { return; } try { int instanceID = ((Object)__instance).GetInstanceID(); float value = Traverse.Create((object)__instance).Field("_lineThrowSpeed").GetValue(); if (!BaseThrowSpeeds.ContainsKey(instanceID) && value > 0f) { BaseThrowSpeeds[instanceID] = value; } if (BaseThrowSpeeds.TryGetValue(instanceID, out var value2)) { float castBonus = FishermanMasteryPlugin.GetCastBonus(); Traverse.Create((object)__instance).Field("_lineThrowSpeed").SetValue((object)(value2 * (1f + castBonus))); } } catch { } } } [HarmonyPatch(typeof(FishingRod), "DecreaseLineLength")] internal static class PatchReelSpeed { private static void Prefix(ref int amount) { float reelBonus = FishermanMasteryPlugin.GetReelBonus(); if (reelBonus > 0f) { amount = Mathf.RoundToInt((float)amount * (1f + reelBonus)); } } } [HarmonyPatch(typeof(FishingRod), "ReleaseItem")] internal static class PatchFishingRodRelease { private static void Prefix(Item item) { FishermanMasteryPlugin.ProcessCaughtItem(item, "FishingRod.ReleaseItem"); } } [HarmonyPatch(typeof(Item), "PickUp")] internal static class PatchItemPickUp { private static void Prefix(Item __instance) { FishermanMasteryPlugin.ProcessCaughtItem(__instance, "Item.PickUp"); } } [HarmonyPatch(typeof(Item), "OnPickUp")] internal static class PatchItemOnPickUp { private static void Prefix(Item __instance) { FishermanMasteryPlugin.ProcessCaughtItem(__instance, "Item.OnPickUp"); } } [HarmonyPatch(typeof(Item), "PutInInventory")] internal static class PatchItemPutInInventory { private static void Prefix(Item __instance) { FishermanMasteryPlugin.ProcessCaughtItem(__instance, "Item.PutInInventory"); } } [HarmonyPatch(typeof(Creature), "OnDeath")] internal static class PatchCreatureDeath { private static void Postfix(Creature __instance) { if ((Object)(object)__instance == (Object)null) { return; } try { string name = ((Object)__instance).name; if (name.IndexOf("Clam", StringComparison.OrdinalIgnoreCase) < 0 && name.IndexOf("Shell", StringComparison.OrdinalIgnoreCase) < 0 && name.IndexOf("Barnacle", StringComparison.OrdinalIgnoreCase) < 0 && name.IndexOf("Plant", StringComparison.OrdinalIgnoreCase) < 0 && !(Time.timeSinceLevelLoad < 4f)) { if (__instance is BowheadWhale || __instance is Spidercrab || name.IndexOf("Boss", StringComparison.OrdinalIgnoreCase) >= 0 || name.IndexOf("Whale", StringComparison.OrdinalIgnoreCase) >= 0 || name.IndexOf("Spider", StringComparison.OrdinalIgnoreCase) >= 0) { int num = Random.Range(400, 600); FishermanMasteryPlugin.AddExp(num); FishermanMasteryPlugin.ModLogger.LogInfo((object)("[Boss Defeated] " + name + " -> +" + num + " EXP")); } else { int num2 = Random.Range(25, 45); FishermanMasteryPlugin.AddExp(num2); FishermanMasteryPlugin.ModLogger.LogInfo((object)("[Predator Defeated] " + name + " -> +" + num2 + " EXP")); } } } catch (Exception ex) { FishermanMasteryPlugin.ModLogger.LogWarning((object)("PatchCreatureDeath error: " + ex.Message)); } } } [HarmonyPatch(typeof(MainMenuManager), "Start")] internal static class PatchMainMenuStart { private static void Postfix(MainMenuManager __instance) { try { if ((Object)(object)__instance != (Object)null) { Traverse.Create((object)__instance).Method("HideBoat", new object[0]).GetValue(); } if ((Object)(object)FishermanMasteryPlugin.Instance != (Object)null) { FishermanMasteryPlugin.Instance.SetupMenuVideo(); } } catch { } } } [HarmonyPatch(typeof(SaveManager), "OnServerLoaded")] internal static class PatchSaveLoaded { private static void Postfix() { FishermanMasteryPlugin.LoadProgress(); FishermanMasteryPlugin.ModLogger.LogInfo((object)("Loaded progress for: " + FishermanMasteryPlugin.GetCurrentSaveName() + " (Level " + FishermanMasteryPlugin.currentLevel + ")")); } } [HarmonyPatch(typeof(SaveManager), "CreateServer")] internal static class PatchSaveCreated { private static void Postfix() { FishermanMasteryPlugin.currentLevel = 1; FishermanMasteryPlugin.currentExp = 0; FishermanMasteryPlugin.SaveProgress(); FishermanMasteryPlugin.ModLogger.LogInfo((object)("Created progress for new save: " + FishermanMasteryPlugin.GetCurrentSaveName())); } } [HarmonyPatch(typeof(SaveManager), "DeleteServer")] internal static class PatchSaveDeleted { private static void Prefix() { try { string curName = FishermanMasteryPlugin.GetCurrentSaveName(); if (!File.Exists(FishermanMasteryPlugin.savePath)) { return; } FishermanMasteryPlugin.MultiSaveContainer multiSaveContainer = JsonUtility.FromJson(File.ReadAllText(FishermanMasteryPlugin.savePath)); if (multiSaveContainer != null && multiSaveContainer.slots != null) { multiSaveContainer.slots.RemoveAll((FishermanMasteryPlugin.SaveSlotData s) => s.saveName == curName); File.WriteAllText(FishermanMasteryPlugin.savePath, JsonUtility.ToJson((object)multiSaveContainer, true)); } } catch { } } } [HarmonyPatch(typeof(PlayerCamera), "MouseMovement")] internal static class PatchCameraMouseMovement { private static bool Prefix() { if (FishermanMasteryPlugin.showLevelTable) { return false; } return true; } } [HarmonyPatch(typeof(PlayerCamera), "MouseInput")] internal static class PatchCameraMouseInput { private static bool Prefix() { if (FishermanMasteryPlugin.showLevelTable) { return false; } return true; } }