Decompiled source of Ribbitdown Playtest v0.1.11

plugins/Ribbitdown/RibbitDown.dll

Decompiled 5 days ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Core.Logging.Interpolation;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using ChainedPuzzles;
using GTFO.API;
using GameData;
using HarmonyLib;
using LevelGeneration;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("RibbitDown")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("RibbitDown")]
[assembly: AssemblyTitle("RibbitDown")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace Weapons
{
	[BepInPlugin("com.ribbit.ribbitdown", "Ribbitdown", "1.0.0")]
	public class Weapons : BasePlugin
	{
		private ConfigEntry<bool>? PurrsonaSpear;

		private ConfigEntry<bool>? ZevKatana;

		private ConfigEntry<bool>? RibbitDevGun;

		public override void Load()
		{
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Expected O, but got Unknown
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Expected O, but got Unknown
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Expected O, but got Unknown
			PurrsonaSpear = ((BasePlugin)this).Config.Bind<bool>("Easter Egg", "PurrsonaShotgunSentry", true, "LMAO");
			ZevKatana = ((BasePlugin)this).Config.Bind<bool>("Easter Egg", "ZevKatana", true, "Wake the fuck up samurai");
			RibbitDevGun = ((BasePlugin)this).Config.Bind<bool>("Easter Egg", "RibbitDevGun", true, "Dev Mode: Enabled");
			bool flag = default(bool);
			if (PurrsonaSpear.Value)
			{
				ManualLogSource log = ((BasePlugin)this).Log;
				BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(14, 0, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Funny For Sona");
				}
				log.LogInfo(val);
				EventAPI.OnManagersSetup += PurrsonaBadSpear;
			}
			if (ZevKatana.Value)
			{
				ManualLogSource log2 = ((BasePlugin)this).Log;
				BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(48, 0, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Wake the fuck up samurai, we have a city to burn");
				}
				log2.LogInfo(val);
				EventAPI.OnManagersSetup += KatanaForZev;
			}
			if (RibbitDevGun.Value)
			{
				ManualLogSource log3 = ((BasePlugin)this).Log;
				BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(17, 0, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Dev Mode: Enabled");
				}
				log3.LogInfo(val);
				EventAPI.OnManagersSetup += RibbitDev;
			}
		}

		private static void PurrsonaBadSpear()
		{
			if (SteamManager.LocalPlayerID == 76561199245163649L)
			{
				((GameDataBlockBase<PlayerOfflineGearDataBlock>)(object)GameDataBlockBase<PlayerOfflineGearDataBlock>.GetBlock(70u)).internalEnabled = false;
			}
			else
			{
				((GameDataBlockBase<PlayerOfflineGearDataBlock>)(object)GameDataBlockBase<PlayerOfflineGearDataBlock>.GetBlock(70u)).internalEnabled = true;
			}
		}

		private static void KatanaForZev()
		{
			if (SteamManager.LocalPlayerID == 76561199103241805L)
			{
				((GameDataBlockBase<PlayerOfflineGearDataBlock>)(object)GameDataBlockBase<PlayerOfflineGearDataBlock>.GetBlock(9028u)).internalEnabled = false;
			}
			else
			{
				((GameDataBlockBase<PlayerOfflineGearDataBlock>)(object)GameDataBlockBase<PlayerOfflineGearDataBlock>.GetBlock(9028u)).internalEnabled = false;
			}
		}

		private static void RibbitDev()
		{
			if (SteamManager.LocalPlayerID == 76561199239663214L)
			{
				((GameDataBlockBase<PlayerOfflineGearDataBlock>)(object)GameDataBlockBase<PlayerOfflineGearDataBlock>.GetBlock(9026u)).internalEnabled = false;
				((GameDataBlockBase<PlayerOfflineGearDataBlock>)(object)GameDataBlockBase<PlayerOfflineGearDataBlock>.GetBlock(9027u)).internalEnabled = false;
				((GameDataBlockBase<PlayerOfflineGearDataBlock>)(object)GameDataBlockBase<PlayerOfflineGearDataBlock>.GetBlock(9028u)).internalEnabled = false;
			}
			else
			{
				((GameDataBlockBase<PlayerOfflineGearDataBlock>)(object)GameDataBlockBase<PlayerOfflineGearDataBlock>.GetBlock(9026u)).internalEnabled = false;
				((GameDataBlockBase<PlayerOfflineGearDataBlock>)(object)GameDataBlockBase<PlayerOfflineGearDataBlock>.GetBlock(9027u)).internalEnabled = false;
				((GameDataBlockBase<PlayerOfflineGearDataBlock>)(object)GameDataBlockBase<PlayerOfflineGearDataBlock>.GetBlock(9028u)).internalEnabled = false;
			}
		}
	}
}
namespace SustainScanPentagonFix
{
	[BepInPlugin("Ribbit.SustainScanPentagonFix", "SustainScanPentagonFix", "1.0.0")]
	public class Plugin : BasePlugin
	{
		public override void Load()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			new Harmony("SustainScanFix").PatchAll();
			EventAPI.OnExpeditionStarted += SustainScanFix;
		}

		public static void SustainScanFix()
		{
			int num = 0;
			foreach (CP_Bioscan_Graphics componentsInChild in ((Component)Builder.CurrentFloor).GetComponentsInChildren<CP_Bioscan_Graphics>(true))
			{
				foreach (Transform componentsInChild2 in ((Component)componentsInChild).GetComponentsInChildren<Transform>(true))
				{
					if (((Object)componentsInChild2).name.ToLower().Contains("zone") && (Object)(object)((Component)componentsInChild2).GetComponent<MeshRenderer>() != (Object)null && ((Object)((Renderer)((Component)componentsInChild2).GetComponent<MeshRenderer>()).material).name.ToLower().Contains("pentagon"))
					{
						num++;
						((Renderer)((Component)componentsInChild2).GetComponent<MeshRenderer>()).material.SetTexture("_Mask", (Texture)(object)Texture2D.whiteTexture);
					}
				}
			}
		}
	}
}
namespace NegativeSnatcherBoxAltitude
{
	[BepInPlugin("Ribbit.NegativeSnatcherBoxAltitude", "NegativeSnatcherBoxAltitude", "1.0.0")]
	public class Plugin : BasePlugin
	{
		[HarmonyPatch]
		private class Dbgpatches
		{
			[HarmonyPatch(typeof(LG_Floor), "CreateDimension")]
			[HarmonyPrefix]
			private static void MoveDimensionPrefix(eDimensionIndex dimensionIndex, bool arenaDimension, ref Vector3 position)
			{
				//IL_0039: Unknown result type (might be due to invalid IL or missing references)
				//IL_003c: Invalid comparison between Unknown and I4
				//IL_0011: Unknown result type (might be due to invalid IL or missing references)
				//IL_0017: Expected O, but got Unknown
				//IL_0044: Unknown result type (might be due to invalid IL or missing references)
				//IL_0047: Invalid comparison between Unknown and I4
				//IL_0026: Unknown result type (might be due to invalid IL or missing references)
				//IL_002c: Expected I4, but got Unknown
				//IL_004f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0052: Invalid comparison between Unknown and I4
				//IL_005a: Unknown result type (might be due to invalid IL or missing references)
				//IL_005d: Invalid comparison between Unknown and I4
				//IL_0073: Unknown result type (might be due to invalid IL or missing references)
				//IL_0078: Unknown result type (might be due to invalid IL or missing references)
				if (!arenaDimension)
				{
					return;
				}
				ManualLogSource l = L;
				if (l != null)
				{
					bool flag = default(bool);
					BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(22, 1, ref flag);
					if (flag)
					{
						((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Snatcher Box Found At ");
						((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>((int)dimensionIndex);
					}
					l.LogInfo(val);
				}
				float num = 0f;
				if ((int)dimensionIndex == 20)
				{
					num = -500f;
				}
				if ((int)dimensionIndex == 19)
				{
					num = -460f;
				}
				if ((int)dimensionIndex == 18)
				{
					num = -420f;
				}
				if ((int)dimensionIndex == 17)
				{
					num = -380f;
				}
				position = new Vector3(position.x, num, position.z);
			}
		}

		public static ManualLogSource? L;

		public override void Load()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			L = ((BasePlugin)this).Log;
			new Harmony("DimBeGone").PatchAll();
		}
	}
}