Decompiled source of DreamgrovePlayerModels v0.1.3

DreamgrovePlayerModels.dll

Decompiled 2 months ago
using System;
using System.Collections;
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 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 = "")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: AssemblyCompany("DreamgrovePlayerModels")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("DreamgrovePlayerModels")]
[assembly: AssemblyTitle("DreamgrovePlayerModels")]
[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 Chad : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "chadModel";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class Lego_Yoda : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "LegoYoda";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}

		protected override void OnDeath()
		{
			GameObject gameObject = ((Component)base.replacementDeadBody.transform.Find("DeathSound")).gameObject;
			gameObject.SetActive(true);
			((MonoBehaviour)this).StartCoroutine(DisableAfterDelay(gameObject, 1.5f));
		}

		private IEnumerator DisableAfterDelay(GameObject gameObject, float delay)
		{
			yield return (object)new WaitForSeconds(delay);
			gameObject.SetActive(false);
		}
	}
	public class Doom_Slayer : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "doom eternal slayer";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class NCR_Ranger : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "RangerFallout4fbx";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}

		protected override void OnDeath()
		{
			GameObject gameObject = ((Component)base.replacementDeadBody.transform.Find("RangerDeathSound")).gameObject;
			gameObject.SetActive(true);
			((MonoBehaviour)this).StartCoroutine(DisableAfterDelay(gameObject, 4.5f));
		}

		private IEnumerator DisableAfterDelay(GameObject gameObject, float delay)
		{
			yield return (object)new WaitForSeconds(delay);
			gameObject.SetActive(false);
		}
	}
	public class HalfLifeScientist : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "HalfLifeScientist";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}

		protected override void OnDeath()
		{
			GameObject gameObject = ((Component)base.replacementDeadBody.transform.Find("ScientistDeathSound")).gameObject;
			gameObject.SetActive(true);
			((MonoBehaviour)this).StartCoroutine(DisableAfterDelay(gameObject, 1f));
		}

		private IEnumerator DisableAfterDelay(GameObject gameObject, float delay)
		{
			yield return (object)new WaitForSeconds(delay);
			gameObject.SetActive(false);
		}
	}
	public class Jerma : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Jerma";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}

		protected override void OnDeath()
		{
			GameObject gameObject = ((Component)base.replacementDeadBody.transform.Find("JermaDeathSound")).gameObject;
			gameObject.SetActive(true);
			((MonoBehaviour)this).StartCoroutine(DisableAfterDelay(gameObject, 1.2f));
		}

		private IEnumerator DisableAfterDelay(GameObject gameObject, float delay)
		{
			yield return (object)new WaitForSeconds(delay);
			gameObject.SetActive(false);
		}
	}
	public class Master_Chief : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Master Chief";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}

		protected override void OnDeath()
		{
			GameObject gameObject = ((Component)base.replacementDeadBody.transform.Find("CheifDeathSound")).gameObject;
			gameObject.SetActive(true);
			((MonoBehaviour)this).StartCoroutine(DisableAfterDelay(gameObject, 1f));
		}

		private IEnumerator DisableAfterDelay(GameObject gameObject, float delay)
		{
			yield return (object)new WaitForSeconds(delay);
			gameObject.SetActive(false);
		}
	}
	public class HaloElite : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "HaloElite";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}

		protected override void OnDeath()
		{
			GameObject gameObject = ((Component)base.replacementDeadBody.transform.Find("EliteDeathSound")).gameObject;
			gameObject.SetActive(true);
			((MonoBehaviour)this).StartCoroutine(DisableAfterDelay(gameObject, 1.2f));
		}

		private IEnumerator DisableAfterDelay(GameObject gameObject, float delay)
		{
			yield return (object)new WaitForSeconds(delay);
			gameObject.SetActive(false);
		}
	}
	public class Poppy : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "PoppyLeaqueOLegendsNoEye";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}

		protected override void OnDeath()
		{
			GameObject gameObject = ((Component)base.replacementDeadBody.transform.Find("PoppyDeathSound")).gameObject;
			gameObject.SetActive(true);
			((MonoBehaviour)this).StartCoroutine(DisableAfterDelay(gameObject, 1f));
		}

		private IEnumerator DisableAfterDelay(GameObject gameObject, float delay)
		{
			yield return (object)new WaitForSeconds(delay);
			gameObject.SetActive(false);
		}
	}
	public class IssacClarke : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "IsaacClarke";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}

		protected override void OnDeath()
		{
			GameObject gameObject = ((Component)base.replacementDeadBody.transform.Find("IssacDeathSound")).gameObject;
			gameObject.SetActive(true);
			((MonoBehaviour)this).StartCoroutine(DisableAfterDelay(gameObject, 3f));
		}

		private IEnumerator DisableAfterDelay(GameObject gameObject, float delay)
		{
			yield return (object)new WaitForSeconds(delay);
			gameObject.SetActive(false);
		}
	}
	public class Clonetrooper : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "clonetrooper";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}

		protected override void OnDeath()
		{
			GameObject gameObject = ((Component)base.replacementDeadBody.transform.Find("cloneDeathSound")).gameObject;
			gameObject.SetActive(true);
			((MonoBehaviour)this).StartCoroutine(DisableAfterDelay(gameObject, 1.2f));
		}

		private IEnumerator DisableAfterDelay(GameObject gameObject, float delay)
		{
			yield return (object)new WaitForSeconds(delay);
			gameObject.SetActive(false);
		}
	}
	public class PillowMan : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "sexyPillow";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class GnomeBaby : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "gnomebaby";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}

		protected override void OnDeath()
		{
			GameObject gameObject = ((Component)base.replacementDeadBody.transform.Find("gnomeDeathSound")).gameObject;
			gameObject.SetActive(true);
			((MonoBehaviour)this).StartCoroutine(DisableAfterDelay(gameObject, 1.6f));
		}

		private IEnumerator DisableAfterDelay(GameObject gameObject, float delay)
		{
			yield return (object)new WaitForSeconds(delay);
			gameObject.SetActive(false);
		}
	}
	public class Gorilla : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "gorilla";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}

		protected override void OnDeath()
		{
			GameObject gameObject = ((Component)base.replacementDeadBody.transform.Find("GorillaDeathSound")).gameObject;
			gameObject.SetActive(true);
			((MonoBehaviour)this).StartCoroutine(DisableAfterDelay(gameObject, 2f));
		}

		private IEnumerator DisableAfterDelay(GameObject gameObject, float delay)
		{
			yield return (object)new WaitForSeconds(delay);
			gameObject.SetActive(false);
		}
	}
	[BepInPlugin("com.MelonsForDays.DreamgrovePlayerModels", "DreamgrovePlayerModels", "0.1.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		private void Awake()
		{
			//IL_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Expected O, but got Unknown
			Assets.PopulateAssets();
			ModelReplacementAPI.RegisterSuitModelReplacement("Poppy", typeof(Poppy));
			ModelReplacementAPI.RegisterSuitModelReplacement("Chad", typeof(Chad));
			ModelReplacementAPI.RegisterSuitModelReplacement("Lego Yoda", typeof(Lego_Yoda));
			ModelReplacementAPI.RegisterSuitModelReplacement("Doom Guy", typeof(Doom_Slayer));
			ModelReplacementAPI.RegisterSuitModelReplacement("NCR Ranger", typeof(NCR_Ranger));
			ModelReplacementAPI.RegisterSuitModelReplacement("Jerma", typeof(Jerma));
			ModelReplacementAPI.RegisterSuitModelReplacement("Master Chief", typeof(Master_Chief));
			ModelReplacementAPI.RegisterSuitModelReplacement("Scientist", typeof(HalfLifeScientist));
			ModelReplacementAPI.RegisterSuitModelReplacement("Halo Elite", typeof(HaloElite));
			ModelReplacementAPI.RegisterSuitModelReplacement("Issac Clarke", typeof(IssacClarke));
			ModelReplacementAPI.RegisterSuitModelReplacement("Clonetrooper", typeof(Clonetrooper));
			ModelReplacementAPI.RegisterSuitModelReplacement("Gnome", typeof(GnomeBaby));
			ModelReplacementAPI.RegisterSuitModelReplacement("Gorilla", typeof(Gorilla));
			ModelReplacementAPI.RegisterSuitModelReplacement("Pillowman", typeof(PillowMan));
			Harmony val = new Harmony("com.MelonsForDays.DreamgrovePlayerModels");
			val.PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin com.MelonsForDays.DreamgrovePlayerModels is loaded!");
		}
	}
	public static class Assets
	{
		public static string mainAssetBundleName = "dreamgrovePlayerModelsForLethalCompany";

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