Decompiled source of LustForGrey v1.2.0

plugins/LustForGrey/LustForGrey.dll

Decompiled 2 months ago
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using HarmonyLib;
using UnityEngine;
using UnityEngine.SceneManagement;

[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 = "")]
[assembly: AssemblyCompany("LustForGrey")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("funny")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("LustForGrey")]
[assembly: AssemblyTitle("LustForGrey")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace LustForGrey;

[BepInPlugin("ImNotSimon.LustForGrey", "LustForGrey", "1.2.0")]
public class Plugin : BaseUnityPlugin
{
	[HarmonyPatch(typeof(StockMapInfo), "Awake")]
	internal class Patch00
	{
		private static void Postfix(StockMapInfo __instance)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_034f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0362: Unknown result type (might be due to invalid IL or missing references)
			//IL_0375: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d4: 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_0388: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e7: 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_0459: Unknown result type (might be due to invalid IL or missing references)
			//IL_044b: Unknown result type (might be due to invalid IL or missing references)
			//IL_040d: Unknown result type (might be due to invalid IL or missing references)
			//IL_046c: Unknown result type (might be due to invalid IL or missing references)
			//IL_047f: Unknown result type (might be due to invalid IL or missing references)
			//IL_04de: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0492: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0504: 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_0555: Unknown result type (might be due to invalid IL or missing references)
			//IL_0517: Unknown result type (might be due to invalid IL or missing references)
			//IL_0576: Unknown result type (might be due to invalid IL or missing references)
			//IL_0589: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_05da: Unknown result type (might be due to invalid IL or missing references)
			//IL_059c: Unknown result type (might be due to invalid IL or missing references)
			//IL_05fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_060e: Unknown result type (might be due to invalid IL or missing references)
			//IL_065f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0621: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_072b: Unknown result type (might be due to invalid IL or missing references)
			Scene activeScene = SceneManager.GetActiveScene();
			string name = ((Scene)(ref activeScene)).name;
			SpriteRenderer[] array = Resources.FindObjectsOfTypeAll<SpriteRenderer>();
			foreach (SpriteRenderer val in array)
			{
				if (((Object)val.sprite).name == "2-1 In the Air Tonight")
				{
					val.sprite = StraightAssetBundle.LoadAsset<Sprite>("2-1 pic.png");
				}
			}
			Material[] array2 = Resources.FindObjectsOfTypeAll<Material>();
			foreach (Material val2 in array2)
			{
				if (((Object)val2).name == "Minos")
				{
					val2.mainTexture = (Texture)(object)StraightAssetBundle.LoadAsset<Texture2D>("straightminos1.png");
				}
				if (((Object)val2).name == "Minos2")
				{
					val2.mainTexture = (Texture)(object)StraightAssetBundle.LoadAsset<Texture2D>("straightminos1.png");
				}
				if (((Object)val2).name == "Minos2Eyeless")
				{
					val2.mainTexture = (Texture)(object)StraightAssetBundle.LoadAsset<Texture2D>("straightminos2.png");
				}
				if (((Object)val2).name == "MinosArm 1")
				{
					val2.mainTexture = (Texture)(object)StraightAssetBundle.LoadAsset<Texture2D>("straightarm1.png");
				}
				if (((Object)val2).name == "MinosWire")
				{
					val2.mainTexture = (Texture)(object)StraightAssetBundle.LoadAsset<Texture2D>("straightwire.png");
				}
				if (((Object)val2).name == "Mat_MinosArmWires")
				{
					val2.mainTexture = (Texture)(object)StraightAssetBundle.LoadAsset<Texture2D>("straightwire.png");
				}
				if (((Object)val2).name == "MinosArm")
				{
					val2.mainTexture = (Texture)(object)StraightAssetBundle.LoadAsset<Texture2D>("straightarm1.png");
				}
				if (((Object)val2).name == "MinosArmUnlit")
				{
					val2.mainTexture = (Texture)(object)StraightAssetBundle.LoadAsset<Texture2D>("straightarm1.png");
				}
				if (((Object)val2).name == "Mat_MinosArm_0")
				{
					val2.mainTexture = (Texture)(object)StraightAssetBundle.LoadAsset<Texture2D>("straightarm1.png");
				}
				if (((Object)val2).name == "Mat_MinosArm")
				{
					val2.mainTexture = (Texture)(object)StraightAssetBundle.LoadAsset<Texture2D>("straightarm1.png");
				}
				if (((Object)val2).name == "CityFromAbove")
				{
					val2.mainTexture = (Texture)(object)StraightAssetBundle.LoadAsset<Texture2D>("straightcity.png");
				}
				if (((Object)val2).name == "CityFromAboveTiled")
				{
					val2.mainTexture = (Texture)(object)StraightAssetBundle.LoadAsset<Texture2D>("straightcity.png");
				}
				activeScene = SceneManager.GetActiveScene();
				name = ((Scene)(ref activeScene)).name;
				switch (name)
				{
				default:
					if (!(name == "e33f259a6c8241e46a5cbe4869cf059f"))
					{
						continue;
					}
					break;
				case "55e17289238a28d488af367454267a0d":
				case "6440445a799e22842babe18edf7da792":
				case "4e039f071c1fba04a82a7b6b44feadc2":
					break;
				}
				if (((Object)val2).name == "LustSky")
				{
					val2.mainTexture = (Texture)(object)StraightAssetBundle.LoadAsset<Texture2D>("straighsky.png");
				}
				Light[] array3 = Resources.FindObjectsOfTypeAll<Light>();
				foreach (Light val3 in array3)
				{
					if (val3.color.r >= 1f && val3.color.g >= 0f && val3.color.b >= 0.9071f && val3.color.a >= 1f)
					{
						blulight1 = val3;
						blulight1.color = new Color(0.5142f, 0.5726f, 1f, 1f);
					}
					if (val3.color.r <= 0.895f && val3.color.g <= 5529f && val3.color.b <= 1f && val3.color.a <= 1f)
					{
						blulight2 = val3;
						blulight2.color = new Color(0.5142f, 0.5726f, 1f, 1f);
					}
					if (val3.color.r >= 0.9305f && val3.color.g >= 0f && val3.color.b >= 1f && val3.color.a >= 1f)
					{
						blulight1 = val3;
						blulight1.color = new Color(0.5142f, 0.5726f, 1f, 1f);
					}
					if (val3.color.r <= 0.9305f && val3.color.g <= 0f && val3.color.b <= 1f && val3.color.a <= 1f)
					{
						blulight1 = val3;
						blulight1.color = new Color(0.5142f, 0.5726f, 1f, 1f);
					}
					if (val3.color.r <= 1f && val3.color.g <= 0f && val3.color.b <= 0.6664f && val3.color.a <= 1f)
					{
						blulight2 = val3;
						blulight2.color = new Color(0.5142f, 0.5726f, 1f, 1f);
					}
					if (val3.color.r >= 1f && val3.color.g >= 0f && val3.color.b >= 0.6664f && val3.color.a >= 1f)
					{
						blulight2 = val3;
						blulight2.color = new Color(0.5142f, 0.5726f, 1f, 1f);
					}
					if (((Object)val3).name == "Directional Light (4)")
					{
						lulight1 = val3;
						lulight1.color = new Color(0.231f, 0.231f, 0.231f, 1f);
					}
					if (((Object)val3).name == "Directional Light (5)")
					{
						lulight2 = val3;
						lulight2.color = new Color(0.439f, 0.439f, 0.439f, 1f);
					}
					if (((Object)val3).name == "Directional Light (6)")
					{
						lulight3 = val3;
						lulight3.color = new Color(0.439f, 0.439f, 0.439f, 1f);
					}
				}
			}
		}
	}

	private static Harmony harmony;

	internal static AssetBundle StraightAssetBundle;

	public static Light lulight1;

	public static Light lulight2;

	public static Light lulight3;

	public static Light blulight1;

	public static Light blulight2;

	public static Color purpleColor = new Color(1f, 0f, 0.9071f, 1f);

	public static Color lightpurpleColor = new Color(0.895f, 0.5529f, 1f, 1f);

	private void Awake()
	{
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Expected O, but got Unknown
		Debug.Log((object)"grey lust starting");
		Assembly executingAssembly = Assembly.GetExecutingAssembly();
		string path = "lustforgrey";
		StraightAssetBundle = AssetBundle.LoadFromFile(Path.Combine(ModPath(), path));
		harmony = new Harmony("simon.LustForGrey");
		harmony.PatchAll();
	}

	public static string ModPath()
	{
		return Assembly.GetExecutingAssembly().Location.Substring(0, Assembly.GetExecutingAssembly().Location.LastIndexOf(Path.DirectorySeparatorChar));
	}
}