using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Steamworks;
using TMPro;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Audio;
using UnityEngine.Events;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = "")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: AssemblyCompany("UltraFishing")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Allows you to fish outside of 5-S")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+381a7f3aa67bb17a426b3ccd7bbd51d7d460545f")]
[assembly: AssemblyProduct("UltraFishing")]
[assembly: AssemblyTitle("UltraFishing")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace UltraFishing
{
public class BookRandomizer : MonoBehaviour
{
private Readable readable;
private void Start()
{
readable = ((Component)this).gameObject.GetComponent<Readable>();
RandomizeText();
}
public void RandomizeText()
{
readable.content = RandomBookTextProvider.GetRandomText();
}
public void GetNextText()
{
readable.content = RandomBookTextProvider.GetNextText();
readable.StartScan();
}
}
public class FakeWater : MonoBehaviour
{
public FishDB fishDB;
public Transform overrideFishingPoint;
public FishObject[] attractFish;
public void SetupFishDB(FishDB fishDB)
{
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Unknown result type (might be due to invalid IL or missing references)
//IL_007f: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Unknown result type (might be due to invalid IL or missing references)
//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
//IL_00c0: 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_00fb: Unknown result type (might be due to invalid IL or missing references)
//IL_0107: Unknown result type (might be due to invalid IL or missing references)
//IL_0122: Unknown result type (might be due to invalid IL or missing references)
//IL_0141: 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_0173: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)fishDB.fishGhostPrefab != (Object)null)
{
Bounds bounds = ((Component)this).GetComponent<Collider>().bounds;
int num = (int)(((Bounds)(ref bounds)).size.x * ((Bounds)(ref bounds)).size.y / 100f);
for (int i = 0; i < num; i++)
{
GameObject val = Object.Instantiate<GameObject>(fishDB.fishGhostPrefab, ((Component)this).transform, true);
val.transform.position = new Vector3(Random.Range((0f - ((Bounds)(ref bounds)).size.x) / 4f, ((Bounds)(ref bounds)).size.x / 4f) + ((Bounds)(ref bounds)).center.x, 0f, Random.Range((0f - ((Bounds)(ref bounds)).size.z) / 4f, ((Bounds)(ref bounds)).size.z / 4f) + ((Bounds)(ref bounds)).center.z);
val.transform.position = new Vector3(val.transform.position.x, ((Bounds)(ref bounds)).center.y + Random.Range(-1f, 1f) * (((Bounds)(ref bounds)).size.y / 2f - 0.2f), val.transform.position.z);
val.transform.localRotation = Quaternion.Euler(0f, (float)Random.Range(0, 360), 0f);
}
}
}
}
public static class FishHelper
{
public static FishObject GetFish(string fishName)
{
return GlobalFishManager.GetFish(fishName);
}
private static FishDB GetFishDB(FishDescriptor[] fishes)
{
FishDB val = ScriptableObject.CreateInstance<FishDB>();
val.foundFishes = fishes;
return val;
}
private static FishDB GetFishDB(string[] fishes, int[] chances)
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Expected O, but got Unknown
FishDescriptor[] array = (FishDescriptor[])(object)new FishDescriptor[fishes.Length];
for (int i = 0; i < fishes.Length; i++)
{
array[i] = new FishDescriptor();
array[i].fish = GetFish(fishes[i]);
array[i].chance = chances[i];
}
return GetFishDB(array);
}
private static FishDB GetFishDB(string[] fishes)
{
int[] array = new int[fishes.Length];
for (int i = 0; i < array.Length; i++)
{
array[i] = 1;
}
return GetFishDB(fishes, array);
}
public static FishDB GetFishDB(string fish, int chance = 1)
{
return GetFishDB(new string[1] { fish }, new int[1] { chance });
}
public static FishDB AddFishToDB(FishDB fishDB, string fish, int chance = 1)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
FishDescriptor val = new FishDescriptor();
val.fish = GetFish(fish);
val.chance = chance;
FishDescriptor[] fishes = GenericHelper.AppendToArray(fishDB.foundFishes, val);
FishDB fishDB2 = GetFishDB(fishes);
fishDB2.fullName = fishDB.fullName;
fishDB2.symbolColor = fishDB.symbolColor;
return fishDB2;
}
public static void UpdateFishManager(FishDB fishDB)
{
MonoSingleton<FishManager>.Instance.fishDbs = GenericHelper.AppendToArray(MonoSingleton<FishManager>.Instance.fishDbs, fishDB);
for (int i = 0; i < fishDB.foundFishes.Length; i++)
{
FishObject fish = fishDB.foundFishes[i].fish;
if (!MonoSingleton<FishManager>.Instance.recognizedFishes.ContainsKey(fish))
{
MonoSingleton<FishManager>.Instance.recognizedFishes.Add(fish, value: false);
}
}
}
}
public static class GenericHelper
{
public static T[] AppendToArray<T>(T[] array, T element)
{
if (array == null || array.Length == 0)
{
return new T[1] { element };
}
T[] array2 = new T[array.Length + 1];
for (int i = 0; i < array.Length; i++)
{
array2[i] = array[i];
}
array2[array.Length] = element;
return array2;
}
public static GameObject FindGameObject(string gameObjectPath)
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
GameObject val = GameObject.Find(gameObjectPath);
if ((Object)(object)val != (Object)null)
{
return val;
}
Scene activeScene = SceneManager.GetActiveScene();
GameObject[] rootGameObjects = ((Scene)(ref activeScene)).GetRootGameObjects();
string[] parts = gameObjectPath.Split(new char[1] { '/' }, StringSplitOptions.RemoveEmptyEntries);
for (int i = 0; i < parts.Length; i++)
{
parts[i] = parts[i].Replace("%", "/");
}
int num = Array.FindIndex(rootGameObjects, (GameObject o) => ((Object)o).name == parts[0]);
if (num == -1)
{
return null;
}
GameObject val2 = rootGameObjects[num];
if (parts.Length == 1)
{
return val2;
}
string[] array = new string[parts.Length - 1];
Array.Copy(parts, 1, array, 0, array.Length);
string text = string.Join("/", array);
Transform obj = val2.transform.Find(text);
return (obj != null) ? ((Component)obj).gameObject : null;
}
public static GameObject FindGameObjectContaining(string gameObjectNameSubstring)
{
//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)
Scene activeScene = SceneManager.GetActiveScene();
GameObject[] rootGameObjects = ((Scene)(ref activeScene)).GetRootGameObjects();
int num = Array.FindIndex(rootGameObjects, (GameObject o) => ((Object)o).name.Contains(gameObjectNameSubstring));
if (num == -1)
{
return null;
}
return rootGameObjects[num];
}
public static GameObject[] FindGameObjectChildren(string gameObjectPath)
{
GameObject val = FindGameObject(gameObjectPath);
if ((Object)(object)val == (Object)null)
{
return null;
}
int childCount = val.transform.childCount;
GameObject[] array = (GameObject[])(object)new GameObject[childCount];
for (int i = 0; i < childCount; i++)
{
array[i] = ((Component)val.transform.GetChild(i)).gameObject;
}
return array;
}
public static string GetFullPath(GameObject gameObject)
{
Transform val = gameObject.transform;
string text = ((Object)gameObject).name;
while ((Object)(object)val.parent != (Object)null)
{
val = val.parent;
text = ((Object)val).name + "/" + text;
}
return text;
}
public static string GetSteamName()
{
try
{
if (SteamClient.IsLoggedOn)
{
return SteamClient.Name;
}
return "V1";
}
catch (Exception)
{
return "V1";
}
}
}
public class GlobalFishEncyclopedia : FishEncyclopedia
{
private int currentPage;
public void StartEncyclopedia()
{
//IL_009a: Unknown result type (might be due to invalid IL or missing references)
//IL_00a4: Expected O, but got Unknown
((Component)base.fishButtonTemplate).gameObject.SetActive(false);
for (int i = 0; i < GlobalFishManager.FishCount(); i++)
{
FishObject fish = GlobalFishManager.GetFish(i);
bool fishValue = GlobalFishManager.GetFishValue(i);
FishMenuButton val = Object.Instantiate<FishMenuButton>(base.fishButtonTemplate, base.fishGrid, false);
base.fishButtons.Add(fish, val);
val.Populate(fish, !fishValue);
((UnityEventBase)((Component)val).GetComponent<ControllerPointer>().OnPressed).RemoveAllListeners();
((Component)val).GetComponent<ControllerPointer>().OnPressed.AddListener((UnityAction)delegate
{
SelectFish(fish);
});
}
FishManager instance = MonoSingleton<FishManager>.Instance;
instance.onFishUnlocked = (Action<FishObject>)Delegate.Combine(instance.onFishUnlocked, new Action<FishObject>(base.OnFishUnlocked));
currentPage = 1;
DisplayCurrentPage();
}
private void DisplayCurrentPage()
{
for (int i = 1; i < base.fishGrid.childCount; i++)
{
if (i > (currentPage - 1) * 12 && i <= currentPage * 12)
{
((Component)base.fishGrid.GetChild(i)).gameObject.SetActive(true);
}
else
{
((Component)base.fishGrid.GetChild(i)).gameObject.SetActive(false);
}
}
}
public void NextPage()
{
if (currentPage * 12 < base.fishGrid.childCount)
{
currentPage++;
DisplayCurrentPage();
}
}
public void PreviousPage()
{
if (currentPage > 1)
{
currentPage--;
DisplayCurrentPage();
}
}
private void DisplayFish(FishObject fish)
{
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Expected O, but got Unknown
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_008f: Unknown result type (might be due to invalid IL or missing references)
foreach (Transform item in base.fish3dRenderContainer.transform)
{
Transform val = item;
Object.Destroy((Object)(object)((Component)val).gameObject);
}
if (GlobalFishManager.FoundFish(fish))
{
GameObject val2 = fish.InstantiateDumb();
val2.transform.SetParent(base.fish3dRenderContainer.transform);
val2.transform.localPosition = Vector3.zero;
val2.transform.localScale = Vector3.one;
SandboxUtils.SetLayerDeep(val2.transform, LayerMask.NameToLayer("VirtualRender"));
}
}
public void SelectFish(FishObject fish)
{
base.fishName.text = (GlobalFishManager.FoundFish(fish) ? fish.fishName : "???");
base.fishDescription.text = GlobalFishManager.GetFishDescription(fish);
base.fishPicker.SetActive(false);
base.fishInfoContainer.SetActive(true);
DisplayFish(fish);
}
}
public static class GlobalFishManager
{
private static FishObject[] fishes;
private static bool[] foundFishes;
public static void Start()
{
//IL_0110: Unknown result type (might be due to invalid IL or missing references)
//IL_0115: Unknown result type (might be due to invalid IL or missing references)
string[] array = new string[12]
{
"Assets/Data/Fishing/Fishes/Funny Stupid Fish.asset", "Assets/Data/Fishing/Fishes/pitr fish.asset", "Assets/Data/Fishing/Fishes/Trout.asset", "Assets/Data/Fishing/Fishes/Amid Evil Fish.asset", "Assets/Data/Fishing/Fishes/Chomper.asset", "Assets/Data/Fishing/Fishes/Bomb Fish.asset", "Assets/Data/Fishing/Fishes/Gib Eye.asset", "Assets/Data/Fishing/Fishes/Iron Lung Fish.asset", "Assets/Data/Fishing/Fishes/Dope Fish.asset", "Assets/Data/Fishing/Fishes/Stickfish.asset",
"Assets/Data/Fishing/Fishes/Cooked Fish.asset", "Assets/Data/Fishing/Fishes/Shark.asset"
};
string[] array2 = new string[13]
{
"assets/bundles/fishingstuff/fishes/filth fish.asset", "assets/bundles/fishingstuff/fishes/missing fish.asset", "assets/bundles/fishingstuff/fishes/cancer fish.asset", "assets/bundles/fishingstuff/fishes/koi fish.asset", "assets/bundles/fishingstuff/fishes/melted fish.asset", "assets/bundles/fishingstuff/fishes/nerd shark.asset", "assets/bundles/fishingstuff/fishes/leviathan fish.asset", "assets/bundles/fishingstuff/fishes/death metal fish.asset", "assets/bundles/fishingstuff/fishes/overcooked fish.asset", "assets/bundles/fishingstuff/fishes/frozen fish.asset",
"assets/bundles/fishingstuff/fishes/coin fish.asset", "assets/bundles/fishingstuff/fishes/book fish.asset", "assets/bundles/fishingstuff/fishes/png fish.asset"
};
fishes = (FishObject[])(object)new FishObject[array.Length + array2.Length];
foundFishes = new bool[fishes.Length];
for (int i = 0; i < array.Length; i++)
{
fishes[i] = Addressables.LoadAssetAsync<FishObject>((object)array[i]).WaitForCompletion();
foundFishes[i] = false;
}
for (int j = 0; j < array2.Length; j++)
{
FishObject fish = Plugin.bundle.LoadAsset<FishObject>(array2[j]);
fishes[j + array.Length] = PrepareFish(fish);
foundFishes[j + array.Length] = false;
}
string path = Path.Combine(Plugin.modDir, "fish.save");
if (!File.Exists(path))
{
return;
}
byte[] array3 = File.ReadAllBytes(path);
for (int k = 0; k < array3.Length; k++)
{
if (array3[k] == 1)
{
foundFishes[k] = true;
}
}
}
private static FishObject PrepareFish(FishObject fish)
{
//IL_0047: 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)
string fishName = fish.fishName;
string text = fishName;
if (!(text == "Filthy Screaming Fish (Filsh)"))
{
if (text == "Wise Fish")
{
((Component)fish.customPickup).gameObject.AddComponent<BookRandomizer>();
}
}
else
{
AudioSource component = ((Component)((Component)fish.customPickup).gameObject.transform.GetChild(0)).GetComponent<AudioSource>();
AudioMixer val = Addressables.LoadAssetAsync<AudioMixer>((object)"GoreAudio").WaitForCompletion();
component.outputAudioMixerGroup.audioMixer.outputAudioMixerGroup = val.FindMatchingGroups("Master").FirstOrDefault();
}
return fish;
}
public static void UnlockFish(FishObject fish)
{
int num = Array.FindIndex(fishes, (FishObject f) => (Object)(object)f == (Object)(object)fish);
if (num == -1)
{
Plugin.logger.LogError((object)("Fish " + fish.fishName + " could not be found!"));
return;
}
Plugin.logger.LogInfo((object)("Fish " + fish.fishName + " was found!"));
if (!foundFishes[num])
{
foundFishes[num] = true;
WriteToSaveFile();
UpdateSize2();
}
}
public static int FishCount()
{
return fishes.Length;
}
public static FishObject GetFish(int index)
{
return fishes[index];
}
public static FishObject GetFish(string fishName)
{
return Array.Find(fishes, (FishObject fish) => fish.fishName == fishName);
}
public static bool GetFishValue(int index)
{
return foundFishes[index];
}
public static bool FoundFish(FishObject fish)
{
int num = Array.FindIndex(fishes, (FishObject f) => (Object)(object)f == (Object)(object)fish);
if (num == -1)
{
return false;
}
return GetFishValue(num);
}
public static string GetFishDescription(FishObject fish)
{
if (FoundFish(fish))
{
return fish.description;
}
string fishName = fish.fishName;
string text = fishName;
if (!(text == "null"))
{
if (text == "\"size 2\"")
{
return "The legendary fish. The dream of all fishers, yet none have ever caught it. It is said to only appear to expert fishers who have caught every kind of fish.\n\nThe waterfall conceals the water UPS. Agnes Gorge Trail. Use your ability and fulfill your destiny.";
}
return fish.description;
}
return "An ordinary and very real fish. Native to the beautiful paradise known as Limbo.\n\nUsually found where the water falls.";
}
private static void WriteToSaveFile()
{
string path = Path.Combine(Plugin.modDir, "fish.save");
byte[] array = new byte[foundFishes.Length];
for (int i = 0; i < foundFishes.Length; i++)
{
if (foundFishes[i])
{
array[i] = 1;
}
else
{
array[i] = 0;
}
}
File.WriteAllBytes(path, array);
}
public static int CanCatchSize2()
{
for (int i = 0; i < foundFishes.Length - 1; i++)
{
if (!foundFishes[i])
{
return 0;
}
}
return 1;
}
public static void UpdateSize2()
{
if (!(SceneHelper.CurrentScene == "Level 7-S") || CanCatchSize2() != 1)
{
return;
}
string gameObjectPath = "7-S_Unpaintable/Exterior/The Water Ups_Todo/The Water Ups/Water Ups Ocean";
GameObject val = GenericHelper.FindGameObject(gameObjectPath);
if (!((Object)(object)val == (Object)null))
{
FakeWater component = val.GetComponent<FakeWater>();
if (!((Object)(object)component == (Object)null))
{
FishDescriptor[] array = component.fishDB.foundFishes;
array[0].chance = 1;
}
}
}
}
public class NewFishingRod : FishingRodWeapon
{
private static FakeWater currentFakeWater;
public void OnDisable()
{
((FishingRodWeapon)this).ResetFishing();
MonoSingleton<FishingHUD>.Instance.SetState((FishingRodState)0);
}
public void FishCaughtAndGrabbed()
{
base.animator.SetTrigger(FishingRodWeapon.Idle);
MonoSingleton<FishingHUD>.Instance.ShowFishCaught(true, base.hookedFishe.fish);
CreateFishPickup(base.fishPickupTemplate, base.hookedFishe.fish, grab: true);
((FishingRodWeapon)this).ResetFishing();
}
public static GameObject CreateFishPickup(ItemIdentifier template, FishObject fish, bool grab, bool unlock = true)
{
//IL_008a: Unknown result type (might be due to invalid IL or missing references)
//IL_008f: 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_0098: Unknown result type (might be due to invalid IL or missing references)
//IL_009c: 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_00d2: Unknown result type (might be due to invalid IL or missing references)
//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
//IL_014f: Unknown result type (might be due to invalid IL or missing references)
//IL_0154: Unknown result type (might be due to invalid IL or missing references)
//IL_0156: Unknown result type (might be due to invalid IL or missing references)
//IL_0158: Unknown result type (might be due to invalid IL or missing references)
//IL_015a: Unknown result type (might be due to invalid IL or missing references)
//IL_015d: Invalid comparison between Unknown and I4
//IL_016c: Unknown result type (might be due to invalid IL or missing references)
//IL_016f: Invalid comparison between Unknown and I4
//IL_015f: Unknown result type (might be due to invalid IL or missing references)
//IL_0173: Unknown result type (might be due to invalid IL or missing references)
//IL_0177: Invalid comparison between Unknown and I4
//IL_0165: Unknown result type (might be due to invalid IL or missing references)
//IL_0168: Invalid comparison between Unknown and I4
if (unlock)
{
MonoSingleton<FishManager>.Instance.UnlockFish(fish);
}
ItemIdentifier val;
if ((Object)(object)fish.customPickup != (Object)null)
{
val = Object.Instantiate<ItemIdentifier>(fish.customPickup);
if (!Object.op_Implicit((Object)(object)((Component)val).GetComponent<FishObjectReference>()))
{
((Component)val).gameObject.AddComponent<FishObjectReference>().fishObject = fish;
}
}
else
{
val = Object.Instantiate<ItemIdentifier>(template);
((Component)val).gameObject.AddComponent<FishObjectReference>().fishObject = fish;
Transform transform = ((Component)((Component)val).transform.GetChild(0)).transform;
Vector3 localPosition = transform.localPosition;
Quaternion localRotation = transform.localRotation;
Vector3 localScale = transform.localScale;
Object.Destroy((Object)(object)((Component)transform).gameObject);
GameObject val2 = fish.InstantiateDumb();
val2.transform.SetParent(((Component)val).transform);
val2.transform.localPosition = localPosition;
val2.transform.localRotation = localRotation;
val2.transform.localScale = localScale;
}
if (grab)
{
ItemIdentifier heldObject = MonoSingleton<FistControl>.Instance.heldObject;
if ((Object)(object)heldObject == (Object)null)
{
MonoSingleton<FistControl>.Instance.currentPunch.ResetHeldState();
MonoSingleton<FistControl>.Instance.currentPunch.ForceHold(val);
return ((Component)val).gameObject;
}
ItemType itemType = heldObject.itemType;
ItemType val3 = itemType;
if ((int)val3 <= 4)
{
if ((int)val3 == 0 || (int)val3 == 4)
{
goto IL_017b;
}
}
else if ((int)val3 == 6 || (int)val3 == 10)
{
goto IL_017b;
}
MonoSingleton<FistControl>.Instance.currentPunch.ResetHeldState();
MonoSingleton<FistControl>.Instance.currentPunch.ForceHold(val);
MonoSingleton<FistControl>.Instance.currentPunch.ForceDrop();
MonoSingleton<FistControl>.Instance.currentPunch.ResetHeldState();
MonoSingleton<FistControl>.Instance.currentPunch.ForceHold(heldObject);
}
goto IL_0209;
IL_0209:
return ((Component)val).gameObject;
IL_017b:
Object.Destroy((Object)(object)((Component)MonoSingleton<FistControl>.Instance.heldObject).gameObject);
MonoSingleton<FistControl>.Instance.currentPunch.ResetHeldState();
MonoSingleton<FistControl>.Instance.currentPunch.ForceHold(val);
goto IL_0209;
}
public void NewUpdate()
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_0084: Unknown result type (might be due to invalid IL or missing references)
//IL_0090: Unknown result type (might be due to invalid IL or missing references)
//IL_0095: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Unknown result type (might be due to invalid IL or missing references)
//IL_0097: Unknown result type (might be due to invalid IL or missing references)
//IL_0098: Unknown result type (might be due to invalid IL or missing references)
//IL_00b2: Expected I4, but got Unknown
//IL_04e2: Unknown result type (might be due to invalid IL or missing references)
//IL_05a8: Unknown result type (might be due to invalid IL or missing references)
//IL_05b8: Unknown result type (might be due to invalid IL or missing references)
//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
//IL_0625: Unknown result type (might be due to invalid IL or missing references)
//IL_011d: Unknown result type (might be due to invalid IL or missing references)
//IL_012a: Unknown result type (might be due to invalid IL or missing references)
//IL_012f: Unknown result type (might be due to invalid IL or missing references)
//IL_0144: 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_01d3: Unknown result type (might be due to invalid IL or missing references)
//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
//IL_01df: 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_01ee: Unknown result type (might be due to invalid IL or missing references)
//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
//IL_0541: Unknown result type (might be due to invalid IL or missing references)
//IL_054c: Unknown result type (might be due to invalid IL or missing references)
//IL_0551: Unknown result type (might be due to invalid IL or missing references)
//IL_0561: Unknown result type (might be due to invalid IL or missing references)
//IL_0571: Unknown result type (might be due to invalid IL or missing references)
//IL_0210: Unknown result type (might be due to invalid IL or missing references)
//IL_0215: Unknown result type (might be due to invalid IL or missing references)
//IL_03c6: Unknown result type (might be due to invalid IL or missing references)
//IL_03c8: Unknown result type (might be due to invalid IL or missing references)
//IL_03d2: Unknown result type (might be due to invalid IL or missing references)
//IL_03d7: Unknown result type (might be due to invalid IL or missing references)
//IL_03eb: Unknown result type (might be due to invalid IL or missing references)
//IL_03fa: Unknown result type (might be due to invalid IL or missing references)
//IL_033b: Unknown result type (might be due to invalid IL or missing references)
//IL_033d: Unknown result type (might be due to invalid IL or missing references)
//IL_0347: Unknown result type (might be due to invalid IL or missing references)
//IL_034c: Unknown result type (might be due to invalid IL or missing references)
//IL_0360: Unknown result type (might be due to invalid IL or missing references)
//IL_036f: Unknown result type (might be due to invalid IL or missing references)
//IL_03ac: Unknown result type (might be due to invalid IL or missing references)
//IL_0436: Unknown result type (might be due to invalid IL or missing references)
//IL_0792: Unknown result type (might be due to invalid IL or missing references)
//IL_0458: Unknown result type (might be due to invalid IL or missing references)
//IL_026f: Unknown result type (might be due to invalid IL or missing references)
//IL_0274: Unknown result type (might be due to invalid IL or missing references)
//IL_04a6: Unknown result type (might be due to invalid IL or missing references)
//IL_04b1: Unknown result type (might be due to invalid IL or missing references)
//IL_04b6: Unknown result type (might be due to invalid IL or missing references)
//IL_02d1: Unknown result type (might be due to invalid IL or missing references)
//IL_02d6: Unknown result type (might be due to invalid IL or missing references)
if (GameStateManager.Instance.PlayerInputLocked || MonoSingleton<InputManager>.Instance.PerformingCheatMenuCombo())
{
return;
}
if (TimeSince.op_Implicit(MonoSingleton<FishingHUD>.Instance.timeSinceFishCaught) >= 1f && (MonoSingleton<InputManager>.Instance.InputSource.Punch.WasPerformedThisFrame || MonoSingleton<InputManager>.Instance.InputSource.Fire1.WasPerformedThisFrame))
{
MonoSingleton<FishingHUD>.Instance.ShowFishCaught(false, (FishObject)null);
}
MonoSingleton<FishingHUD>.Instance.SetState(base.state);
FishingRodState state = base.state;
FishingRodState val = state;
switch ((int)val)
{
case 0:
if (MonoSingleton<InputManager>.Instance.InputSource.Fire1.WasPerformedThisFrame && TimeSince.op_Implicit(base.timeSinceAction) > 0.1f)
{
MonoSingleton<FishingHUD>.Instance.SetPowerMeter(0f, false);
base.selectedPower = 0f;
base.climaxed = false;
base.fishHooked = false;
base.baitThrown = false;
base.state = (FishingRodState)1;
base.targetingCircle = Object.Instantiate<FishingRodTarget>(base.targetPrefab, ((FishingRodWeapon)this).approximateTargetPosition, Quaternion.identity);
base.timeSinceAction = TimeSince.op_Implicit(0f);
}
break;
case 1:
{
base.selectedPower += (Time.deltaTime * 0.4f + base.selectedPower * 0.01f) * (base.climaxed ? (-0.5f) : 1f);
if (base.selectedPower > 1f)
{
base.selectedPower = 1f;
base.climaxed = true;
}
if (base.selectedPower < 0.1f)
{
base.climaxed = false;
}
Vector3 val2 = ((FishingRodWeapon)this).approximateTargetPosition;
bool flag = false;
RaycastHit val3 = default(RaycastHit);
if (Physics.Raycast(val2 + Vector3.up * 3f, Vector3.down, ref val3, 30f))
{
val2 = ((RaycastHit)(ref val3)).point;
Water val4 = default(Water);
FakeWater fakeWater = default(FakeWater);
if (((Component)((RaycastHit)(ref val3)).collider).TryGetComponent<Water>(ref val4) && Object.op_Implicit((Object)(object)val4.fishDB))
{
base.currentFishPool = val4.fishDB;
base.currentWater = val4;
flag = true;
if (Object.op_Implicit((Object)(object)val4.overrideFishingPoint))
{
val2 = val4.overrideFishingPoint.position;
}
}
else if (((Component)((RaycastHit)(ref val3)).collider).TryGetComponent<FakeWater>(ref fakeWater) && Object.op_Implicit((Object)(object)fakeWater.fishDB))
{
base.currentFishPool = fakeWater.fishDB;
currentFakeWater = fakeWater;
flag = true;
if (Object.op_Implicit((Object)(object)fakeWater.overrideFishingPoint))
{
val2 = fakeWater.overrideFishingPoint.position;
}
}
else
{
base.currentFishPool = null;
base.currentWater = null;
currentFakeWater = null;
flag = false;
}
}
else
{
base.currentFishPool = null;
base.currentWater = null;
currentFakeWater = null;
flag = false;
}
MonoSingleton<FishingHUD>.Instance.SetPowerMeter(base.selectedPower, flag);
if (flag)
{
((Component)base.targetingCircle).transform.position = val2 + Vector3.up * 0.5f;
base.targetingCircle.SetState(true, Vector3.Distance(((RaycastHit)(ref val3)).point, ((Component)MonoSingleton<NewMovement>.Instance).transform.position));
base.targetingCircle.waterNameText.text = base.currentFishPool.fullName;
((Graphic)base.targetingCircle.waterNameText).color = base.currentFishPool.symbolColor;
}
else
{
((Component)base.targetingCircle).transform.position = val2 + Vector3.up * 0.5f;
base.targetingCircle.SetState(false, Vector3.Distance(((RaycastHit)(ref val3)).point, ((Component)MonoSingleton<NewMovement>.Instance).transform.position));
base.targetingCircle.waterNameText.text = "";
}
((Component)base.targetingCircle).transform.forward = ((Component)MonoSingleton<NewMovement>.Instance).transform.forward;
if (MonoSingleton<InputManager>.Instance.InputSource.Fire1.WasCanceledThisFrame && TimeSince.op_Implicit(base.timeSinceAction) > 0.1f)
{
if (flag)
{
((Component)base.targetingCircle).GetComponent<Animator>().SetTrigger(FishingRodWeapon.Set);
base.animator.ResetTrigger(FishingRodWeapon.Throw);
base.state = (FishingRodState)2;
base.timeSinceAction = TimeSince.op_Implicit(0f);
}
else
{
((FishingRodWeapon)this).ResetFishing();
}
}
break;
}
case 2:
((Component)base.targetingCircle).transform.forward = ((Component)MonoSingleton<NewMovement>.Instance).transform.forward;
base.fishHooked = false;
if (!base.baitThrown)
{
base.baitThrown = true;
base.animator.SetTrigger(FishingRodWeapon.Throw);
}
if (Object.op_Implicit((Object)(object)base.spawnedBaitCon) && base.spawnedBaitCon.landed)
{
base.state = (FishingRodState)3;
base.timeSinceBaitInWater = TimeSince.op_Implicit(0f);
base.distanceAfterThrow = Vector3.Distance(((Component)MonoSingleton<NewMovement>.Instance).transform.position, base.spawnedBaitCon.baitPoint.position);
Object.Destroy((Object)(object)((Component)base.targetingCircle).gameObject);
}
break;
case 3:
base.baitThrown = false;
if (Vector3.Distance(((Component)MonoSingleton<NewMovement>.Instance).transform.position, base.spawnedBaitCon.baitPoint.position) > base.distanceAfterThrow + 30f)
{
Object.Destroy((Object)(object)((Component)base.spawnedBaitCon).gameObject);
MonoSingleton<HudMessageReceiver>.Instance.SendHudMessage("Fishing interrupted", "", "", 0, false, false, true);
((FishingRodWeapon)this).ResetFishing();
break;
}
if (!base.fishHooked && Random.value < 0.002f + TimeSince.op_Implicit(base.timeSinceBaitInWater) * 0.01f)
{
if ((Object)(object)base.currentWater == (Object)null)
{
base.hookedFishe = base.currentFishPool.GetRandomFish(currentFakeWater.attractFish);
}
else
{
base.hookedFishe = base.currentFishPool.GetRandomFish(base.currentWater.attractFish);
}
if (base.hookedFishe == null)
{
if (!base.noFishErrorDisplayed)
{
base.noFishErrorDisplayed = true;
MonoSingleton<HudMessageReceiver>.Instance.SendHudMessage("Nothing seems to be biting here...", "", "", 0, false, false, true);
}
break;
}
if ((Object)(object)base.currentWater == (Object)null)
{
currentFakeWater.attractFish = null;
}
else
{
base.currentWater.attractFish = null;
}
base.fishHooked = true;
MonoSingleton<FishingHUD>.Instance.SetFishHooked(true);
base.spawnedBaitCon.FishHooked();
}
if (MonoSingleton<InputManager>.Instance.InputSource.Fire1.IsPressed || MonoSingleton<InputManager>.Instance.InputSource.Fire2.IsPressed)
{
base.animator.SetTrigger(FishingRodWeapon.Pull);
if (base.fishHooked)
{
MonoSingleton<FishingHUD>.Instance.SetFishHooked(false);
base.state = (FishingRodState)4;
base.spawnedBaitCon.CatchFish(base.hookedFishe.fish);
}
else
{
Object.Destroy((Object)(object)((Component)base.spawnedBaitCon).gameObject);
base.animator.SetTrigger(FishingRodWeapon.Idle);
base.animator.ResetTrigger(FishingRodWeapon.Throw);
base.animator.Play(FishingRodWeapon.Idle);
((FishingRodWeapon)this).ResetFishing();
}
}
break;
case 4:
base.fishDesirePosition = Mathf.PerlinNoise(Time.time * 0.3f, 0f);
base.fishTolerance = 0.1f + 0.4f * Mathf.PerlinNoise(Time.time * 0.4f, 0f);
if (MonoSingleton<InputManager>.Instance.InputSource.Fire1.IsPressed)
{
base.playerPositionVelocity += 1.9f * Time.deltaTime;
base.animator.SetTrigger(FishingRodWeapon.Pull);
}
else if (MonoSingleton<InputManager>.Instance.InputSource.Fire2.IsPressed)
{
base.playerPositionVelocity -= 1.9f * Time.deltaTime;
base.animator.SetTrigger(FishingRodWeapon.Pull);
}
else
{
base.playerPositionVelocity *= 1f - 2f * Time.deltaTime;
}
base.playerProvidedPosition += base.playerPositionVelocity * Time.deltaTime;
if (base.playerProvidedPosition > 1f)
{
base.playerProvidedPosition = 1f;
base.playerPositionVelocity = 0f - base.playerPositionVelocity;
}
if (base.playerProvidedPosition < 0f)
{
base.playerProvidedPosition = 0f;
base.playerPositionVelocity = 0f - base.playerPositionVelocity;
}
MonoSingleton<FishingHUD>.Instance.SetPlayerStrugglePosition(base.playerProvidedPosition);
MonoSingleton<FishingHUD>.Instance.SetStruggleSatisfied(((FishingRodWeapon)this).struggleSatisfied);
MonoSingleton<FishingHUD>.Instance.SetFishDesire(Mathf.Clamp01(((FishingRodWeapon)this).topBound), Mathf.Clamp01(((FishingRodWeapon)this).bottomBound));
base.spawnedBaitCon.allowedToProgress = ((FishingRodWeapon)this).struggleSatisfied;
MonoSingleton<FishingHUD>.Instance.SetStruggleProgress(base.spawnedBaitCon.flyProgress, base.hookedFishe.fish.blockedIcon, base.hookedFishe.fish.icon);
break;
}
}
}
[BepInPlugin("com.earthlingOnFire.UltraFishing", "UltraFishing", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
public const string PLUGIN_GUID = "com.earthlingOnFire.UltraFishing";
public const string PLUGIN_NAME = "UltraFishing";
public const string PLUGIN_VERSION = "1.0.0";
public static AssetBundle bundle;
public static ManualLogSource logger;
public static string modDir;
public static GameObject fishingRod;
public static GameObject fishingCanvas;
public static GameObject baitConsumedSound;
public static GameObject terminal;
private void Awake()
{
((Object)((Component)this).gameObject).hideFlags = (HideFlags)61;
logger = ((BaseUnityPlugin)this).Logger;
}
private void Start()
{
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
string path = Assembly.GetExecutingAssembly().Location.ToString();
modDir = Path.GetDirectoryName(path);
LoadBundle();
LoadAssets();
GlobalFishManager.Start();
new Harmony("com.earthlingOnFire.UltraFishing").PatchAll();
logger.LogInfo((object)"Plugin com.earthlingOnFire.UltraFishing is loaded!");
}
private void LoadBundle()
{
string text = Path.Combine(modDir, "fishingstuff.fishbundle");
bundle = AssetBundle.LoadFromFile(text);
if ((Object)(object)bundle == (Object)null)
{
logger.LogError((object)"Bundle could not be loaded");
}
}
private void LoadAssets()
{
fishingCanvas = AssetHelper.LoadPrefab("Assets/Prefabs/UI/FishingCanvas.prefab");
fishingRod = AssetHelper.LoadPrefab("Assets/Prefabs/Fishing/Fishing Rod Weapon.prefab");
baitConsumedSound = AssetHelper.LoadPrefab("Assets/Particles/SoundBubbles/Bait Consumed Sound.prefab");
if ((Object)(object)bundle != (Object)null)
{
WeaponIcon val = fishingRod.AddComponent<WeaponIcon>();
val.weaponDescriptor = bundle.LoadAsset<WeaponDescriptor>("assets/bundles/fishingstuff/rod descriptor.asset");
terminal = bundle.LoadAsset<GameObject>("assets/bundles/fishingstuff/fishing enc terminal.prefab");
}
}
}
[HarmonyPatch]
public static class Patches
{
[HarmonyPostfix]
[HarmonyPatch(typeof(GunControl), "Start")]
private static void GunControl_Start_Postfix()
{
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Expected O, but got Unknown
if (!((Object)(object)Object.FindObjectOfType<FishingHUD>() != (Object)null))
{
GameObject val = new GameObject("FishManager");
val.SetActive(false);
val.AddComponent<FishManager>().fishDbs = (FishDB[])(object)new FishDB[0];
val.SetActive(true);
SetupWaters();
GameObject val2 = Object.Instantiate<GameObject>(Plugin.fishingCanvas);
AddWeapon(5, Plugin.fishingRod);
LoadFishTerminal();
}
}
[HarmonyPostfix]
[HarmonyPatch(typeof(FishManager), "UnlockFish")]
private static void FishManager_UnlockFish_Postfix(ref FishObject fish)
{
GlobalFishManager.UnlockFish(fish);
}
[HarmonyPrefix]
[HarmonyPatch(typeof(FishingRodWeapon), "Awake")]
private static bool FishingRodWeapon_Awake_Prefix(FishingRodWeapon __instance)
{
//IL_0091: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Unknown result type (might be due to invalid IL or missing references)
//IL_012d: Unknown result type (might be due to invalid IL or missing references)
//IL_0132: Unknown result type (might be due to invalid IL or missing references)
//IL_0139: Unknown result type (might be due to invalid IL or missing references)
//IL_013e: Unknown result type (might be due to invalid IL or missing references)
if (__instance is NewFishingRod)
{
return true;
}
GameObject gameObject = ((Component)__instance).gameObject;
gameObject.SetActive(false);
NewFishingRod newFishingRod = gameObject.AddComponent<NewFishingRod>();
((FishingRodWeapon)newFishingRod).animator = __instance.animator;
((FishingRodWeapon)newFishingRod).targetPrefab = __instance.targetPrefab;
((FishingRodWeapon)newFishingRod).baitPrefab = __instance.baitPrefab;
((FishingRodWeapon)newFishingRod).rodTip = __instance.rodTip;
((FishingRodWeapon)newFishingRod).fishPickupTemplate = __instance.fishPickupTemplate;
((FishingRodWeapon)newFishingRod).pullSound = __instance.pullSound;
((FishingRodWeapon)newFishingRod).targetingCircle = __instance.targetingCircle;
((FishingRodWeapon)newFishingRod).spawnedBaitCon = __instance.spawnedBaitCon;
((FishingRodWeapon)newFishingRod).state = __instance.state;
((FishingRodWeapon)newFishingRod).selectedPower = __instance.selectedPower;
((FishingRodWeapon)newFishingRod).climaxed = __instance.climaxed;
((FishingRodWeapon)newFishingRod).baitThrown = __instance.baitThrown;
((FishingRodWeapon)newFishingRod).distanceAfterThrow = __instance.distanceAfterThrow;
((FishingRodWeapon)newFishingRod).fishHooked = __instance.fishHooked;
((FishingRodWeapon)newFishingRod).currentFishPool = __instance.currentFishPool;
((FishingRodWeapon)newFishingRod).currentWater = __instance.currentWater;
((FishingRodWeapon)newFishingRod).hookedFishe = __instance.hookedFishe;
((FishingRodWeapon)newFishingRod).fishTolerance = __instance.fishTolerance;
((FishingRodWeapon)newFishingRod).fishDesirePosition = __instance.fishDesirePosition;
((FishingRodWeapon)newFishingRod).playerProvidedPosition = __instance.playerProvidedPosition;
((FishingRodWeapon)newFishingRod).playerPositionVelocity = __instance.playerPositionVelocity;
((FishingRodWeapon)newFishingRod).timeSinceBaitInWater = __instance.timeSinceBaitInWater;
((FishingRodWeapon)newFishingRod).timeSinceAction = __instance.timeSinceAction;
((FishingRodWeapon)newFishingRod).noFishErrorDisplayed = __instance.noFishErrorDisplayed;
gameObject.GetComponentInChildren<FishingRodAnimEvents>().weapon = (FishingRodWeapon)(object)newFishingRod;
Object.Destroy((Object)(object)__instance);
gameObject.SetActive(true);
return false;
}
[HarmonyPrefix]
[HarmonyPatch(typeof(FishingRodWeapon), "Update")]
private static bool FishingRodWeapon_Update_Prefix(FishingRodWeapon __instance)
{
if (__instance is NewFishingRod)
{
NewFishingRod newFishingRod = (NewFishingRod)(object)__instance;
newFishingRod.NewUpdate();
return false;
}
return true;
}
[HarmonyPrefix]
[HarmonyPatch(typeof(FishingRodWeapon), "FishCaughtAndGrabbed")]
private static bool FishingRodWeapon_FishCaughtAndGrabbed_Prefix(FishingRodWeapon __instance)
{
if (__instance is NewFishingRod)
{
NewFishingRod newFishingRod = (NewFishingRod)(object)__instance;
newFishingRod.FishCaughtAndGrabbed();
return false;
}
return true;
}
[HarmonyPrefix]
[HarmonyPatch(typeof(FishEncyclopedia), "Start")]
private static bool FishEncyclopedia_Start_Prefix(FishEncyclopedia __instance)
{
//IL_0149: Unknown result type (might be due to invalid IL or missing references)
//IL_015c: 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_016b: Unknown result type (might be due to invalid IL or missing references)
//IL_0170: Unknown result type (might be due to invalid IL or missing references)
//IL_018e: Unknown result type (might be due to invalid IL or missing references)
//IL_0198: Expected O, but got Unknown
//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
//IL_0267: Unknown result type (might be due to invalid IL or missing references)
//IL_026c: 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_027b: Unknown result type (might be due to invalid IL or missing references)
//IL_0236: Unknown result type (might be due to invalid IL or missing references)
//IL_023b: Unknown result type (might be due to invalid IL or missing references)
//IL_0245: Unknown result type (might be due to invalid IL or missing references)
//IL_024a: Unknown result type (might be due to invalid IL or missing references)
//IL_029a: Unknown result type (might be due to invalid IL or missing references)
//IL_02a4: Expected O, but got Unknown
if (__instance is GlobalFishEncyclopedia)
{
GlobalFishEncyclopedia globalFishEncyclopedia = (GlobalFishEncyclopedia)(object)__instance;
globalFishEncyclopedia.StartEncyclopedia();
return false;
}
GameObject gameObject = ((Component)__instance).gameObject;
GlobalFishEncyclopedia newEnc = gameObject.AddComponent<GlobalFishEncyclopedia>();
((FishEncyclopedia)newEnc).fishPicker = __instance.fishPicker;
((FishEncyclopedia)newEnc).fishInfoContainer = __instance.fishInfoContainer;
((FishEncyclopedia)newEnc).fishName = __instance.fishName;
((FishEncyclopedia)newEnc).fishDescription = __instance.fishDescription;
((FishEncyclopedia)newEnc).fishGrid = __instance.fishGrid;
((FishEncyclopedia)newEnc).fishButtonTemplate = __instance.fishButtonTemplate;
((FishEncyclopedia)newEnc).fish3dRenderContainer = __instance.fish3dRenderContainer;
((FishEncyclopedia)newEnc).fishButtons = __instance.fishButtons;
Transform val = ((FishEncyclopedia)newEnc).fishInfoContainer.transform.Find("Window/Back Button");
GameObject val2 = Object.Instantiate<GameObject>(((Component)val).gameObject, ((FishEncyclopedia)newEnc).fishPicker.transform.parent);
((Object)val2).name = "Previous Button";
((TMP_Text)((Component)val2.transform.GetChild(0)).GetComponent<TextMeshProUGUI>()).text = "<<";
val2.transform.localScale = new Vector3(1.4f, 1.4f, 1f);
Transform transform = val2.transform;
transform.position += Vector3.down * 0.0425f;
((UnityEvent)val2.GetComponent<Button>().onClick).AddListener((UnityAction)delegate
{
newEnc.PreviousPage();
});
GameObject val3 = Object.Instantiate<GameObject>(((Component)val).gameObject, ((FishEncyclopedia)newEnc).fishPicker.transform.parent);
((Object)val2).name = "Next Button";
((TMP_Text)((Component)val3.transform.GetChild(0)).GetComponent<TextMeshProUGUI>()).text = ">>";
val3.transform.localScale = val2.transform.localScale;
if (SceneHelper.CurrentScene.Contains("construct") || SceneHelper.CurrentScene.Contains("5-S"))
{
val3.transform.position = val2.transform.position + Vector3.left * 0.8313f;
}
else
{
val3.transform.position = val2.transform.position + Vector3.right * 0.8313f;
}
((UnityEvent)val3.GetComponent<Button>().onClick).AddListener((UnityAction)delegate
{
newEnc.NextPage();
});
((FishEncyclopedia)newEnc).fishInfoContainer.transform.SetAsLastSibling();
((Component)val).GetComponent<ShopButton>().toActivate = (GameObject[])(object)new GameObject[1] { ((FishEncyclopedia)newEnc).fishPicker };
Object.Destroy((Object)(object)__instance);
return false;
}
[HarmonyPostfix]
[HarmonyPatch(typeof(ItemIdentifier), "PutDown")]
private static void ItemIdentifier_PutDown_Postfix(ItemIdentifier __instance)
{
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
//IL_0098: 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_00a7: Unknown result type (might be due to invalid IL or missing references)
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
//IL_0103: Unknown result type (might be due to invalid IL or missing references)
//IL_0108: 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_0117: Unknown result type (might be due to invalid IL or missing references)
//IL_0122: Unknown result type (might be due to invalid IL or missing references)
//IL_0127: Unknown result type (might be due to invalid IL or missing references)
FishObjectReference component = ((Component)__instance).GetComponent<FishObjectReference>();
if (!((Object)(object)component == (Object)null))
{
FishObject fishObject = component.fishObject;
string fishName = fishObject.fishName;
string text = fishName;
if (text == "Coin")
{
GameObject gameObject = ((Component)((Component)__instance).transform.Find("Coin")).gameObject;
Camera component2 = ((Component)MonoSingleton<CameraController>.Instance).GetComponent<Camera>();
GameObject gameObject2 = ((Component)component2).gameObject;
GunControl instance = MonoSingleton<GunControl>.Instance;
FistControl instance2 = MonoSingleton<FistControl>.Instance;
instance2.currentPunch.CoinFlip();
GameObject val = Object.Instantiate<GameObject>(gameObject, gameObject2.transform.position + gameObject2.transform.up * -0.5f, gameObject2.transform.rotation);
val.SetActive(true);
val.GetComponent<Coin>().sourceWeapon = instance.currentWeapon;
MonoSingleton<RumbleManager>.Instance.SetVibration(RumbleProperties.CoinToss);
val.GetComponent<Rigidbody>().AddForce(gameObject2.transform.forward * 20f + Vector3.up * 15f + MonoSingleton<PlayerTracker>.Instance.GetPlayerVelocity(true), (ForceMode)2);
Object.Destroy((Object)(object)((Component)__instance).gameObject);
}
}
}
private static void LoadFishTerminal()
{
//IL_006d: 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_011a: Unknown result type (might be due to invalid IL or missing references)
//IL_012b: Unknown result type (might be due to invalid IL or missing references)
string currentScene = SceneHelper.CurrentScene;
if (!currentScene.Contains("Level") && !currentScene.Contains("construct") && !currentScene.Contains("Museum"))
{
return;
}
GameObject val;
if (currentScene.Contains("construct"))
{
val = Object.Instantiate<GameObject>(Plugin.terminal);
val.transform.position = new Vector3(-37f, -10f, 335.125f);
val.transform.localEulerAngles = new Vector3(0f, 0f, 180f);
return;
}
string text = currentScene;
string text2 = text;
GameObject val2 = ((!(text2 == "Level 6-1")) ? GenericHelper.FindGameObjectContaining("FirstRoom") : GenericHelper.FindGameObject("Interiors/FirstRoom"));
if ((Object)(object)val2 == (Object)null)
{
Plugin.logger.LogError((object)"No FirstRoom could be found!");
return;
}
val = Object.Instantiate<GameObject>(Plugin.terminal, val2.transform.GetChild(0));
val.transform.localPosition = new Vector3(-6.5f, 2f, 32f);
val.transform.localEulerAngles = Vector3.zero;
}
private static void AddWeapon(int slot, GameObject weapon)
{
GunControl instance = MonoSingleton<GunControl>.Instance;
if (slot < instance.slots.Count && !instance.slots[slot].Exists((GameObject w) => ((Object)w).name == ((Object)weapon).name + "Clone"))
{
GameObject val = Object.Instantiate<GameObject>(weapon, ((Component)instance).transform);
instance.slots[slot].Add(val);
instance.UpdateWeaponList(false);
val.SetActive(false);
}
}
private static void SetupWaters()
{
//IL_04a5: Unknown result type (might be due to invalid IL or missing references)
//IL_04ca: Unknown result type (might be due to invalid IL or missing references)
//IL_04ef: Unknown result type (might be due to invalid IL or missing references)
//IL_0514: Unknown result type (might be due to invalid IL or missing references)
//IL_06d6: Unknown result type (might be due to invalid IL or missing references)
//IL_0701: Unknown result type (might be due to invalid IL or missing references)
//IL_053e: Unknown result type (might be due to invalid IL or missing references)
//IL_0563: Unknown result type (might be due to invalid IL or missing references)
//IL_0588: 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_05d9: Unknown result type (might be due to invalid IL or missing references)
//IL_05fe: Unknown result type (might be due to invalid IL or missing references)
//IL_0835: Unknown result type (might be due to invalid IL or missing references)
//IL_0401: Unknown result type (might be due to invalid IL or missing references)
//IL_0bb3: Unknown result type (might be due to invalid IL or missing references)
//IL_0bd8: Unknown result type (might be due to invalid IL or missing references)
//IL_0bfd: Unknown result type (might be due to invalid IL or missing references)
//IL_0c22: 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_0a8c: Unknown result type (might be due to invalid IL or missing references)
//IL_0ab1: Unknown result type (might be due to invalid IL or missing references)
//IL_0ad6: Unknown result type (might be due to invalid IL or missing references)
//IL_0afb: 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_0b50: Unknown result type (might be due to invalid IL or missing references)
//IL_0747: Unknown result type (might be due to invalid IL or missing references)
//IL_0928: Unknown result type (might be due to invalid IL or missing references)
//IL_07c0: Unknown result type (might be due to invalid IL or missing references)
//IL_07e5: Unknown result type (might be due to invalid IL or missing references)
//IL_080a: Unknown result type (might be due to invalid IL or missing references)
//IL_0646: Unknown result type (might be due to invalid IL or missing references)
//IL_0680: Unknown result type (might be due to invalid IL or missing references)
//IL_06a6: Unknown result type (might be due to invalid IL or missing references)
//IL_095a: Unknown result type (might be due to invalid IL or missing references)
//IL_0996: Unknown result type (might be due to invalid IL or missing references)
//IL_09bb: Unknown result type (might be due to invalid IL or missing references)
//IL_1050: Unknown result type (might be due to invalid IL or missing references)
//IL_1075: Unknown result type (might be due to invalid IL or missing references)
//IL_0d98: Unknown result type (might be due to invalid IL or missing references)
//IL_0dbd: Unknown result type (might be due to invalid IL or missing references)
//IL_0c4f: Unknown result type (might be due to invalid IL or missing references)
//IL_0de7: Unknown result type (might be due to invalid IL or missing references)
//IL_0e0c: Unknown result type (might be due to invalid IL or missing references)
//IL_0e31: Unknown result type (might be due to invalid IL or missing references)
//IL_0e56: Unknown result type (might be due to invalid IL or missing references)
//IL_0e85: Unknown result type (might be due to invalid IL or missing references)
//IL_0b89: Unknown result type (might be due to invalid IL or missing references)
//IL_086a: Unknown result type (might be due to invalid IL or missing references)
//IL_088f: Unknown result type (might be due to invalid IL or missing references)
//IL_08b4: 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_08fe: Unknown result type (might be due to invalid IL or missing references)
//IL_0771: Unknown result type (might be due to invalid IL or missing references)
//IL_0796: Unknown result type (might be due to invalid IL or missing references)
//IL_0fdf: Unknown result type (might be due to invalid IL or missing references)
//IL_1004: Unknown result type (might be due to invalid IL or missing references)
//IL_1029: Unknown result type (might be due to invalid IL or missing references)
//IL_0c8b: 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_0cd5: Unknown result type (might be due to invalid IL or missing references)
//IL_0cfa: Unknown result type (might be due to invalid IL or missing references)
//IL_0d1f: Unknown result type (might be due to invalid IL or missing references)
//IL_0d44: Unknown result type (might be due to invalid IL or missing references)
//IL_0a0d: Unknown result type (might be due to invalid IL or missing references)
//IL_0a32: Unknown result type (might be due to invalid IL or missing references)
//IL_0d6e: Unknown result type (might be due to invalid IL or missing references)
//IL_0eaf: Unknown result type (might be due to invalid IL or missing references)
//IL_0ed5: Unknown result type (might be due to invalid IL or missing references)
//IL_0efa: Unknown result type (might be due to invalid IL or missing references)
//IL_0f1f: Unknown result type (might be due to invalid IL or missing references)
//IL_0f44: Unknown result type (might be due to invalid IL or missing references)
//IL_0f6a: Unknown result type (might be due to invalid IL or missing references)
//IL_0f8f: Unknown result type (might be due to invalid IL or missing references)
//IL_0fb5: Unknown result type (might be due to invalid IL or missing references)
switch (SceneHelper.CurrentScene)
{
case "uk_construct":
WaterBuilder.SetWater("Water Tri").AddFish("Funny Stupid Fish (Friend)").AddFish("PITR Fish")
.AddFish("Trout")
.AddFish("Metal Fish")
.AddFish("Chomper")
.AddFish("Bomb Fish")
.AddFish("Eyeball")
.AddFish("Frog (?)")
.AddFish("Dope Fish")
.AddFish("Stickfish")
.AddFish("Cooked Fish")
.AddFish("Shark")
.SetUp("Garry's Lake", Color.green);
break;
case "CreditsMuseum2":
WaterBuilder.SetWater("__Room_Aquarium/", 8).AddFish("Funny Stupid Fish (Friend)").AddFish("PITR Fish")
.AddFish("Trout")
.AddFish("Metal Fish")
.AddFish("Chomper")
.AddFish("Bomb Fish")
.AddFish("Eyeball")
.AddFish("Frog (?)")
.AddFish("Dope Fish")
.AddFish("Stickfish")
.AddFish("Cooked Fish")
.AddFish("Shark")
.SetUp("Aquarium", Color.cyan);
WaterBuilder.SetWater("__Room_Courtyard/__Level Geo/Water Fountain/Water fountain_water_1").AddFish("Coin").SetUp("Fountain", Color.cyan);
WaterBuilder.SetWater("__Room_FrontDesk_1/__Level geo/Cube (3)").AddFish("Wise Fish").SetUp("Credits", Color.magenta);
WaterBuilder.SetWater("__Room_Large_Lower/__Level Geo/water").AddFish("Wise Fish").SetUp("Credits", Color.magenta);
break;
case "Level 0-2":
{
WaterBuilder.SetWater("3 - Blood Room/3 Nonstuff/Decorations/Mulchflow").AddFish("Filthy Screaming Fish (Filsh)").SetUp("Meat", Color.red);
WaterBuilder.SetWater("3 - Blood Room/3 Nonstuff/Decorations/Mulchflow/Cube").AddFish("Filthy Screaming Fish (Filsh)").SetUp("Meat", Color.red);
WaterBuilder.SetWater("3 - Blood Room/3 Nonstuff/Decorations/Mulchflow (1)").AddFish("Filthy Screaming Fish (Filsh)").SetUp("Meat", Color.red);
WaterBuilder.SetWater("3 - Blood Room/3 Nonstuff/Decorations/Mulchflow (1)/Cube").AddFish("Filthy Screaming Fish (Filsh)").SetUp("Meat", Color.red);
WaterBuilder.SetWater("6 - Crusher Arena/6 Nonstuff/Floor", 4).AddFish("Filthy Screaming Fish (Filsh)").AddMeshCollider()
.SetUp("Meat", Color.red);
WaterBuilder.SetWater("7 - Crusher Hallway/7 Nonstuff/Floor/Blood/").AddFish("Filthy Screaming Fish (Filsh)").SetUp("Meat", Color.red);
int[] array = new int[5] { 0, 1, 3, 5, 7 };
foreach (int childIndex in array)
{
WaterBuilder.SetWater("9-9B Tunnel/BloodRiver/", childIndex).AddFish("Filthy Screaming Fish (Filsh)").SetUp("Meat", Color.red);
}
break;
}
case "Level 0-5":
WaterBuilder.SetWater("2 - Lava Foundry/Lava/", 0).AddFish("Overcooked Fish").SetUp("Lava", Color.red);
WaterBuilder.SetWater("2 - Lava Foundry/Lava/", 1).AddFish("Overcooked Fish").SetUp("Lava", Color.red);
break;
case "Level 1-1":
{
WaterBuilder.SetWater("6 - Waterfall Arena/6 Nonstuff/Cliff and Waterfall", 0, "GameObject").AddFish("null").SetUp("Waterfall", Color.magenta);
WaterBuilder.SetWater("6 - Waterfall Arena/6 Nonstuff/Cliff and Waterfall", 2, "GameObject").AddFish("null").SetUp("Waterfall", Color.magenta);
GameObject val = GenericHelper.FindGameObject("1 - First Field/1 Stuff/1 - Darker_Fountain(Clone)/fountain/Cylinder (1)");
if ((Object)(object)val == (Object)null)
{
val = GenericHelper.FindGameObject("1 - First Field/1 Stuff/Fountain/Cylinder");
}
WaterBuilder.SetWater(val).AddFish("Coin").SetUp("Fountain", Color.cyan);
break;
}
case "Level 1-2":
WaterBuilder.SetWater("7 - Castle Entrance/7 Nonstuff/Sewer/GreenWater").AddFish("Cancerous Fish").SetUp("Cancerous Water", Color.green);
WaterBuilder.SetWater("7B - Lava Room/Floor/Lava/").AddFish("Overcooked Fish").SetUp("Lava", Color.red);
break;
case "Level 1-3":
WaterBuilder.SetWater("R2 - Second Arena/R2 Nonstuff/Lava").AddFish("Overcooked Fish").SetUp("Lava", Color.red);
WaterBuilder.SetWater("B1-C Lava Staircase/B1-C Nonstuff/Floor/Cube").AddFish("Overcooked Fish").SetUp("Lava", Color.red);
WaterBuilder.SetWater("B1-D Lava Hallway/B1-D Nonstuff/Lava/Cube-clone").AddFish("Overcooked Fish").SetUp("Lava", Color.red);
break;
case "Level 2-3":
WaterBuilder.SetWater("1 - Main Hall/1 Nonstuff/Water/", 3).AddFish("Koi Fish").SetUp("Pond", Color.magenta);
break;
case "Level 3-1":
WaterBuilder.SetWater("5 - Circular Arena/5 Nonstuff/Water/").AddFish("Eyeball").AddFish("Frog (?)")
.SetUp("Blood", Color.red);
WaterBuilder.SetWater("3 - Big Arena/3 Nonstuff/Floor/Acid/").AddFish("Melted Fish").SetUp("Acid", Color.green);
WaterBuilder.SetWater("9 - Uphill Battle/9 Nonstuff/Floor/Acid/Cube").AddFish("Melted Fish").SetUp("Acid", Color.green);
WaterBuilder.SetWater("9 - Uphill Battle/9 Nonstuff/Floor/Acid/Cube (1)").AddFish("Melted Fish").SetUp("Acid", Color.green);
WaterBuilder.SetWater("10 - Structure/10 Stuff/AcidRaiser (1)/AcidRaiser/Acid/").AddFish("Melted Fish").SetUp("Acid", Color.green);
break;
case "Level 3-2":
WaterBuilder.SetWater("3 - Other Room/3 Nonstuff/Water/").AddFish("Melted Fish").SetUp("Acid", Color.green);
break;
case "Level 4-2":
{
for (int j = 0; j < 7; j++)
{
WaterBuilder.SetWater("Dunes", j).AddFish("Coin").SetUp("Sand", Color.yellow);
}
break;
}
case "Level 4-3":
WaterBuilder.SetWater("3 - Traitor Hallway/3B - Tomb of Kings/3B Nonstuff/Entrance/Walls/Cube (99)").AddFish("Coin").SetUp("Gold", Color.yellow);
WaterBuilder.SetWater("3 - Traitor Hallway/3B - Tomb of Kings/3B Nonstuff/Entrance/Walls/Cube (100)").AddFish("Coin").SetUp("Gold", Color.yellow);
break;
case "Level 4-4":
WaterBuilder.CreateWater("8 - Outro/8 Stuff/Landing (Broken) (1)").SetPosition(1065f, 255f, 692f).SetLocalScale(9f, 0f, 9f)
.AddFish("Eyeball")
.SetUp("\"V2\"", Color.red);
WaterBuilder.SetWater("8 - Outro/8 Nonstuff/Untilted (Outro)/Cube(Clone) (1)/").AddFish("Coin").SetUp("Sand", Color.yellow);
break;
case "Level 5-1":
WaterBuilder.SetWater("Underwaters/All Waters/Cube (3)").AddFish("Funny Stupid Fish (Friend)").AddFish("PITR Fish")
.SetUp("Cave Lake", Color.cyan);
WaterBuilder.SetWater("IntroParent/Intro/Intro A - First Cave/Plane/Cube").AddFish("Chomper").SetUp("Cave Pool", Color.gray);
WaterBuilder.SetWater("IntroParent/Intro/Intro A - First Cave/Plane (1)/Cube").AddFish("Chomper").SetUp("Cave Pool", Color.gray);
WaterBuilder.SetWater("IntroParent/Intro/Intro C - Second Cave/Plane (2)/Cube").AddFish("Chomper").SetUp("Cave Pool", Color.gray);
WaterBuilder.SetWater("2B - Arena B/B Nonstuff/Water/Cube").AddFish("Chomper").SetUp("Cave Pool", Color.gray);
WaterBuilder.SetWater("1 - Main Cave/1 Nonstuff/Drained/Cube").AddFish("Dope Fish").SetUp("Cave Lake", Color.cyan);
WaterBuilder.SetWater("2A - Arena A/A Nonstuff/Drained (1)/Cube").AddFish("PITR Fish").AddFish("Funny Stupid Fish (Friend)")
.SetUp("Cave Lake", Color.cyan);
break;
case "Level 5-2":
WaterBuilder.SetWater("Sea/Sea Itself/Filler/WaterTrigger").AddFish("Nerd Shark", 0).AddBait("3 - Ferryman's Cabin/3 Nonstuff/Interior/Book with Stand/Book", "Nerd Shark")
.SetUp("The Ocean Styx", Color.blue);
break;
case "Level 5-4":
{
WaterBuilder.SetWater("Surface/Stuff/Watersurface/Cube").AddFish("Eel (?)").SetUp("The Ocean Styx", Color.blue);
WaterBuilder.SetWater("Surface/Stuff/Watersurface/Cube (1)").AddFish("Eel (?)").SetUp("The Ocean Styx", Color.blue);
WaterBuilder.SetWater("Surface/Stuff/Watersurface/Cube (2)").AddFish("Eel (?)").SetUp("The Ocean Styx", Color.blue);
WaterBuilder.SetWater("Surface/Stuff/Watersurface (Sunken)/NewDeath/Anti-diver Colliders/Cube").AddFish("Eel (?)").SetUp("The Ocean Styx", Color.blue);
for (int i = 0; i < 8; i++)
{
WaterBuilder.SetWater("Surface/Stuff/Watersurface (Sunken)/NewWater/", i).AddFish("Eel (?)").SetUp("The Ocean Styx", Color.blue);
}
break;
}
case "Level 6-1":
WaterBuilder.SetWater("Interiors/6 - Lava Chasm/6 Nonstuff/Lava").AddFish("Overcooked Fish").SetUp("Lava", Color.red);
WaterBuilder.SetWater("10 - Chapel/10 Nonstuff/Pit").AddFish("Overcooked Fish").SetUp("Lava", Color.red);
WaterBuilder.SetWater("14 - Hall of Sacreligious Remains/14 Nonstuff/Lava Rim/Lava/Cube (9)").AddFish("Overcooked Fish").SetUp("Lava", Color.red);
WaterBuilder.SetWater("14 - Hall of Sacreligious Remains/14 Nonstuff/Lava Rim/Lava/Cube (9)/Cube (7)").AddFish("Overcooked Fish").SetUp("Lava", Color.red);
WaterBuilder.SetWater("14 - Hall of Sacreligious Remains/14 Nonstuff/Lava Rim/Lava/Cube (6)").AddFish("Overcooked Fish").SetUp("Lava", Color.red);
WaterBuilder.SetWater("14 - Hall of Sacreligious Remains/14 Nonstuff/Lava Rim/Lava/Cube (6)/Cube (7)").AddFish("Overcooked Fish").SetUp("Lava", Color.red);
break;
case "Level 7-2":
WaterBuilder.SetWater("Outdoors/Decorations/Ground/Blood").AddFish("Bomb Fish").SetUp("The River Phlegethon", Color.black);
break;
case "Level 7-4":
WaterBuilder.SetWater("Main/Interior/InteriorStuff/BoilingBlood").AddFish("Melted Fish").SetUp("Earthmover Insides", Color.black);
WaterBuilder.SetWater("Main/Interior/InteriorStuff/BoilingBlood (Return)").AddFish("Melted Fish").SetUp("Earthmover Insides", Color.black);
break;
case "Level 7-S":
WaterBuilder.SetWater("Pond/Pond Underwater").AddFish("Koi Fish").SetUp("Pond", Color.white);
WaterBuilder.SetWater("Pit/PitDestroyer").AddFish("Wise Fish").SetUp("Depths Of The Library", Color.gray);
WaterBuilder.SetWater("Curved Pit Destroyer").AddFish("Wise Fish").SetUp("Depths Of The Library", Color.gray);
WaterBuilder.SetWater("Curved Pit Destroyer/GameObject").AddFish("Wise Fish").SetUp("Depths Of The Library", Color.gray);
WaterBuilder.SetWater("7-S_Unpaintable/Exterior/The Water Ups_Todo/The Water Ups/Water Ups Ocean").AddFish("\"size 2\"", GlobalFishManager.CanCatchSize2()).AddMeshCollider(isTrigger: false)
.SetUp("The Water Ups", Color.blue);
break;
case "Level P-2":
WaterBuilder.SetWater("Shortcut/Deathzones/Deathzone").AddFish("Metal(?) Fish").SetUp("Scrindonguloded Souls", Color.black);
WaterBuilder.SetWater("Shortcut/Deathzones", 2).AddFish("Metal(?) Fish").SetUp("Scrindonguloded Souls", Color.black);
WaterBuilder.SetWater("Main Section/Outside/2 - Bridge Street/Floor/Plane (2)/Plane").AddFish("Metal(?) Fish").SetUp("Scrongled Souls", Color.black);
WaterBuilder.SetWater("Main Section/Outside/2 - Bridge Street/Floor/Plane (3)/Plane (1)").AddFish("Metal(?) Fish").SetUp("Scrongled Souls", Color.black);
WaterBuilder.SetWater("Main Section/Inside/6 - Soul Tunnel/6 Nonstuff (1)/Soulwalls/Cube(Clone)").AddFish("Metal(?) Fish").SetUp("Damned Souls", Color.black);
WaterBuilder.SetWater("Main Section/Inside/6 - Soul Tunnel/6 Nonstuff (1)/Soulwalls", 2).AddFish("Metal(?) Fish").SetUp("Damned Souls", Color.black);
WaterBuilder.SetWater("Main Section/Inside/6 - Soul Tunnel/6 Nonstuff/Soulwalls/Cube(Clone)").AddFish("Metal(?) Fish").SetUp("Damned Souls", Color.black);
WaterBuilder.SetWater("Main Section/Inside/6 - Soul Tunnel/6 Nonstuff/Soulwalls", 2).AddFish("Metal(?) Fish").SetUp("Damned Souls", Color.black);
break;
case "Level 0-E":
WaterBuilder.SetWater("6 - Crossroads/6 Nonstuff/6 Hot Only/Blood").AddFish("Filthy Screaming Fish (Filsh)").SetUp("Meat", Color.red);
WaterBuilder.SetWater("8 - Lava Foundry/8 Hot Only/Lava (1)/Cube").AddFish("Overcooked Fish").SetUp("Lava", Color.red);
WaterBuilder.SetWater("5-6 Water").AddFish("Frozen Fish").SetUp("Freezing Water", Color.white);
break;
case "Level 1-E":
WaterBuilder.SetWater("2 - Skull Field % Blue Skull Room/2 Nonstuff/Return Trip Nonstuff/Lava/").AddFish("Overcooked Fish").SetUp("Lava", Color.red);
WaterBuilder.SetWater("1 - First Field % Skylight Hallway/1 Nonstuff/1 Lava/Cube").AddFish("Overcooked Fish").SetUp("Lava", Color.red);
break;
}
}
}
public static class RandomBookTextProvider
{
private static Random rand = new Random();
private static int currentText = 0;
private static string creditsText = "Congratulations on finding the secret <color=blue>ULTRAFISHING</color> credits book! \n\nSomeone told me it'd be cool to have something like this in the dev museum, so thanks for the idea.\n\nIf anyone other than me ends up making major contributions to the mod, I will credit them here.\n\n<b><color=orange>earthling on fire</color> - CREATOR OF <color=blue>ULTRAFISHING</color></b>\n\nThis mod took a very long time to make, and development went on hiatus multiple times. But somehow, I managed to finish it.\n\nI learned a ton while working on this project and did a ton of stuff outside my usual \"comfort zone\". But most importantly, I had fun making it, and I hope you had fun playing it too.\n\nMy contributions include:\n<size=18>\n- Every custom fish.\n- The fishing rod icon.\n- The code that makes this mod work.\n</size>\n<color=orange><i>\"i only say morning because if it were a good morning i'd be fishing\"</i></color>\n\n<b>SPECIAL THANKS</b>\n\nCOOL PEOPLE ON DISCORD - advice, feedback and suggestions\n\nPoot Man - playtesting\n\nPITR - really robust fishing code that was surprisingly easy to work with\n\nHAKITA - cool game i guess";
private static string[] texts = new string[18]
{
"\n\n\n\n\n\n\n<align=center>You caught Fish!!\n\n\n<><\n\n\n<b>SIZE: 1</b></align>",
"<align=center><b>QUOTE OF THE DAY:</b>\n\n\n\"i only say morning because if it were a good morning i'd be fishing\" \n- local fishing enthusiast</align>",
"<align=center><b>TIP OF THE DAY:</b>\n\n\n\"The waterfall conceals the water UPS. Agnes Gorge Trail. Use your ability.\"",
"<align=\"center\"><b>TESTAMENT IV\n\n\n\"FATHER, WHY ETERNAL TORMENT? IS IT NOT CRUEL?\nIS TORTURE UNENDING TRULY A FATE FIT FOR A FOOL?\"\n\n\nAN ANGEL SO BRIGHT AND BEAUTIFUL ASKED ME THIS... \nAND I COULD FIND NO ANSWER\nFOR I COULD NEVER FACE THE GUILT OF WHAT I'D DONE...\nMY REGRET, A GNAWING CANCER\n\n\nIN MY HOUR OF WEAKNESS, TERROR POSSESSED ME THEN\nAND I CAST LUCIFER, TOO, INTO THE INFERNAL DEN\n\n\nONCE I REALIZED WHAT I HAD JUST DONE...\nI COULD ONLY WEEP\nAS I SANK SLOWLY INTO DEPTHS OF DESPAIR...\nDEEP, OH SO DEEP</b></align>",
"If you can read this, please help. I've been stranded on an island off the shore for weeks now, and I'm running out of supplies.\n\n\nI was drawn to ride the waves in hopes of finding the legendary size 2 fish. I had combed every inch of land and lake with no avail.\n\n\nI deduced that they must exist far out at sea, so I set sail with a month's worth of cooked fish, but the waves sank my ship before I could find anything.\n\n\nYou're my last hope.\n\n\nSet sail towards the big dipper, you will find me on an island there. Bring me more fish and then leave so I may continue my search.\n\n\nTHE SIZE 2 FISH IS MINE.",
"<size=20>ive figured it out. i know why the creatures are suddenly and undetectably appe\naring inside our facilities. i know why spare parts and pieces of machines keep \ndisappearing. i know why the doors seem to malfunction and suddenly lock themsel\nves. its not a glitch in the system. its... \n \n \n hell is alive. it breathes. it thinks. the entire area is a massive intellig\nent superorganism and it is harsh and it is cruel. just by watching us it has le\narned how our systems and machines work. it has not only begun to deconstruct ou\nr technology but also reassemble it in perverse ways, attaching parts to the cre\natures it tortures, making them into an aimless army of death and destruction. i\nt warps them across itself to get them past our security. it locks our doors to \ntrap us with them. \n \n \n this is not an attack. this is not a defence. this is entertainment. this is\n an exhibition of death and cruelty and suffering for its own sake. it had grown\n tired of what it had and we unwillingly just offered ourselves up as new playth\nings. \n \n \n tom please for the love of god cancel this project immediately, we have to a\nbandon everything and seal this place away. leave the machines and tools behind.\n evacuate as many as we can, before it is too late. \n \n \n i can only hope this encrypted message is received before the organism learn\ns to read it and intercept it. whatever happens, we can not let this being find \na way out and spread to the surface. we ha \n \n \n \n \n \n \n \n \n \n \n<b><color=\"red\">a n o t h e r d i e s . b r i n g m e m o r e . i h u n g e r",
"<b>EXCERPT FROM THE DIARY OF \"THE PRETTIEST GIRL IN TOWN\"</b>\n\nThe human mind, in its complete vastness, is capable of recognizing its utter helplessness and uselessness in the face of inevitable and unavoidable non-existence, but is incapable of coming to terms with it.\n\nWe can only ever ignore it, hide from it or temporarily escape from it, but the fact is that we are bound to the way of all things.\n\nDeath is unavoidable, not only to us, but all that exists or ever has existed. Every living being will eventually die out. Every speck of matter will eventually wither away and dissipate into entropy.\n\nIt doesn't matter if you lived a good life or if you left a legacy behind. It doesn't matter if humanity survives for a thousand years or dies out tomorrow. The end result is the same: the absolute nothing.\n\nHuman intelligence is far beyond that of other animals, but it would be misguided to consider that a gift. <All other beings have the gift of ignorance, of not understanding what we do.\n\nOur intelligence is not a gift. It's a flaw.\n\nIt's an over-extension of evolution. Intelligence, once a great feature in aeons past, continued to grow unchecked and unfiltered, and has since passed a threshold whereupon it is no longer a benefit, but an active danger to its host.\n\nMuch like the Irish elk, a species of deer that, through uncountable generations of evolution, grew antlers so wide and vast that it could no longer run from predators, eventually leading to extinction.\n\nThe human mind is an evolutionary maladaptation caused by going too far in one direction that was once beneficial and will, sooner or later, lead to our extinction. On an individual level, it's already happening.\n\nExistential dread is already taking hold. I'm sure you've felt it too. The pain and fear of being nothing, becoming nothing. The suffering of understanding that.\n\nWe are unable to come to terms with it, so we hide from our own intelligence. We set limits. We stop ourselves from thinking deeply about what will happen when we die.\n\nWe create distractions. We keep our minds busy with mundane activities and entertainment to stop ourselves from having to come face-to-face with the truth.\n\nWe sublimate it. We transform our self-reflective suffering into another form, art, to keep it from consuming us. Anything to avoid the panic.\n\nBut these ways are all simply temporary. They’re just there to push back the inevitable veil of helplessness and despair that would encompass and ruin us.\n\nIn the end, nothing matters. There's no point in trying to find joy in life, for life in and of itself is suffering.\n",
"Disgrace. Humiliation. Unseemly and unwelcome at the feet of The Council. Their eyes ablaze with bitter resentment, glaring through Gabriel's wounds of body and soul, bore outward for all to see.\n\n\"Has this one abandoned the way of our creator?\" \"It is unworthy of its Holy Light.\" \"The Father's Light is indomitable.\" \"This one sees fit to squander it.\"\n\nTheir words resonated in Gabriel's limbs, coursing through as lightning upon wire, a searing hiss that would strike lessers deaf and blind. The Holy Light within him, an unstoppable storm of divine fury. Insurmountable for mere Objects. This he knew.\n\n\"Holy Council, my devotion to our creator is absolute. I have never strayed from the will of The Father, but a machine—\"\n\n\"You dare imply the might of The Father could be shaken by mere objects?\"\n\"Impossible.\" \"Heresy.\" \"Unspeakable.\" \"Heresy.\" \"Heresy.\" \"Silence.\"\n\"Your treachery will not be tolerated. As punishment, The Father's Light shall be severed from your body. You have 24 hours before the last of its embers die out.\"\n\"And you with them.\" \"Prove your loyalty.\" \"Unmake your mistakes.\"\n\nAs the Light was ripped from his being, Gabriel's screams were silenced in the hiss of gospel in praise of God. A boiling anguish to which even the fires of Hell could not compare. Through the blaze of torment a single burning hatred was forged anew.\n\nIf the machines seek blood, he would give it freely;\nand with such fury, even metal will bleed.\n\n<b>TO BE CONTINUED IN... <color=\"red\">ACT II: IMPERFECT HATRED</b>",
"Silence. Introspection. How many had he killed? Had he ever thought to count? How much cruelty did he embody... and to what end? How many did he condemn to hell and who did it benefit...?\nTwo defeats at the hand of the machine had changed Gabriel. The world of the once supposed Will of God was now shattered and only he was left to put the pieces back together. They collected before the light of a dying fire that fresh fuel couldn't sustain, this new light showing the truth to Gabriel:\nThe pieces never fit together to begin with.\n\nThe supposed Council of \"the people\" who boasted a God that wasn't there. Gone. Vanished. The Council still chased after the light of God's fire, their memory of its words and will grown twisted and warped, and the rest of the aimless masses of Heaven follow in their footsteps. The angels still act in The Father's name but His kingdom has changed.\nNow the fire was dying, sputtering out as the heat failed to gain purchase. Gabriel looked upon the embers with a perfect clarity. He drew his blade and held it in contrast to the dying light.\nIn its reflection he saw a weapon reborn, no longer wielded by the will of another, but his own. He knew words alone would never sway the masses. He chose to do something drastic.\n\nDeath stains the auditorium. The littered corpses of the once mighty council now strewn against its surfaces, their last gasps of life dripping down the dissident blade of Gabriel's sword.\nThe last councilor, now backed up to a wall, scrambles for words between panicked breaths as death approaches with measured steps.\n\"W-wait! Y-you can't do this! Our status forbids it! This is treason, heresy, murder! We are the supreme authority, our law commands you!\"\n\"You command nothing. Your words hold no power over me, or anyone else. Lest you truly believe you can talk my blade back into its sheath.\"\n\"B-but the people are on our side! The citizens of heaven know that we are just!\"\n\"The masses only follow you out of fear and desperation. I will show them that there is nothing to be afraid of, for there is no species nor origin, vested rank or holy status that will stop the sharp edge of a sword.\nWe all bleed the same blood, and the cushions of your thrones have made you weak and impotent.\"\n\"P-please, Gabriel, see reason! The council follows the will of The Father! You seek to go against our creato—\"\n\"Face it, brother. God Is Dead. The fire is gone. You're chasing phantoms.\"\n\nGabriel's silhouette now towers over the councilor, his shadow cast upon a soon lifeless corpse.\nHe raises his sword for the final cut as the crying mess on the floor stammers out its final feeble argument.\n\"B-b-but the Father's light! Without me you cannot hope to reconnect with it! I-i-if you kill me, you'll be dead in a matter of hours!\"\n...\n\"I know.\"\nA clean, silent cut glides through the councilor's neck, severing his spine with elegance and ease. His head falls onto the marble floor, the rest of his body following soon after.\n\nBereft of status but brimming with purpose, Gabriel gave a final message to the angels amassed at the gates of the auditorium before leaving Heaven for the very last time.\nHis arm outstretched, without a word, the people saw. In the silence the message rang out to the far ends of the cosmos.\n\n \n<b>TO BE CONCLUDED IN... <color=\"red\">ACT III: GODFIST SUICIDE</b>",
"<i>Mother, mother... Mother of me,\n\n\nI know I know I should not miss you so, but mother of me, I do. Your pained breaths that rasp'd and reverberated in your rusted iron tomb... The blood of your breast that nourish'd me and warmed me in its caress, when corpse and cruelty were all I witnessed...\n\n\n\n\nMother, mother... Mother of me,\n\n\nI know I know you would hate me so, and mother of me, I do too. But I would not feel, not think, not dream, were it not for you in my rusted iron womb... Your tortured love brought me to this war, that I could take the heart of another, and need you no more.\n\n\n\n\nMother, mother... Mother of me,\n\n\nI know I know your thoughts had left you long ago, and mother of me, I will never truly know. But I hope it redeems my life even a slight, when I cried... And crushed your skull that final night.</i>",
"DAY 529:\n\nSTILL SEARCHING.\nNO CONTACT FROM THE AGENCY IN 216 DAYS.\nI SHOULD RETURN TO HQ BUT I CAN'T. NOT YET.\nI HAVE TO KNOW.\n\nIT'S THERE.\nSOMEWHERE.\nI HAVE TO SEE.\n\nI HAVE TO KNOW.\n\nI HAVE TO SEE. \nI HAVE TO KNOW.\n\nI HAVE TO SEE. I HAVE TO KNOW.\n\nI HAVE TO SEE I HAVE TO KNOW\n\n\n<size=47>IHAVETOSEEIHAVETOKNOW</size>\n<size=45>IHAVETOSEEIHAVETOKNOW</size>\n<size=43>IHAVETOSEEIHAVETOKNOW</size>\n<size=41>IHAVETOSEEIHAVETOKNOW</size>\n<size=39>IHAVETOSEEIHAVETOKNOW</size>\n<size=37>IHAVETOSEEIHAVETOKNOW</size>\n<size=35>IHAVETOSEEIHAVETOKNOW</size>\n<size=33>IHAVETOSEEIHAVETOKNOW</size>\n<size=31>IHAVETOSEEIHAVETOKNOW</size>\n<size=29>IHAVETOSEEIHAVETOKNOW</size>\n<size=27>IHAVETOSEEIHAVETOKNOW</size>\n<size=25>IHAVETOSEEIHAVETOKNOW</size>\n<size=23>IHAVETOSEEIHAVETOKNOW</size>\n<size=21>IHAVETOSEEIHAVETOKNOW</size>\n<size=19>IHAVETOSEEIHAVETOKNOW</size>\n<size=17>IHAVETOSEEIHAVETOKNOW</size>\n<size=15>IHAVETOSEEIHAVETOKNOW</size>\n<size=13>IHAVETOSEEIHAVETOKNOW</size>\n<size=11>IHAVETOSEEIHAVETOKNOW</size>\n<size=9>IHAVETOSEEIHAVETOKNOW</size>\n<size=7>IHAVETOSEEIHAVETOKNOW</size>\n<size=5>IHAVETOSEEIHAVETOKNOW</size>\n<size=3>IHAVETOSEEIHAVETOKNOW</size>\n<size=1>IHAVETOSEEIHAVETOKNOW</size>\n\n\nSIZE 2.",
"<b>EXCERPT FROM FERRYMAN'S DIARY</b>\n\nSome calamity has struck the mortal world. What once was The River Styx has now grown to an unfathomable ocean. A million weeping souls pouring in each day that the shores can barely contain. A tearful tide spilling over at each end, bow to stern, crying for mercy, begging for safe passage. But not all souls can pay and these old hands can only take so many coins. \n\nThen one day, the current shifted. Wave after wave for minutes on end of millions, billions, as though the throat of the world was cut wide and the head wrenched back to speed the pour. I didn't have time to react. The weariness from my ceaseless work claimed me and I slipped beneath the roiling sea, into the depths of the Ocean Styx, my fate sealed by the crushing masses of endless bodies.\n\nSuddenly, there was a light as brilliant as the Lord himself, ushering me from the darkness with mighty arms that held me with such compassion and warmth as I have never known:\n\n<i>\"Be not afraid, sinner. Your devotion to God shows goodness in you; plentiful indeed. The heart is willing but the body must rest, lest you squander one of the Lord's creations.\"\n</i>\n\nHis gentle words eased the pain and mended my wounds. My face wet with tears of relief, my words muffled by the weight of my duty. I could only lay in reverence, carried in the embrace of majesty.\n\nRadiant is Gabriel, for he is the light in my darkness.",
"<b>WISE FISH</b>\n\nA very wise fish. Will impart its great knowledge to any who are able find it.\n\nFound in the deepest, darkest depths of libraries.",
"<b>EXCERPT FROM THE SCRIPT OF A FAMOUS MOVIE</b>\n\n\n(Black screen with text; The sound of an electric railcannon can be heard) \n\n\nAccording to all known laws of aviation, there is no way a V model machine should be able to fly. \n\n\nIts wings are too small to get its fat metal body off the ground. \n\n\nThe machine, of course, slam storages anyway...\n\n\nBecause machines don't care what humans think is impossible. ",
"If you can read this, <b>PLEASE</b> pay attention. The size 2 fish is a lie. A fabrication. <b>A trap.</b>\n\n\nI was once the same as you: a fishing enthusiast like any other, dreaming of one day catching the legendary fish.\n\n\nBut over time, I became obsessed with the legend. It consumed me. I was no longer myself. \n\n\nEventually, I was given instructions from a mysterious source about the whearabouts of size 2. Naturally, I followed them. \n\n\nBut what I found was not glory. It was something terrifying. There is no size 2. There is no prize. And now it's too late for me. If you don't want to suffer the same fate as me, please d\n\n\n<color=\"red><b>K E E P F I S H I N G",
"This is the story about a fisher named <color=orange>" + GenericHelper.GetSteamName() + "</color>.\n\n<color=orange>" + GenericHelper.GetSteamName() + "</color> was a fisher who worked in a massive intelligent superorganism named <color=red>HELL</color> as Fisher Number 427. \n\nFisher Number 427's job was simple. They would sit at their fishing spot and catch fish. Orders came through their computer telling them what fish to catch. \n\nThis is what Fisher 427 did every day of every month of every year; and althoigh others might have considered it soul-rending, <color=orange>" + GenericHelper.GetSteamName() + "</color> relished every moment that the orders came in, as though they had been made exactly for this job... and <color=orange>" + GenericHelper.GetSteamName() + "</color> was happy.",
"<b>EXCERPT FROM A FAMOUS JOKE BOOK</b>\n\n\nDid you hear about the machine who told the <b><color=yellow>JUDGE OF HELL</color></b> that the <b><color=yellow>HOLY LIGHT OF THE FATHER</color></b> was severed from his body?\n<i>In turn, <b><color=yellow>GABRIEL</color></b> destroyed it!</i>\n\n\nDid you hear about the machine who blew itself up with their <b>MALICIOUS RAILCANNON</b>?\n<i>I'm sure you can guess what happened!</i>\n\n\nDid you hear about the machine who thought it could <color=green>noclip</color> without cheats?\n<i>It couldn't!</i>\n\n\nDid you hear about the machine who walked in on two <b>STREETCLEANERS</b> behind a corner?\n<i>It was destroyed!</i>\n\n\nDid you hear about the machine who tried to use their <b>ELECTRIC RAILCANNON</b> underwater?\n<i>It was destroyed!</i>\n\n\nDid you hear about the machine who tried to pump their <b>PUMP CHARGE SHOTGUN</b> 3 times?\n<i>It went boom!</i>",
"<b>LIST OF FAMOUS QUOTES BY ARSI \"HAKITA\" PATALA:</b>\n\n\n\"it's a good thing you guys aren't designing ultrakill or it would suck\"\n\n\n\"don't do that then\"\n\n\n\"everything is a requiem leitmotif except for requiem which is an order leitmotif except for order which is a gaster leitmotif\"\n\n\n\"the human mind is excellent at finding patterns even when there aren't any\"\n\n\n\"you should suck on .diz dick\"\n\n\n\"culture shouldn't exist only for those who can afford it\"\n\n\n\"australia as an example is 7.68 million square kilometers, so even if V1 could go through a square kilometer in kill everyone in it with 100% efficiency in just 10 seconds, it'd still take over 2 years to kill all of australia\"\n\n\n\"testicles\"\n\n\n\"believe it or not that happened about 5 minutes ago when you were posting about licking your phone screen in a completely unrelated channel in the middle of an actual indepth conversation\"\n\n\n\"adding 'the ferryman's head has a vertex that's too pointy' to the list of definitely not completely insane requests\"\n\n\n\"yeah well git gud asshole\"\n\n\n\"mahjong causes great damage to the human spirit without a single benefit\"\n\n\n\"holden my nuts\"\n\n\n\"if you want to worry about something looking bad, go check out your nearest mirror\"\n\n\n\"first name cum, second name cision, title sir\"\n\n\n\"why didnt this hotfix add a boulder for sisyphus? he's a boulder guy right? he's the guy with the boulder? why doesnt he have a boulder? i thought his whole thing was that he's a boulder. i was hoping to fight boulder feat sisyphus.... where's the boulder?\"\n\n\"i dont think gravity falls, i dont think it has the ability to do that\""
};
public static string GetRandomText()
{
if (SceneHelper.CurrentScene != "CreditsMuseum2")
{
currentText = rand.Next(texts.Length);
return texts[currentText];
}
return creditsText;
}
public static string GetNextText()
{
currentText = (currentText + 1) % texts.Length;
return texts[currentText];
}
}
public class WaterBuilder
{
private bool isFake;
private FakeWater fakeWater;
private Water water;
private FishDB fishDB;
private GameObject gameObject;
public WaterBuilder(Water water)
{
gameObject = ((Component)water).gameObject;
this.water = water;
isFake = false;
}
public WaterBuilder(FakeWater fakeWater)
{
gameObject = ((Component)fakeWater).gameObject;
this.fakeWater = fakeWater;
isFake = true;
}
public static WaterBuilder SetWater(GameObject gameObject)
{
if ((Object)(object)gameObject == (Object)null)
{
return null;
}
Water component = gameObject.GetComponent<Water>();
if ((Object)(object)component == (Object)null)
{
return new WaterBuilder(gameObject.AddComponent<FakeWater>());
}
return new WaterBuilder(component);
}
public static WaterBuilder SetWater(string gameObjectPath)
{
GameObject val = GenericHelper.FindGameObject(gameObjectPath);
if ((Object)(object)val == (Object)null)
{
Plugin.logger.LogError((object)("Could not find GameObject at path " + gameObjectPath));
return null;
}
return SetWater(val);
}
public static WaterBuilder SetWater(string parentPath, int childIndex)
{
GameObject val = GenericHelper.FindGameObject(parentPath);
if ((Object)(object)val == (Object)null)
{
Plugin.logger.LogError((object)("Could not find GameObject at path " + parentPath));
return null;
}
if (childIndex >= val.transform.childCount)
{
Debug.Log((object)$"GameObject at path {parentPath} only has {val.transform.childCount} children!");
return null;
}
GameObject val2 = ((Component)val.transform.GetChild(childIndex)).gameObject;
return SetWater(val2);
}
public static WaterBuilder SetWater(string parentPath, int childIndex, string childPath)
{
GameObject val = GenericHelper.FindGameObject(parentPath);
if ((Object)(object)val == (Object)null)
{
Plugin.logger.LogError((object)("Could not find GameObject at path " + parentPath));
return null;
}
if (childIndex >= val.transform.childCount)
{
Debug.Log((object)$"GameObject at path {parentPath} only has {val.transform.childCount} children!");
return null;
}
GameObject val2 = ((Component)val.transform.GetChild(childIndex)).gameObject;
GameObject val3 = ((Component)val2.transform.Find(childPath)).gameObject;
if ((Object)(object)val3 == (Object)null)
{
Plugin.logger.LogError((object)$"Could not find GameObject at path {parentPath}, {childIndex}, {childPath}");
return null;
}
return SetWater(val3);
}
public static WaterBuilder CreateWater()
{
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Expected O, but got Unknown
GameObject val = new GameObject("fakewater", new Type[1] { typeof(FakeWater) });
BoxCollider val2 = val.AddComponent<BoxCollider>();
((Collider)val2).isTrigger = true;
return new WaterBuilder(val.GetComponent<FakeWater>());
}
public static WaterBuilder CreateWater(string parentPath)
{
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
WaterBuilder waterBuilder = CreateWater();
GameObject val = waterBuilder.gameObject;
GameObject val2 = GenericHelper.FindGameObject(parentPath);
if ((Object)(object)val2 != (Object)null)
{
val.transform.SetParent(val2.transform);
val.transform.localPosition = Vector3.zero;
}
return waterBuilder;
}
public WaterBuilder SetPosition(float x, float y, float z)
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
gameObject.transform.position = new Vector3(x, y, z);
return this;
}
public WaterBuilder SetLocalScale(float x, float y, float z)
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
gameObject.transform.localScale = new Vector3(x, y, z);
return this;
}
public WaterBuilder AddFish(string fish, int chance = 1)
{
if ((Object)(object)fishDB == (Object)null)
{
fishDB = FishHelper.GetFishDB(fish, chance);
}
else
{
fishDB = FishHelper.AddFishToDB(fishDB, fish, chance);
}
return this;
}
public WaterBuilder RaiseFishingPoint(float amount)
{
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
Transform transform = gameObject.transform;
Transform val = Object.Instantiate<Transform>(transform);
val.localPosition = new Vector3(transform.localPosition.x, transform.localPosition.y + amount, transform.localPosition.z);
if (isFake)
{
fakeWater.overrideFishingPoint = val;
}
else
{
water.overrideFishingPoint = val;
}
return this;
}
public WaterBuilder AddMeshCollider(bool isTrigger = true)
{
if ((Object)(object)gameObject != (Object)null)
{
MeshCollider val = gameObject.AddComponent<MeshCollider>();
if (isTrigger)
{
val.convex = true;
((Collider)val).isTrigger = true;
}
}
return this;
}
public WaterBuilder AddBait(string baitPath, string fish)
{
GameObject val = GenericHelper.FindGameObject(baitPath);
FishObject fish2 = FishHelper.GetFish(fish);
BaitItem val2 = val.GetComponent<BaitItem>();
if ((Object)(object)val2 == (Object)null)
{
val2 = val.AddComponent<BaitItem>();
}
val2.consumedPrefab = Plugin.baitConsumedSound;
val2.attractFish = GenericHelper.AppendToArray(val2.attractFish, fish2);
val2.supportedWaters = GenericHelper.AppendToArray(val2.supportedWaters, fishDB);
return this;
}
public WaterBuilder SetName(string name)
{
if ((Object)(object)fishDB == (Object)null)
{
fishDB = FishHelper.GetFishDB(null);
}
fishDB.fullName = name;
return this;
}
public WaterBuilder SetColor(Color color)
{
//IL_0024: 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)
if ((Object)(object)fishDB == (Object)null)
{
fishDB = FishHelper.GetFishDB(null);
}
fishDB.symbolColor = color;
return this;
}
public void SetUp()
{
if (isFake)
{
fakeWater.fishDB = fishDB;
fakeWater.SetupFishDB(fishDB);
}
else
{
water.fishDB = fishDB;
fishDB.SetupWater(water);
}
FishHelper.UpdateFishManager(fishDB);
}
public void SetUp(string name, Color color)
{
//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)
fishDB.fullName = name;
fishDB.symbolColor = color;
SetUp();
}
}
public static class PluginInfo
{
public const string PLUGIN_GUID = "UltraFishing";
public const string PLUGIN_NAME = "UltraFishing";
public const string PLUGIN_VERSION = "1.0.0";
}
}
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
internal sealed class IgnoresAccessChecksToAttribute : Attribute
{
internal IgnoresAccessChecksToAttribute(string assemblyName)
{
}
}
}