Decompiled source of TonyPizzaSkinPack v0.1.0

0-TonyPizzaSkinPack1.dll

Decompiled a day 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-CSharp")]
[assembly: AssemblyCompany("0-TonyPizzaSkinPack1")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("0-TonyPizzaSkinPack1")]
[assembly: AssemblyTitle("0-TonyPizzaSkinPack1")]
[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 MRBANJOSSBU : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "BanjoSSBU";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRBILLYHATCHER : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "BillyHatcher";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRBUG : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Bug";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRCHIITAN : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Chiitan";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRDOOM1P : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Doom1P";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRGEX : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Gex";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRIRONMAN : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Iron Man";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRMARIAROBOTNIK : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "MariaRobotnik";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRMRMOONKNIGHT : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "MR Moon Knight";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MROMNIMAN : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "OmniMan";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRPICHU : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Pichu";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRVANDHAM : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Vandham";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRVENOM : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Venom";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRYOSHINORMAL : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "YoshiNormal";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRHACKETT : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Hackett";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRARGAGARG : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Argagarg";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRARTHUR : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Arthur";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRARMORKING : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "ArmorKing";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRMONKEYRIGGED : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "MonkeyRigged";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRDONKEYKONG : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "DonkeyKong";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRAGGRETSUKO : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Aggretsuko";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRASUKACLASSIC : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "AsukaClassic";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRCOMMANDERSHEPARD : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "CommanderShepard";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRFULGOREKI : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "FulgoreKI";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRGARRTUSRIGGED : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "GarrtusRigged";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRGORDONRAMSAY : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "GordonRamsay";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRIORIRIGGED : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "IoriRigged";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRNEGANTEKKEN : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "NeganTekken";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRZANGIEFSFIV : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "ZangiefSFIV";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRZAGREUS_RIG : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Zagreus_RIG";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRSPACEMARINE : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "SpaceMarine";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRTERRY : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Terry";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRNIA : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Nia";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRISABELLEAC : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "IsabelleAC";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRRASH : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Rash";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRPHOENIXWRIGHT : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "PhoenixWright";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRANKHAAC : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "AnkhaAC";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRSORA : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Sora";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRSOUNDWAVE : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Soundwave";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	[BepInPlugin("com.tonypizza.TonyPizzaSkinPack", "TonyPizzaSkinPack", "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", "Default,Orange suit", "Enter a comma separated list of suit names.(Additionally, [Green suit,Pajama suit,Hazard suit])");
		}

		private void Awake()
		{
			//IL_03c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03cf: Expected O, but got Unknown
			config = ((BaseUnityPlugin)this).Config;
			InitConfig();
			Assets.PopulateAssets();
			if (enableModelForAllSuits.Value)
			{
				ModelReplacementAPI.RegisterModelReplacementOverride(typeof(MRBANJOSSBU));
			}
			if (enableModelAsDefault.Value)
			{
				ModelReplacementAPI.RegisterModelReplacementDefault(typeof(MRBANJOSSBU));
			}
			string[] array = suitNamesToEnableModel.Value.Split(',');
			string[] array2 = array;
			foreach (string text in array2)
			{
				ModelReplacementAPI.RegisterSuitModelReplacement("Admiral Hackett", typeof(MRHACKETT));
				ModelReplacementAPI.RegisterSuitModelReplacement("Aggretsuko", typeof(MRAGGRETSUKO));
				ModelReplacementAPI.RegisterSuitModelReplacement("Ankha", typeof(MRANKHAAC));
				ModelReplacementAPI.RegisterSuitModelReplacement("Argagarg", typeof(MRARGAGARG));
				ModelReplacementAPI.RegisterSuitModelReplacement("Armor King", typeof(MRARMORKING));
				ModelReplacementAPI.RegisterSuitModelReplacement("Arthur", typeof(MRARTHUR));
				ModelReplacementAPI.RegisterSuitModelReplacement("Asuka Kazama", typeof(MRASUKACLASSIC));
				ModelReplacementAPI.RegisterSuitModelReplacement("Banjo", typeof(MRBANJOSSBU));
				ModelReplacementAPI.RegisterSuitModelReplacement("Billy Hatcher", typeof(MRBILLYHATCHER));
				ModelReplacementAPI.RegisterSuitModelReplacement("Bug", typeof(MRBUG));
				ModelReplacementAPI.RegisterSuitModelReplacement("Chiitan", typeof(MRCHIITAN));
				ModelReplacementAPI.RegisterSuitModelReplacement("Commander Shepard", typeof(MRCOMMANDERSHEPARD));
				ModelReplacementAPI.RegisterSuitModelReplacement("Dart Monkey", typeof(MRMONKEYRIGGED));
				ModelReplacementAPI.RegisterSuitModelReplacement("Doctor Doom", typeof(MRDOOM1P));
				ModelReplacementAPI.RegisterSuitModelReplacement("Donkey Kong", typeof(MRDONKEYKONG));
				ModelReplacementAPI.RegisterSuitModelReplacement("Fulgore", typeof(MRFULGOREKI));
				ModelReplacementAPI.RegisterSuitModelReplacement("Garrus", typeof(MRGARRTUSRIGGED));
				ModelReplacementAPI.RegisterSuitModelReplacement("Gex", typeof(MRGEX));
				ModelReplacementAPI.RegisterSuitModelReplacement("Gordon Ramsay", typeof(MRGORDONRAMSAY));
				ModelReplacementAPI.RegisterSuitModelReplacement("Iori Yagami", typeof(MRIORIRIGGED));
				ModelReplacementAPI.RegisterSuitModelReplacement("Iron Man", typeof(MRIRONMAN));
				ModelReplacementAPI.RegisterSuitModelReplacement("Isabelle", typeof(MRISABELLEAC));
				ModelReplacementAPI.RegisterSuitModelReplacement("Maria Robotnik", typeof(MRMARIAROBOTNIK));
				ModelReplacementAPI.RegisterSuitModelReplacement("Moon Knight", typeof(MRMRMOONKNIGHT));
				ModelReplacementAPI.RegisterSuitModelReplacement("Negan", typeof(MRNEGANTEKKEN));
				ModelReplacementAPI.RegisterSuitModelReplacement("Nia", typeof(MRNIA));
				ModelReplacementAPI.RegisterSuitModelReplacement("Omni-Man", typeof(MROMNIMAN));
				ModelReplacementAPI.RegisterSuitModelReplacement("Phoenix Wright", typeof(MRPHOENIXWRIGHT));
				ModelReplacementAPI.RegisterSuitModelReplacement("Pichu", typeof(MRPICHU));
				ModelReplacementAPI.RegisterSuitModelReplacement("Rash", typeof(MRRASH));
				ModelReplacementAPI.RegisterSuitModelReplacement("Sora", typeof(MRSORA));
				ModelReplacementAPI.RegisterSuitModelReplacement("Soundwave", typeof(MRSOUNDWAVE));
				ModelReplacementAPI.RegisterSuitModelReplacement("Terry Bogard", typeof(MRTERRY));
				ModelReplacementAPI.RegisterSuitModelReplacement("Ultra Marine", typeof(MRSPACEMARINE));
				ModelReplacementAPI.RegisterSuitModelReplacement("Vandham", typeof(MRVANDHAM));
				ModelReplacementAPI.RegisterSuitModelReplacement("Venom", typeof(MRVENOM));
				ModelReplacementAPI.RegisterSuitModelReplacement("Yoshi", typeof(MRYOSHINORMAL));
				ModelReplacementAPI.RegisterSuitModelReplacement("Zagreus", typeof(MRZAGREUS_RIG));
				ModelReplacementAPI.RegisterSuitModelReplacement("Zangief", typeof(MRZANGIEFSFIV));
			}
			Harmony val = new Harmony("com.tonypizza.TonyPizzaSkinPack");
			val.PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin com.tonypizza.TonyPizzaSkinPack is loaded!");
		}
	}
	public static class Assets
	{
		public static string mainAssetBundleName = "TonyPizzaSP1";

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