Decompiled source of Nexavali v3.2.0

Nexa'vali.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 BepInEx.Configuration;
using Dissonance;
using GameNetcodeStuff;
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("Nexa'vali")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Nexa'vali")]
[assembly: AssemblyTitle("Nexa'vali")]
[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;
		}
	}
}
public class SkinChanger : MonoBehaviour
{
	public void Start()
	{
		Transform val = ((Component)this).transform.Find("MainBody");
		Transform val2 = ((Component)this).transform.Find("MainBody1");
		switch (Random.Range(0, 2))
		{
		case 0:
			((Component)val).gameObject.SetActive(true);
			((Component)val2).gameObject.SetActive(false);
			break;
		case 1:
			((Component)val).gameObject.SetActive(false);
			((Component)val2).gameObject.SetActive(true);
			break;
		default:
			((Component)val).gameObject.SetActive(true);
			((Component)val2).gameObject.SetActive(false);
			break;
		}
	}
}
public class Blinking : MonoBehaviour
{
	public PlayerControllerB player;

	public SkinnedMeshRenderer skinnedMeshRenderer;

	public string blendShapeName = "Eyes_Closed";

	public float minBlinkInterval = 5f;

	public float maxBlinkInterval = 8f;

	public float blinkSpeed = 800f;

	private float nextBlinkTime;

	private bool isBlinking = false;

	private float blinkWeight = 0f;

	private void Start()
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Expected O, but got Unknown
		if ((Object)skinnedMeshRenderer == (Object)null)
		{
			skinnedMeshRenderer = ((Component)this).GetComponent<SkinnedMeshRenderer>();
		}
		nextBlinkTime = Time.time + Random.Range(minBlinkInterval, maxBlinkInterval);
	}

	private void Update()
	{
		if (!player.isPlayerDead && Time.time >= nextBlinkTime && !isBlinking)
		{
			((MonoBehaviour)this).StartCoroutine(DoBlink());
		}
	}

	private IEnumerator DoBlink()
	{
		isBlinking = true;
		while (blinkWeight < 100f)
		{
			blinkWeight += blinkSpeed * Time.deltaTime;
			blinkWeight = Mathf.Clamp(blinkWeight, 0f, 100f);
			skinnedMeshRenderer.SetBlendShapeWeight(skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex(blendShapeName), blinkWeight);
			yield return null;
		}
		yield return (object)new WaitForSeconds(0.1f);
		while (blinkWeight > 0f)
		{
			blinkWeight -= blinkSpeed * Time.deltaTime;
			blinkWeight = Mathf.Clamp(blinkWeight, 0f, 100f);
			skinnedMeshRenderer.SetBlendShapeWeight(skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex(blendShapeName), blinkWeight);
			yield return null;
		}
		isBlinking = false;
		nextBlinkTime = Time.time + Random.Range(minBlinkInterval, maxBlinkInterval);
	}
}
public class Blinking2 : MonoBehaviour
{
	public PlayerControllerB player;

	public SkinnedMeshRenderer skinnedMeshRenderer;

	public string blendShapeName = "HAPPY BLEP";

	public float minBlinkInterval = 5f;

	public float maxBlinkInterval = 100f;

	public float blinkSpeed = 100f;

	private float nextBlinkTime;

	private bool isBlinking2 = false;

	private float blinkWeight = 0f;

	private void Start()
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Expected O, but got Unknown
		if ((Object)skinnedMeshRenderer == (Object)null)
		{
			skinnedMeshRenderer = ((Component)this).GetComponent<SkinnedMeshRenderer>();
		}
		nextBlinkTime = Time.time + Random.Range(minBlinkInterval, maxBlinkInterval);
	}

	private void Update()
	{
		if (!player.isPlayerDead && Time.time >= nextBlinkTime && !isBlinking2)
		{
			((MonoBehaviour)this).StartCoroutine(DoBlink());
		}
	}

	private IEnumerator DoBlink()
	{
		isBlinking2 = true;
		while (blinkWeight < 100f)
		{
			blinkWeight += blinkSpeed * Time.deltaTime;
			blinkWeight = Mathf.Clamp(blinkWeight, 0f, 100f);
			skinnedMeshRenderer.SetBlendShapeWeight(skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex(blendShapeName), blinkWeight);
			yield return null;
		}
		yield return (object)new WaitForSeconds(0.1f);
		while (blinkWeight > 0f)
		{
			blinkWeight -= blinkSpeed * Time.deltaTime;
			blinkWeight = Mathf.Clamp(blinkWeight, 0f, 100f);
			skinnedMeshRenderer.SetBlendShapeWeight(skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex(blendShapeName), blinkWeight);
			yield return null;
		}
		isBlinking2 = false;
		nextBlinkTime = Time.time + Random.Range(minBlinkInterval, maxBlinkInterval);
	}
}
public class JawMovement : MonoBehaviour
{
	public PlayerControllerB player;

	public float maxJawOpening = 100f;

	public SkinnedMeshRenderer skinnedMeshRenderer;

	public float sensibility = 1000f;

	protected VoicePlayerState voice;

	public string blendShapeName = "JawOpen";

	public void Start()
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Expected O, but got Unknown
		if ((Object)skinnedMeshRenderer == (Object)null)
		{
			skinnedMeshRenderer = ((Component)this).GetComponent<SkinnedMeshRenderer>();
		}
	}

	private void Update()
	{
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Expected O, but got Unknown
		if ((Object)StartOfRound.Instance.voiceChatModule == (Object)null)
		{
			return;
		}
		if (voice == null)
		{
			init();
		}
		if (voice != null)
		{
			float num = 0f;
			if (voice.IsSpeaking)
			{
				num = (player.isPlayerDead ? 0f : Mathf.Clamp(voice.Amplitude * sensibility, 0f, maxJawOpening));
			}
			skinnedMeshRenderer.SetBlendShapeWeight(skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex(blendShapeName), num);
		}
	}

	public void init()
	{
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_003a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Expected O, but got Unknown
		//IL_0044: Expected O, but got Unknown
		StartOfRound.Instance.RefreshPlayerVoicePlaybackObjects();
		voice = player.voicePlayerState;
		if (voice == null && (Object)player == (Object)StartOfRound.Instance.localPlayerController)
		{
			voice = StartOfRound.Instance.voiceChatModule.FindPlayer(StartOfRound.Instance.voiceChatModule.LocalPlayerName);
		}
	}
}
namespace ModelReplacement
{
	public class MRNEXAVALIAQUA : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Nexavali Aqua";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}

		protected override void AddModelScripts()
		{
			GameObject gameObject = ((Component)base.replacementModel.transform).gameObject;
			SkinChanger skinChanger = gameObject.AddComponent(typeof(SkinChanger)) as SkinChanger;
			GameObject gameObject2 = ((Component)base.replacementModel.transform.Find("MainBody")).gameObject;
			JawMovement jawMovement = gameObject2.AddComponent(typeof(JawMovement)) as JawMovement;
			jawMovement.player = ((BodyReplacementBase)this).controller;
			jawMovement.init();
			Blinking blinking = gameObject2.AddComponent(typeof(Blinking)) as Blinking;
			blinking.player = ((BodyReplacementBase)this).controller;
			Blinking2 blinking2 = gameObject2.AddComponent(typeof(Blinking2)) as Blinking2;
			blinking2.player = ((BodyReplacementBase)this).controller;
			GameObject gameObject3 = ((Component)base.replacementModel.transform.Find("MainBody1")).gameObject;
			JawMovement jawMovement2 = gameObject3.AddComponent(typeof(JawMovement)) as JawMovement;
			jawMovement2.player = ((BodyReplacementBase)this).controller;
			jawMovement2.init();
			Blinking blinking3 = gameObject3.AddComponent(typeof(Blinking)) as Blinking;
			blinking3.player = ((BodyReplacementBase)this).controller;
			Blinking2 blinking4 = gameObject3.AddComponent(typeof(Blinking2)) as Blinking2;
			blinking4.player = ((BodyReplacementBase)this).controller;
		}
	}
	public class MRNEXAVALIVOID : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Nexavali Void";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}

		protected override void AddModelScripts()
		{
			GameObject gameObject = ((Component)base.replacementModel.transform).gameObject;
			SkinChanger skinChanger = gameObject.AddComponent(typeof(SkinChanger)) as SkinChanger;
			GameObject gameObject2 = ((Component)base.replacementModel.transform.Find("MainBody")).gameObject;
			JawMovement jawMovement = gameObject2.AddComponent(typeof(JawMovement)) as JawMovement;
			jawMovement.player = ((BodyReplacementBase)this).controller;
			jawMovement.init();
			Blinking blinking = gameObject2.AddComponent(typeof(Blinking)) as Blinking;
			blinking.player = ((BodyReplacementBase)this).controller;
			Blinking2 blinking2 = gameObject2.AddComponent(typeof(Blinking2)) as Blinking2;
			blinking2.player = ((BodyReplacementBase)this).controller;
			GameObject gameObject3 = ((Component)base.replacementModel.transform.Find("MainBody1")).gameObject;
			JawMovement jawMovement2 = gameObject3.AddComponent(typeof(JawMovement)) as JawMovement;
			jawMovement2.player = ((BodyReplacementBase)this).controller;
			jawMovement2.init();
			Blinking blinking3 = gameObject3.AddComponent(typeof(Blinking)) as Blinking;
			blinking3.player = ((BodyReplacementBase)this).controller;
			Blinking2 blinking4 = gameObject3.AddComponent(typeof(Blinking2)) as Blinking2;
			blinking4.player = ((BodyReplacementBase)this).controller;
		}
	}
	public class MRNEXAVALIANDROID : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Nexavali Android";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}

		protected override void AddModelScripts()
		{
			GameObject gameObject = ((Component)base.replacementModel.transform).gameObject;
			SkinChanger skinChanger = gameObject.AddComponent(typeof(SkinChanger)) as SkinChanger;
			GameObject gameObject2 = ((Component)base.replacementModel.transform.Find("MainBody")).gameObject;
			JawMovement jawMovement = gameObject2.AddComponent(typeof(JawMovement)) as JawMovement;
			jawMovement.player = ((BodyReplacementBase)this).controller;
			jawMovement.init();
			Blinking blinking = gameObject2.AddComponent(typeof(Blinking)) as Blinking;
			blinking.player = ((BodyReplacementBase)this).controller;
			Blinking2 blinking2 = gameObject2.AddComponent(typeof(Blinking2)) as Blinking2;
			blinking2.player = ((BodyReplacementBase)this).controller;
			GameObject gameObject3 = ((Component)base.replacementModel.transform.Find("MainBody1")).gameObject;
			JawMovement jawMovement2 = gameObject3.AddComponent(typeof(JawMovement)) as JawMovement;
			jawMovement2.player = ((BodyReplacementBase)this).controller;
			jawMovement2.init();
			Blinking blinking3 = gameObject3.AddComponent(typeof(Blinking)) as Blinking;
			blinking3.player = ((BodyReplacementBase)this).controller;
			Blinking2 blinking4 = gameObject3.AddComponent(typeof(Blinking2)) as Blinking2;
			blinking4.player = ((BodyReplacementBase)this).controller;
		}
	}
	public class MRNEXAVALIBANSHEE : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Nexavali Banshee";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}

		protected override void AddModelScripts()
		{
			GameObject gameObject = ((Component)base.replacementModel.transform).gameObject;
			SkinChanger skinChanger = gameObject.AddComponent(typeof(SkinChanger)) as SkinChanger;
			GameObject gameObject2 = ((Component)base.replacementModel.transform.Find("MainBody")).gameObject;
			JawMovement jawMovement = gameObject2.AddComponent(typeof(JawMovement)) as JawMovement;
			jawMovement.player = ((BodyReplacementBase)this).controller;
			jawMovement.init();
			Blinking blinking = gameObject2.AddComponent(typeof(Blinking)) as Blinking;
			blinking.player = ((BodyReplacementBase)this).controller;
			Blinking2 blinking2 = gameObject2.AddComponent(typeof(Blinking2)) as Blinking2;
			blinking2.player = ((BodyReplacementBase)this).controller;
			GameObject gameObject3 = ((Component)base.replacementModel.transform.Find("MainBody1")).gameObject;
			JawMovement jawMovement2 = gameObject3.AddComponent(typeof(JawMovement)) as JawMovement;
			jawMovement2.player = ((BodyReplacementBase)this).controller;
			jawMovement2.init();
			Blinking blinking3 = gameObject3.AddComponent(typeof(Blinking)) as Blinking;
			blinking3.player = ((BodyReplacementBase)this).controller;
			Blinking2 blinking4 = gameObject3.AddComponent(typeof(Blinking2)) as Blinking2;
			blinking4.player = ((BodyReplacementBase)this).controller;
		}
	}
	public class MRNEXAVALIVIOLETPUNK : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Nexavali Violet Punk";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}

		protected override void AddModelScripts()
		{
			GameObject gameObject = ((Component)base.replacementModel.transform).gameObject;
			SkinChanger skinChanger = gameObject.AddComponent(typeof(SkinChanger)) as SkinChanger;
			GameObject gameObject2 = ((Component)base.replacementModel.transform.Find("MainBody")).gameObject;
			JawMovement jawMovement = gameObject2.AddComponent(typeof(JawMovement)) as JawMovement;
			jawMovement.player = ((BodyReplacementBase)this).controller;
			jawMovement.init();
			Blinking blinking = gameObject2.AddComponent(typeof(Blinking)) as Blinking;
			blinking.player = ((BodyReplacementBase)this).controller;
			Blinking2 blinking2 = gameObject2.AddComponent(typeof(Blinking2)) as Blinking2;
			blinking2.player = ((BodyReplacementBase)this).controller;
			GameObject gameObject3 = ((Component)base.replacementModel.transform.Find("MainBody1")).gameObject;
			JawMovement jawMovement2 = gameObject3.AddComponent(typeof(JawMovement)) as JawMovement;
			jawMovement2.player = ((BodyReplacementBase)this).controller;
			jawMovement2.init();
			Blinking blinking3 = gameObject3.AddComponent(typeof(Blinking)) as Blinking;
			blinking3.player = ((BodyReplacementBase)this).controller;
			Blinking2 blinking4 = gameObject3.AddComponent(typeof(Blinking2)) as Blinking2;
			blinking4.player = ((BodyReplacementBase)this).controller;
		}
	}
	public class MRNEXAVALIWINTERWYVERN : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Nexavali Winter Wyvern";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}

		protected override void AddModelScripts()
		{
			GameObject gameObject = ((Component)base.replacementModel.transform).gameObject;
			SkinChanger skinChanger = gameObject.AddComponent(typeof(SkinChanger)) as SkinChanger;
			GameObject gameObject2 = ((Component)base.replacementModel.transform.Find("MainBody")).gameObject;
			JawMovement jawMovement = gameObject2.AddComponent(typeof(JawMovement)) as JawMovement;
			jawMovement.player = ((BodyReplacementBase)this).controller;
			jawMovement.init();
			Blinking blinking = gameObject2.AddComponent(typeof(Blinking)) as Blinking;
			blinking.player = ((BodyReplacementBase)this).controller;
			Blinking2 blinking2 = gameObject2.AddComponent(typeof(Blinking2)) as Blinking2;
			blinking2.player = ((BodyReplacementBase)this).controller;
			GameObject gameObject3 = ((Component)base.replacementModel.transform.Find("MainBody1")).gameObject;
			JawMovement jawMovement2 = gameObject3.AddComponent(typeof(JawMovement)) as JawMovement;
			jawMovement2.player = ((BodyReplacementBase)this).controller;
			jawMovement2.init();
			Blinking blinking3 = gameObject3.AddComponent(typeof(Blinking)) as Blinking;
			blinking3.player = ((BodyReplacementBase)this).controller;
			Blinking2 blinking4 = gameObject3.AddComponent(typeof(Blinking2)) as Blinking2;
			blinking4.player = ((BodyReplacementBase)this).controller;
		}
	}
	public class MRNEXAVALIMINTCHOCOLATE : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Nexavali Mint Chocolate";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}

		protected override void AddModelScripts()
		{
			GameObject gameObject = ((Component)base.replacementModel.transform).gameObject;
			SkinChanger skinChanger = gameObject.AddComponent(typeof(SkinChanger)) as SkinChanger;
			GameObject gameObject2 = ((Component)base.replacementModel.transform.Find("MainBody")).gameObject;
			JawMovement jawMovement = gameObject2.AddComponent(typeof(JawMovement)) as JawMovement;
			jawMovement.player = ((BodyReplacementBase)this).controller;
			jawMovement.init();
			Blinking blinking = gameObject2.AddComponent(typeof(Blinking)) as Blinking;
			blinking.player = ((BodyReplacementBase)this).controller;
			Blinking2 blinking2 = gameObject2.AddComponent(typeof(Blinking2)) as Blinking2;
			blinking2.player = ((BodyReplacementBase)this).controller;
			GameObject gameObject3 = ((Component)base.replacementModel.transform.Find("MainBody1")).gameObject;
			JawMovement jawMovement2 = gameObject3.AddComponent(typeof(JawMovement)) as JawMovement;
			jawMovement2.player = ((BodyReplacementBase)this).controller;
			jawMovement2.init();
			Blinking blinking3 = gameObject3.AddComponent(typeof(Blinking)) as Blinking;
			blinking3.player = ((BodyReplacementBase)this).controller;
			Blinking2 blinking4 = gameObject3.AddComponent(typeof(Blinking2)) as Blinking2;
			blinking4.player = ((BodyReplacementBase)this).controller;
		}
	}
	public class MRNEXAVALICARAMELCAPPUCCINO : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Nexavali Caramel Cappucino";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}

		protected override void AddModelScripts()
		{
			GameObject gameObject = ((Component)base.replacementModel.transform).gameObject;
			SkinChanger skinChanger = gameObject.AddComponent(typeof(SkinChanger)) as SkinChanger;
			GameObject gameObject2 = ((Component)base.replacementModel.transform.Find("MainBody")).gameObject;
			JawMovement jawMovement = gameObject2.AddComponent(typeof(JawMovement)) as JawMovement;
			jawMovement.player = ((BodyReplacementBase)this).controller;
			jawMovement.init();
			Blinking blinking = gameObject2.AddComponent(typeof(Blinking)) as Blinking;
			blinking.player = ((BodyReplacementBase)this).controller;
			Blinking2 blinking2 = gameObject2.AddComponent(typeof(Blinking2)) as Blinking2;
			blinking2.player = ((BodyReplacementBase)this).controller;
			GameObject gameObject3 = ((Component)base.replacementModel.transform.Find("MainBody1")).gameObject;
			JawMovement jawMovement2 = gameObject3.AddComponent(typeof(JawMovement)) as JawMovement;
			jawMovement2.player = ((BodyReplacementBase)this).controller;
			jawMovement2.init();
			Blinking blinking3 = gameObject3.AddComponent(typeof(Blinking)) as Blinking;
			blinking3.player = ((BodyReplacementBase)this).controller;
			Blinking2 blinking4 = gameObject3.AddComponent(typeof(Blinking2)) as Blinking2;
			blinking4.player = ((BodyReplacementBase)this).controller;
		}
	}
	public class MRNEXAVALIFASTFOOD : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Nexavali Fast Food";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}

		protected override void AddModelScripts()
		{
			GameObject gameObject = ((Component)base.replacementModel.transform).gameObject;
			SkinChanger skinChanger = gameObject.AddComponent(typeof(SkinChanger)) as SkinChanger;
			GameObject gameObject2 = ((Component)base.replacementModel.transform.Find("MainBody")).gameObject;
			JawMovement jawMovement = gameObject2.AddComponent(typeof(JawMovement)) as JawMovement;
			jawMovement.player = ((BodyReplacementBase)this).controller;
			jawMovement.init();
			Blinking blinking = gameObject2.AddComponent(typeof(Blinking)) as Blinking;
			blinking.player = ((BodyReplacementBase)this).controller;
			Blinking2 blinking2 = gameObject2.AddComponent(typeof(Blinking2)) as Blinking2;
			blinking2.player = ((BodyReplacementBase)this).controller;
			GameObject gameObject3 = ((Component)base.replacementModel.transform.Find("MainBody1")).gameObject;
			JawMovement jawMovement2 = gameObject3.AddComponent(typeof(JawMovement)) as JawMovement;
			jawMovement2.player = ((BodyReplacementBase)this).controller;
			jawMovement2.init();
			Blinking blinking3 = gameObject3.AddComponent(typeof(Blinking)) as Blinking;
			blinking3.player = ((BodyReplacementBase)this).controller;
			Blinking2 blinking4 = gameObject3.AddComponent(typeof(Blinking2)) as Blinking2;
			blinking4.player = ((BodyReplacementBase)this).controller;
		}
	}
	public class MRNEXAVALISTRAWBERRYMILKSHAKE : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Nexavali Strawberry Shake";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}

		protected override void AddModelScripts()
		{
			GameObject gameObject = ((Component)base.replacementModel.transform).gameObject;
			SkinChanger skinChanger = gameObject.AddComponent(typeof(SkinChanger)) as SkinChanger;
			GameObject gameObject2 = ((Component)base.replacementModel.transform.Find("MainBody")).gameObject;
			JawMovement jawMovement = gameObject2.AddComponent(typeof(JawMovement)) as JawMovement;
			jawMovement.player = ((BodyReplacementBase)this).controller;
			jawMovement.init();
			Blinking blinking = gameObject2.AddComponent(typeof(Blinking)) as Blinking;
			blinking.player = ((BodyReplacementBase)this).controller;
			Blinking2 blinking2 = gameObject2.AddComponent(typeof(Blinking2)) as Blinking2;
			blinking2.player = ((BodyReplacementBase)this).controller;
			GameObject gameObject3 = ((Component)base.replacementModel.transform.Find("MainBody1")).gameObject;
			JawMovement jawMovement2 = gameObject3.AddComponent(typeof(JawMovement)) as JawMovement;
			jawMovement2.player = ((BodyReplacementBase)this).controller;
			jawMovement2.init();
			Blinking blinking3 = gameObject3.AddComponent(typeof(Blinking)) as Blinking;
			blinking3.player = ((BodyReplacementBase)this).controller;
			Blinking2 blinking4 = gameObject3.AddComponent(typeof(Blinking2)) as Blinking2;
			blinking4.player = ((BodyReplacementBase)this).controller;
		}
	}
	public class MRNEXAVALICHERRYPIE : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "Nexavali Cherry Pie";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}

		protected override void AddModelScripts()
		{
			GameObject gameObject = ((Component)base.replacementModel.transform).gameObject;
			SkinChanger skinChanger = gameObject.AddComponent(typeof(SkinChanger)) as SkinChanger;
			GameObject gameObject2 = ((Component)base.replacementModel.transform.Find("MainBody")).gameObject;
			JawMovement jawMovement = gameObject2.AddComponent(typeof(JawMovement)) as JawMovement;
			jawMovement.player = ((BodyReplacementBase)this).controller;
			jawMovement.init();
			Blinking blinking = gameObject2.AddComponent(typeof(Blinking)) as Blinking;
			blinking.player = ((BodyReplacementBase)this).controller;
			Blinking2 blinking2 = gameObject2.AddComponent(typeof(Blinking2)) as Blinking2;
			blinking2.player = ((BodyReplacementBase)this).controller;
			GameObject gameObject3 = ((Component)base.replacementModel.transform.Find("MainBody1")).gameObject;
			JawMovement jawMovement2 = gameObject3.AddComponent(typeof(JawMovement)) as JawMovement;
			jawMovement2.player = ((BodyReplacementBase)this).controller;
			jawMovement2.init();
			Blinking blinking3 = gameObject3.AddComponent(typeof(Blinking)) as Blinking;
			blinking3.player = ((BodyReplacementBase)this).controller;
			Blinking2 blinking4 = gameObject3.AddComponent(typeof(Blinking2)) as Blinking2;
			blinking4.player = ((BodyReplacementBase)this).controller;
		}
	}
	[BepInPlugin(".com.Ghost.Nexavali", "Nexavali", "0.1.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		public static ConfigFile config;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

		private static void InitConfig()
		{
			enableAndroidModelForAllSuits = config.Bind<bool>("Suits to Replace Settings", "Enable Nexavali Android Model for all Suits", false, "Enable to model replace every suit. Set to false to specify suits");
			enableAndroidModelAsDefault = config.Bind<bool>("Suits to Replace Settings", "Enable Nexavali Android Model as default", false, "Enable to model replace every suit that hasn't been otherwise registered.");
			suitNamesToEnableAndroidModel = config.Bind<string>("Suits to Replace Settings", "Suits to enable Nexavali Android Model for", "Nexavali Android", "Enter a comma separated list of suit names.(Additionally, [Green suit,Pajama suit,Hazard suit])");
			enableAquaModelForAllSuits = config.Bind<bool>("Suits to Replace Settings", "Enable Nexavali Aqua Model for all Suits", false, "Enable to model replace every suit. Set to false to specify suits");
			enableAquaModelAsDefault = config.Bind<bool>("Suits to Replace Settings", "Enable Nexavali Aqua Model as default", false, "Enable to model replace every suit that hasn't been otherwise registered.");
			suitNamesToEnableAquaModel = config.Bind<string>("Suits to Replace Settings", "Suits to enable Nexavali Aqua Model for", "Nexavali Aqua", "Enter a comma separated list of suit names.(Additionally, [Green suit,Pajama suit,Hazard suit])");
			enableBansheeModelForAllSuits = config.Bind<bool>("Suits to Replace Settings", "Enable Nexavali Banshee Model for all Suits", false, "Enable to model replace every suit. Set to false to specify suits");
			enableBansheeModelAsDefault = config.Bind<bool>("Suits to Replace Settings", "Enable Nexavali Banshee Model as default", false, "Enable to model replace every suit that hasn't been otherwise registered.");
			suitNamesToEnableBansheeModel = config.Bind<string>("Suits to Replace Settings", "Suits to enable Nexavali Banshee Model for", "Nexavali Banshee", "Enter a comma separated list of suit names.(Additionally, [Green suit,Pajama suit,Hazard suit])");
			enableWinterWyvernModelForAllSuits = config.Bind<bool>("Suits to Replace Settings", "Enable Nexavali Winter Wyvern Model for all Suits", false, "Enable to model replace every suit. Set to false to specify suits");
			enableWinterWyvernModelAsDefault = config.Bind<bool>("Suits to Replace Settings", "Enable Nexavali Winter Wyvern Model as default", false, "Enable to model replace every suit that hasn't been otherwise registered.");
			suitNamesToEnableWinterWyvernModel = config.Bind<string>("Suits to Replace Settings", "Suits to enable Nexavali Winter Wyvern Model for", "Nexavali Winter Wyvern", "Enter a comma separated list of suit names.(Additionally, [Green suit,Pajama suit,Hazard suit])");
			enableVioletPunkModelForAllSuits = config.Bind<bool>("Suits to Replace Settings", "Enable Nexavali Violet Punk Model for all Suits", false, "Enable to model replace every suit. Set to false to specify suits");
			enableVioletPunkModelAsDefault = config.Bind<bool>("Suits to Replace Settings", "Enable Nexavali Violet Punk Model as default", false, "Enable to model replace every suit that hasn't been otherwise registered.");
			suitNamesToEnableVioletPunkModel = config.Bind<string>("Suits to Replace Settings", "Suits to enable Nexavali Violet Punk Model for", "Nexavali Violet Punk", "Enter a comma separated list of suit names.(Additionally, [Green suit,Pajama suit,Hazard suit])");
			enableVoidModelForAllSuits = config.Bind<bool>("Suits to Replace Settings", "Enable Nexavali Void Model for all Suits", false, "Enable to model replace every suit. Set to false to specify suits");
			enableVoidModelAsDefault = config.Bind<bool>("Suits to Replace Settings", "Enable Nexavali Void Model as default", false, "Enable to model replace every suit that hasn't been otherwise registered.");
			suitNamesToEnableVoidModel = config.Bind<string>("Suits to Replace Settings", "Suits to enable Nexavali Void Model for", "Nexavali Void", "Enter a comma separated list of suit names.(Additionally, [Green suit,Pajama suit,Hazard suit])");
			enableMintChocolateModelForAllSuits = config.Bind<bool>("Suits to Replace Settings", "Enable Nexavali Mint Chocolate Model for all Suits", false, "Enable to model replace every suit. Set to false to specify suits");
			enableMintChocolateModelAsDefault = config.Bind<bool>("Suits to Replace Settings", "Enable Nexavali Mint Chocolate Model as default", false, "Enable to model replace every suit that hasn't been otherwise registered.");
			suitNamesToEnableMintChocolateModel = config.Bind<string>("Suits to Replace Settings", "Suits to enable Nexavali Mint Chocolate Model for", "Nexavali Mint Chocolate", "Enter a comma separated list of suit names.(Additionally, [Green suit,Pajama suit,Hazard suit])");
			enableCaramelCappuccinoModelForAllSuits = config.Bind<bool>("Suits to Replace Settings", "Enable Nexavali Caramel Cappuccino Model for all Suits", false, "Enable to model replace every suit. Set to false to specify suits");
			enableCaramelCappuccinoModelAsDefault = config.Bind<bool>("Suits to Replace Settings", "Enable Nexavali Caramel Cappuccino Model as default", false, "Enable to model replace every suit that hasn't been otherwise registered.");
			suitNamesToEnableCaramelCappuccinoModel = config.Bind<string>("Suits to Replace Settings", "Suits to enable Nexavali Caramel Cappuccino Model for", "Nexavali Caramel Cappuccino", "Enter a comma separated list of suit names.(Additionally, [Green suit,Pajama suit,Hazard suit])");
			enableFastFoodModelForAllSuits = config.Bind<bool>("Suits to Replace Settings", "Enable Nexavali Fast Food Model for all Suits", false, "Enable to model replace every suit. Set to false to specify suits");
			enableFastFoodModelAsDefault = config.Bind<bool>("Suits to Replace Settings", "Enable Nexavali Fast Food Model as default", false, "Enable to model replace every suit that hasn't been otherwise registered.");
			suitNamesToEnableFastFoodModel = config.Bind<string>("Suits to Replace Settings", "Suits to enable Nexavali Fast Food Model for", "Nexavali Fast Food", "Enter a comma separated list of suit names.(Additionally, [Green suit,Pajama suit,Hazard suit])");
			enableStrawberryMilkshakeModelForAllSuits = config.Bind<bool>("Suits to Replace Settings", "Enable Nexavali Strawberry Milkshake Model for all Suits", false, "Enable to model replace every suit. Set to false to specify suits");
			enableStrawberryMilkshakeModelAsDefault = config.Bind<bool>("Suits to Replace Settings", "Enable Nexavali Strawberry Milkshake Model as default", false, "Enable to model replace every suit that hasn't been otherwise registered.");
			suitNamesToEnableStrawberryMilkshakeModel = config.Bind<string>("Suits to Replace Settings", "Suits to enable Nexavali Strawberry Milkshake Model for", "Nexavali Strawberry Milkshake", "Enter a comma separated list of suit names.(Additionally, [Green suit,Pajama suit,Hazard suit])");
			enableCherryPieModelForAllSuits = config.Bind<bool>("Suits to Replace Settings", "Enable Nexavali Cherry Pie Model for all Suits", false, "Enable to model replace every suit. Set to false to specify suits");
			enableCherryPieModelAsDefault = config.Bind<bool>("Suits to Replace Settings", "Enable Nexavali Cherry Pie Model as default", false, "Enable to model replace every suit that hasn't been otherwise registered.");
			suitNamesToEnableCherryPieModel = config.Bind<string>("Suits to Replace Settings", "Suits to enable Nexavali Cherry Pie Model for", "Nexavali Cherry Pie", "Enter a comma separated list of suit names.(Additionally, [Green suit,Pajama suit,Hazard suit])");
		}

		private void Awake()
		{
			//IL_060e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0615: Expected O, but got Unknown
			config = ((BaseUnityPlugin)this).Config;
			InitConfig();
			Assets.PopulateAssets();
			if (enableAquaModelForAllSuits.Value)
			{
				ModelReplacementAPI.RegisterModelReplacementOverride(typeof(MRNEXAVALIAQUA));
			}
			if (enableAquaModelAsDefault.Value)
			{
				ModelReplacementAPI.RegisterModelReplacementDefault(typeof(MRNEXAVALIAQUA));
			}
			string[] array = suitNamesToEnableAquaModel.Value.Split(',');
			string[] array2 = array;
			foreach (string text in array2)
			{
				ModelReplacementAPI.RegisterSuitModelReplacement(text, typeof(MRNEXAVALIAQUA));
			}
			if (enableVoidModelForAllSuits.Value)
			{
				ModelReplacementAPI.RegisterModelReplacementOverride(typeof(MRNEXAVALIVOID));
			}
			if (enableVoidModelAsDefault.Value)
			{
				ModelReplacementAPI.RegisterModelReplacementDefault(typeof(MRNEXAVALIVOID));
			}
			string[] array3 = suitNamesToEnableVoidModel.Value.Split(',');
			string[] array4 = array3;
			foreach (string text2 in array4)
			{
				ModelReplacementAPI.RegisterSuitModelReplacement(text2, typeof(MRNEXAVALIVOID));
			}
			if (enableAndroidModelForAllSuits.Value)
			{
				ModelReplacementAPI.RegisterModelReplacementOverride(typeof(MRNEXAVALIANDROID));
			}
			if (enableAndroidModelAsDefault.Value)
			{
				ModelReplacementAPI.RegisterModelReplacementDefault(typeof(MRNEXAVALIANDROID));
			}
			string[] array5 = suitNamesToEnableAndroidModel.Value.Split(',');
			string[] array6 = array5;
			foreach (string text3 in array6)
			{
				ModelReplacementAPI.RegisterSuitModelReplacement(text3, typeof(MRNEXAVALIANDROID));
			}
			if (enableBansheeModelForAllSuits.Value)
			{
				ModelReplacementAPI.RegisterModelReplacementOverride(typeof(MRNEXAVALIBANSHEE));
			}
			if (enableBansheeModelAsDefault.Value)
			{
				ModelReplacementAPI.RegisterModelReplacementDefault(typeof(MRNEXAVALIBANSHEE));
			}
			string[] array7 = suitNamesToEnableBansheeModel.Value.Split(',');
			string[] array8 = array7;
			foreach (string text4 in array8)
			{
				ModelReplacementAPI.RegisterSuitModelReplacement(text4, typeof(MRNEXAVALIBANSHEE));
			}
			if (enableVioletPunkModelForAllSuits.Value)
			{
				ModelReplacementAPI.RegisterModelReplacementOverride(typeof(MRNEXAVALIVIOLETPUNK));
			}
			if (enableVioletPunkModelAsDefault.Value)
			{
				ModelReplacementAPI.RegisterModelReplacementDefault(typeof(MRNEXAVALIVIOLETPUNK));
			}
			string[] array9 = suitNamesToEnableVioletPunkModel.Value.Split(',');
			string[] array10 = array9;
			foreach (string text5 in array10)
			{
				ModelReplacementAPI.RegisterSuitModelReplacement(text5, typeof(MRNEXAVALIVIOLETPUNK));
			}
			if (enableWinterWyvernModelForAllSuits.Value)
			{
				ModelReplacementAPI.RegisterModelReplacementOverride(typeof(MRNEXAVALIWINTERWYVERN));
			}
			if (enableWinterWyvernModelAsDefault.Value)
			{
				ModelReplacementAPI.RegisterModelReplacementDefault(typeof(MRNEXAVALIWINTERWYVERN));
			}
			string[] array11 = suitNamesToEnableWinterWyvernModel.Value.Split(',');
			string[] array12 = array11;
			foreach (string text6 in array12)
			{
				ModelReplacementAPI.RegisterSuitModelReplacement(text6, typeof(MRNEXAVALIWINTERWYVERN));
			}
			if (enableMintChocolateModelForAllSuits.Value)
			{
				ModelReplacementAPI.RegisterModelReplacementOverride(typeof(MRNEXAVALIMINTCHOCOLATE));
			}
			if (enableMintChocolateModelAsDefault.Value)
			{
				ModelReplacementAPI.RegisterModelReplacementDefault(typeof(MRNEXAVALIMINTCHOCOLATE));
			}
			string[] array13 = suitNamesToEnableMintChocolateModel.Value.Split(',');
			string[] array14 = array13;
			foreach (string text7 in array14)
			{
				ModelReplacementAPI.RegisterSuitModelReplacement(text7, typeof(MRNEXAVALIMINTCHOCOLATE));
			}
			if (enableCaramelCappuccinoModelForAllSuits.Value)
			{
				ModelReplacementAPI.RegisterModelReplacementOverride(typeof(MRNEXAVALICARAMELCAPPUCCINO));
			}
			if (enableCaramelCappuccinoModelAsDefault.Value)
			{
				ModelReplacementAPI.RegisterModelReplacementDefault(typeof(MRNEXAVALICARAMELCAPPUCCINO));
			}
			string[] array15 = suitNamesToEnableCaramelCappuccinoModel.Value.Split(',');
			string[] array16 = array15;
			foreach (string text8 in array16)
			{
				ModelReplacementAPI.RegisterSuitModelReplacement(text8, typeof(MRNEXAVALICARAMELCAPPUCCINO));
			}
			if (enableFastFoodModelForAllSuits.Value)
			{
				ModelReplacementAPI.RegisterModelReplacementOverride(typeof(MRNEXAVALIFASTFOOD));
			}
			if (enableFastFoodModelAsDefault.Value)
			{
				ModelReplacementAPI.RegisterModelReplacementDefault(typeof(MRNEXAVALIFASTFOOD));
			}
			string[] array17 = suitNamesToEnableFastFoodModel.Value.Split(',');
			string[] array18 = array17;
			foreach (string text9 in array18)
			{
				ModelReplacementAPI.RegisterSuitModelReplacement(text9, typeof(MRNEXAVALIFASTFOOD));
			}
			if (enableStrawberryMilkshakeModelForAllSuits.Value)
			{
				ModelReplacementAPI.RegisterModelReplacementOverride(typeof(MRNEXAVALISTRAWBERRYMILKSHAKE));
			}
			if (enableStrawberryMilkshakeModelAsDefault.Value)
			{
				ModelReplacementAPI.RegisterModelReplacementDefault(typeof(MRNEXAVALISTRAWBERRYMILKSHAKE));
			}
			string[] array19 = suitNamesToEnableStrawberryMilkshakeModel.Value.Split(',');
			string[] array20 = array19;
			foreach (string text10 in array20)
			{
				ModelReplacementAPI.RegisterSuitModelReplacement(text10, typeof(MRNEXAVALISTRAWBERRYMILKSHAKE));
			}
			if (enableCherryPieModelForAllSuits.Value)
			{
				ModelReplacementAPI.RegisterModelReplacementOverride(typeof(MRNEXAVALICHERRYPIE));
			}
			if (enableCherryPieModelAsDefault.Value)
			{
				ModelReplacementAPI.RegisterModelReplacementDefault(typeof(MRNEXAVALICHERRYPIE));
			}
			string[] array21 = suitNamesToEnableCherryPieModel.Value.Split(',');
			string[] array22 = array21;
			foreach (string text11 in array22)
			{
				ModelReplacementAPI.RegisterSuitModelReplacement(text11, typeof(MRNEXAVALICHERRYPIE));
			}
			Harmony val = new Harmony(".com.Ghost.Nexavali");
			val.PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin .com.Ghost.Nexavali is loaded!");
		}
	}
	public static class Assets
	{
		public static string mainAssetBundleName = "NexavaliGhost";

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