Decompiled source of GlowCatSkulls v1.0.2

GlowCatSkulls.dll

Decompiled a month ago
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.Reflection;
using System.Resources;
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 UnityEngine;

[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.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("GlowCatSkulls")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("GlowCatSkulls")]
[assembly: AssemblyTitle("GlowCatSkulls")]
[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 GlowCatSkulls
{
	[BepInPlugin("GlowCatSkulls", "GlowCatSkulls", "1.0.1.0")]
	public class GlowCatSkulls : BaseUnityPlugin
	{
		[HarmonyPatch(typeof(Skull), "Start")]
		public static class catifyskull
		{
			public static void Prefix(Skull __instance)
			{
				//IL_003b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0040: Unknown result type (might be due to invalid IL or missing references)
				//IL_005d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0062: Unknown result type (might be due to invalid IL or missing references)
				//IL_0064: Unknown result type (might be due to invalid IL or missing references)
				//IL_0066: Unknown result type (might be due to invalid IL or missing references)
				//IL_0068: Unknown result type (might be due to invalid IL or missing references)
				//IL_006b: Invalid comparison between Unknown and I4
				//IL_00a1: 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_00a3: Unknown result type (might be due to invalid IL or missing references)
				//IL_006f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0072: Invalid comparison between Unknown and I4
				Renderer component = ((Component)__instance).GetComponent<Renderer>();
				if (!Object.op_Implicit((Object)(object)component))
				{
					return;
				}
				Vector3 position = default(Vector3);
				((Vector3)(ref position))..ctor(0f, 0f, 0.15f);
				Quaternion rotation = Quaternion.Euler(0f, 100f, 90f);
				Vector3 scale = default(Vector3);
				((Vector3)(ref scale))..ctor(50f, 50f, 50f);
				ItemType itemType = ((Component)__instance).GetComponent<ItemIdentifier>().itemType;
				ItemType val = itemType;
				string text;
				if ((int)val != 1)
				{
					if ((int)val != 2)
					{
						text = "Red";
						return;
					}
					text = "Red";
				}
				else
				{
					text = "Blue";
				}
				component.enabled = false;
				CreateCat(text, ((Component)component).transform, position, rotation, scale);
			}
		}

		internal static ManualLogSource Logger;

		private Harmony glowcat;

		public static AssetBundle glowcatbundle;

		public static Dictionary<string, GameObject> allCats = new Dictionary<string, GameObject>();

		private void Awake()
		{
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Expected O, but got Unknown
			Logger = ((BaseUnityPlugin)this).Logger;
			Logger.LogInfo((object)"The cats have been AWAKENED!");
			Logger.LogInfo((object)"\"Thank you Tony.Fumoskulls for a understanding of how all this SHIT works.\" - wynstium :3");
			glowcatbundle = AssetBundle.LoadFromMemory(Resources1.glowcatbundle);
			Logger.LogInfo((object)"Memory Loaded");
			glowcatbundle.LoadAllAssets();
			Logger.LogInfo((object)"Loaded All Assets");
			glowcat = new Harmony("wynstium.glowcatskulls");
			glowcat.PatchAll();
			Logger.LogInfo((object)"New Harmony Patch");
			allCats.Add("RedCat", glowcatbundle.LoadAsset<GameObject>("GlowCatRedGO"));
			allCats.Add("BlueCat", glowcatbundle.LoadAsset<GameObject>("GlowCatBlueGO"));
			Logger.LogInfo((object)"allCats listed!!");
		}

		public static void CreateCat(string catColor, Transform masterSkull, Vector3 position, Quaternion rotation, Vector3 scale)
		{
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			Debug.Log((object)("Transforming " + ((Object)masterSkull).name + " into a " + catColor + " Cat!!!"));
			GameObject val = Object.Instantiate<GameObject>(allCats[catColor + "Cat"], masterSkull);
			val.active = true;
			val.transform.localRotation = rotation;
			val.transform.localPosition = position;
			val.transform.localScale = scale;
		}
	}
	[GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
	[DebuggerNonUserCode]
	[CompilerGenerated]
	internal class Resources1
	{
		private static ResourceManager resourceMan;

		private static CultureInfo resourceCulture;

		[EditorBrowsable(EditorBrowsableState.Advanced)]
		internal static ResourceManager ResourceManager
		{
			get
			{
				if (resourceMan == null)
				{
					ResourceManager resourceManager = new ResourceManager("GlowCatSkulls.Resources1", typeof(Resources1).Assembly);
					resourceMan = resourceManager;
				}
				return resourceMan;
			}
		}

		[EditorBrowsable(EditorBrowsableState.Advanced)]
		internal static CultureInfo Culture
		{
			get
			{
				return resourceCulture;
			}
			set
			{
				resourceCulture = value;
			}
		}

		internal static byte[] glowcatbundle
		{
			get
			{
				object @object = ResourceManager.GetObject("glowcatbundle", resourceCulture);
				return (byte[])@object;
			}
		}

		internal Resources1()
		{
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "GlowCatSkulls";

		public const string PLUGIN_NAME = "GlowCatSkulls";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}