using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using FishingTweaks.patches;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;
using _otAPI;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("officerballs.FishingTweaks")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("2.0.0.0")]
[assembly: AssemblyInformationalVersion("2.0.0")]
[assembly: AssemblyProduct("officerballs.FishingTweaks")]
[assembly: AssemblyTitle("officerballs.FishingTweaks")]
[assembly: AssemblyVersion("2.0.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace FishingTweaks
{
[BepInPlugin("officerballs.FishingTweaks", "Fishing Tweaks", "2.0.0.0")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class Plugin : BaseUnityPlugin
{
public const string modGUID = "officerballs.FishingTweaks";
public const string modName = "Fishing Tweaks";
public const string modVersion = "2.0.0.0";
internal static Depot FishingDepot = otAPI.CreateDepot("Fishing Tweaks", "Fishing Tweaks", "officer balls", "A set of changes to the fishing system.", "/");
private Harmony harmony = new Harmony("officerballs.FishingTweaks");
public static ConfigEntry<bool> configHideOversizedCatches { get; private set; }
public static ConfigEntry<bool> configAutoCatch { get; private set; }
public static ConfigEntry<bool> configAutoRecast { get; private set; }
public static ConfigEntry<bool> configInfiniteBait { get; private set; }
public static ConfigEntry<bool> configMuteFishing { get; private set; }
public static ConfigEntry<bool> configMuteMinigame { get; private set; }
public static ConfigEntry<bool> configMuteFishingDuringFocus { get; private set; }
private void Awake()
{
ApplyPatches();
BindBinds();
CreateCFG();
Debug.Log((object)"Fishing Tweaks Twoke");
}
private void ApplyPatches()
{
harmony.PatchAll(typeof(FishingPatch));
harmony.PatchAll(typeof(FishingPatch2));
harmony.PatchAll(typeof(GroundCheckPatch));
harmony.PatchAll(typeof(KeepSizeInCheck));
harmony.PatchAll(typeof(BlockSounds));
harmony.PatchAll(typeof(BlockSounds2));
}
private void BindBinds()
{
configHideOversizedCatches = ((BaseUnityPlugin)this).Config.Bind<bool>("General.Toggles", "HideOversizedCatches", false, "Resizes oversized fish from other players.");
configAutoCatch = ((BaseUnityPlugin)this).Config.Bind<bool>("General.Toggles", "AutoCatch", false, "Enable/disable automatic catching.");
configAutoRecast = ((BaseUnityPlugin)this).Config.Bind<bool>("General.Toggles", "AutoRecast", false, "Automatically recast to last position when fishing.");
configInfiniteBait = ((BaseUnityPlugin)this).Config.Bind<bool>("General.Toggles", "InfiniteBait", false, "Infinite bait.");
configMuteMinigame = ((BaseUnityPlugin)this).Config.Bind<bool>("General.Sound", "MuteMinigame", false, "Mutes SFX from the fishing minigame.");
configMuteFishing = ((BaseUnityPlugin)this).Config.Bind<bool>("General.Sound", "MuteFishing", false, "Gets rid of the annoying bobber noise.");
configMuteFishingDuringFocus = ((BaseUnityPlugin)this).Config.Bind<bool>("General.Sound", "MuteDuringFocus", false, "Mute all fishing during Pomodoro focus.");
}
private void InfiniteBait(string[] args)
{
if (configInfiniteBait.Value)
{
FieldRef<FishingManager, List<int>> val = AccessTools.FieldRefAccess<FishingManager, List<int>>("_baitCounts");
FishingManager i = MonoSingleton<FishingManager>.I;
List<int> list = val.Invoke(i);
for (int j = 0; j < list.Count; j++)
{
list[j] = 40;
}
MonoSingleton<DataManager>.I.PlayerDataZip.BaitCounts = list;
MonoSingleton<DataManager>.I.SavePlayerZipData();
}
}
private void CreateCFG()
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: Expected O, but got Unknown
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
//IL_0045: Expected O, but got Unknown
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: Expected O, but got Unknown
//IL_0067: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Expected O, but got Unknown
//IL_007e: Unknown result type (might be due to invalid IL or missing references)
//IL_0088: Expected O, but got Unknown
//IL_0083: Unknown result type (might be due to invalid IL or missing references)
//IL_008d: Expected O, but got Unknown
//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
//IL_00b0: Expected O, but got Unknown
//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
//IL_00d8: Expected O, but got Unknown
//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
//IL_00dd: Expected O, but got Unknown
//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
//IL_0100: Expected O, but got Unknown
//IL_0111: Unknown result type (might be due to invalid IL or missing references)
//IL_011b: Expected O, but got Unknown
//IL_0116: Unknown result type (might be due to invalid IL or missing references)
//IL_0120: Expected O, but got Unknown
//IL_013d: Unknown result type (might be due to invalid IL or missing references)
//IL_0143: Expected O, but got Unknown
//IL_0154: Unknown result type (might be due to invalid IL or missing references)
//IL_015e: Expected O, but got Unknown
//IL_0159: Unknown result type (might be due to invalid IL or missing references)
//IL_0163: Expected O, but got Unknown
//IL_0180: Unknown result type (might be due to invalid IL or missing references)
//IL_0186: Expected O, but got Unknown
//IL_0197: Unknown result type (might be due to invalid IL or missing references)
//IL_01a1: Expected O, but got Unknown
//IL_019c: Unknown result type (might be due to invalid IL or missing references)
//IL_01a6: Expected O, but got Unknown
//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
//IL_01c9: Expected O, but got Unknown
//IL_01da: Unknown result type (might be due to invalid IL or missing references)
//IL_01e4: Expected O, but got Unknown
//IL_01df: Unknown result type (might be due to invalid IL or missing references)
//IL_01e9: Expected O, but got Unknown
//IL_0224: Unknown result type (might be due to invalid IL or missing references)
List<Alias> list = new List<Alias>(7);
list.Add(new Alias("Auto-Catch", FishingDepot, "Toggles auto-catching.", (Arg[])(object)new Arg[1]
{
new Arg((ArgType)3, true, (object)null, (object)null)
}, new CfgLink((ArgType)3, configAutoCatch, "was changed to", "is currently set to", false)));
list.Add(new Alias("Auto-Recast", FishingDepot, "Toggles auto-recasting.", (Arg[])(object)new Arg[1]
{
new Arg((ArgType)3, true, (object)null, (object)null)
}, new CfgLink((ArgType)3, configAutoRecast, "was changed to", "is currently set to", false)));
list.Add(new Alias("Infinite Bait", FishingDepot, "Unlimited bait.", (Arg[])(object)new Arg[1]
{
new Arg((ArgType)3, true, (object)null, (object)null)
}, new CfgLink((ArgType)3, configInfiniteBait, "was changed to", "is currently set to", false), (Action<string[]>)InfiniteBait, (AuxTiming)2));
list.Add(new Alias("Regulate Size", FishingDepot, "Normalizes fish sizing.", (Arg[])(object)new Arg[1]
{
new Arg((ArgType)3, true, (object)null, (object)null)
}, new CfgLink((ArgType)3, configHideOversizedCatches, "was changed to", "is currently set to", false)));
list.Add(new Alias("Mute Fishing", FishingDepot, "Mutes fishing noise.", (Arg[])(object)new Arg[1]
{
new Arg((ArgType)3, true, (object)null, (object)null)
}, new CfgLink((ArgType)3, configMuteFishing, "was changed to", "is currently set to", false)));
list.Add(new Alias("Mute Minigame", FishingDepot, "Mutes fishing minigame.", (Arg[])(object)new Arg[1]
{
new Arg((ArgType)3, true, (object)null, (object)null)
}, new CfgLink((ArgType)3, configMuteMinigame, "was changed to", "is currently set to", false)));
list.Add(new Alias("Mute in Focus", FishingDepot, "Mutes fishing during focus.", (Arg[])(object)new Arg[1]
{
new Arg((ArgType)3, true, (object)null, (object)null)
}, new CfgLink((ArgType)3, configMuteFishingDuringFocus, "was changed to", "is currently set to", false)));
List<Alias> list2 = list;
foreach (Alias item in list2)
{
otAPI.AddCfg(item.name, item.description, item.depot, item.args, item.cfgLink, item.action, item.auxTiming);
}
}
}
}
namespace FishingTweaks.patches
{
[HarmonyPatch(typeof(FishingManager))]
public static class FishingPatch
{
public static float clickDelayer = 0f;
public static bool sendClick = false;
public static bool sendUpClick = false;
public static Vector3 recastPos = Vector3.zero;
public static float updateDelayer = 0f;
public static bool loaded = false;
[HarmonyPatch("Awake")]
[HarmonyPostfix]
public static void FishingTweaks(ref float ____catchWait, ref List<int> ____baitCounts)
{
____catchWait = 60f;
if (Plugin.configInfiniteBait.Value)
{
for (int i = 0; i < ____baitCounts.Count; i++)
{
____baitCounts[i] = 40;
}
MonoSingleton<DataManager>.I.PlayerDataZip.BaitCounts = ____baitCounts;
MonoSingleton<DataManager>.I.SavePlayerZipData();
}
}
[HarmonyPatch("Update")]
[HarmonyPrefix]
public static void UpdateTweak()
{
//IL_015d: Unknown result type (might be due to invalid IL or missing references)
//IL_0162: Unknown result type (might be due to invalid IL or missing references)
//IL_017f: Unknown result type (might be due to invalid IL or missing references)
//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
//IL_018b: Unknown result type (might be due to invalid IL or missing references)
if (updateDelayer > 0f)
{
updateDelayer -= Time.deltaTime;
return;
}
if ((Object)(object)MonoSingleton<MainSceneManager>.I != (Object)null && !loaded)
{
try
{
FishingController fishingCont = MonoSingleton<FishingManager>.I.FishingCont;
PlayerMovementController mainMovementController = NetworkSingleton<TextChannelManager>.I.MainMovementController;
FieldRef<FishingManager, Transform> val = AccessTools.FieldRefAccess<FishingManager, Transform>("_castIndicator");
Transform val2 = val.Invoke(MonoSingleton<FishingManager>.I);
loaded = true;
}
catch (NullReferenceException)
{
loaded = false;
return;
}
}
else if (!loaded)
{
updateDelayer = 2.5f;
return;
}
try
{
if (MonoSingleton<InputManager>.I.IsMouseButton0Down)
{
NetworkSingleton<TextChannelManager>.I.MainMovementController.GroundState = (GroundState)0;
NetworkSingleton<TextChannelManager>.I.MainMovementController.MovementState = (MovementState)0;
}
if (MonoSingleton<FishingManager>.I.FishingCont.GetAlert() && Plugin.configAutoCatch.Value)
{
if (clickDelayer <= 0f)
{
Traverse.Create((object)MonoSingleton<InputManager>.I).Property("IsMouseButton0Down", (object[])null).SetValue((object)true);
clickDelayer = 0.0625f;
}
else
{
clickDelayer -= Time.deltaTime;
}
}
if (recastPos != Vector3.zero && Plugin.configAutoRecast.Value && (int)MonoSingleton<FishingManager>.I.CurrentBait != 0 && (int)MonoSingleton<FishingManager>.I.FishingState == 0 && MonoSingleton<FishingManager>.I.FishingCont.FishingRod.activeSelf)
{
FieldRef<FishingManager, Transform> val3 = AccessTools.FieldRefAccess<FishingManager, Transform>("_castIndicator");
((Component)val3.Invoke(MonoSingleton<FishingManager>.I)).gameObject.SetActive(true);
((Component)val3.Invoke(MonoSingleton<FishingManager>.I)).transform.position = recastPos;
Traverse.Create((object)MonoSingleton<FishingManager>.I).Property("FishingState", (object[])null).SetValue((object)(FishingState)1);
FieldRef<FishingManager, bool> val4 = AccessTools.FieldRefAccess<FishingManager, bool>("_isWater");
val4.Invoke(MonoSingleton<FishingManager>.I) = true;
Traverse.Create((object)MonoSingleton<InputManager>.I).Property("IsMouseButton0Up", (object[])null).SetValue((object)true);
}
}
catch (NullReferenceException)
{
updateDelayer = 2.5f;
loaded = false;
Debug.Log((object)"fishtweaks loadin delayed");
}
}
[HarmonyPatch("FishMiniGameUpdate")]
[HarmonyPostfix]
public static void autoClickSnapon(FishingManager __instance)
{
if (Plugin.configAutoCatch.Value && checkClick(__instance))
{
if (clickDelayer <= 0f)
{
Traverse.Create((object)MonoSingleton<InputManager>.I).Property("IsMouseButton0Down", (object[])null).SetValue((object)true);
clickDelayer = 1f / 32f;
}
else
{
clickDelayer -= Time.deltaTime;
}
}
}
public static bool checkClick(FishingManager instance)
{
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: 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_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
FieldRef<FishingManager, RectTransform> val = AccessTools.FieldRefAccess<FishingManager, RectTransform>("_fishIcon");
FieldRef<FishingManager, RectTransform> val2 = AccessTools.FieldRefAccess<FishingManager, RectTransform>("_clickZone");
FieldRef<FishingManager, float> val3 = AccessTools.FieldRefAccess<FishingManager, float>("_clickZoneDegree");
Quaternion rotation = ((Transform)val.Invoke(instance)).rotation;
float z = ((Quaternion)(ref rotation)).eulerAngles.z;
rotation = ((Transform)val2.Invoke(instance)).rotation;
float z2 = ((Quaternion)(ref rotation)).eulerAngles.z;
float num = z2 + val3.Invoke(instance);
if (num >= 360f)
{
if (z >= z2 || z <= num - 360f)
{
return true;
}
}
else if (z >= z2 && z <= num)
{
return true;
}
return false;
}
[HarmonyPatch("CastFishingRod")]
[HarmonyPrefix]
public static void storePosition(ref Transform ____castIndicator)
{
//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)
recastPos = ((Component)____castIndicator).transform.position;
}
[HarmonyPatch("CancelFishing")]
[HarmonyPrefix]
public static void clearPosition()
{
//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)
recastPos = Vector3.zero;
}
}
[HarmonyPatch(typeof(TaskManager))]
internal class FishingPatch2
{
[HarmonyPatch("IsReadyForFishing")]
public static void Postfix(ref bool __result)
{
FieldRef<MusicManager, MusicInstrumentController> val = AccessTools.FieldRefAccess<MusicManager, MusicInstrumentController>("_currentInstrument");
MusicManager i = NetworkSingleton<MusicManager>.I;
if ((Object)(object)val.Invoke(i) == (Object)null)
{
__result = true;
}
}
}
[HarmonyPatch(typeof(FishingController))]
internal class KeepSizeInCheck
{
[HarmonyPatch("CatchFishRpc_Original_3")]
[HarmonyPrefix]
public static void Resizer(ref CaughtFish caughtFish)
{
//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_001b: 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_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0032: Expected I4, but got Unknown
//IL_010b: Unknown result type (might be due to invalid IL or missing references)
//IL_0110: 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)
//IL_0119: Unknown result type (might be due to invalid IL or missing references)
//IL_012a: Unknown result type (might be due to invalid IL or missing references)
//IL_013a: 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_0064: 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_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_007e: Unknown result type (might be due to invalid IL or missing references)
//IL_008e: Unknown result type (might be due to invalid IL or missing references)
//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
//IL_01bc: 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_01c5: Unknown result type (might be due to invalid IL or missing references)
//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
//IL_014a: 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_01f6: Unknown result type (might be due to invalid IL or missing references)
if (!Plugin.configHideOversizedCatches.Value)
{
return;
}
FishSource source = caughtFish.Source;
FishSource val = source;
switch ((int)val)
{
case 1:
{
List<Fish> freshFishes = ScriptableSingleton<FishingSettings>.I.FreshFishes;
for (int j = 0; j < freshFishes.Count; j++)
{
if (caughtFish.FishIndex == j)
{
Fish val3 = freshFishes[j];
float num2 = Random.Range(val3.MinSize, val3.MaxSize);
float sizeRatio2 = num2 / val3.AverageSize;
if (caughtFish.Size < (float)val3.MinSize || caughtFish.Size > (float)val3.MaxSize)
{
caughtFish.Size = num2;
caughtFish.SizeRatio = sizeRatio2;
}
}
}
break;
}
case 0:
{
List<Fish> fishes = ScriptableSingleton<FishingSettings>.I.Fishes;
for (int k = 0; k < fishes.Count; k++)
{
if (caughtFish.FishIndex == k)
{
Fish val4 = fishes[k];
float num3 = Random.Range(val4.MinSize, val4.MaxSize);
float sizeRatio3 = num3 / val4.AverageSize;
if (caughtFish.Size < (float)val4.MinSize || caughtFish.Size > (float)val4.MaxSize)
{
caughtFish.Size = num3;
caughtFish.SizeRatio = sizeRatio3;
}
}
}
break;
}
case 2:
{
List<Fish> garbages = ScriptableSingleton<FishingSettings>.I.Garbages;
for (int i = 0; i < garbages.Count; i++)
{
if (caughtFish.FishIndex == i)
{
Fish val2 = garbages[i];
float num = Random.Range(val2.MinSize, val2.MaxSize);
float sizeRatio = num / val2.AverageSize;
if (caughtFish.Size < (float)val2.MinSize || caughtFish.Size > (float)val2.MaxSize)
{
caughtFish.Size = num;
caughtFish.SizeRatio = sizeRatio;
}
}
}
break;
}
}
}
[HarmonyPatch("SinkHook")]
[HarmonyPrefix]
public static void ClickOnMinigameStart()
{
if (Plugin.configAutoCatch.Value)
{
FishingPatch.sendClick = true;
}
if (Plugin.configInfiniteBait.Value)
{
FieldRef<FishingManager, List<int>> val = AccessTools.FieldRefAccess<FishingManager, List<int>>("_baitCounts");
FishingManager i = MonoSingleton<FishingManager>.I;
List<int> list = val.Invoke(i);
for (int j = 0; j < list.Count; j++)
{
list[j] = 40;
}
MonoSingleton<DataManager>.I.PlayerDataZip.BaitCounts = list;
MonoSingleton<DataManager>.I.SavePlayerZipData();
}
}
}
[HarmonyPatch(typeof(IsGroundedChecker))]
internal class GroundCheckPatch
{
[HarmonyPatch("FixedUpdate")]
[HarmonyPrefix]
public static bool GroundPatch(IsGroundedChecker __instance)
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Invalid comparison between Unknown and I4
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Invalid comparison between Unknown and I4
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Invalid comparison between Unknown and I4
if ((int)MonoSingleton<FishingManager>.I.FishingState == 1 || (int)MonoSingleton<FishingManager>.I.FishingState == 2 || (int)MonoSingleton<FishingManager>.I.FishingState == 3)
{
__instance.IsGrounded = true;
return false;
}
return true;
}
}
[HarmonyPatch(typeof(PlayerSFXController))]
public static class BlockSounds
{
[HarmonyPatch("SetFishingDrop")]
[HarmonyPrefix]
public static bool SkipDropSound()
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Invalid comparison between Unknown and I4
if ((Plugin.configMuteFishingDuringFocus.Value && (int)MonoSingleton<PomodoroController>.I.PomodoroType == 1 && !MonoSingleton<PomodoroController>.I.IsPaused) || Plugin.configMuteMinigame.Value)
{
return false;
}
return true;
}
[HarmonyPatch("SetFishingCast")]
[HarmonyPrefix]
public static bool SkipFishingCast()
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Invalid comparison between Unknown and I4
if ((Plugin.configMuteFishingDuringFocus.Value && (int)MonoSingleton<PomodoroController>.I.PomodoroType == 1 && !MonoSingleton<PomodoroController>.I.IsPaused) || Plugin.configMuteMinigame.Value)
{
return false;
}
return true;
}
[HarmonyPatch("SetFishingReel")]
[HarmonyPrefix]
public static bool SkipFishingReel()
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Invalid comparison between Unknown and I4
if ((Plugin.configMuteFishingDuringFocus.Value && (int)MonoSingleton<PomodoroController>.I.PomodoroType == 1 && !MonoSingleton<PomodoroController>.I.IsPaused) || Plugin.configMuteMinigame.Value)
{
return false;
}
return true;
}
[HarmonyPatch("SetFishingAlert")]
[HarmonyPrefix]
public static bool SkipFishingAlert()
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Invalid comparison between Unknown and I4
if ((Plugin.configMuteFishingDuringFocus.Value && (int)MonoSingleton<PomodoroController>.I.PomodoroType == 1 && !MonoSingleton<PomodoroController>.I.IsPaused) || Plugin.configMuteMinigame.Value)
{
return false;
}
return true;
}
[HarmonyPatch("StopFishingReel")]
[HarmonyPrefix]
public static bool SkipStopFishingReel(ref AudioSource ____audioSource)
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Invalid comparison between Unknown and I4
if ((Plugin.configMuteFishingDuringFocus.Value && (int)MonoSingleton<PomodoroController>.I.PomodoroType == 1 && !MonoSingleton<PomodoroController>.I.IsPaused) || Plugin.configMuteMinigame.Value)
{
____audioSource.Stop();
return false;
}
return true;
}
}
[HarmonyPatch(typeof(SFXManager))]
public static class BlockSounds2
{
[HarmonyPatch("PlayFishCatch")]
[HarmonyPrefix]
public static bool SkipFishCatch()
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Invalid comparison between Unknown and I4
if ((Plugin.configMuteFishingDuringFocus.Value && (int)MonoSingleton<PomodoroController>.I.PomodoroType == 1 && !MonoSingleton<PomodoroController>.I.IsPaused) || Plugin.configMuteMinigame.Value)
{
return false;
}
return true;
}
[HarmonyPatch("PlayFishClick")]
[HarmonyPrefix]
public static bool SkipFishClick()
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Invalid comparison between Unknown and I4
if ((Plugin.configMuteFishingDuringFocus.Value && (int)MonoSingleton<PomodoroController>.I.PomodoroType == 1 && !MonoSingleton<PomodoroController>.I.IsPaused) || Plugin.configMuteMinigame.Value)
{
return false;
}
return true;
}
[HarmonyPatch("PlayFishFail")]
[HarmonyPrefix]
public static bool SkipFishFail()
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Invalid comparison between Unknown and I4
if ((Plugin.configMuteFishingDuringFocus.Value && (int)MonoSingleton<PomodoroController>.I.PomodoroType == 1 && !MonoSingleton<PomodoroController>.I.IsPaused) || Plugin.configMuteMinigame.Value)
{
return false;
}
return true;
}
[HarmonyPatch("PlayFishSuccess")]
[HarmonyPrefix]
public static bool SkipFishSuccess()
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Invalid comparison between Unknown and I4
if ((Plugin.configMuteFishingDuringFocus.Value && (int)MonoSingleton<PomodoroController>.I.PomodoroType == 1 && !MonoSingleton<PomodoroController>.I.IsPaused) || Plugin.configMuteMinigame.Value)
{
return false;
}
return true;
}
}
}