Decompiled source of VenaChraes v1.0.0

BepInEx/plugins/VenaADDON/V6.dll

Decompiled 2 hours 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 Dissonance;
using HarmonyLib;
using JigglePhysics;
using Microsoft.CodeAnalysis;
using ModelReplacement;
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("V6")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("V6")]
[assembly: AssemblyTitle("V6")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[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]
	[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 VenaChraesModelReplacement
{
	public class MRVENACHRAES_PHYSICS : BodyReplacementBase
	{
		private Transform blinkLeft;

		private Transform blinkRight;

		private Quaternion openLeft;

		private Quaternion openRight;

		private float nextBlinkTime;

		private bool blinkReady;

		private Vector3 previousPlayerPosition;

		private bool hasPreviousPlayerPosition;

		private float tailIdleBlend;

		private JiggleRigBuilder tailJiggle;

		private Transform jawBone;

		private Quaternion jawClosedRotation;

		private VoicePlayerState jawVoice;

		private float jawOpenAmount;

		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "VenaChraes_Physics";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}

		public override void LateUpdate()
		{
			//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			((BodyReplacementBase)this).LateUpdate();
			UpdateIdleTailSway();
			UpdateMouthMovement();
			if ((Object)(object)base.replacementModel == (Object)null)
			{
				return;
			}
			if (!blinkReady)
			{
				Transform[] componentsInChildren = base.replacementModel.GetComponentsInChildren<Transform>(true);
				foreach (Transform val in componentsInChildren)
				{
					if (((Object)val).name == "j_f_mabup_01_l")
					{
						blinkLeft = val;
					}
					if (((Object)val).name == "j_f_mabup_01_r")
					{
						blinkRight = val;
					}
				}
				if ((Object)(object)blinkLeft == (Object)null || (Object)(object)blinkRight == (Object)null)
				{
					return;
				}
				openLeft = blinkLeft.localRotation;
				openRight = blinkRight.localRotation;
				nextBlinkTime = Time.time + Random.Range(3f, 6f);
				blinkReady = true;
			}
			float num = Time.time - nextBlinkTime;
			if (!(num < 0f))
			{
				float num2;
				if (num < 0.08f)
				{
					num2 = num / 0.08f;
				}
				else if (num < 0.11f)
				{
					num2 = 1f;
				}
				else if (num < 0.23f)
				{
					num2 = 1f - (num - 0.11f) / 0.12f;
				}
				else
				{
					num2 = 0f;
					nextBlinkTime = Time.time + Random.Range(3f, 6f);
				}
				Quaternion val2 = Quaternion.Euler(10.062f, -16.497f, 27.692f);
				Quaternion val3 = Quaternion.Euler(10.062f, 16.497f, 27.692f);
				blinkLeft.localRotation = Quaternion.Slerp(openLeft, val2, num2);
				blinkRight.localRotation = Quaternion.Slerp(openRight, val3, num2);
			}
		}

		private void UpdateIdleTailSway()
		{
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Unknown result type (might be due to invalid IL or missing references)
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)base.replacementModel == (Object)null || (Object)(object)((BodyReplacementBase)this).controller == (Object)null)
			{
				return;
			}
			if ((Object)(object)tailJiggle == (Object)null)
			{
				Transform[] componentsInChildren = base.replacementModel.GetComponentsInChildren<Transform>(true);
				foreach (Transform val in componentsInChildren)
				{
					if (((Object)val).name == "n_sippo_a")
					{
						tailJiggle = ((Component)val).GetComponent<JiggleRigBuilder>();
						break;
					}
				}
				if ((Object)(object)tailJiggle == (Object)null)
				{
					return;
				}
			}
			Vector3 position = ((Component)((BodyReplacementBase)this).controller).transform.position;
			if (!hasPreviousPlayerPosition)
			{
				previousPlayerPosition = position;
				hasPreviousPlayerPosition = true;
				return;
			}
			Vector3 val2 = position - previousPlayerPosition;
			val2.y = 0f;
			previousPlayerPosition = position;
			float num = ((Vector3)(ref val2)).magnitude / Mathf.Max(Time.deltaTime, 0.0001f);
			bool flag = num < 0.12f;
			tailIdleBlend = Mathf.MoveTowards(tailIdleBlend, flag ? 1f : 0f, Time.deltaTime * 2f);
			float num2 = Mathf.Sin(Time.time * (MathF.PI * 2f / 3f)) * 0.6f * tailIdleBlend;
			tailJiggle.wind = ((Component)((BodyReplacementBase)this).controller).transform.right * num2;
		}

		private void UpdateMouthMovement()
		{
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)base.replacementModel == (Object)null || (Object)(object)((BodyReplacementBase)this).controller == (Object)null)
			{
				return;
			}
			if ((Object)(object)jawBone == (Object)null)
			{
				Transform[] componentsInChildren = base.replacementModel.GetComponentsInChildren<Transform>(true);
				foreach (Transform val in componentsInChildren)
				{
					if (((Object)val).name == "j_f_ago")
					{
						jawBone = val;
						jawClosedRotation = val.localRotation;
						break;
					}
				}
				if ((Object)(object)jawBone == (Object)null)
				{
					return;
				}
			}
			if (jawVoice == null)
			{
				StartOfRound instance = StartOfRound.Instance;
				if ((Object)(object)instance != (Object)null && (Object)(object)instance.voiceChatModule != (Object)null && (Object)(object)((BodyReplacementBase)this).controller == (Object)(object)instance.localPlayerController)
				{
					DissonanceComms voiceChatModule = instance.voiceChatModule;
					if (!string.IsNullOrEmpty(voiceChatModule.LocalPlayerName))
					{
						jawVoice = voiceChatModule.FindPlayer(voiceChatModule.LocalPlayerName);
					}
				}
				if (jawVoice == null)
				{
					jawVoice = ((BodyReplacementBase)this).controller.voicePlayerState;
				}
			}
			float num = 0f;
			if (jawVoice != null && jawVoice.IsSpeaking && !((BodyReplacementBase)this).controller.isPlayerDead)
			{
				num = Mathf.InverseLerp(0.002f, 0.018f, jawVoice.Amplitude);
			}
			float num2 = ((num > jawOpenAmount) ? 15f : 10f);
			jawOpenAmount = Mathf.MoveTowards(jawOpenAmount, num, Time.deltaTime * num2);
			jawBone.localRotation = jawClosedRotation * Quaternion.Euler(0f, 0f, 6.285f * jawOpenAmount);
		}
	}
	public class MRVENACHRAES_PHYSICS_ : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "VenaChraes_Physics";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	public class MRVENACHRAES_PHYSICS__ : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "VenaChraes_Physics";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}
	}
	[BepInPlugin("com.yashyy.venachraes", "\tVenaChraes", "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", "Vena Chraes", "Enter a comma separated list of suit names.(Additionally, [Green suit,Pajama suit,Hazard suit])");
		}

		private void Awake()
		{
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Expected O, but got Unknown
			config = ((BaseUnityPlugin)this).Config;
			InitConfig();
			Assets.PopulateAssets();
			if (enableModelForAllSuits.Value)
			{
				ModelReplacementAPI.RegisterModelReplacementOverride(typeof(MRVENACHRAES_PHYSICS));
			}
			if (enableModelAsDefault.Value)
			{
				ModelReplacementAPI.RegisterModelReplacementDefault(typeof(MRVENACHRAES_PHYSICS));
			}
			string[] array = suitNamesToEnableModel.Value.Split(',');
			string[] array2 = array;
			foreach (string text in array2)
			{
				ModelReplacementAPI.RegisterSuitModelReplacement(text, typeof(MRVENACHRAES_PHYSICS));
			}
			Harmony val = new Harmony("com.yashyy.venachraes");
			val.PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin com.yashyy.venachraes is loaded!");
		}
	}
	public static class Assets
	{
		public static string mainAssetBundleName = "venachraesbundle";

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

BepInEx/plugins/VenaADDON/Vena Chraes V6.dll

Decompiled 2 hours 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 Dissonance;
using HarmonyLib;
using JigglePhysics;
using Microsoft.CodeAnalysis;
using ModelReplacement;
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("Vena Chraes V6")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Vena Chraes V6")]
[assembly: AssemblyTitle("Vena Chraes V6")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[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]
	[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 VenaChraesV6ModelReplacement
{
	public class MRVENACHRAES_V6 : BodyReplacementBase
	{
		private Transform blinkLeft;

		private Transform blinkRight;

		private Quaternion openLeft;

		private Quaternion openRight;

		private float nextBlinkTime;

		private bool blinkReady;

		private Vector3 previousPlayerPosition;

		private bool hasPreviousPlayerPosition;

		private float tailIdleBlend;

		private JiggleRigBuilder tailJiggle;

		private Transform jawBone;

		private Quaternion jawClosedRotation;

		private VoicePlayerState jawVoice;

		private float jawOpenAmount;

		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "VenaChraes_Physics_V6";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}

		public override void LateUpdate()
		{
			//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			((BodyReplacementBase)this).LateUpdate();
			UpdateIdleTailSway();
			UpdateMouthMovement();
			if ((Object)(object)base.replacementModel == (Object)null)
			{
				return;
			}
			if (!blinkReady)
			{
				Transform[] componentsInChildren = base.replacementModel.GetComponentsInChildren<Transform>(true);
				foreach (Transform val in componentsInChildren)
				{
					if (((Object)val).name == "j_f_mabup_01_l")
					{
						blinkLeft = val;
					}
					if (((Object)val).name == "j_f_mabup_01_r")
					{
						blinkRight = val;
					}
				}
				if ((Object)(object)blinkLeft == (Object)null || (Object)(object)blinkRight == (Object)null)
				{
					return;
				}
				openLeft = blinkLeft.localRotation;
				openRight = blinkRight.localRotation;
				nextBlinkTime = Time.time + Random.Range(3f, 6f);
				blinkReady = true;
			}
			float num = Time.time - nextBlinkTime;
			if (!(num < 0f))
			{
				float num2;
				if (num < 0.08f)
				{
					num2 = num / 0.08f;
				}
				else if (num < 0.11f)
				{
					num2 = 1f;
				}
				else if (num < 0.23f)
				{
					num2 = 1f - (num - 0.11f) / 0.12f;
				}
				else
				{
					num2 = 0f;
					nextBlinkTime = Time.time + Random.Range(3f, 6f);
				}
				Quaternion val2 = Quaternion.Euler(10.062f, -16.497f, 27.692f);
				Quaternion val3 = Quaternion.Euler(10.062f, 16.497f, 27.692f);
				blinkLeft.localRotation = Quaternion.Slerp(openLeft, val2, num2);
				blinkRight.localRotation = Quaternion.Slerp(openRight, val3, num2);
			}
		}

		private void UpdateIdleTailSway()
		{
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Unknown result type (might be due to invalid IL or missing references)
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)base.replacementModel == (Object)null || (Object)(object)((BodyReplacementBase)this).controller == (Object)null)
			{
				return;
			}
			if ((Object)(object)tailJiggle == (Object)null)
			{
				Transform[] componentsInChildren = base.replacementModel.GetComponentsInChildren<Transform>(true);
				foreach (Transform val in componentsInChildren)
				{
					if (((Object)val).name == "n_sippo_a")
					{
						tailJiggle = ((Component)val).GetComponent<JiggleRigBuilder>();
						break;
					}
				}
				if ((Object)(object)tailJiggle == (Object)null)
				{
					return;
				}
			}
			Vector3 position = ((Component)((BodyReplacementBase)this).controller).transform.position;
			if (!hasPreviousPlayerPosition)
			{
				previousPlayerPosition = position;
				hasPreviousPlayerPosition = true;
				return;
			}
			Vector3 val2 = position - previousPlayerPosition;
			val2.y = 0f;
			previousPlayerPosition = position;
			float num = ((Vector3)(ref val2)).magnitude / Mathf.Max(Time.deltaTime, 0.0001f);
			bool flag = num < 0.12f;
			tailIdleBlend = Mathf.MoveTowards(tailIdleBlend, flag ? 1f : 0f, Time.deltaTime * 2f);
			float num2 = Mathf.Sin(Time.time * (MathF.PI * 2f / 3f)) * 0.6f * tailIdleBlend;
			tailJiggle.wind = ((Component)((BodyReplacementBase)this).controller).transform.right * num2;
		}

		private void UpdateMouthMovement()
		{
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)base.replacementModel == (Object)null || (Object)(object)((BodyReplacementBase)this).controller == (Object)null)
			{
				return;
			}
			if ((Object)(object)jawBone == (Object)null)
			{
				Transform[] componentsInChildren = base.replacementModel.GetComponentsInChildren<Transform>(true);
				foreach (Transform val in componentsInChildren)
				{
					if (((Object)val).name == "j_f_ago")
					{
						jawBone = val;
						jawClosedRotation = val.localRotation;
						break;
					}
				}
				if ((Object)(object)jawBone == (Object)null)
				{
					return;
				}
			}
			if (jawVoice == null)
			{
				StartOfRound instance = StartOfRound.Instance;
				if ((Object)(object)instance != (Object)null && (Object)(object)instance.voiceChatModule != (Object)null && (Object)(object)((BodyReplacementBase)this).controller == (Object)(object)instance.localPlayerController)
				{
					DissonanceComms voiceChatModule = instance.voiceChatModule;
					if (!string.IsNullOrEmpty(voiceChatModule.LocalPlayerName))
					{
						jawVoice = voiceChatModule.FindPlayer(voiceChatModule.LocalPlayerName);
					}
				}
				if (jawVoice == null)
				{
					jawVoice = ((BodyReplacementBase)this).controller.voicePlayerState;
				}
			}
			float num = 0f;
			if (jawVoice != null && jawVoice.IsSpeaking && !((BodyReplacementBase)this).controller.isPlayerDead)
			{
				num = Mathf.InverseLerp(0.002f, 0.018f, jawVoice.Amplitude);
			}
			float num2 = ((num > jawOpenAmount) ? 15f : 10f);
			jawOpenAmount = Mathf.MoveTowards(jawOpenAmount, num, Time.deltaTime * num2);
			jawBone.localRotation = jawClosedRotation * Quaternion.Euler(0f, 0f, 6.285f * jawOpenAmount);
		}
	}
	[BepInPlugin("com.yashyy.venachraesv6", "VenaChraesV6", "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.");
			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", "Vena Chraes 1", "Enter a comma separated list of suit names.");
		}

		private void Awake()
		{
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Expected O, but got Unknown
			config = ((BaseUnityPlugin)this).Config;
			InitConfig();
			Assets.PopulateAssets();
			if (enableModelForAllSuits.Value)
			{
				ModelReplacementAPI.RegisterModelReplacementOverride(typeof(MRVENACHRAES_V6));
			}
			if (enableModelAsDefault.Value)
			{
				ModelReplacementAPI.RegisterModelReplacementDefault(typeof(MRVENACHRAES_V6));
			}
			string[] array = suitNamesToEnableModel.Value.Split(',');
			string[] array2 = array;
			foreach (string text in array2)
			{
				string text2 = text.Trim();
				if (!string.IsNullOrEmpty(text2))
				{
					ModelReplacementAPI.RegisterSuitModelReplacement(text2, typeof(MRVENACHRAES_V6));
				}
			}
			Harmony val = new Harmony("com.yashyy.venachraesv6");
			val.PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"VenaChraes V6 is loaded!");
		}
	}
	public static class Assets
	{
		public static string mainAssetBundleName = "venachraesv6bundle";

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

BepInEx/plugins/VenaADDON/VenaChraesV2ModelReplacement.dll

Decompiled 2 hours 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 Dissonance;
using HarmonyLib;
using JigglePhysics;
using Microsoft.CodeAnalysis;
using ModelReplacement;
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("VenaChraesV2ModelReplacement")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("VenaChraesV2ModelReplacement")]
[assembly: AssemblyTitle("VenaChraesV2ModelReplacement")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[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]
	[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 VenaChraesV2ModelReplacement
{
	public class MRVENACHRAES_V2 : BodyReplacementBase
	{
		private Transform blinkLeft;

		private Transform blinkRight;

		private Quaternion openLeft;

		private Quaternion openRight;

		private float nextBlinkTime;

		private bool blinkReady;

		private Vector3 previousPlayerPosition;

		private bool hasPreviousPlayerPosition;

		private float tailIdleBlend;

		private JiggleRigBuilder tailJiggle;

		private Transform jawBone;

		private Quaternion jawClosedRotation;

		private VoicePlayerState jawVoice;

		private float jawOpenAmount;

		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "VenaChraes_Physics_V2";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}

		public override void LateUpdate()
		{
			//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			((BodyReplacementBase)this).LateUpdate();
			UpdateIdleTailSway();
			UpdateMouthMovement();
			if ((Object)(object)base.replacementModel == (Object)null)
			{
				return;
			}
			if (!blinkReady)
			{
				Transform[] componentsInChildren = base.replacementModel.GetComponentsInChildren<Transform>(true);
				foreach (Transform val in componentsInChildren)
				{
					if (((Object)val).name == "j_f_mabup_01_l")
					{
						blinkLeft = val;
					}
					if (((Object)val).name == "j_f_mabup_01_r")
					{
						blinkRight = val;
					}
				}
				if ((Object)(object)blinkLeft == (Object)null || (Object)(object)blinkRight == (Object)null)
				{
					return;
				}
				openLeft = blinkLeft.localRotation;
				openRight = blinkRight.localRotation;
				nextBlinkTime = Time.time + Random.Range(3f, 6f);
				blinkReady = true;
			}
			float num = Time.time - nextBlinkTime;
			if (!(num < 0f))
			{
				float num2;
				if (num < 0.08f)
				{
					num2 = num / 0.08f;
				}
				else if (num < 0.11f)
				{
					num2 = 1f;
				}
				else if (num < 0.23f)
				{
					num2 = 1f - (num - 0.11f) / 0.12f;
				}
				else
				{
					num2 = 0f;
					nextBlinkTime = Time.time + Random.Range(3f, 6f);
				}
				Quaternion val2 = Quaternion.Euler(10.062f, -16.497f, 27.692f);
				Quaternion val3 = Quaternion.Euler(10.062f, 16.497f, 27.692f);
				blinkLeft.localRotation = Quaternion.Slerp(openLeft, val2, num2);
				blinkRight.localRotation = Quaternion.Slerp(openRight, val3, num2);
			}
		}

		private void UpdateIdleTailSway()
		{
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Unknown result type (might be due to invalid IL or missing references)
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)base.replacementModel == (Object)null || (Object)(object)((BodyReplacementBase)this).controller == (Object)null)
			{
				return;
			}
			if ((Object)(object)tailJiggle == (Object)null)
			{
				Transform[] componentsInChildren = base.replacementModel.GetComponentsInChildren<Transform>(true);
				foreach (Transform val in componentsInChildren)
				{
					if (((Object)val).name == "n_sippo_a")
					{
						tailJiggle = ((Component)val).GetComponent<JiggleRigBuilder>();
						break;
					}
				}
				if ((Object)(object)tailJiggle == (Object)null)
				{
					return;
				}
			}
			Vector3 position = ((Component)((BodyReplacementBase)this).controller).transform.position;
			if (!hasPreviousPlayerPosition)
			{
				previousPlayerPosition = position;
				hasPreviousPlayerPosition = true;
				return;
			}
			Vector3 val2 = position - previousPlayerPosition;
			val2.y = 0f;
			previousPlayerPosition = position;
			float num = ((Vector3)(ref val2)).magnitude / Mathf.Max(Time.deltaTime, 0.0001f);
			bool flag = num < 0.12f;
			tailIdleBlend = Mathf.MoveTowards(tailIdleBlend, flag ? 1f : 0f, Time.deltaTime * 2f);
			float num2 = Mathf.Sin(Time.time * (MathF.PI * 2f / 3f)) * 0.6f * tailIdleBlend;
			tailJiggle.wind = ((Component)((BodyReplacementBase)this).controller).transform.right * num2;
		}

		private void UpdateMouthMovement()
		{
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)base.replacementModel == (Object)null || (Object)(object)((BodyReplacementBase)this).controller == (Object)null)
			{
				return;
			}
			if ((Object)(object)jawBone == (Object)null)
			{
				Transform[] componentsInChildren = base.replacementModel.GetComponentsInChildren<Transform>(true);
				foreach (Transform val in componentsInChildren)
				{
					if (((Object)val).name == "j_f_ago")
					{
						jawBone = val;
						jawClosedRotation = val.localRotation;
						break;
					}
				}
				if ((Object)(object)jawBone == (Object)null)
				{
					return;
				}
			}
			if (jawVoice == null)
			{
				StartOfRound instance = StartOfRound.Instance;
				if ((Object)(object)instance != (Object)null && (Object)(object)instance.voiceChatModule != (Object)null && (Object)(object)((BodyReplacementBase)this).controller == (Object)(object)instance.localPlayerController)
				{
					DissonanceComms voiceChatModule = instance.voiceChatModule;
					if (!string.IsNullOrEmpty(voiceChatModule.LocalPlayerName))
					{
						jawVoice = voiceChatModule.FindPlayer(voiceChatModule.LocalPlayerName);
					}
				}
				if (jawVoice == null)
				{
					jawVoice = ((BodyReplacementBase)this).controller.voicePlayerState;
				}
			}
			float num = 0f;
			if (jawVoice != null && jawVoice.IsSpeaking && !((BodyReplacementBase)this).controller.isPlayerDead)
			{
				num = Mathf.InverseLerp(0.002f, 0.018f, jawVoice.Amplitude);
			}
			float num2 = ((num > jawOpenAmount) ? 15f : 10f);
			jawOpenAmount = Mathf.MoveTowards(jawOpenAmount, num, Time.deltaTime * num2);
			jawBone.localRotation = jawClosedRotation * Quaternion.Euler(0f, 0f, 6.285f * jawOpenAmount);
		}
	}
	[BepInPlugin("com.yashyy.venachraesv2", "VenaChraesV2", "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.");
			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", "Vena Chraes 2", "Enter a comma separated list of suit names.");
		}

		private void Awake()
		{
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Expected O, but got Unknown
			config = ((BaseUnityPlugin)this).Config;
			InitConfig();
			Assets.PopulateAssets();
			if (enableModelForAllSuits.Value)
			{
				ModelReplacementAPI.RegisterModelReplacementOverride(typeof(MRVENACHRAES_V2));
			}
			if (enableModelAsDefault.Value)
			{
				ModelReplacementAPI.RegisterModelReplacementDefault(typeof(MRVENACHRAES_V2));
			}
			string[] array = suitNamesToEnableModel.Value.Split(',');
			string[] array2 = array;
			foreach (string text in array2)
			{
				string text2 = text.Trim();
				if (!string.IsNullOrEmpty(text2))
				{
					ModelReplacementAPI.RegisterSuitModelReplacement(text2, typeof(MRVENACHRAES_V2));
				}
			}
			Harmony val = new Harmony("com.yashyy.venachraesv2");
			val.PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"VenaChraes V2 is loaded!");
		}
	}
	public static class Assets
	{
		public static string mainAssetBundleName = "venachraesv2bundle";

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

BepInEx/plugins/VenaADDON/VenaChraesV4ModelReplacement.dll

Decompiled 2 hours 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 Dissonance;
using HarmonyLib;
using JigglePhysics;
using Microsoft.CodeAnalysis;
using ModelReplacement;
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("VenaChraesV4ModelReplacement")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("VenaChraesV4ModelReplacement")]
[assembly: AssemblyTitle("VenaChraesV4ModelReplacement")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[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]
	[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 VenaChraesV4ModelReplacement
{
	public class MRVENACHRAES_V4 : BodyReplacementBase
	{
		private Transform blinkLeft;

		private Transform blinkRight;

		private Quaternion openLeft;

		private Quaternion openRight;

		private float nextBlinkTime;

		private bool blinkReady;

		private Vector3 previousPlayerPosition;

		private bool hasPreviousPlayerPosition;

		private float tailIdleBlend;

		private JiggleRigBuilder tailJiggle;

		private Transform jawBone;

		private Quaternion jawClosedRotation;

		private VoicePlayerState jawVoice;

		private float jawOpenAmount;

		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "VenaChraes_Outfit4";
			if ((Object)(object)Assets.MainAssetBundle == (Object)null)
			{
				Debug.LogError((object)"[Vena V4] AssetBundle is not loaded.");
				return null;
			}
			GameObject val = Assets.MainAssetBundle.LoadAsset<GameObject>(text);
			if ((Object)(object)val == (Object)null)
			{
				Debug.LogError((object)("[Vena V4] Prefab not found in bundle: " + text + ". Contents: " + string.Join(", ", Assets.MainAssetBundle.GetAllAssetNames())));
			}
			return val;
		}

		public override void LateUpdate()
		{
			//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			((BodyReplacementBase)this).LateUpdate();
			UpdateIdleTailSway();
			UpdateMouthMovement();
			if ((Object)(object)base.replacementModel == (Object)null)
			{
				return;
			}
			if (!blinkReady)
			{
				Transform[] componentsInChildren = base.replacementModel.GetComponentsInChildren<Transform>(true);
				foreach (Transform val in componentsInChildren)
				{
					if (((Object)val).name == "j_f_mabup_01_l")
					{
						blinkLeft = val;
					}
					if (((Object)val).name == "j_f_mabup_01_r")
					{
						blinkRight = val;
					}
				}
				if ((Object)(object)blinkLeft == (Object)null || (Object)(object)blinkRight == (Object)null)
				{
					return;
				}
				openLeft = blinkLeft.localRotation;
				openRight = blinkRight.localRotation;
				nextBlinkTime = Time.time + Random.Range(3f, 6f);
				blinkReady = true;
			}
			float num = Time.time - nextBlinkTime;
			if (!(num < 0f))
			{
				float num2;
				if (num < 0.08f)
				{
					num2 = num / 0.08f;
				}
				else if (num < 0.11f)
				{
					num2 = 1f;
				}
				else if (num < 0.23f)
				{
					num2 = 1f - (num - 0.11f) / 0.12f;
				}
				else
				{
					num2 = 0f;
					nextBlinkTime = Time.time + Random.Range(3f, 6f);
				}
				Quaternion val2 = Quaternion.Euler(10.062f, -16.497f, 27.692f);
				Quaternion val3 = Quaternion.Euler(10.062f, 16.497f, 27.692f);
				blinkLeft.localRotation = Quaternion.Slerp(openLeft, val2, num2);
				blinkRight.localRotation = Quaternion.Slerp(openRight, val3, num2);
			}
		}

		private void UpdateIdleTailSway()
		{
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Unknown result type (might be due to invalid IL or missing references)
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)base.replacementModel == (Object)null || (Object)(object)((BodyReplacementBase)this).controller == (Object)null)
			{
				return;
			}
			if ((Object)(object)tailJiggle == (Object)null)
			{
				Transform[] componentsInChildren = base.replacementModel.GetComponentsInChildren<Transform>(true);
				foreach (Transform val in componentsInChildren)
				{
					if (((Object)val).name == "n_sippo_a")
					{
						tailJiggle = ((Component)val).GetComponent<JiggleRigBuilder>();
						break;
					}
				}
				if ((Object)(object)tailJiggle == (Object)null)
				{
					return;
				}
			}
			Vector3 position = ((Component)((BodyReplacementBase)this).controller).transform.position;
			if (!hasPreviousPlayerPosition)
			{
				previousPlayerPosition = position;
				hasPreviousPlayerPosition = true;
				return;
			}
			Vector3 val2 = position - previousPlayerPosition;
			val2.y = 0f;
			previousPlayerPosition = position;
			float num = ((Vector3)(ref val2)).magnitude / Mathf.Max(Time.deltaTime, 0.0001f);
			bool flag = num < 0.12f;
			tailIdleBlend = Mathf.MoveTowards(tailIdleBlend, flag ? 1f : 0f, Time.deltaTime * 2f);
			float num2 = Mathf.Sin(Time.time * (MathF.PI * 2f / 3f)) * 0.6f * tailIdleBlend;
			tailJiggle.wind = ((Component)((BodyReplacementBase)this).controller).transform.right * num2;
		}

		private void UpdateMouthMovement()
		{
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)base.replacementModel == (Object)null || (Object)(object)((BodyReplacementBase)this).controller == (Object)null)
			{
				return;
			}
			if ((Object)(object)jawBone == (Object)null)
			{
				Transform[] componentsInChildren = base.replacementModel.GetComponentsInChildren<Transform>(true);
				foreach (Transform val in componentsInChildren)
				{
					if (((Object)val).name == "j_f_ago")
					{
						jawBone = val;
						jawClosedRotation = val.localRotation;
						break;
					}
				}
				if ((Object)(object)jawBone == (Object)null)
				{
					return;
				}
			}
			if (jawVoice == null)
			{
				StartOfRound instance = StartOfRound.Instance;
				if ((Object)(object)instance != (Object)null && (Object)(object)instance.voiceChatModule != (Object)null && (Object)(object)((BodyReplacementBase)this).controller == (Object)(object)instance.localPlayerController)
				{
					DissonanceComms voiceChatModule = instance.voiceChatModule;
					if (!string.IsNullOrEmpty(voiceChatModule.LocalPlayerName))
					{
						jawVoice = voiceChatModule.FindPlayer(voiceChatModule.LocalPlayerName);
					}
				}
				if (jawVoice == null)
				{
					jawVoice = ((BodyReplacementBase)this).controller.voicePlayerState;
				}
			}
			float num = 0f;
			if (jawVoice != null && jawVoice.IsSpeaking && !((BodyReplacementBase)this).controller.isPlayerDead)
			{
				num = Mathf.InverseLerp(0.002f, 0.018f, jawVoice.Amplitude);
			}
			float num2 = ((num > jawOpenAmount) ? 15f : 10f);
			jawOpenAmount = Mathf.MoveTowards(jawOpenAmount, num, Time.deltaTime * num2);
			jawBone.localRotation = jawClosedRotation * Quaternion.Euler(0f, 0f, 6.285f * jawOpenAmount);
		}
	}
	[BepInPlugin("com.yashyy.venachraesv4", "VenaChraesV4", "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.");
			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", "Vena Chraes 3", "Enter a comma separated list of suit names.");
		}

		private void Awake()
		{
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Expected O, but got Unknown
			config = ((BaseUnityPlugin)this).Config;
			InitConfig();
			Assets.PopulateAssets();
			if ((Object)(object)Assets.MainAssetBundle == (Object)null)
			{
				((BaseUnityPlugin)this).Logger.LogError((object)"Vena V4 bundle did not load; suit registration skipped.");
				return;
			}
			if (enableModelForAllSuits.Value)
			{
				ModelReplacementAPI.RegisterModelReplacementOverride(typeof(MRVENACHRAES_V4));
			}
			if (enableModelAsDefault.Value)
			{
				ModelReplacementAPI.RegisterModelReplacementDefault(typeof(MRVENACHRAES_V4));
			}
			string[] array = suitNamesToEnableModel.Value.Split(',');
			string[] array2 = array;
			foreach (string text in array2)
			{
				string text2 = text.Trim();
				if (!string.IsNullOrEmpty(text2))
				{
					ModelReplacementAPI.RegisterSuitModelReplacement(text2, typeof(MRVENACHRAES_V4));
				}
			}
			Harmony val = new Harmony("com.yashyy.venachraesv4");
			val.PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"VenaChraes V2 is loaded!");
		}
	}
	public static class Assets
	{
		public static string mainAssetBundleName = "venachraesV4bundle";

		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))
			{
				return;
			}
			Console.WriteLine(GetAssemblyName() + "." + mainAssetBundleName);
			string text = GetAssemblyName() + "." + mainAssetBundleName;
			Assembly executingAssembly = Assembly.GetExecutingAssembly();
			using Stream stream = executingAssembly.GetManifestResourceStream(text);
			if (stream == null)
			{
				Debug.LogError((object)("[Vena V4] Embedded bundle missing: " + text + ". Available resources: " + string.Join(", ", executingAssembly.GetManifestResourceNames())));
				return;
			}
			MainAssetBundle = AssetBundle.LoadFromStream(stream);
			if ((Object)(object)MainAssetBundle == (Object)null)
			{
				Debug.LogError((object)("[Vena V4] Could not load embedded AssetBundle: " + text));
			}
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}