Decompiled source of CatInfo v2.4.1

CatInfo.dll

Decompiled 8 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using Microsoft.CodeAnalysis;
using TMPro;
using TabInfo.Utils;
using UnboundLib;
using UnboundLib.Utils.UI;
using UnityEngine;
using UnityEngine.Events;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("CatInfo")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+bcfc1a73b7b183577c6dd00b4a689099b42d1015")]
[assembly: AssemblyProduct("CatInfo")]
[assembly: AssemblyTitle("CatInfo")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.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]
	[Microsoft.CodeAnalysis.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 CatInfo
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("Com.Cat.Info", "CatInfo", "2.4.1")]
	[BepInProcess("Rounds.exe")]
	public class CatInfo : BaseUnityPlugin
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static UnityAction <>9__15_0;

			public static UnityAction<bool> <>9__16_0;

			internal void <Start>b__15_0()
			{
			}

			internal void <NewGUI>b__16_0(bool value)
			{
				AllwaysShowStats = value;
				CycleArt();
			}
		}

		public const string Version = "2.4.1";

		private const string ModId = "Com.Cat.Info";

		private const string ModName = "CatInfo";

		public const string ModInitials = "Cats";

		private static Color HolyWhiteText = new Color(255f, 255f, 255f, 1f);

		private static Color GreenText = new Color(0.521f, 1f, 0.521f, 1f);

		private static Color RedText = new Color(1f, 0.521f, 0.521f, 1f);

		internal static bool AllwaysShowStats
		{
			get
			{
				return GetBool("AllwaysShowStats");
			}
			set
			{
				SetBool("AllwaysShowStats", value);
			}
		}

		internal static string ConfigKey(string name)
		{
			return "Com.Cat.Info_" + name.ToLower();
		}

		internal static bool GetBool(string name, bool defaultValue = false)
		{
			return PlayerPrefs.GetInt(ConfigKey(name), defaultValue ? 1 : 0) == 1;
		}

		internal static void SetBool(string name, bool value)
		{
			PlayerPrefs.SetInt(ConfigKey(name), value ? 1 : 0);
		}

		private static void CycleArt()
		{
			ArtHandler.instance.NextArt();
			ArtHandler.instance.NextArt();
		}

		private static void CreateSpace(GameObject menu, int size = 45)
		{
			TextMeshProUGUI val = default(TextMeshProUGUI);
			MenuHandler.CreateText(" ", menu, ref val, size, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
		}

		private void Start()
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			TabinfoInterface.Setup();
			Unbound.RegisterClientSideMod("Com.Cat.Info");
			object obj = <>c.<>9__15_0;
			if (obj == null)
			{
				UnityAction val = delegate
				{
				};
				<>c.<>9__15_0 = val;
				obj = (object)val;
			}
			Unbound.RegisterMenu("CatInfo", (UnityAction)obj, (Action<GameObject>)NewGUI, (GameObject)null, false);
			Unbound.RegisterCredits("CatInfo", new string[4] { "Cats Army (CatInfo)", "willuwontu (Creator Of TabInfo) - Helped With Code", "Root[Tess] - Helped With Code", "Willis - Helped With Code" }, new string[4] { "CatInfo Thunderstore", "TabInfo Thunderstore", "Root Thunderstore", "Willis Thunderstore" }, new string[4] { "https://rounds.thunderstore.io/package/CatsArmy/CatInfo/", "https://rounds.thunderstore.io/package/willuwontu/TabInfo/", "https://rounds.thunderstore.io/package/Root/", "https://rounds.thunderstore.io/package/willis81808/" });
		}

		private static void NewGUI(GameObject menu)
		{
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			TextMeshProUGUI val = default(TextMeshProUGUI);
			MenuHandler.CreateText("Toggle CatInfo Stats", menu, ref val, 90, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
			CreateSpace(menu);
			MenuHandler.CreateToggle(AllwaysShowStats, "Allways Show Stats", menu, (UnityAction<bool>)delegate(bool value)
			{
				AllwaysShowStats = value;
				CycleArt();
			}, 50, false, (Color?)(AllwaysShowStats ? GreenText : RedText), (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
		}
	}
	public class TabinfoInterface
	{
		public static bool IsDecayFixed;

		public static bool DecayDamage(Player p)
		{
			if (IsDecayFixed)
			{
				return p.data.stats.secondsToTakeDamageOver > 0f;
			}
			return p.data.stats.secondsToTakeDamageOver != 0f;
		}

		public static void Setup()
		{
			bool ASS = CatInfo.AllwaysShowStats;
			StatCategory basicStats = TabInfoManager.basicStats;
			TabInfoManager.RegisterStat(basicStats, "Echo Blocks", (Func<Player, bool>)((Player p) => ASS || p.data.block.additionalBlocks > 0), (Func<Player, string>)((Player p) => $"{p.data.block.additionalBlocks:F0}"));
			TabInfoManager.RegisterStat(basicStats, "Attack Speed", (Func<Player, bool>)((Player p) => true), (Func<Player, string>)((Player p) => $"{p.data.weaponHandler.gun.attackSpeed:F2}"));
			TabInfoManager.RegisterStat(basicStats, "Life Steal", (Func<Player, bool>)((Player p) => ASS || p.data.stats.lifeSteal != 0f), (Func<Player, string>)((Player p) => $"{p.data.stats.lifeSteal:F2}"));
			TabInfoManager.RegisterStat(basicStats, "Bounces", (Func<Player, bool>)((Player p) => ASS || p.data.weaponHandler.gun.reflects != 0), (Func<Player, string>)((Player p) => $"{p.data.weaponHandler.gun.reflects:F0}"));
			TabInfoManager.RegisterStat(basicStats, "Bursts", (Func<Player, bool>)((Player p) => ASS || p.data.weaponHandler.gun.bursts > 1), (Func<Player, string>)((Player p) => $"{p.data.weaponHandler.gun.bursts - 2:F0}"));
			TabInfoManager.RegisterStat(basicStats, "Bullets", (Func<Player, bool>)((Player p) => ASS || p.data.weaponHandler.gun.numberOfProjectiles > 1), (Func<Player, string>)((Player p) => $"{p.data.weaponHandler.gun.numberOfProjectiles:F0}"));
			TabInfoManager.RegisterStat(basicStats, "Bounce Damage", (Func<Player, bool>)((Player p) => ASS || (p.data.weaponHandler.gun.reflects > 0 && p.data.weaponHandler.gun.dmgMOnBounce != 1f)), (Func<Player, string>)((Player p) => $"{(p.data.weaponHandler.gun.dmgMOnBounce - 1f) * 100f:F0}%"));
			TabInfoManager.RegisterStat(basicStats, "Bounce Speed", (Func<Player, bool>)((Player p) => ASS || (p.data.weaponHandler.gun.reflects > 0 && p.data.weaponHandler.gun.speedMOnBounce != 1f)), (Func<Player, string>)((Player p) => $"{(p.data.weaponHandler.gun.speedMOnBounce - 1f) * 100f:F0}%"));
			StatCategory val = TabInfoManager.RegisterCategory("Useful Stats", 4);
			TabInfoManager.RegisterStat(val, "Unblockable", (Func<Player, bool>)((Player p) => ASS || p.data.weaponHandler.gun.unblockable), (Func<Player, string>)((Player p) => "Ignores Blocks"));
			TabInfoManager.RegisterStat(val, "Ghost Bullets", (Func<Player, bool>)((Player p) => ASS || p.data.weaponHandler.gun.ignoreWalls), (Func<Player, string>)((Player p) => "Ignores Walls"));
			TabInfoManager.RegisterStat(val, "Chargable Gun", (Func<Player, bool>)((Player p) => ASS || p.data.weaponHandler.gun.useCharge), (Func<Player, string>)((Player p) => "Plasma Charge"));
			TabInfoManager.RegisterStat(val, "Demonic Gun", (Func<Player, bool>)((Player p) => ASS || p.data.weaponHandler.gun.dontAllowAutoFire), (Func<Player, string>)((Player p) => "Cant Spray"));
			StatCategory val2 = TabInfoManager.RegisterCategory("Advanced Character Stats", 2);
			TabInfoManager.RegisterStat(val2, "Phoenix Revives", (Func<Player, bool>)((Player p) => ASS || p.data.stats.respawns > 0), (Func<Player, string>)((Player p) => $"{p.data.stats.respawns:F0}"));
			TabInfoManager.RegisterStat(val2, "Healing On Block", (Func<Player, bool>)((Player p) => p.data.block.healing != 0f), (Func<Player, string>)((Player p) => $"{p.data.block.healing:F0}HP"));
			TabInfoManager.RegisterStat(val2, "Decay", (Func<Player, bool>)((Player p) => ASS || DecayDamage(p)), (Func<Player, string>)((Player p) => $"{p.data.stats.secondsToTakeDamageOver:F2}"));
			TabInfoManager.RegisterStat(val2, "Regeneration", (Func<Player, bool>)((Player p) => ASS || p.data.healthHandler.regeneration > 0f), (Func<Player, string>)((Player p) => $"{p.data.healthHandler.regeneration:F2}HP/s"));
			TabInfoManager.RegisterStat(val2, "Size", (Func<Player, bool>)((Player p) => ASS || p.data.stats.sizeMultiplier != 1f), (Func<Player, string>)((Player p) => $"{p.data.stats.sizeMultiplier:F2}"));
			TabInfoManager.RegisterStat(val2, "Jumps", (Func<Player, bool>)((Player p) => ASS || p.data.stats.numberOfJumps > 1), (Func<Player, string>)((Player p) => $"{p.data.stats.numberOfJumps:F0}"));
			TabInfoManager.RegisterStat(val2, "Jump Height", (Func<Player, bool>)((Player p) => ASS || p.data.stats.jump != 1f), (Func<Player, string>)((Player p) => $"{p.data.stats.jump:F2}"));
			TabInfoManager.RegisterStat(val2, "Gravity", (Func<Player, bool>)((Player p) => ASS || p.data.stats.gravity != 1f), (Func<Player, string>)((Player p) => $"{p.data.stats.gravity:F2}"));
			StatCategory val3 = TabInfoManager.RegisterCategory("Advanced Gun Stats", 3);
			TabInfoManager.RegisterStat(val3, "%Health Culling", (Func<Player, bool>)((Player p) => ASS || p.data.weaponHandler.gun.percentageDamage > 0f), (Func<Player, string>)((Player p) => $"{p.data.weaponHandler.gun.percentageDamage * 100f:F1}%"));
			TabInfoManager.RegisterStat(val3, "Bullet Range", (Func<Player, bool>)((Player p) => ASS || p.data.weaponHandler.gun.destroyBulletAfter > 0f), (Func<Player, string>)((Player p) => $"{p.data.weaponHandler.gun.destroyBulletAfter:F2}"));
			TabInfoManager.RegisterStat(val3, "Bullet Speed", (Func<Player, bool>)((Player p) => ASS || p.data.weaponHandler.gun.projectileSpeed != 1f), (Func<Player, string>)((Player p) => $"{p.data.weaponHandler.gun.projectileSpeed:F2}"));
			TabInfoManager.RegisterStat(val3, "Bullet Size", (Func<Player, bool>)((Player p) => ASS || p.data.weaponHandler.gun.size > 0f), (Func<Player, string>)((Player p) => $"{p.data.weaponHandler.gun.size:F2}"));
			TabInfoManager.RegisterStat(val3, "Projectile Size", (Func<Player, bool>)((Player p) => ASS || p.data.weaponHandler.gun.projectileSize > 0f), (Func<Player, string>)((Player p) => $"{p.data.weaponHandler.gun.projectileSize:F2}"));
			TabInfoManager.RegisterStat(val3, "Projectile Time Scale", (Func<Player, bool>)((Player p) => ASS || p.data.weaponHandler.gun.projectielSimulatonSpeed != 1f), (Func<Player, string>)((Player p) => $"{p.data.weaponHandler.gun.projectielSimulatonSpeed:F2}"));
			TabInfoManager.RegisterStat(val3, "Damage Growth", (Func<Player, bool>)((Player p) => ASS || p.data.weaponHandler.gun.damageAfterDistanceMultiplier != 1f), (Func<Player, string>)((Player p) => $"{p.data.weaponHandler.gun.damageAfterDistanceMultiplier:F2}"));
			TabInfoManager.RegisterStat(val3, "Gun Spread", (Func<Player, bool>)((Player p) => ASS || p.data.weaponHandler.gun.spread != 0f), (Func<Player, string>)((Player p) => $"{p.data.weaponHandler.gun.spread:F2}"));
			TabInfoManager.RegisterStat(val3, "Even Gun Spread", (Func<Player, bool>)((Player p) => ASS || p.data.weaponHandler.gun.evenSpread > 0f), (Func<Player, string>)((Player p) => $"{p.data.weaponHandler.gun.evenSpread:F2}"));
			TabInfoManager.RegisterStat(val3, "Bullet Drag", (Func<Player, bool>)((Player p) => ASS || p.data.weaponHandler.gun.drag > 0f), (Func<Player, string>)((Player p) => $"{p.data.weaponHandler.gun.drag:F2}"));
			TabInfoManager.RegisterStat(val3, "Cold Bullets", (Func<Player, bool>)((Player p) => ASS || p.data.weaponHandler.gun.slow > 0f), (Func<Player, string>)((Player p) => $"{p.data.weaponHandler.gun.slow:F2}"));
			TabInfoManager.RegisterStat(val3, "Bullet Gravity", (Func<Player, bool>)((Player p) => ASS || p.data.weaponHandler.gun.gravity != 1f), (Func<Player, string>)((Player p) => $"{p.data.weaponHandler.gun.gravity:F2}"));
			TabInfoManager.RegisterStat(val3, "Bullet Knockback", (Func<Player, bool>)((Player p) => ASS || p.data.weaponHandler.gun.knockback != 1f), (Func<Player, string>)((Player p) => $"{p.data.weaponHandler.gun.knockback:F0}"));
			TabInfoManager.RegisterStat(val3, "Time Between Bursts", (Func<Player, bool>)((Player p) => p.data.weaponHandler.gun.timeBetweenBullets != 1f && p.data.weaponHandler.gun.bursts > 1), (Func<Player, string>)((Player p) => $"{p.data.weaponHandler.gun.timeBetweenBullets:F2}"));
			TabInfoManager.RegisterStat(val3, "%Ammo Regeneration", (Func<Player, bool>)((Player p) => ASS || p.data.weaponHandler.gun.ammoReg > 0f), (Func<Player, string>)((Player p) => $"{p.data.weaponHandler.gun.ammoReg * 100f:0F}%"));
			TabInfoManager.RegisterStat(val3, "Recoil", (Func<Player, bool>)((Player p) => p.data.weaponHandler.gun.bodyRecoil != 0f && p.data.weaponHandler.gun.recoilMuiltiplier != 1f), (Func<Player, string>)((Player p) => $"{p.data.weaponHandler.gun.bodyRecoil * p.data.weaponHandler.gun.recoilMuiltiplier:F2}"));
			TabInfoManager.RegisterStat(val3, "Recoil Multiplier", (Func<Player, bool>)((Player p) => ASS || p.data.weaponHandler.gun.recoilMuiltiplier != 1f), (Func<Player, string>)((Player p) => $"{p.data.weaponHandler.gun.recoilMuiltiplier:F2}"));
			TabInfoManager.RegisterStat(val3, "Body Recoil", (Func<Player, bool>)((Player p) => ASS || p.data.weaponHandler.gun.bodyRecoil != 0f), (Func<Player, string>)((Player p) => $"{p.data.weaponHandler.gun.bodyRecoil:F2}"));
			StatCategory val4 = TabInfoManager.RegisterCategory("Charged Stats", 5);
			TabInfoManager.RegisterStat(val4, "Charged Damage Multiplier", (Func<Player, bool>)((Player p) => ASS || (p.data.weaponHandler.gun.useCharge && p.data.weaponHandler.gun.chargeDamageMultiplier != 1f)), (Func<Player, string>)((Player p) => $"{p.data.weaponHandler.gun.chargeDamageMultiplier:F2}"));
			TabInfoManager.RegisterStat(val4, "Charged Bullet Speed", (Func<Player, bool>)((Player p) => ASS || (p.data.weaponHandler.gun.useCharge && p.data.weaponHandler.gun.chargeSpeedTo != 1f)), (Func<Player, string>)((Player p) => $"{p.data.weaponHandler.gun.chargeSpeedTo:F2}"));
			TabInfoManager.RegisterStat(val4, "Charged Gun Spread", (Func<Player, bool>)((Player p) => ASS || (p.data.weaponHandler.gun.useCharge && p.data.weaponHandler.gun.chargeSpreadTo != 1f)), (Func<Player, string>)((Player p) => $"{p.data.weaponHandler.gun.chargeSpreadTo:F2}"));
			TabInfoManager.RegisterStat(val4, "Charged Even Gun Spread", (Func<Player, bool>)((Player p) => ASS || (p.data.weaponHandler.gun.useCharge && p.data.weaponHandler.gun.chargeEvenSpreadTo != 1f)), (Func<Player, string>)((Player p) => $"{p.data.weaponHandler.gun.chargeEvenSpreadTo:F2}"));
			TabInfoManager.RegisterStat(val4, "Charged Recoil", (Func<Player, bool>)((Player p) => ASS || (p.data.weaponHandler.gun.useCharge && p.data.weaponHandler.gun.chargeRecoilTo != 1f)), (Func<Player, string>)((Player p) => $"{p.data.weaponHandler.gun.chargeRecoilTo:F2}"));
			TabInfoManager.RegisterStat(val4, "Charged Number Of Bullets", (Func<Player, bool>)((Player p) => ASS || (p.data.weaponHandler.gun.useCharge && p.data.weaponHandler.gun.chargeNumberOfProjectilesTo != 0f)), (Func<Player, string>)((Player p) => $"{p.data.weaponHandler.gun.chargeNumberOfProjectilesTo:F0}"));
		}
	}
}