Decompiled source of AutoMithrixDisplays v1.0.0

AutoMithrixDisplays.dll

Decompiled 2 weeks ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HG;
using HarmonyLib;
using On.RoR2;
using R2API.Utils;
using RoR2;
using RoR2.ContentManagement;
using UnityEngine;
using UnityEngine.AddressableAssets;

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

[BepInPlugin("com.Zenithrium.AutoMithrixDisplays", "AutoMithrixDisplays", "1.0.0")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
public class AutoMithrixDisplays : BaseUnityPlugin
{
	public const string ModGuid = "com.Zenithrium.AutoMithrixDisplays";

	public const string ModName = "AutoMithrixDisplays";

	public const string ModVer = "1.0.0";

	public static ManualLogSource ModLogger;

	public static ConfigEntry<ulong> seed;

	public static ConfigEntry<string> idsToIgnore;

	public static AssetBundle MainAssets;

	public GameObject t1Infect;

	public GameObject t2Infect;

	public GameObject t3Infect;

	public GameObject bsInfect;

	public GameObject luInfect;

	public GameObject v1Infect;

	public GameObject v2Infect;

	public GameObject v3Infect;

	public GameObject v4Infect;

	public GameObject syblInfect;

	public GameObject sacrInfect;

	public GameObject vdluInfect;

	private ItemTier syblTier;

	private ItemTier sacrTier;

	private ItemTier vdluTier;

	private void Awake()
	{
		//IL_0092: Unknown result type (might be due to invalid IL or missing references)
		//IL_009c: Expected O, but got Unknown
		seed = ((BaseUnityPlugin)this).Config.Bind<ulong>("General", "Placement Seed", 2147483520uL, "Adjust what seed the random number generator uses for item placement. (Ex: 2147483520, 7, 3691215, etc)");
		idsToIgnore = ((BaseUnityPlugin)this).Config.Bind<string>("General", "Ignored Content Packs", "", "Adjust which mods do not get item displays added for them, in the event they already have them, separated by commas. (Ex. \"Aetherium, Starstorm\" or \"com.ContactLight.LostInTransit, com.Hex3.Hex3Mod\"");
		ModLogger = ((BaseUnityPlugin)this).Logger;
		using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("AutoMithrixDisplays.automithrixdisplaysassets"))
		{
			MainAssets = AssetBundle.LoadFromStream(stream);
		}
		Swapallshaders(MainAssets);
		ItemCatalog.Init += new hook_Init(ItemCatalog_Init);
	}

	private void ItemCatalog_Init(orig_Init orig)
	{
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: 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_0045: 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_005e: Unknown result type (might be due to invalid IL or missing references)
		//IL_044c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0453: Expected O, but got Unknown
		//IL_0453: Unknown result type (might be due to invalid IL or missing references)
		//IL_0458: Unknown result type (might be due to invalid IL or missing references)
		//IL_045d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0462: Unknown result type (might be due to invalid IL or missing references)
		//IL_0494: Unknown result type (might be due to invalid IL or missing references)
		//IL_0499: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ec: 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_0501: Unknown result type (might be due to invalid IL or missing references)
		//IL_0506: Unknown result type (might be due to invalid IL or missing references)
		//IL_0516: Unknown result type (might be due to invalid IL or missing references)
		//IL_051b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0525: Unknown result type (might be due to invalid IL or missing references)
		//IL_052a: Unknown result type (might be due to invalid IL or missing references)
		//IL_053e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0543: Unknown result type (might be due to invalid IL or missing references)
		//IL_0570: Unknown result type (might be due to invalid IL or missing references)
		//IL_0575: Unknown result type (might be due to invalid IL or missing references)
		//IL_0587: Unknown result type (might be due to invalid IL or missing references)
		//IL_058c: Unknown result type (might be due to invalid IL or missing references)
		//IL_068f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0694: Unknown result type (might be due to invalid IL or missing references)
		//IL_062f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0634: Unknown result type (might be due to invalid IL or missing references)
		//IL_06d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0670: Unknown result type (might be due to invalid IL or missing references)
		orig.Invoke();
		t1Infect = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Brother/ItemInfection, White.prefab").WaitForCompletion();
		t2Infect = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Brother/ItemInfection, Green.prefab").WaitForCompletion();
		t3Infect = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Brother/ItemInfection, Red.prefab").WaitForCompletion();
		luInfect = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Brother/ItemInfection, Blue.prefab").WaitForCompletion();
		v1Infect = MainAssets.LoadAsset<GameObject>("void1Infection.prefab");
		ItemDisplay val = v1Infect.AddComponent<ItemDisplay>();
		val.rendererInfos = (RendererInfo[])(object)new RendererInfo[1];
		val.rendererInfos[0].renderer = (Renderer)(object)v1Infect.GetComponent<MeshRenderer>();
		val.rendererInfos[0].defaultMaterial = MainAssets.LoadAsset<Material>("voidInfectionT1.mat");
		v2Infect = MainAssets.LoadAsset<GameObject>("void2Infection.prefab");
		ItemDisplay val2 = v2Infect.AddComponent<ItemDisplay>();
		val2.rendererInfos = (RendererInfo[])(object)new RendererInfo[1];
		val2.rendererInfos[0].renderer = (Renderer)(object)v2Infect.GetComponent<MeshRenderer>();
		val2.rendererInfos[0].defaultMaterial = MainAssets.LoadAsset<Material>("voidInfectionT2.mat");
		v3Infect = MainAssets.LoadAsset<GameObject>("void3Infection.prefab");
		ItemDisplay val3 = v3Infect.AddComponent<ItemDisplay>();
		val3.rendererInfos = (RendererInfo[])(object)new RendererInfo[1];
		val3.rendererInfos[0].renderer = (Renderer)(object)v3Infect.GetComponent<MeshRenderer>();
		val3.rendererInfos[0].defaultMaterial = MainAssets.LoadAsset<Material>("voidInfectionT3.mat");
		v4Infect = MainAssets.LoadAsset<GameObject>("void3Infection.prefab");
		ItemDisplay val4 = v4Infect.AddComponent<ItemDisplay>();
		val4.rendererInfos = (RendererInfo[])(object)new RendererInfo[1];
		val4.rendererInfos[0].renderer = (Renderer)(object)v4Infect.GetComponent<MeshRenderer>();
		val4.rendererInfos[0].defaultMaterial = MainAssets.LoadAsset<Material>("voidInfectionT4.mat");
		bsInfect = MainAssets.LoadAsset<GameObject>("t4Infection.prefab");
		ItemDisplay val5 = bsInfect.AddComponent<ItemDisplay>();
		val5.rendererInfos = (RendererInfo[])(object)new RendererInfo[1];
		val5.rendererInfos[0].renderer = (Renderer)(object)bsInfect.GetComponent<MeshRenderer>();
		val5.rendererInfos[0].defaultMaterial = MainAssets.LoadAsset<Material>("InfectionT4.mat");
		syblInfect = MainAssets.LoadAsset<GameObject>("syblInfect.prefab");
		ItemDisplay val6 = syblInfect.AddComponent<ItemDisplay>();
		val6.rendererInfos = (RendererInfo[])(object)new RendererInfo[1];
		val6.rendererInfos[0].renderer = (Renderer)(object)syblInfect.GetComponent<MeshRenderer>();
		val6.rendererInfos[0].defaultMaterial = MainAssets.LoadAsset<Material>("syblInfectMat.mat");
		sacrInfect = MainAssets.LoadAsset<GameObject>("sacrInfect.prefab");
		ItemDisplay val7 = sacrInfect.AddComponent<ItemDisplay>();
		val7.rendererInfos = (RendererInfo[])(object)new RendererInfo[1];
		val7.rendererInfos[0].renderer = (Renderer)(object)sacrInfect.GetComponent<MeshRenderer>();
		val7.rendererInfos[0].defaultMaterial = MainAssets.LoadAsset<Material>("sacriInfectMat.mat");
		vdluInfect = MainAssets.LoadAsset<GameObject>("vdluInfect.prefab");
		ItemDisplay val8 = vdluInfect.AddComponent<ItemDisplay>();
		val8.rendererInfos = (RendererInfo[])(object)new RendererInfo[1];
		val8.rendererInfos[0].renderer = (Renderer)(object)vdluInfect.GetComponent<MeshRenderer>();
		val8.rendererInfos[0].defaultMaterial = MainAssets.LoadAsset<Material>("vdluInfectMat.mat");
		string[] bones = new string[14]
		{
			"chest", "Stomach", "Head", "UpperArmL", "LowerArmL", "UpperArmR", "LowerArmR", "ThighL", "ThighR", "CalfL",
			"CalfR", "chest", "Stomach", "chest"
		};
		Xoroshiro128Plus mithRand = new Xoroshiro128Plus(seed.Value);
		Enumerator<ItemTierDef> enumerator = ItemTierCatalog.allItemTierDefs.GetEnumerator();
		try
		{
			while (enumerator.MoveNext())
			{
				ItemTierDef current = enumerator.Current;
				string[] obj = new string[6]
				{
					"j2: ",
					((Object)current).name,
					" | ",
					null,
					null,
					null
				};
				ItemTier tier = current.tier;
				obj[3] = ((object)(ItemTier)(ref tier)).ToString();
				obj[4] = " | ";
				obj[5] = ((object)current).ToString();
				Debug.Log((object)string.Concat(obj));
			}
		}
		finally
		{
			((IDisposable)enumerator).Dispose();
		}
		syblTier = ItemTierCatalog.FindTierDef("Sibylline").tier;
		sacrTier = ItemTierCatalog.FindTierDef("Sacrificial").tier;
		vdluTier = ItemTierCatalog.FindTierDef("VoidLunarTierDef").tier;
		ItemDisplayRuleSet val9 = Addressables.LoadAssetAsync<ItemDisplayRuleSet>((object)"RoR2/Base/Brother/idrsBrother.asset").WaitForCompletion();
		KeyAssetRuleGroup[] array = val9.keyAssetRuleGroups;
		ReadOnlyArray<ReadOnlyContentPack> allLoadedContentPacks = ContentManager.allLoadedContentPacks;
		IList<string> source = idsToIgnore.Value.Split(new string[2] { ",", " " }, StringSplitOptions.RemoveEmptyEntries);
		Enumerator<ReadOnlyContentPack> enumerator2 = allLoadedContentPacks.GetEnumerator();
		try
		{
			while (enumerator2.MoveNext())
			{
				ReadOnlyContentPack pack = enumerator2.Current;
				List<string> list = source.Where((string item) => ((ReadOnlyContentPack)(ref pack)).identifier.Contains(item)).ToList();
				Debug.Log((object)("List of Finds: " + list.Count + " | " + list.ToString()));
				if (list.Count > 0)
				{
					Debug.Log((object)("Skipping " + ((ReadOnlyContentPack)(ref pack)).identifier));
				}
				else if (((ReadOnlyContentPack)(ref pack)).identifier == "RoR2.BaseContent")
				{
					if (((ReadOnlyContentPack)(ref pack)).itemDefs.Length != 0)
					{
						Debug.Log((object)("Adding " + ((ReadOnlyContentPack)(ref pack)).identifier + " boss items"));
						array = AddAllDisplays(((ReadOnlyContentPack)(ref pack)).itemDefs, array, mithRand, bones, (ItemTier)4);
					}
				}
				else if (((ReadOnlyContentPack)(ref pack)).itemDefs.Length != 0)
				{
					Debug.Log((object)("Adding " + ((ReadOnlyContentPack)(ref pack)).identifier + "'s items"));
					array = AddAllDisplays(((ReadOnlyContentPack)(ref pack)).itemDefs, array, mithRand, bones, (ItemTier)5);
				}
			}
		}
		finally
		{
			((IDisposable)enumerator2).Dispose();
		}
		val9.keyAssetRuleGroups = array;
	}

	private (Vector3, Vector3) GeneratePositionFromRand(Xoroshiro128Plus rand, int randVal)
	{
		//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_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d3: 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_03d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_03da: Unknown result type (might be due to invalid IL or missing references)
		//IL_03db: Unknown result type (might be due to invalid IL or missing references)
		//IL_03dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ec: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ef: Unknown result type (might be due to invalid IL or missing references)
		//IL_03f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_03f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_03f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0317: Unknown result type (might be due to invalid IL or missing references)
		Vector3 zero = Vector3.zero;
		Vector3 zero2 = Vector3.zero;
		Vector3 val = default(Vector3);
		if (randVal == 0 || randVal == 11)
		{
			((Vector3)(ref val))..ctor(rand.nextBool ? rand.RangeFloat(-0.125f, -0.045f) : rand.RangeFloat(0.045f, 0.125f), rand.RangeFloat(-0.2f, 0.325f), rand.nextBool ? rand.RangeFloat(-0.125f, -0.085f) : rand.RangeFloat(0.085f, 0.125f));
			((Vector3)(ref zero))..ctor(-0.00957f, 0.20225f, -0.023202f);
			((Vector3)(ref zero2))..ctor(0f, 80f, 330f);
		}
		else if (randVal == 1 || randVal == 12)
		{
			((Vector3)(ref val))..ctor(rand.nextBool ? rand.RangeFloat(-0.1275f, -0.065f) : rand.RangeFloat(0.065f, 0.1275f), rand.RangeFloat(0.125f, 0.325f), rand.nextBool ? rand.RangeFloat(-0.125f, -0.085f) : rand.RangeFloat(0.085f, 0.125f));
			((Vector3)(ref zero))..ctor(-0.03386f, 0.24174f, 0.06423f);
			((Vector3)(ref zero2))..ctor(0f, 90f, 0f);
		}
		else if (randVal == 2)
		{
			((Vector3)(ref val))..ctor(rand.RangeFloat(-0.075f, 0.075f), rand.RangeFloat(-0.03f, 0.0675f), rand.RangeFloat(-0.075f, 0.075f));
		}
		else if (randVal >= 3 && randVal <= 6)
		{
			((Vector3)(ref val))..ctor(rand.RangeFloat(-0.0065f, 0.0065f), rand.RangeFloat(0.075f, 0.3f), rand.RangeFloat(0.005f, 0.01f));
		}
		else if (randVal == 7 || randVal == 8)
		{
			((Vector3)(ref val))..ctor(rand.RangeFloat(-0.021f, 0.029f), rand.RangeFloat(0.0375f, 0.325f), 0f);
		}
		else if (randVal == 9 || randVal == 10)
		{
			(float, float, float) tuple = (rand.RangeFloat(-0.025f, 0.045f), rand.RangeFloat(0f, 0.3675f), rand.RangeFloat(0.02f, 0.04f));
			Debug.Log((object)("bean: " + tuple.Item1 + " | " + tuple.Item2 + " | " + tuple.Item3));
			((Vector3)(ref val))..ctor(tuple.Item1, tuple.Item2, tuple.Item3);
			((Vector3)(ref zero))..ctor(0.01f, val.y, 0.03f);
		}
		else
		{
			((Vector3)(ref val))..ctor(rand.nextBool ? rand.RangeFloat(-0.115f, -0.065f) : rand.RangeFloat(0.065f, 0.115f), rand.RangeFloat(0.12f, 0.325f), rand.nextBool ? rand.RangeFloat(-0.05f, -0.035f) : rand.RangeFloat(-0.005f, 0.01f));
			((Vector3)(ref zero))..ctor(-0.00957f, 0.20225f, -0.025f);
			((Vector3)(ref zero2))..ctor(341.1971f, 90f, 27f);
		}
		zero.y = val.y;
		Vector3 val2 = val - zero;
		Quaternion val3 = Quaternion.LookRotation(val2);
		Vector3 eulerAngles = ((Quaternion)(ref val3)).eulerAngles;
		eulerAngles += zero2;
		return (val, eulerAngles);
	}

	private KeyAssetRuleGroup[] AddAllDisplays(ReadOnlyNamedAssetCollection<ItemDef> items, KeyAssetRuleGroup[] itemRuleGroups, Xoroshiro128Plus mithRand, string[] bones, ItemTier filter)
	{
		//IL_0004: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Invalid comparison between Unknown and I4
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0024: Invalid comparison between Unknown and I4
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Invalid comparison between Unknown and I4
		//IL_0057: Unknown result type (might be due to invalid IL or missing references)
		//IL_005c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0097: Unknown result type (might be due to invalid IL or missing references)
		//IL_009c: Unknown result type (might be due to invalid IL or missing references)
		//IL_009e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a0: 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_00d1: Expected I4, but got Unknown
		//IL_0143: Unknown result type (might be due to invalid IL or missing references)
		//IL_0149: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_01eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
		//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_0214: Unknown result type (might be due to invalid IL or missing references)
		//IL_0219: Unknown result type (might be due to invalid IL or missing references)
		//IL_021e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0227: Unknown result type (might be due to invalid IL or missing references)
		//IL_0163: Unknown result type (might be due to invalid IL or missing references)
		//IL_0169: Unknown result type (might be due to invalid IL or missing references)
		//IL_0183: Unknown result type (might be due to invalid IL or missing references)
		//IL_0189: Unknown result type (might be due to invalid IL or missing references)
		AssetEnumerator<ItemDef> enumerator = items.GetEnumerator();
		try
		{
			KeyAssetRuleGroup val = default(KeyAssetRuleGroup);
			while (enumerator.MoveNext())
			{
				ItemDef current = enumerator.Current;
				if (((int)filter == 5 && (int)current.tier != 5) || (current.tier == filter && (int)filter != 5))
				{
					string nameToken = current.nameToken;
					ItemTier tier = current.tier;
					Debug.Log((object)("item: " + nameToken + "| " + ((object)(ItemTier)(ref tier)).ToString()));
					val.keyAsset = (Object)(object)current;
					int num = mithRand.RangeInt(0, bones.Length);
					(Vector3, Vector3) tuple = GeneratePositionFromRand(mithRand, num);
					ItemTier tier2 = current.tier;
					ItemTier val2 = tier2;
					GameObject followerPrefab = (GameObject)((int)val2 switch
					{
						0 => t1Infect, 
						1 => t2Infect, 
						2 => t3Infect, 
						4 => bsInfect, 
						3 => luInfect, 
						6 => t1Infect, 
						7 => t2Infect, 
						8 => t3Infect, 
						9 => bsInfect, 
						_ => (current.tier != syblTier) ? ((current.tier != sacrTier) ? ((current.tier != vdluTier) ? t1Infect : vdluInfect) : sacrInfect) : syblInfect, 
					});
					val.displayRuleGroup = default(DisplayRuleGroup);
					((DisplayRuleGroup)(ref val.displayRuleGroup)).AddDisplayRule(new ItemDisplayRule
					{
						ruleType = (ItemDisplayRuleType)0,
						followerPrefab = followerPrefab,
						childName = bones[num],
						localPos = tuple.Item1,
						localAngles = tuple.Item2,
						localScale = new Vector3(0.11f, 0.11f, 0.11f)
					});
					itemRuleGroups = CollectionExtensions.AddItem<KeyAssetRuleGroup>((IEnumerable<KeyAssetRuleGroup>)itemRuleGroups, val).ToArray();
				}
			}
		}
		finally
		{
			((IDisposable)enumerator).Dispose();
		}
		return itemRuleGroups;
	}

	public void Swapallshaders(AssetBundle bundle)
	{
		Material[] array = bundle.LoadAllAssets<Material>();
		Material[] array2 = array;
		foreach (Material val in array2)
		{
			switch (((Object)val.shader).name)
			{
			case "Stubbed Hopoo Games/Deferred/Standard":
				val.shader = Resources.Load<Shader>("shaders/deferred/hgstandard");
				break;
			case "Stubbed Hopoo Games/Deferred/Snow Topped":
				val.shader = Resources.Load<Shader>("shaders/deferred/hgsnowtopped");
				break;
			case "Stubbed Hopoo Games/FX/Cloud Remap":
				val.shader = Resources.Load<Shader>("shaders/fx/hgcloudremap");
				break;
			case "Stubbed Hopoo Games/FX/Cloud Intersection Remap":
				val.shader = Resources.Load<Shader>("shaders/fx/hgintersectioncloudremap");
				break;
			case "Stubbed Hopoo Games/FX/Opaque Cloud Remap":
				val.shader = Resources.Load<Shader>("shaders/fx/hgopaquecloudremap");
				break;
			case "Stubbed Hopoo Games/FX/Distortion":
				val.shader = Resources.Load<Shader>("shaders/fx/hgdistortion");
				break;
			case "Stubbed Hopoo Games/FX/Solid Parallax":
				val.shader = Resources.Load<Shader>("shaders/fx/hgsolidparallax");
				break;
			case "Stubbed Hopoo Games/Environment/Distant Water":
				val.shader = Resources.Load<Shader>("shaders/environment/hgdistantwater");
				break;
			case "StubbedRoR2/Base/Shaders/HGCloudRemap":
				val.shader = Resources.Load<Shader>("shaders/fx/hgcloudremap");
				break;
			}
		}
	}
}