Decompiled source of Blessed Company v0.1.0

Blessed Company.dll

Decompiled 9 months 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.Configuration;
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.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: IgnoresAccessChecksTo("")]
[assembly: AssemblyCompany("Blessed Company")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Blessed Company")]
[assembly: AssemblyTitle("Blessed Company")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
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 ModelReplacement
{
	public class MRCH : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "ch";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRCH11_KIRYU : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "ch11_kiryu";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRCLOUDSTRIFE7RSKYSOARERMOD : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Cloud Strife 7R Sky Soarer Mod";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRCOMMISSIONRHULANIMAWILA10JUJUTSUKAISENSATORUGOJO : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Commission rhulanimawila10 Jujutsu kaisen Satoru Gojo";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRGENERIC_ITEMFUR : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "generic_item - fur";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRGIOVANNI_SYGNA_10 : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Giovanni_Sygna_10";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRJETJUGER_ALL1 : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "jetjuger_all1";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRN_REGULAR_00 : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "N_Regular_00";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRP_CHA_2200 : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "P_Cha_2200";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRPLAYER_DEFAULT_INTRO_CS_1 : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "player_default_intro_cs_1";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRLOONA : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Loona";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRMASTERCHIEFWALK : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Master Chief-walk";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRMMAKICK : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Mma Kick";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRKAFKAV0 : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "kafkaV0";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRBLADEV5 : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "BladeV5";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRSORAKH2 : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Sora KH2";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRLAMBERTOUTLINE : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Lambert-Outline";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRSEPHIROTHOPERATIVEOFLEGEND : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Sephiroth Operative of Legend";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRSTARPLATINUM : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Star Platinum";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MR3PLN01 : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "3pln01";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRKILLERQUEEN : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Killer Queen";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRPL14_DESTROIA : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "pl14_destroia";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRPL15_GIGAN : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "pl15_gigan";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRSKEL_MOXXI : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Skel_Moxxi";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRPL05_KINGGIDRA : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "pl05_kinggidra";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	[BepInPlugin("ImperialMech.BlessedCompany", "Blessed_Company", "0.1.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		public static ConfigFile config;

		public static ConfigEntry<bool> enableModelForAllSuits { get; private set; }

		public static ConfigEntry<bool> enableModelAsDefault { get; private set; }

		public static ConfigEntry<string> suitNamesToEnableModel { get; private set; }

		private static void InitConfig()
		{
			enableModelForAllSuits = config.Bind<bool>("Suits to Replace Settings", "Enable Model for all Suits", false, "Enable to model replace every suit. Set to false to specify suits");
			enableModelAsDefault = config.Bind<bool>("Suits to Replace Settings", "Enable Model as default", false, "Enable to model replace every suit that hasn't been otherwise registered.");
			suitNamesToEnableModel = config.Bind<string>("Suits to Replace Settings", "Suits to enable Model for", "Blade, Charles, Chun Li, Destroyah, Generic Cowboy, Gigan, Giovanni, Gojo, Jet Jaguar, KafkaKH 2 Sora, KH Cloud, Killer Queen, King Ghidorah, Kiryu, Lamb, Loona, Mad Moxxi, Master Chief, N, Polnareff, Sephiroth, Star Platinum, Sully, Van Present", "Enter a comma separated list of suit names.(Additionally, [Green suit,Pajama suit,Hazard suit])");
		}

		private void Awake()
		{
			//IL_02a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a9: Expected O, but got Unknown
			config = ((BaseUnityPlugin)this).Config;
			InitConfig();
			Assets.PopulateAssets();
			if (enableModelForAllSuits.Value)
			{
				ModelReplacementAPI.RegisterModelReplacementOverride(typeof(MRCH));
			}
			if (enableModelAsDefault.Value)
			{
				ModelReplacementAPI.RegisterModelReplacementDefault(typeof(MRCH));
			}
			string[] array = suitNamesToEnableModel.Value.Split(',');
			string[] array2 = array;
			foreach (string text in array2)
			{
				ModelReplacementAPI.RegisterSuitModelReplacement("Blade", typeof(MRBLADEV5));
				ModelReplacementAPI.RegisterSuitModelReplacement("Charles", typeof(MRCH));
				ModelReplacementAPI.RegisterSuitModelReplacement("Chun Li", typeof(MRMMAKICK));
				ModelReplacementAPI.RegisterSuitModelReplacement("Destroyah", typeof(MRPL14_DESTROIA));
				ModelReplacementAPI.RegisterSuitModelReplacement("Generic Cowboy", typeof(MRPLAYER_DEFAULT_INTRO_CS_1));
				ModelReplacementAPI.RegisterSuitModelReplacement("Gigan", typeof(MRPL15_GIGAN));
				ModelReplacementAPI.RegisterSuitModelReplacement("Giovanni", typeof(MRGIOVANNI_SYGNA_10));
				ModelReplacementAPI.RegisterSuitModelReplacement("Gojo", typeof(MRCOMMISSIONRHULANIMAWILA10JUJUTSUKAISENSATORUGOJO));
				ModelReplacementAPI.RegisterSuitModelReplacement("Jet Jaguar", typeof(MRJETJUGER_ALL1));
				ModelReplacementAPI.RegisterSuitModelReplacement("Kafka", typeof(MRKAFKAV0));
				ModelReplacementAPI.RegisterSuitModelReplacement("KH 2 Sora", typeof(MRSORAKH2));
				ModelReplacementAPI.RegisterSuitModelReplacement("KH Cloud", typeof(MRCLOUDSTRIFE7RSKYSOARERMOD));
				ModelReplacementAPI.RegisterSuitModelReplacement("Killer Queen", typeof(MRKILLERQUEEN));
				ModelReplacementAPI.RegisterSuitModelReplacement("King Ghidorah", typeof(MRPL05_KINGGIDRA));
				ModelReplacementAPI.RegisterSuitModelReplacement("Kiryu", typeof(MRCH11_KIRYU));
				ModelReplacementAPI.RegisterSuitModelReplacement("Lamb", typeof(MRLAMBERTOUTLINE));
				ModelReplacementAPI.RegisterSuitModelReplacement("Loona", typeof(MRLOONA));
				ModelReplacementAPI.RegisterSuitModelReplacement("Mad Moxxi", typeof(MRSKEL_MOXXI));
				ModelReplacementAPI.RegisterSuitModelReplacement("Master Chief", typeof(MRMASTERCHIEFWALK));
				ModelReplacementAPI.RegisterSuitModelReplacement("N", typeof(MRN_REGULAR_00));
				ModelReplacementAPI.RegisterSuitModelReplacement("Polnareff", typeof(MR3PLN01));
				ModelReplacementAPI.RegisterSuitModelReplacement("Sephiroth", typeof(MRSEPHIROTHOPERATIVEOFLEGEND));
				ModelReplacementAPI.RegisterSuitModelReplacement("Star Platinum", typeof(MRSTARPLATINUM));
				ModelReplacementAPI.RegisterSuitModelReplacement("Sully", typeof(MRGENERIC_ITEMFUR));
				ModelReplacementAPI.RegisterSuitModelReplacement("Van Present", typeof(MRP_CHA_2200));
			}
			Harmony val = new Harmony("ImperialMech.BlessedCompany");
			val.PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin ImperialMech.BlessedCompany is loaded!");
		}
	}
	public static class Assets
	{
		public static string mainAssetBundleName = "blessedcompanylethal";

		public static AssetBundle MainAssetBundle = null;

		private static string GetAssemblyName()
		{
			return Assembly.GetExecutingAssembly().GetName().Name.Replace(" ", "_");
		}

		public static void PopulateAssets()
		{
			if ((Object)(object)MainAssetBundle == (Object)null)
			{
				Console.WriteLine(GetAssemblyName() + "." + mainAssetBundleName);
				using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(GetAssemblyName() + "." + mainAssetBundleName);
				MainAssetBundle = AssetBundle.LoadFromStream(stream);
			}
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}