Decompiled source of Craftys MHA Models v0.1.0

craftysmyheroplayermodels.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 GameNetcodeStuff;
using HarmonyLib;
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("craftysmyheroplayermodels")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("craftysmyheroplayermodels")]
[assembly: AssemblyTitle("craftysmyheroplayermodels")]
[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;
		}
	}
}
public class MRCRAFTYSDABI : BodyReplacementBase
{
	protected override GameObject LoadAssetsAndReturnModel()
	{
		string text = "craftysdabi";
		return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
	}

	protected override void AddModelScripts()
	{
		GameObject gameObject = ((Component)base.replacementModel.transform.Find("SK_pl17_100/root/waist/chest/neck/head/face/jaw")).gameObject;
		JawSyncToya jawSyncToya = gameObject.AddComponent(typeof(JawSyncToya)) as JawSyncToya;
		jawSyncToya.player = ((BodyReplacementBase)this).controller;
		jawSyncToya.init();
	}
}
public class MRCRAFTYSSHOTO : BodyReplacementBase
{
	protected override GameObject LoadAssetsAndReturnModel()
	{
		string text = "craftysshoto";
		return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
	}

	protected override void AddModelScripts()
	{
		GameObject gameObject = ((Component)base.replacementModel.transform.Find("SK_Ch004_Default_00/root/jointroot/COG/waist/spine/chest/neck/head/face/jaw")).gameObject;
		JawSyncShoto jawSyncShoto = gameObject.AddComponent(typeof(JawSyncShoto)) as JawSyncShoto;
		jawSyncShoto.player = ((BodyReplacementBase)this).controller;
		jawSyncShoto.init();
	}
}
public class MRCRAFTYSSHIGARAKI : BodyReplacementBase
{
	protected override GameObject LoadAssetsAndReturnModel()
	{
		string text = "craftysshigaraki";
		return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
	}

	protected override void AddModelScripts()
	{
		GameObject gameObject = ((Component)base.replacementModel.transform.Find("Armature/root/jointroot/COG/waist/chest/neck/head/face/jaw")).gameObject;
		JawSyncShigaraki jawSyncShigaraki = gameObject.AddComponent(typeof(JawSyncShigaraki)) as JawSyncShigaraki;
		jawSyncShigaraki.player = ((BodyReplacementBase)this).controller;
		jawSyncShigaraki.init();
	}
}
public class MRCRAFTYSTOYATODOROKI : BodyReplacementBase
{
	protected override GameObject LoadAssetsAndReturnModel()
	{
		string text = "craftystoyatodoroki";
		return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
	}

	protected override void AddModelScripts()
	{
		GameObject gameObject = ((Component)base.replacementModel.transform.Find("SK_pl217_001/root/jointroot/COG/waist/chest/neck/head/face/jaw")).gameObject;
		JawSyncToya jawSyncToya = gameObject.AddComponent(typeof(JawSyncToya)) as JawSyncToya;
		jawSyncToya.player = ((BodyReplacementBase)this).controller;
		jawSyncToya.init();
	}
}
public class MRCRAFTYSSHOTOQUEST : BodyReplacementBase
{
	protected override GameObject LoadAssetsAndReturnModel()
	{
		string text = "craftysshotoquest";
		return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
	}

	protected override void AddModelScripts()
	{
		GameObject gameObject = ((Component)base.replacementModel.transform.Find("SK_pl04_1301/root/jointroot/COG/waist/chest/neck/head/face/jaw")).gameObject;
		JawSyncShoto2 jawSyncShoto = gameObject.AddComponent(typeof(JawSyncShoto2)) as JawSyncShoto2;
		jawSyncShoto.player = ((BodyReplacementBase)this).controller;
		jawSyncShoto.init();
	}
}
public class MRCRAFTYSCYBERPUNKDABI : BodyReplacementBase
{
	protected override GameObject LoadAssetsAndReturnModel()
	{
		string text = "craftyscyberpunkdabi";
		return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
	}

	protected override void AddModelScripts()
	{
		GameObject gameObject = ((Component)base.replacementModel.transform.Find("Armature/root/jointroot/COG/waist/spine/chest/neck/head/face/jaw")).gameObject;
		JawSyncToya jawSyncToya = gameObject.AddComponent(typeof(JawSyncToya)) as JawSyncToya;
		jawSyncToya.player = ((BodyReplacementBase)this).controller;
		jawSyncToya.init();
	}
}
public class MRCRAFTYSCYBERPUNKDABIGLOW : BodyReplacementBase
{
	protected override GameObject LoadAssetsAndReturnModel()
	{
		string text = "craftyscyberpunkdabiglow";
		return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
	}

	protected override void AddModelScripts()
	{
		GameObject gameObject = ((Component)base.replacementModel.transform.Find("Armature/root/jointroot/COG/waist/spine/chest/neck/head/face/jaw")).gameObject;
		JawSyncToya jawSyncToya = gameObject.AddComponent(typeof(JawSyncToya)) as JawSyncToya;
		jawSyncToya.player = ((BodyReplacementBase)this).controller;
		jawSyncToya.init();
	}
}
public class MRCRAFTYSYOUNGALLFORONE : BodyReplacementBase
{
	protected override GameObject LoadAssetsAndReturnModel()
	{
		string text = "craftysyoungallforone";
		return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
	}

	protected override void AddModelScripts()
	{
		GameObject gameObject = ((Component)base.replacementModel.transform.Find("SK_pl244_000/root/jointroot/COG/waist/chest/neck/head/face/jaw")).gameObject;
		JawSyncToya jawSyncToya = gameObject.AddComponent(typeof(JawSyncToya)) as JawSyncToya;
		jawSyncToya.player = ((BodyReplacementBase)this).controller;
		jawSyncToya.init();
	}
}
public class MRCRAFTYSVIGILANTEDEKU : BodyReplacementBase
{
	protected override GameObject LoadAssetsAndReturnModel()
	{
		string text = "craftysvigilantedeku";
		return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
	}

	protected override void AddModelScripts()
	{
		GameObject gameObject = ((Component)base.replacementModel.transform.Find("Epsilon SK/root/jointroot/COG/waist/chest/neck/head/face/jaw")).gameObject;
		JawSyncNormal jawSyncNormal = gameObject.AddComponent(typeof(JawSyncNormal)) as JawSyncNormal;
		jawSyncNormal.player = ((BodyReplacementBase)this).controller;
		jawSyncNormal.init();
	}
}
public class MRCRAFTYSENDEAVOR : BodyReplacementBase
{
	protected override GameObject LoadAssetsAndReturnModel()
	{
		string text = "craftysendeavor";
		return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
	}

	protected override void AddModelScripts()
	{
		GameObject gameObject = ((Component)base.replacementModel.transform.Find("SK_Ch023_Default_00/root/jointroot/COG/waist/spine/chest/neck/head/face/jaw")).gameObject;
		JawSyncShoto2 jawSyncShoto = gameObject.AddComponent(typeof(JawSyncShoto2)) as JawSyncShoto2;
		jawSyncShoto.player = ((BodyReplacementBase)this).controller;
		jawSyncShoto.init();
	}
}
public class MRCRAFTYSALLFORONEFACE : BodyReplacementBase
{
	protected override GameObject LoadAssetsAndReturnModel()
	{
		string text = "craftysallforoneface";
		return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
	}

	protected override void AddModelScripts()
	{
		GameObject gameObject = ((Component)base.replacementModel.transform.Find("SK_Pl16_100/root/jointroot/COG/waist/chest/neck/head/face/jaw")).gameObject;
		JawSyncAFO jawSyncAFO = gameObject.AddComponent(typeof(JawSyncAFO)) as JawSyncAFO;
		jawSyncAFO.player = ((BodyReplacementBase)this).controller;
		jawSyncAFO.init();
	}
}
public class MRCRAFTYSALLFORONENEWMASK : BodyReplacementBase
{
	protected override GameObject LoadAssetsAndReturnModel()
	{
		string text = "craftysallforonenewmask";
		return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
	}
}
public class MRCRAFTYSSHIGARAKIWAR : BodyReplacementBase
{
	protected override GameObject LoadAssetsAndReturnModel()
	{
		string text = "craftysshigarakiwar";
		return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
	}

	protected override void AddModelScripts()
	{
		GameObject gameObject = ((Component)base.replacementModel.transform.Find("SK_Pl215_000/root/jointroot/COG/waist/chest/neck/head/face/jaw")).gameObject;
		JawSyncDefault jawSyncDefault = gameObject.AddComponent(typeof(JawSyncDefault)) as JawSyncDefault;
		jawSyncDefault.player = ((BodyReplacementBase)this).controller;
		jawSyncDefault.init();
	}
}
public class MRCRAFTYSBAKUGO : BodyReplacementBase
{
	protected override GameObject LoadAssetsAndReturnModel()
	{
		string text = "craftysbakugo";
		return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
	}

	protected override void AddModelScripts()
	{
		GameObject gameObject = ((Component)base.replacementModel.transform.Find("SK_pl02_100/root/jointroot/COG/waist/chest/neck/head/face/jaw")).gameObject;
		JawSyncDefault jawSyncDefault = gameObject.AddComponent(typeof(JawSyncDefault)) as JawSyncDefault;
		jawSyncDefault.player = ((BodyReplacementBase)this).controller;
		jawSyncDefault.init();
	}
}
public class MRCRAFTYSLADYNAGANT : BodyReplacementBase
{
	protected override GameObject LoadAssetsAndReturnModel()
	{
		string text = "craftysladynagant";
		return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
	}

	protected override void AddModelScripts()
	{
		GameObject gameObject = ((Component)base.replacementModel.transform.Find("SK_Pl222_001/root/jointroot/COG/waist/chest/neck/head/face/jaw")).gameObject;
		JawSyncDefault jawSyncDefault = gameObject.AddComponent(typeof(JawSyncDefault)) as JawSyncDefault;
		jawSyncDefault.player = ((BodyReplacementBase)this).controller;
		jawSyncDefault.init();
	}
}
public class MRCRAFTYSZETAMIDORIYA : BodyReplacementBase
{
	protected override GameObject LoadAssetsAndReturnModel()
	{
		string text = "craftyszetamidoriya";
		return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
	}

	protected override void AddModelScripts()
	{
		GameObject gameObject = ((Component)base.replacementModel.transform.Find("SK_Pl203_000/root/jointroot/COG/waist/chest/neck/head/face/jaw")).gameObject;
		JawSyncDefault jawSyncDefault = gameObject.AddComponent(typeof(JawSyncDefault)) as JawSyncDefault;
		jawSyncDefault.player = ((BodyReplacementBase)this).controller;
		jawSyncDefault.init();
	}
}
public class JawSync : MonoBehaviour
{
	public PlayerControllerB player;

	public float initialJawOpening = 44.75f;

	public float maxJawOpening = 22f;

	private Vector3 startingLocalRotation;

	protected VoicePlayerState voice;

	public float sensitivity => Plugin.voiceSensitivity.Value;

	private void Start()
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		startingLocalRotation = ((Component)this).gameObject.transform.localEulerAngles;
	}

	private void Update()
	{
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Expected O, but got Unknown
		//IL_009c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b5: 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)
		if (!((Object)StartOfRound.Instance.voiceChatModule == (Object)null))
		{
			if (voice == null)
			{
				init();
				return;
			}
			float x = ((voice.IsSpeaking && !player.isPlayerDead) ? Mathf.Clamp(Map(voice.Amplitude * sensitivity, 0f, 1f, initialJawOpening, maxJawOpening), maxJawOpening, initialJawOpening) : initialJawOpening);
			Vector3 val = startingLocalRotation;
			val.x = x;
			((Component)this).gameObject.transform.localRotation = Quaternion.Euler(val);
		}
	}

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

	private float Map(float value, float min1, float max1, float min2, float max2)
	{
		float num = (value - min1) / (max1 - min1);
		return num * (max2 - min2) + min2;
	}
}
public class JawSyncOther : MonoBehaviour
{
	public PlayerControllerB player;

	public float initialJawOpening = 44.75f;

	public float maxJawOpening = 22f;

	private Vector3 startingLocalRotation;

	protected VoicePlayerState voice;

	public float sensitivity => Plugin.voiceSensitivity.Value;

	private void Start()
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		startingLocalRotation = ((Component)this).gameObject.transform.localEulerAngles;
	}

	private void Update()
	{
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Expected O, but got Unknown
		//IL_009c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b5: 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)
		if (!((Object)StartOfRound.Instance.voiceChatModule == (Object)null))
		{
			if (voice == null)
			{
				init();
				return;
			}
			float x = ((voice.IsSpeaking && !player.isPlayerDead) ? Mathf.Clamp(Map(voice.Amplitude * sensitivity, 0f, 1f, initialJawOpening, maxJawOpening), maxJawOpening, initialJawOpening) : initialJawOpening);
			Vector3 val = startingLocalRotation;
			val.x = x;
			((Component)this).gameObject.transform.localRotation = Quaternion.Euler(val);
		}
	}

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

	private float Map(float value, float min1, float max1, float min2, float max2)
	{
		float num = (value - min1) / (max1 - min1);
		return num * (max2 - min2) + min2;
	}
}
public class JawSyncShigaraki : MonoBehaviour
{
	public PlayerControllerB player;

	public float initialJawOpening = -70f;

	public float maxJawOpening = -50f;

	private Vector3 startingLocalRotation;

	protected VoicePlayerState voice;

	public float sensitivity => Plugin.voiceSensitivity.Value;

	private void Start()
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		startingLocalRotation = ((Component)this).gameObject.transform.localEulerAngles;
	}

	private void Update()
	{
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Expected O, but got Unknown
		//IL_009c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b5: 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)
		if (!((Object)StartOfRound.Instance.voiceChatModule == (Object)null))
		{
			if (voice == null)
			{
				init();
				return;
			}
			float x = ((voice.IsSpeaking && !player.isPlayerDead) ? Mathf.Clamp(Map(voice.Amplitude * sensitivity, 0f, 1f, initialJawOpening, maxJawOpening), initialJawOpening, maxJawOpening) : initialJawOpening);
			Vector3 val = startingLocalRotation;
			val.x = x;
			((Component)this).gameObject.transform.localRotation = Quaternion.Euler(val);
		}
	}

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

	private float Map(float value, float min1, float max1, float min2, float max2)
	{
		float num = (value - min1) / (max1 - min1);
		return num * (max2 - min2) + min2;
	}
}
public class JawSyncNormal : MonoBehaviour
{
	public PlayerControllerB player;

	public float initialJawOpening = 22f;

	public float maxJawOpening = 44.75f;

	private Vector3 startingLocalRotation;

	protected VoicePlayerState voice;

	public float sensitivity => Plugin.voiceSensitivity.Value;

	private void Start()
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		startingLocalRotation = ((Component)this).gameObject.transform.localEulerAngles;
	}

	private void Update()
	{
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Expected O, but got Unknown
		//IL_009c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b5: 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)
		if (!((Object)StartOfRound.Instance.voiceChatModule == (Object)null))
		{
			if (voice == null)
			{
				init();
				return;
			}
			float x = ((voice.IsSpeaking && !player.isPlayerDead) ? Mathf.Clamp(Map(voice.Amplitude * sensitivity, 0f, 1f, initialJawOpening, maxJawOpening), initialJawOpening, maxJawOpening) : initialJawOpening);
			Vector3 val = startingLocalRotation;
			val.x = x;
			((Component)this).gameObject.transform.localRotation = Quaternion.Euler(val);
		}
	}

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

	private float Map(float value, float min1, float max1, float min2, float max2)
	{
		float num = (value - min1) / (max1 - min1);
		return num * (max2 - min2) + min2;
	}
}
public class JawSyncToya : MonoBehaviour
{
	public PlayerControllerB player;

	public float initialJawOpening = 35f;

	public float maxJawOpening = 50f;

	private Vector3 startingLocalRotation;

	protected VoicePlayerState voice;

	public float sensitivity => Plugin.voiceSensitivity.Value;

	private void Start()
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		startingLocalRotation = ((Component)this).gameObject.transform.localEulerAngles;
	}

	private void Update()
	{
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Expected O, but got Unknown
		//IL_009c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b5: 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)
		if (!((Object)StartOfRound.Instance.voiceChatModule == (Object)null))
		{
			if (voice == null)
			{
				init();
				return;
			}
			float x = ((voice.IsSpeaking && !player.isPlayerDead) ? Mathf.Clamp(Map(voice.Amplitude * sensitivity, 0f, 1f, initialJawOpening, maxJawOpening), initialJawOpening, maxJawOpening) : initialJawOpening);
			Vector3 val = startingLocalRotation;
			val.x = x;
			((Component)this).gameObject.transform.localRotation = Quaternion.Euler(val);
		}
	}

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

	private float Map(float value, float min1, float max1, float min2, float max2)
	{
		float num = (value - min1) / (max1 - min1);
		return num * (max2 - min2) + min2;
	}
}
public class JawSyncShoto : MonoBehaviour
{
	public PlayerControllerB player;

	public float initialJawOpening = 6f;

	public float maxJawOpening = 25f;

	private Vector3 startingLocalRotation;

	protected VoicePlayerState voice;

	public float sensitivity => Plugin.voiceSensitivity.Value;

	private void Start()
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		startingLocalRotation = ((Component)this).gameObject.transform.localEulerAngles;
	}

	private void Update()
	{
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Expected O, but got Unknown
		//IL_009c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b5: 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)
		if (!((Object)StartOfRound.Instance.voiceChatModule == (Object)null))
		{
			if (voice == null)
			{
				init();
				return;
			}
			float x = ((voice.IsSpeaking && !player.isPlayerDead) ? Mathf.Clamp(Map(voice.Amplitude * sensitivity, 0f, 1f, initialJawOpening, maxJawOpening), initialJawOpening, maxJawOpening) : initialJawOpening);
			Vector3 val = startingLocalRotation;
			val.x = x;
			((Component)this).gameObject.transform.localRotation = Quaternion.Euler(val);
		}
	}

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

	private float Map(float value, float min1, float max1, float min2, float max2)
	{
		float num = (value - min1) / (max1 - min1);
		return num * (max2 - min2) + min2;
	}
}
public class JawSyncShoto2 : MonoBehaviour
{
	public PlayerControllerB player;

	public float initialJawOpening = 1f;

	public float maxJawOpening = 15f;

	private Vector3 startingLocalRotation;

	protected VoicePlayerState voice;

	public float sensitivity => Plugin.voiceSensitivity.Value;

	private void Start()
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		startingLocalRotation = ((Component)this).gameObject.transform.localEulerAngles;
	}

	private void Update()
	{
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Expected O, but got Unknown
		//IL_009c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b5: 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)
		if (!((Object)StartOfRound.Instance.voiceChatModule == (Object)null))
		{
			if (voice == null)
			{
				init();
				return;
			}
			float x = ((voice.IsSpeaking && !player.isPlayerDead) ? Mathf.Clamp(Map(voice.Amplitude * sensitivity, 0f, 1f, initialJawOpening, maxJawOpening), initialJawOpening, maxJawOpening) : initialJawOpening);
			Vector3 val = startingLocalRotation;
			val.x = x;
			((Component)this).gameObject.transform.localRotation = Quaternion.Euler(val);
		}
	}

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

	private float Map(float value, float min1, float max1, float min2, float max2)
	{
		float num = (value - min1) / (max1 - min1);
		return num * (max2 - min2) + min2;
	}
}
public class JawSyncAFO : MonoBehaviour
{
	public PlayerControllerB player;

	public float initialJawOpening = 45f;

	public float maxJawOpening = 60f;

	private Vector3 startingLocalRotation;

	protected VoicePlayerState voice;

	public float sensitivity => Plugin.voiceSensitivity.Value;

	private void Start()
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		startingLocalRotation = ((Component)this).gameObject.transform.localEulerAngles;
	}

	private void Update()
	{
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Expected O, but got Unknown
		//IL_009c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b5: 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)
		if (!((Object)StartOfRound.Instance.voiceChatModule == (Object)null))
		{
			if (voice == null)
			{
				init();
				return;
			}
			float x = ((voice.IsSpeaking && !player.isPlayerDead) ? Mathf.Clamp(Map(voice.Amplitude * sensitivity, 0f, 1f, initialJawOpening, maxJawOpening), initialJawOpening, maxJawOpening) : initialJawOpening);
			Vector3 val = startingLocalRotation;
			val.x = x;
			((Component)this).gameObject.transform.localRotation = Quaternion.Euler(val);
		}
	}

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

	private float Map(float value, float min1, float max1, float min2, float max2)
	{
		float num = (value - min1) / (max1 - min1);
		return num * (max2 - min2) + min2;
	}
}
public class JawSyncDefault : MonoBehaviour
{
	public PlayerControllerB player;

	public float initialJawOpening = 34f;

	public float maxJawOpening = 50f;

	private Vector3 startingLocalRotation;

	protected VoicePlayerState voice;

	public float sensitivity => Plugin.voiceSensitivity.Value;

	private void Start()
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		startingLocalRotation = ((Component)this).gameObject.transform.localEulerAngles;
	}

	private void Update()
	{
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Expected O, but got Unknown
		//IL_009c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b5: 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)
		if (!((Object)StartOfRound.Instance.voiceChatModule == (Object)null))
		{
			if (voice == null)
			{
				init();
				return;
			}
			float x = ((voice.IsSpeaking && !player.isPlayerDead) ? Mathf.Clamp(Map(voice.Amplitude * sensitivity, 0f, 1f, initialJawOpening, maxJawOpening), initialJawOpening, maxJawOpening) : initialJawOpening);
			Vector3 val = startingLocalRotation;
			val.x = x;
			((Component)this).gameObject.transform.localRotation = Quaternion.Euler(val);
		}
	}

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

	private float Map(float value, float min1, float max1, float min2, float max2)
	{
		float num = (value - min1) / (max1 - min1);
		return num * (max2 - min2) + min2;
	}
}
namespace ModelReplacement
{
	public class MRCRAFTYSAIZAWA : BodyReplacementBase
	{
		protected override GameObject LoadAssetsAndReturnModel()
		{
			string text = "craftysaizawa";
			return Assets.MainAssetBundle.LoadAsset<GameObject>(text);
		}

		protected override void AddModelScripts()
		{
			GameObject gameObject = ((Component)base.replacementModel.transform.Find("SK_Ch013_Default_00/root/jointroot/COG/waist/spine/chest/neck/head/face/jaw")).gameObject;
			JawSyncShoto2 jawSyncShoto = gameObject.AddComponent(typeof(JawSyncShoto2)) as JawSyncShoto2;
			jawSyncShoto.player = ((BodyReplacementBase)this).controller;
			jawSyncShoto.init();
		}
	}
	[BepInPlugin("Crafty_Glitches.Craftys_MHA_Models", "Craftys_MHA_Models", "0.1.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		public static ConfigFile config;

		public static ConfigEntry<float> voiceSensitivity { get; private set; }

		private static void InitConfig()
		{
			voiceSensitivity = config.Bind<float>("Voice Sensitivity For models Jaw", "Sensitivity Value", 20f, "Number from 5 to 20");
		}

		private void Awake()
		{
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_018a: Expected O, but got Unknown
			config = ((BaseUnityPlugin)this).Config;
			InitConfig();
			Assets.PopulateAssets();
			ModelReplacementAPI.RegisterSuitModelReplacement("aizawaskin", typeof(MRCRAFTYSAIZAWA));
			ModelReplacementAPI.RegisterSuitModelReplacement("dabiskin", typeof(MRCRAFTYSDABI));
			ModelReplacementAPI.RegisterSuitModelReplacement("shotoskin", typeof(MRCRAFTYSSHOTO));
			ModelReplacementAPI.RegisterSuitModelReplacement("shigarakiskin", typeof(MRCRAFTYSSHIGARAKI));
			ModelReplacementAPI.RegisterSuitModelReplacement("toyaskin", typeof(MRCRAFTYSTOYATODOROKI));
			ModelReplacementAPI.RegisterSuitModelReplacement("shotoquest", typeof(MRCRAFTYSSHOTOQUEST));
			ModelReplacementAPI.RegisterSuitModelReplacement("cyberpunkdabi", typeof(MRCRAFTYSCYBERPUNKDABI));
			ModelReplacementAPI.RegisterSuitModelReplacement("cyberpunkdabiglow", typeof(MRCRAFTYSCYBERPUNKDABIGLOW));
			ModelReplacementAPI.RegisterSuitModelReplacement("youngallforoneskin", typeof(MRCRAFTYSYOUNGALLFORONE));
			ModelReplacementAPI.RegisterSuitModelReplacement("vigilantedekuskin", typeof(MRCRAFTYSVIGILANTEDEKU));
			ModelReplacementAPI.RegisterSuitModelReplacement("endeavorskin", typeof(MRCRAFTYSENDEAVOR));
			ModelReplacementAPI.RegisterSuitModelReplacement("allforonefaceskin", typeof(MRCRAFTYSALLFORONEFACE));
			ModelReplacementAPI.RegisterSuitModelReplacement("allforonemaskedskin", typeof(MRCRAFTYSALLFORONENEWMASK));
			ModelReplacementAPI.RegisterSuitModelReplacement("shigarakiwarskin", typeof(MRCRAFTYSSHIGARAKIWAR));
			ModelReplacementAPI.RegisterSuitModelReplacement("bakugoskin", typeof(MRCRAFTYSBAKUGO));
			ModelReplacementAPI.RegisterSuitModelReplacement("ladynagantskin", typeof(MRCRAFTYSLADYNAGANT));
			ModelReplacementAPI.RegisterSuitModelReplacement("zetamidoriyaskin", typeof(MRCRAFTYSZETAMIDORIYA));
			Harmony val = new Harmony("Crafty_Glitches.Craftys_MHA_Models");
			val.PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin Crafty_Glitches.Craftys_MHA_Models is loaded!");
		}
	}
	public static class Assets
	{
		public static string mainAssetBundleName = "craftysmhamodels";

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