Decompiled source of Smiling Company v0.1.0

Smiling Company.dll

Decompiled 2 weeks 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("Smiling Company")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Smiling Company")]
[assembly: AssemblyTitle("Smiling 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 MRYUJIROHANMA : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Yujiro Hanma";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRBAKIHAMNA : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Baki Hamna";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRANUKAS : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "anukaS";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRDJSPIT : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "DJ Spit";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRCHARLIE : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Charlie";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRCLONECOMMANDO : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Clone Commando";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRHEDORAH : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Hedorah";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRBURNINGGODZILLA : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Burning Godzilla";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRPIM : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Pim";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRSECURITY : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Security";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRPO : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Po";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MREMILE : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Emile";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRFALLGUY : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Fall Guy";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRTEAMMAGMA : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Team Magma";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRPEELY : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Peely";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRWOLFMACCLOUD : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Wolf MacCloud";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRFALLOUT : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Fallout";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MREMINEM : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Eminem";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRKINGKONG : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "King Kong";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRDEBBIEGRAYSON : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Debbie Grayson";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRINVINCIBLE : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Invincible ";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRKERMIT : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Kermit";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRKILLERBEAN : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Killer Bean";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRPLAGUEDOCTOR : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Plague Doctor";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRTAKANUVA : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Takanuva";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRRINTOO : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Rintoo";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRMAXILOS : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Maxilos";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRENSIGNSCAV : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Ensign Scav";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRBARBATOS : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Barbatos";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRPERIDOT : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Peridot";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRALZHEIMERS : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Alzheimers ";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRTHECONVICT : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "The Convict";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRCASEOH : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Caseoh";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MROBAMNA : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Obamna";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRGOONER : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Gooner";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRICHIBAN : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Ichiban";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRBENCARMINE : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Ben Carmine";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRSATORUGOJO : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Satoru Gojo";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	[BepInPlugin("ImperialMech.SmilingCompany", "Smiling 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", "Ensign Scav", true, "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", "Alzheimers, anukaS, Baki Hamna, Barbatos, Ben Carmine, Burning Godzilla, Caseoh, CharlieClone Commando, Debbie Grayson, DJ Spit, Emile, Eminem, Ensign Scav, Fall Guy, Fallout, Gooner, Guts, Hedorah, Ichiban, Invincible, Kermit, Killer Bean, King King, Maxilos, Obamna, Peely, Peridot, Pim, Plague DoctorPo, Rintoo, Satoru Gojo, Security, Takanuva, Team Magma, The Convict, Wolf MacCloud, Yujiro Hamna", "Enter a comma separated list of suit names.(Additionally, [Green suit,Pajama suit,Hazard suit])");
		}

		private void Awake()
		{
			//IL_03b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ba: Expected O, but got Unknown
			config = ((BaseUnityPlugin)this).Config;
			InitConfig();
			Assets.PopulateAssets();
			if (enableModelForAllSuits.Value)
			{
				ModelReplacementAPI.RegisterModelReplacementOverride(typeof(MRYUJIROHANMA));
			}
			if (enableModelAsDefault.Value)
			{
				ModelReplacementAPI.RegisterModelReplacementDefault(typeof(MRENSIGNSCAV));
			}
			string[] array = suitNamesToEnableModel.Value.Split(',');
			string[] array2 = array;
			foreach (string text in array2)
			{
				ModelReplacementAPI.RegisterSuitModelReplacement("Alzheimers", typeof(MRALZHEIMERS));
				ModelReplacementAPI.RegisterSuitModelReplacement("anukaS", typeof(MRANUKAS));
				ModelReplacementAPI.RegisterSuitModelReplacement("Baki Hamna", typeof(MRBAKIHAMNA));
				ModelReplacementAPI.RegisterSuitModelReplacement("Barbatos", typeof(MRBARBATOS));
				ModelReplacementAPI.RegisterSuitModelReplacement("Ben Carmine", typeof(MRBENCARMINE));
				ModelReplacementAPI.RegisterSuitModelReplacement("Burning Godzilla", typeof(MRBURNINGGODZILLA));
				ModelReplacementAPI.RegisterSuitModelReplacement("Caseoh", typeof(MRCASEOH));
				ModelReplacementAPI.RegisterSuitModelReplacement("Charlie", typeof(MRCHARLIE));
				ModelReplacementAPI.RegisterSuitModelReplacement("Clone Commando", typeof(MRCLONECOMMANDO));
				ModelReplacementAPI.RegisterSuitModelReplacement("Debbie Grayson", typeof(MRDEBBIEGRAYSON));
				ModelReplacementAPI.RegisterSuitModelReplacement("DJ Spit", typeof(MRDJSPIT));
				ModelReplacementAPI.RegisterSuitModelReplacement("Emile", typeof(MREMILE));
				ModelReplacementAPI.RegisterSuitModelReplacement("Eminem", typeof(MREMINEM));
				ModelReplacementAPI.RegisterSuitModelReplacement("Ensign Scav", typeof(MRENSIGNSCAV));
				ModelReplacementAPI.RegisterSuitModelReplacement("Fall Guy", typeof(MRFALLGUY));
				ModelReplacementAPI.RegisterSuitModelReplacement("Fallout", typeof(MRFALLOUT));
				ModelReplacementAPI.RegisterSuitModelReplacement("Gooner", typeof(MRGOONER));
				ModelReplacementAPI.RegisterSuitModelReplacement("Hedorah", typeof(MRHEDORAH));
				ModelReplacementAPI.RegisterSuitModelReplacement("Ichiban", typeof(MRICHIBAN));
				ModelReplacementAPI.RegisterSuitModelReplacement("Invincible", typeof(MRINVINCIBLE));
				ModelReplacementAPI.RegisterSuitModelReplacement("Kermit", typeof(MRKERMIT));
				ModelReplacementAPI.RegisterSuitModelReplacement("Killer Bean", typeof(MRKILLERBEAN));
				ModelReplacementAPI.RegisterSuitModelReplacement("King Kong", typeof(MRKINGKONG));
				ModelReplacementAPI.RegisterSuitModelReplacement("Maxilos", typeof(MRMAXILOS));
				ModelReplacementAPI.RegisterSuitModelReplacement("Obamna", typeof(MROBAMNA));
				ModelReplacementAPI.RegisterSuitModelReplacement("Peely", typeof(MRPEELY));
				ModelReplacementAPI.RegisterSuitModelReplacement("Peridot", typeof(MRPERIDOT));
				ModelReplacementAPI.RegisterSuitModelReplacement("Pim", typeof(MRPIM));
				ModelReplacementAPI.RegisterSuitModelReplacement("Plague Doctor", typeof(MRPLAGUEDOCTOR));
				ModelReplacementAPI.RegisterSuitModelReplacement("Po", typeof(MRPO));
				ModelReplacementAPI.RegisterSuitModelReplacement("Rintoo", typeof(MRRINTOO));
				ModelReplacementAPI.RegisterSuitModelReplacement("Satoru Gojo", typeof(MRSATORUGOJO));
				ModelReplacementAPI.RegisterSuitModelReplacement("Security", typeof(MRSECURITY));
				ModelReplacementAPI.RegisterSuitModelReplacement("Takanuva", typeof(MRTAKANUVA));
				ModelReplacementAPI.RegisterSuitModelReplacement("Team Magma", typeof(MRTEAMMAGMA));
				ModelReplacementAPI.RegisterSuitModelReplacement("The Convict", typeof(MRTHECONVICT));
				ModelReplacementAPI.RegisterSuitModelReplacement("Wolf MacCloud", typeof(MRWOLFMACCLOUD));
				ModelReplacementAPI.RegisterSuitModelReplacement("Yujiro Hamna", typeof(MRYUJIROHANMA));
			}
			Harmony val = new Harmony("ImperialMech.SmilingCompany");
			val.PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin ImperialMech.SmilingCompany is loaded!");
		}
	}
	public static class Assets
	{
		public static string mainAssetBundleName = "SmilingCompany";

		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)
		{
		}
	}
}