Decompiled source of MauriceArmer v1.0.0

bitmotte.MauriceArmer.dll

Decompiled 10 hours ago
using System;
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 BepInEx.Logging;
using HarmonyLib;
using MauriceBridge;
using Microsoft.CodeAnalysis;
using PluginConfig.API;
using PluginConfig.API.Decorators;
using PluginConfig.API.Fields;
using PluginConfig.API.Functionals;
using TMPro;
using UnityEngine;
using UnityEngine.AddressableAssets;
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.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("bitmotte.MauriceArmer")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("MauriceArmer")]
[assembly: AssemblyTitle("bitmotte.MauriceArmer")]
[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 MauriceArmer
{
	public static class ArmConfigurator
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static OnClick <0>__RendApart;

			public static OnClick <1>__OpenDiscord;

			public static GlobalConfig.ConfigChangeEvent <2>__ReadGlobalConfig;

			public static PostConfigChangeEvent <3>__UpdateGlobalConfig;
		}

		public static ButtonField breakThoseArms;

		public static BoolField useGravity;

		public static FloatSliderField velocityMultiplier;

		public static BoolField wackyEntrance;

		public static BoolField enragedVisual;

		public static BoolField damagedVisual;

		public static ButtonField joinDC;

		public static PluginConfigurator CreateConfigurator()
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Expected O, but got Unknown
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Expected O, but got Unknown
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Expected O, but got Unknown
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Expected O, but got Unknown
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Expected O, but got Unknown
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Expected O, but got Unknown
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Expected O, but got Unknown
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Expected O, but got Unknown
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Expected O, but got Unknown
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Expected O, but got Unknown
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Expected O, but got Unknown
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Expected O, but got Unknown
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Expected O, but got Unknown
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Expected O, but got Unknown
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			//IL_0179: Expected O, but got Unknown
			//IL_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Expected O, but got Unknown
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Expected O, but got Unknown
			//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01be: Expected O, but got Unknown
			//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_01de: Expected O, but got Unknown
			//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0204: Expected O, but got Unknown
			//IL_026b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0272: Expected O, but got Unknown
			//IL_028f: Unknown result type (might be due to invalid IL or missing references)
			//IL_029e: Unknown result type (might be due to invalid IL or missing references)
			//IL_023c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0241: Unknown result type (might be due to invalid IL or missing references)
			//IL_0247: Expected O, but got Unknown
			PluginConfigurator val = PluginConfigurator.Create("Maurice Armer", "bitmotte.MauriceArmer");
			ConfigSpace val2 = new ConfigSpace(val.rootPanel, 15f);
			breakThoseArms = new ButtonField(val.rootPanel, "Rend them apart", "break_arms");
			ConfigSpace val3 = new ConfigSpace(val.rootPanel, 15f);
			ConfigHeader val4 = new ConfigHeader(val.rootPanel, "Arms", 24, (TextAlignmentOptions)513);
			ConfigHeader val5 = new ConfigHeader(val.rootPanel, "Notice : Some configs update live", 14, (TextAlignmentOptions)513);
			useGravity = new BoolField(val.rootPanel, "Gravity", "gravity", true);
			ConfigSpace val6 = new ConfigSpace(val.rootPanel, 7f);
			velocityMultiplier = new FloatSliderField(val.rootPanel, "Velocity Multiplier", "multi", new Tuple<float, float>(0f, 360f), 60f);
			ConfigSpace val7 = new ConfigSpace(val.rootPanel, 15f);
			ConfigHeader val8 = new ConfigHeader(val.rootPanel, "Tweaks", 24, (TextAlignmentOptions)513);
			wackyEntrance = new BoolField(val.rootPanel, "Wacky Entrance", "wacky", false);
			ConfigSpace val9 = new ConfigSpace(val.rootPanel, 7f);
			damagedVisual = new BoolField(val.rootPanel, "Damaged Visual", "damaged_visual", true);
			enragedVisual = new BoolField(val.rootPanel, "Enraged Visual", "enraged_visual", true);
			ConfigSpace val10 = new ConfigSpace(val.rootPanel, 15f);
			ConfigHeader val11 = new ConfigHeader(val.rootPanel, "Join my discord for sneak peeks,devlogs,and the possibility to test my mods early ! !", 20, (TextAlignmentOptions)513);
			joinDC = new ButtonField(val.rootPanel, "Join my Discord", "joinDC");
			ConfigSpace val12 = new ConfigSpace(val.rootPanel, 15f);
			ButtonField obj = breakThoseArms;
			object obj2 = <>O.<0>__RendApart;
			if (obj2 == null)
			{
				OnClick val13 = GlobalConfig.RendApart;
				<>O.<0>__RendApart = val13;
				obj2 = (object)val13;
			}
			obj.onClick += (OnClick)obj2;
			ButtonField obj3 = joinDC;
			object obj4 = <>O.<1>__OpenDiscord;
			if (obj4 == null)
			{
				OnClick val14 = OpenDiscord;
				<>O.<1>__OpenDiscord = val14;
				obj4 = (object)val14;
			}
			obj3.onClick += (OnClick)obj4;
			GlobalConfig.OnConfigChange += ReadGlobalConfig;
			object obj5 = <>O.<3>__UpdateGlobalConfig;
			if (obj5 == null)
			{
				PostConfigChangeEvent val15 = UpdateGlobalConfig;
				<>O.<3>__UpdateGlobalConfig = val15;
				obj5 = (object)val15;
			}
			val.postConfigChange += (PostConfigChangeEvent)obj5;
			UpdateGlobalConfig();
			AssetBundle val16 = BundleTool.Load("arms.bundle");
			Texture2D val17 = (Texture2D)val16.LoadAsset("Assets/armer.png");
			val.icon = Sprite.Create(val17, new Rect(0f, 0f, (float)((Texture)val17).width, (float)((Texture)val17).height), new Vector2(0.5f, 0.5f), 100f);
			val16.Unload(false);
			return val;
		}

		public static void ReadGlobalConfig()
		{
			useGravity.value = GlobalConfig.useGravity;
			velocityMultiplier.value = GlobalConfig.velocityMultiplier / 100f;
			wackyEntrance.value = GlobalConfig.wackyEntrance;
			damagedVisual.value = GlobalConfig.damagedVisual;
			enragedVisual.value = GlobalConfig.enragedVisual;
		}

		public static void UpdateGlobalConfig()
		{
			GlobalConfig.useGravity = useGravity.value;
			GlobalConfig.velocityMultiplier = velocityMultiplier.value * 100f;
			GlobalConfig.wackyEntrance = wackyEntrance.value;
			GlobalConfig.damagedVisual = damagedVisual.value;
			GlobalConfig.enragedVisual = enragedVisual.value;
			GlobalConfig.OnConfigChangeAAAAAA();
		}

		private static void OpenDiscord()
		{
			Process.Start("http://discord.gg/pVdr9e6hZ8");
		}
	}
	public static class GlobalConfig
	{
		public delegate void ConfigChangeEvent();

		public static bool useGravity;

		public static float velocityMultiplier = 6000f;

		public static bool adjustOnLanding = true;

		public static bool wackyEntrance = false;

		public static bool damagedVisual = true;

		public static bool enragedVisual = true;

		public static event ConfigChangeEvent OnConfigChange;

		public static void RendApart()
		{
			GameObject[] armses = SceneUtility.armses;
			foreach (GameObject val in armses)
			{
				if (!((Object)(object)val == (Object)null))
				{
					val.GetComponent<ArmsController>().RendApart();
				}
			}
		}

		public static void OnConfigChangeAAAAAA()
		{
			GlobalConfig.OnConfigChange?.Invoke();
		}
	}
	[HarmonyPatch(typeof(MaliciousFace), "Start")]
	public class LegPatch : MonoBehaviour
	{
		private static void Postfix(MaliciousFace __instance)
		{
			SecretVariations.MakeArmsWithSecretPossibility(((Component)__instance).gameObject);
		}
	}
	[HarmonyPatch(typeof(MaliciousFace), "HandleCollision")]
	[HarmonyPriority(10)]
	public class FloorPatch : MonoBehaviour
	{
		private static void Postfix(MaliciousFace __instance, Collision other)
		{
			ArmsController[] componentsInChildren = ((Component)((Component)__instance).transform.parent).GetComponentsInChildren<ArmsController>();
			if (other.gameObject.CompareTag("Floor"))
			{
				ArmsController[] array = componentsInChildren;
				foreach (ArmsController armsController in array)
				{
					armsController.SwitchToPhysical();
				}
			}
		}
	}
	[HarmonyPatch(typeof(MaliciousFace), "HandleSpiderDamage")]
	public class WoundPatch : MonoBehaviour
	{
		private static void Postfix(MaliciousFace __instance, ref DamageData data)
		{
			if (GlobalConfig.damagedVisual && !__instance.eid.dead && __instance.spider.health >= __instance.maxHealth / 2f && __instance.spider.health - data.damage < __instance.maxHealth / 2f)
			{
				ArmsController[] componentsInChildren = ((Component)((Component)__instance).transform.parent).GetComponentsInChildren<ArmsController>();
				ArmsController[] array = componentsInChildren;
				foreach (ArmsController armsController in array)
				{
					armsController.SwitchToDamagedVisuals();
				}
			}
		}
	}
	[HarmonyPatch(typeof(MaliciousFace), "ProcessDeath")]
	public class DeathPatch : MonoBehaviour
	{
		private static void Postfix(MaliciousFace __instance)
		{
			ArmsController[] componentsInChildren = ((Component)((Component)__instance).transform.parent).GetComponentsInChildren<ArmsController>();
			ArmsController[] array = componentsInChildren;
			foreach (ArmsController armsController in array)
			{
				armsController.UnEnrageWhat();
				armsController.SwitchToHealthyVisuals();
				armsController.Death();
			}
		}
	}
	[HarmonyPatch(typeof(MaliciousFace), "Enrage")]
	public class EnragePatch : MonoBehaviour
	{
		private static void Postfix(MaliciousFace __instance)
		{
			if (GlobalConfig.enragedVisual)
			{
				ArmsController[] componentsInChildren = ((Component)((Component)__instance).transform.parent).GetComponentsInChildren<ArmsController>();
				ArmsController[] array = componentsInChildren;
				foreach (ArmsController armsController in array)
				{
					armsController.EnrageWhat();
				}
			}
		}
	}
	[HarmonyPatch(typeof(MaliciousFace), "UnEnrage")]
	public class UnEnragePatch : MonoBehaviour
	{
		private static void Postfix(MaliciousFace __instance)
		{
			ArmsController[] componentsInChildren = ((Component)((Component)__instance).transform.parent).GetComponentsInChildren<ArmsController>();
			ArmsController[] array = componentsInChildren;
			foreach (ArmsController armsController in array)
			{
				armsController.UnEnrageWhat();
			}
		}
	}
	public class ArmsController : MonoBehaviour
	{
		public MaliciousFace malFace;

		public FollowVelocity followVelocity;

		public Animator stateController;

		private Transform turningBody;

		private Transform adjusted;

		private EnemySimplifier[] ensims = Array.Empty<EnemySimplifier>();

		private void Awake()
		{
			ensims = ((Component)this).GetComponentsInChildren<EnemySimplifier>();
		}

		private void Start()
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			EnemySimplifier[] array = ensims;
			foreach (EnemySimplifier val in array)
			{
				val.eid = malFace.eid;
				val.enemyColorType = (EnemyType)0;
			}
			stateController = ((Component)this).GetComponent<Animator>();
			turningBody = ((Component)this).transform.parent.GetChild(0);
			adjusted = ((Component)this).transform.GetChild(0);
			((Component)adjusted).gameObject.SetActive(false);
			CheckConfig();
		}

		private void FixedUpdate()
		{
			//IL_0012: 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)
			((Component)this).transform.eulerAngles = new Vector3(0f, turningBody.eulerAngles.y, 0f);
		}

		private void CheckConfig()
		{
			((MonoBehaviour)this).Invoke("CheckConfig", 1f);
			if (!GlobalConfig.useGravity)
			{
				Rigidbody[] componentsInChildren = ((Component)this).GetComponentsInChildren<Rigidbody>();
				foreach (Rigidbody val in componentsInChildren)
				{
					val.useGravity = false;
				}
			}
			else
			{
				Rigidbody[] componentsInChildren2 = ((Component)this).GetComponentsInChildren<Rigidbody>();
				foreach (Rigidbody val2 in componentsInChildren2)
				{
					val2.useGravity = true;
				}
			}
		}

		public void RendApart()
		{
			SpringJoint[] componentsInChildren = ((Component)this).GetComponentsInChildren<SpringJoint>();
			foreach (SpringJoint val in componentsInChildren)
			{
				((Joint)val).breakForce = 0f;
			}
		}

		public void SwitchToDamagedVisuals()
		{
			if (GlobalConfig.damagedVisual)
			{
				Plugin.Logger.LogInfo((object)stateController);
				stateController.SetBoolString("Damaged", true);
			}
		}

		public void SwitchToHealthyVisuals()
		{
			stateController.SetBoolString("Damaged", false);
		}

		public void Enrage()
		{
			if (!GlobalConfig.enragedVisual)
			{
				UnEnrage();
			}
			else if (!malFace.eid.puppet)
			{
				((MonoBehaviour)this).Invoke("EnrageWhat", 0.01f);
			}
		}

		public void EnrageWhat()
		{
			EnemySimplifier[] array = ensims;
			foreach (EnemySimplifier val in array)
			{
				val.ChangeMaterialNew((MaterialState)2, val.enragedMaterial);
				val.enraged = true;
			}
		}

		public void UnEnrage()
		{
			if (!malFace.eid.puppet)
			{
				((MonoBehaviour)this).Invoke("UnEnrageWhat", 0.01f);
			}
		}

		public void UnEnrageWhat()
		{
			EnemySimplifier[] array = ensims;
			foreach (EnemySimplifier val in array)
			{
				val.ChangeMaterialNew((MaterialState)0, val.originalMaterial);
				val.enraged = false;
			}
		}

		public void Death()
		{
			((MonoBehaviour)this).Invoke("DeathWhat", 0.01f);
		}

		public void DeathWhat()
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Expected O, but got Unknown
			EnemySimplifier[] array = ensims;
			foreach (EnemySimplifier val in array)
			{
				MaterialPropertyBlock val2 = new MaterialPropertyBlock();
				val2.SetFloat("_Outline", 0f);
				val2.SetFloat("_ForceOutline", 0f);
				val.meshrenderer.SetPropertyBlock(val2);
				val.active = false;
				Object.Destroy((Object)(object)val);
			}
			DoubleRender[] componentsInChildren = ((Component)this).GetComponentsInChildren<DoubleRender>();
			DoubleRender[] array2 = componentsInChildren;
			foreach (DoubleRender val3 in array2)
			{
				Object.Destroy((Object)(object)val3);
			}
		}

		public void SwitchToPhysicala()
		{
			if (!((Object)(object)Store.corpse == (Object)null))
			{
				((MonoBehaviour)this).Invoke("SwitchToPhysicalWhat", 0.01f);
			}
		}

		public void SwitchToPhysical()
		{
			((Component)adjusted).gameObject.SetActive(true);
			adjusted.parent = Store.corpse.transform;
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}
	public class FollowVelocity : MonoBehaviour
	{
		public float veloMulti = 6000f;

		private Vector3 moveVelocity;

		private Vector3 prevPos;

		public ConstantForce[] forceAdders;

		public int frametick = 0;

		private void Start()
		{
			forceAdders = ((Component)this).GetComponentsInChildren<ConstantForce>();
			CheckConfig();
		}

		private void FixedUpdate()
		{
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: 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_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			if (frametick < 1)
			{
				frametick++;
				if (!GlobalConfig.wackyEntrance)
				{
					prevPos = ((Component)this).transform.parent.position;
				}
			}
			moveVelocity = (((Component)this).transform.parent.position - prevPos) * veloMulti;
			ConstantForce[] array = forceAdders;
			foreach (ConstantForce val in array)
			{
				val.force = -moveVelocity;
			}
			prevPos = ((Component)this).transform.parent.position;
		}

		private void CheckConfig()
		{
			((MonoBehaviour)this).Invoke("CheckConfig", 1f);
			veloMulti = GlobalConfig.velocityMultiplier;
		}
	}
	public static class SecretVariations
	{
		public static void MakeArmsWithSecretPossibility(GameObject gameObject)
		{
			GenericArms("Assets/Armer/Arms/Arms.prefab", gameObject);
		}

		public static void GenericArms(string key, GameObject malFace)
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Expected O, but got Unknown
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			AssetBundle val = BundleTool.Load("arms.bundle");
			GameObject val2 = Object.Instantiate<GameObject>((GameObject)val.LoadAsset(key));
			SetupResource.FixShader(val2);
			val2.transform.parent = malFace.transform;
			val2.transform.position = malFace.transform.position;
			ArmsController armsController = val2.AddComponent<ArmsController>();
			armsController.malFace = malFace.GetComponent<MaliciousFace>();
			armsController.followVelocity = val2.AddComponent<FollowVelocity>();
			GameObject[] armses = SceneUtility.armses;
			int num = 0;
			GameObject[] array = (GameObject[])(object)new GameObject[1 + armses.Length];
			ReadOnlySpan<GameObject> readOnlySpan = new ReadOnlySpan<GameObject>(armses);
			readOnlySpan.CopyTo(new Span<GameObject>(array).Slice(num, readOnlySpan.Length));
			num += readOnlySpan.Length;
			array[num] = val2;
			SceneUtility.armses = array;
			val.Unload(false);
		}
	}
	[BepInPlugin("bitmotte.MauriceArmer", "MauriceArmer", "1.0.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		internal static ManualLogSource Logger;

		public static PluginConfigurator config;

		private void Awake()
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Expected O, but got Unknown
			Logger = ((BaseUnityPlugin)this).Logger;
			Logger.LogInfo((object)"Plugin bitmotte.MauriceArmer is loaded!");
			Harmony val = new Harmony("bitmotte.MauriceArmer");
			val.PatchAll();
			config = ArmConfigurator.CreateConfigurator();
			SceneManager.sceneLoaded += SceneUtility.OnSceneLoad;
			Store.armer = true;
		}
	}
	public static class BundleTool
	{
		public static AssetBundle Load(string fileName)
		{
			return AssetBundle.LoadFromMemory(EmbeddedAccess.AccessFile(fileName));
		}
	}
	public static class EmbeddedAccess
	{
		public static byte[] AccessFile(string fileName)
		{
			Assembly executingAssembly = Assembly.GetExecutingAssembly();
			byte[] array;
			using (Stream stream = executingAssembly.GetManifestResourceStream("MauriceArmer.resources." + fileName))
			{
				if (stream == null)
				{
					return null;
				}
				array = new byte[stream.Length];
				stream.Read(array, 0, array.Length);
			}
			return array;
		}
	}
	public static class SceneUtility
	{
		public static GameObject[] armses;

		public static string sceneName;

		public static void OnSceneLoad(Scene scene, LoadSceneMode mode)
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Expected O, but got Unknown
			sceneName = ((Scene)(ref scene)).name;
			armses = Array.Empty<GameObject>();
			GameObject val = new GameObject("aaarms");
			val.transform.parent = null;
			val.AddComponent<SetPhysArms>();
		}
	}
	internal class SetPhysArms : MonoBehaviour
	{
		private void Start()
		{
			((MonoBehaviour)this).Invoke("Wagh", 0.1f);
		}

		private void Wagh()
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Expected O, but got Unknown
			AssetBundle val = BundleTool.Load("arms.bundle");
			GameObject val2 = (GameObject)val.LoadAsset("Assets/Armer/Arms/Adjusted/Adjusted.prefab");
			SetupResource.FixShader(val2);
			Store.storedPhysicalArm = val2;
			val.Unload(false);
		}
	}
	public static class SetupResource
	{
		public static GameObject FixShader(GameObject gameObject)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: 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_021c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0221: 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)
			Shader shader = Addressables.LoadAssetAsync<Material>((object)"Assets/Materials/Environment/Metal/Pattern 1/Metal Pattern 1 8.mat").WaitForCompletion().shader;
			SkinnedMeshRenderer[] componentsInChildren = gameObject.GetComponentsInChildren<SkinnedMeshRenderer>();
			foreach (SkinnedMeshRenderer val in componentsInChildren)
			{
				Material[] materials = ((Renderer)val).materials;
				foreach (Material val2 in materials)
				{
					if (((Object)val2.shader).name == "ULTRAKILL/Master")
					{
						val2.shader = shader;
					}
					if (((Object)val2.shader).name == "Hidden/InternalErrorShader")
					{
						val2.shader = Addressables.LoadAssetAsync<Material>((object)"Assets/Materials/Dev/FadeToWhite.mat").WaitForCompletion().shader;
					}
				}
			}
			MeshRenderer[] componentsInChildren2 = gameObject.GetComponentsInChildren<MeshRenderer>();
			foreach (MeshRenderer val3 in componentsInChildren2)
			{
				Material[] materials2 = ((Renderer)val3).materials;
				foreach (Material val4 in materials2)
				{
					val4.shader = shader;
				}
			}
			ParticleSystem[] componentsInChildren3 = gameObject.GetComponentsInChildren<ParticleSystem>();
			foreach (ParticleSystem val5 in componentsInChildren3)
			{
				Renderer[] componentsInChildren4 = ((Component)val5).gameObject.GetComponentsInChildren<Renderer>();
				foreach (Renderer val6 in componentsInChildren4)
				{
					Material[] materials3 = val6.materials;
					foreach (Material val7 in materials3)
					{
						val7.shader = shader;
					}
				}
			}
			EnemySimplifier[] componentsInChildren5 = gameObject.GetComponentsInChildren<EnemySimplifier>();
			foreach (EnemySimplifier val8 in componentsInChildren5)
			{
				val8.simplifiedMaterial.shader = shader;
				val8.enragedSimplifiedMaterial.shader = shader;
				if (((Object)val8.enragedMaterial.shader).name == "Hidden/InternalErrorShader" || ((Object)val8.enragedMaterial.shader).name == "Sprites/Default")
				{
					val8.enragedMaterial.shader = Addressables.LoadAssetAsync<Material>((object)"Assets/Materials/Dev/FadeToWhite.mat").WaitForCompletion().shader;
				}
				else
				{
					val8.enragedMaterial.shader = shader;
				}
				val8.enemyColorType = (EnemyType)0;
			}
			return gameObject;
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "bitmotte.MauriceArmer";

		public const string PLUGIN_NAME = "MauriceArmer";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}