Decompiled source of RailgunnerAris v1.1.3

RailgunnerArisuVoiceover.dll

Decompiled 3 months ago
using System;
using System.Collections;
using System.Collections.Generic;
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 BaseVoiceoverLib;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using R2API;
using RailgunnerArisuVoiceover.Components;
using RailgunnerArisuVoiceover.Modules;
using RiskOfOptions;
using RiskOfOptions.Options;
using RoR2;
using RoR2.ContentManagement;
using UnityEngine;
using UnityEngine.Networking;

[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: AssemblyCompany("RailgunnerArisuVoiceover")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+e6454bba45b106e7ac28c2ee4e42885cf67ff665")]
[assembly: AssemblyProduct("RailgunnerArisuVoiceover")]
[assembly: AssemblyTitle("RailgunnerArisuVoiceover")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace RailgunnerArisuVoiceover
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.Schale.RailgunnerArisuVoiceover", "RailgunnerArisVoiceover", "1.1.3")]
	public class RailgunnerArisuVoiceoverPlugin : BaseUnityPlugin
	{
		public class NSEInfo
		{
			public NetworkSoundEventDef nse;

			public uint akId = 0u;

			public string eventName = string.Empty;

			public NSEInfo(NetworkSoundEventDef source)
			{
				nse = source;
				akId = source.akId;
				eventName = source.eventName;
			}

			private void DisableSound()
			{
				nse.akId = 0u;
				nse.eventName = string.Empty;
			}

			private void EnableSound()
			{
				nse.akId = akId;
				nse.eventName = eventName;
			}

			public void ValidateParams()
			{
				if (akId == 0)
				{
					akId = nse.akId;
				}
				if (eventName == string.Empty)
				{
					eventName = nse.eventName;
				}
				if (!enableVoicelines.Value)
				{
					DisableSound();
				}
				else
				{
					EnableSound();
				}
			}
		}

		public static ConfigEntry<KeyboardShortcut> buttonTitle;

		public static ConfigEntry<KeyboardShortcut> buttonPanpakapan;

		public static ConfigEntry<KeyboardShortcut> buttonHikari;

		public static ConfigEntry<KeyboardShortcut> buttonMahou;

		public static ConfigEntry<KeyboardShortcut> buttonNakama;

		public static ConfigEntry<KeyboardShortcut> buttonHurt;

		public static ConfigEntry<KeyboardShortcut> buttonLevel;

		public static ConfigEntry<KeyboardShortcut> buttonKougeki;

		public static ConfigEntry<KeyboardShortcut> buttonIntro;

		public static ConfigEntry<KeyboardShortcut> buttonPotion;

		public static ConfigEntry<KeyboardShortcut> buttonIkimasu;

		public static ConfigEntry<KeyboardShortcut> buttonReset;

		public static ConfigEntry<KeyboardShortcut> buttonCafe5;

		public static ConfigEntry<KeyboardShortcut> buttonLight;

		public static ConfigEntry<bool> enableVoicelines;

		public static bool playedSeasonalVoiceline = false;

		public static AssetBundle assetBundle;

		public static List<NSEInfo> nseList = new List<NSEInfo>();

		public void Awake()
		{
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Expected O, but got Unknown
			//IL_0099: Expected O, but got Unknown
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Expected O, but got Unknown
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Expected O, but got Unknown
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Expected O, but got Unknown
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Expected O, but got Unknown
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0169: Expected O, but got Unknown
			//IL_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_018e: Expected O, but got Unknown
			//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b3: Expected O, but got Unknown
			//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d8: Expected O, but got Unknown
			//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)
			//IL_01fd: Expected O, but got Unknown
			//IL_0212: Unknown result type (might be due to invalid IL or missing references)
			//IL_0217: Unknown result type (might be due to invalid IL or missing references)
			//IL_0222: Expected O, but got Unknown
			//IL_0237: Unknown result type (might be due to invalid IL or missing references)
			//IL_023c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0247: Expected O, but got Unknown
			//IL_025c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0261: Unknown result type (might be due to invalid IL or missing references)
			//IL_026c: Expected O, but got Unknown
			//IL_0281: Unknown result type (might be due to invalid IL or missing references)
			//IL_0286: Unknown result type (might be due to invalid IL or missing references)
			//IL_0291: Expected O, but got Unknown
			//IL_02a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b6: Expected O, but got Unknown
			new Content().Initialize();
			Files.PluginInfo = ((BaseUnityPlugin)this).Info;
			RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(OnLoad));
			using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("RailgunnerArisuVoiceover.arisurailgunnervoiceoverbundle"))
			{
				assetBundle = AssetBundle.LoadFromStream(stream);
			}
			SoundBanks.Init();
			InitNSE();
			enableVoicelines = ((BaseUnityPlugin)this).Config.Bind<bool>(new ConfigDefinition("Settings", "Enable Voicelines"), true, new ConfigDescription("Enable voicelines when using the Aris Railgunner Skin.", (AcceptableValueBase)null, Array.Empty<object>()));
			enableVoicelines.SettingChanged += EnableVoicelines_SettingChanged;
			buttonTitle = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "Blue Archive"), KeyboardShortcut.Empty, (ConfigDescription)null);
			buttonIntro = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "Introduction"), KeyboardShortcut.Empty, (ConfigDescription)null);
			buttonPanpakapan = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "Panpakapan"), KeyboardShortcut.Empty, (ConfigDescription)null);
			buttonHikari = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "Hikari yo!"), KeyboardShortcut.Empty, (ConfigDescription)null);
			buttonMahou = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "Courage"), KeyboardShortcut.Empty, (ConfigDescription)null);
			buttonNakama = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "Friendship"), KeyboardShortcut.Empty, (ConfigDescription)null);
			buttonCafe5 = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "Pat"), KeyboardShortcut.Empty, (ConfigDescription)null);
			buttonLight = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "Light"), KeyboardShortcut.Empty, (ConfigDescription)null);
			buttonReset = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "System Reset"), KeyboardShortcut.Empty, (ConfigDescription)null);
			buttonPotion = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "HP Potion"), KeyboardShortcut.Empty, (ConfigDescription)null);
			buttonLevel = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "Level Up"), KeyboardShortcut.Empty, (ConfigDescription)null);
			buttonKougeki = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "Kougeki"), KeyboardShortcut.Empty, (ConfigDescription)null);
			buttonIkimasu = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "Ikimasu"), KeyboardShortcut.Empty, (ConfigDescription)null);
			buttonHurt = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "Hurt"), KeyboardShortcut.Empty, (ConfigDescription)null);
			if (Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions"))
			{
				RiskOfOptionsCompat();
			}
		}

		private void EnableVoicelines_SettingChanged(object sender, EventArgs e)
		{
			RefreshNSE();
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		private void RiskOfOptionsCompat()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Expected O, but got Unknown
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Expected O, but got Unknown
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Expected O, but got Unknown
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Expected O, but got Unknown
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Expected O, but got Unknown
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Expected O, but got Unknown
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Expected O, but got Unknown
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Expected O, but got Unknown
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Expected O, but got Unknown
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Expected O, but got Unknown
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Expected O, but got Unknown
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Expected O, but got Unknown
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Expected O, but got Unknown
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Expected O, but got Unknown
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Expected O, but got Unknown
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(enableVoicelines));
			ModSettingsManager.SetModIcon(assetBundle.LoadAsset<Sprite>("ClanChat_Emoji_14_Jp"));
			ModSettingsManager.AddOption((BaseOption)new KeyBindOption(buttonTitle));
			ModSettingsManager.AddOption((BaseOption)new KeyBindOption(buttonIntro));
			ModSettingsManager.AddOption((BaseOption)new KeyBindOption(buttonPanpakapan));
			ModSettingsManager.AddOption((BaseOption)new KeyBindOption(buttonHikari));
			ModSettingsManager.AddOption((BaseOption)new KeyBindOption(buttonMahou));
			ModSettingsManager.AddOption((BaseOption)new KeyBindOption(buttonNakama));
			ModSettingsManager.AddOption((BaseOption)new KeyBindOption(buttonCafe5));
			ModSettingsManager.AddOption((BaseOption)new KeyBindOption(buttonLight));
			ModSettingsManager.AddOption((BaseOption)new KeyBindOption(buttonReset));
			ModSettingsManager.AddOption((BaseOption)new KeyBindOption(buttonPotion));
			ModSettingsManager.AddOption((BaseOption)new KeyBindOption(buttonLevel));
			ModSettingsManager.AddOption((BaseOption)new KeyBindOption(buttonKougeki));
			ModSettingsManager.AddOption((BaseOption)new KeyBindOption(buttonIkimasu));
			ModSettingsManager.AddOption((BaseOption)new KeyBindOption(buttonHurt));
		}

		private void OnLoad()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Expected O, but got Unknown
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Expected O, but got Unknown
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Expected O, but got Unknown
			SkinDef val = null;
			SkinDef[] array = SkinCatalog.FindSkinsForBody(BodyCatalog.FindBodyIndex("RailgunnerBody"));
			SkinDef[] array2 = array;
			foreach (SkinDef val2 in array2)
			{
				if (((Object)val2).name == "ArisSkinDef")
				{
					val = val2;
					break;
				}
			}
			if (!Object.op_Implicit((Object)(object)val))
			{
				Debug.LogError((object)"ArisuRailgunnerVoiceover: Aris Railgunner SkinDef not found. Voicelines will not work!");
			}
			else
			{
				VoiceoverInfo val3 = new VoiceoverInfo(typeof(RailgunnerArisuVoiceoverComponent), val, "RailgunnerBody");
				val3.selectActions = (LobbySelectActions)Delegate.Combine((Delegate?)(object)val3.selectActions, (Delegate?)new LobbySelectActions(ArisuSelect));
			}
			RefreshNSE();
		}

		private void ArisuSelect(GameObject mannequinObject)
		{
			if (!enableVoicelines.Value)
			{
				return;
			}
			bool flag = false;
			if (!playedSeasonalVoiceline)
			{
				if (DateTime.Today.Month == 1 && DateTime.Today.Day == 1)
				{
					Util.PlaySound("Play_RailgunnerArisu_Lobby_Newyear", mannequinObject);
					flag = true;
				}
				else if (DateTime.Today.Month == 5 && DateTime.Today.Day == 8)
				{
					Util.PlaySound("Play_RailgunnerArisu_Lobby_bday", mannequinObject);
					flag = true;
				}
				else if (DateTime.Today.Month == 10 && DateTime.Today.Day == 31)
				{
					Util.PlaySound("Play_RailgunnerArisu_Lobby_Halloween", mannequinObject);
					flag = true;
				}
				else if (DateTime.Today.Month == 12 && DateTime.Today.Day == 25)
				{
					Util.PlaySound("Play_RailgunnerArisu_Lobby_xmas", mannequinObject);
					flag = true;
				}
				if (flag)
				{
					playedSeasonalVoiceline = true;
				}
			}
			if (!flag)
			{
				if (Util.CheckRoll(5f, 0f, (CharacterMaster)null))
				{
					Util.PlaySound("Play_RailgunnerArisu_TitleDrop", mannequinObject);
				}
				else
				{
					Util.PlaySound("Play_RailgunnerArisu_Lobby", mannequinObject);
				}
			}
		}

		private void InitNSE()
		{
			RailgunnerArisuVoiceoverComponent.nseTitle = RegisterNSE("Play_RailgunnerArisu_TitleDrop");
			RailgunnerArisuVoiceoverComponent.nseSpecial = RegisterNSE("Play_RailgunnerArisu_ExSkill");
			RailgunnerArisuVoiceoverComponent.nseBlock = RegisterNSE("Play_RailgunnerArisu_Blocked");
			RailgunnerArisuVoiceoverComponent.nsePanpakapan = RegisterNSE("Play_RailgunnerArisu_Panpakapan");
			RailgunnerArisuVoiceoverComponent.nseHikari = RegisterNSE("Play_RailgunnerArisu_Hikari");
			RailgunnerArisuVoiceoverComponent.nseMahou = RegisterNSE("Play_RailgunnerArisu_Mahou");
			RailgunnerArisuVoiceoverComponent.nseNakama = RegisterNSE("Play_RailgunnerArisu_Nakama");
			RailgunnerArisuVoiceoverComponent.nseHurt = RegisterNSE("Play_RailgunnerArisu_TakeDamage");
			RailgunnerArisuVoiceoverComponent.nseLevel = RegisterNSE("Play_RailgunnerArisu_Level");
			RailgunnerArisuVoiceoverComponent.nseKougeki = RegisterNSE("Play_RailgunnerArisu_Kougeki");
			RailgunnerArisuVoiceoverComponent.nseIntro = RegisterNSE("Play_RailgunnerArisu_Intro");
			RailgunnerArisuVoiceoverComponent.nsePotion = RegisterNSE("Play_RailgunnerArisu_Heal");
			RailgunnerArisuVoiceoverComponent.nseIkimasu = RegisterNSE("Play_RailgunnerArisu_Ikimasu");
			RailgunnerArisuVoiceoverComponent.nseReset = RegisterNSE("Play_RailgunnerArisu_Reset");
			RailgunnerArisuVoiceoverComponent.nseCafe5 = RegisterNSE("Play_RailgunnerArisu_Cafe5");
			RailgunnerArisuVoiceoverComponent.nseLight = RegisterNSE("Play_RailgunnerArisu_Light");
		}

		private NetworkSoundEventDef RegisterNSE(string eventName)
		{
			NetworkSoundEventDef val = ScriptableObject.CreateInstance<NetworkSoundEventDef>();
			val.eventName = eventName;
			Content.networkSoundEventDefs.Add(val);
			nseList.Add(new NSEInfo(val));
			return val;
		}

		public void RefreshNSE()
		{
			foreach (NSEInfo nse in nseList)
			{
				nse.ValidateParams();
			}
		}
	}
}
namespace RailgunnerArisuVoiceover.Modules
{
	public class Content : IContentPackProvider
	{
		internal ContentPack contentPack = new ContentPack();

		public static List<NetworkSoundEventDef> networkSoundEventDefs = new List<NetworkSoundEventDef>();

		public string identifier => "com.Schale.RailgunnerArisuVoiceover";

		public void Initialize()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			ContentManager.collectContentPackProviders += new CollectContentPackProvidersDelegate(ContentManager_collectContentPackProviders);
		}

		private void ContentManager_collectContentPackProviders(AddContentPackProviderDelegate addContentPackProvider)
		{
			addContentPackProvider.Invoke((IContentPackProvider)(object)this);
		}

		public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args)
		{
			contentPack.identifier = identifier;
			contentPack.networkSoundEventDefs.Add(networkSoundEventDefs.ToArray());
			args.ReportProgress(1f);
			yield break;
		}

		public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args)
		{
			ContentPack.Copy(contentPack, args.output);
			args.ReportProgress(1f);
			yield break;
		}

		public IEnumerator FinalizeAsync(FinalizeAsyncArgs args)
		{
			args.ReportProgress(1f);
			yield break;
		}
	}
	public static class Files
	{
		public static PluginInfo PluginInfo;

		internal static string assemblyDir => Path.GetDirectoryName(PluginInfo.Location);

		internal static void Init(PluginInfo info)
		{
			PluginInfo = info;
		}

		internal static string GetPathToFile(string folderName, string fileName)
		{
			return Path.Combine(assemblyDir, folderName, fileName);
		}
	}
	public static class SoundBanks
	{
		private static bool initialized;

		public static string SoundBankDirectory => Files.assemblyDir;

		public static void Init()
		{
			if (initialized)
			{
				return;
			}
			initialized = true;
			using Stream stream = new FileStream(SoundBankDirectory + "\\RailgunnerArisuSoundbank.bnk", FileMode.Open);
			byte[] array = new byte[stream.Length];
			stream.Read(array, 0, array.Length);
			SoundBanks.Add(array);
		}
	}
}
namespace RailgunnerArisuVoiceover.Components
{
	public class RailgunnerArisuVoiceoverComponent : BaseVoiceoverComponent
	{
		public static NetworkSoundEventDef nseSpecial;

		public static NetworkSoundEventDef nseBlock;

		public static NetworkSoundEventDef nsePanpakapan;

		public static NetworkSoundEventDef nseTitle;

		public static NetworkSoundEventDef nseHikari;

		public static NetworkSoundEventDef nseMahou;

		public static NetworkSoundEventDef nseNakama;

		public static NetworkSoundEventDef nseHurt;

		public static NetworkSoundEventDef nseLevel;

		public static NetworkSoundEventDef nseKougeki;

		public static NetworkSoundEventDef nseIntro;

		public static NetworkSoundEventDef nsePotion;

		public static NetworkSoundEventDef nseIkimasu;

		public static NetworkSoundEventDef nseReset;

		public static NetworkSoundEventDef nseCafe5;

		public static NetworkSoundEventDef nseLight;

		private float blockedCooldown = 0f;

		private float specialCooldown = 0f;

		private float levelCooldown = 0f;

		private float coffeeCooldown = 0f;

		private float elixirCooldown = 0f;

		private float lowHealthCooldown = 0f;

		private bool acquiredScepter = false;

		protected override void Start()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			((BaseVoiceoverComponent)this).Start();
			if (Object.op_Implicit((Object)(object)base.inventory) && base.inventory.GetItemCount(BaseVoiceoverComponent.scepterIndex) > 0)
			{
				acquiredScepter = true;
			}
		}

		protected override void FixedUpdate()
		{
			((BaseVoiceoverComponent)this).FixedUpdate();
			if (blockedCooldown > 0f)
			{
				blockedCooldown -= Time.fixedDeltaTime;
			}
			if (specialCooldown > 0f)
			{
				specialCooldown -= Time.fixedDeltaTime;
			}
			if (levelCooldown > 0f)
			{
				levelCooldown -= Time.fixedDeltaTime;
			}
			if (coffeeCooldown > 0f)
			{
				coffeeCooldown -= Time.fixedDeltaTime;
			}
			if (elixirCooldown > 0f)
			{
				elixirCooldown -= Time.fixedDeltaTime;
			}
			if (lowHealthCooldown > 0f)
			{
				lowHealthCooldown -= Time.fixedDeltaTime;
			}
		}

		public override void PlayDamageBlockedServer()
		{
			if (NetworkServer.active && !(blockedCooldown > 0f) && ((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseBlock, 1.2f, false))
			{
				blockedCooldown = 30f;
			}
		}

		public override void PlayDeath()
		{
			((BaseVoiceoverComponent)this).TryPlaySound("Play_RailgunnerArisu_Defeat", 3.5f, true);
		}

		public override void PlayHurt(float percentHPLost)
		{
			if (percentHPLost >= 0.1f)
			{
				((BaseVoiceoverComponent)this).TryPlaySound("Play_RailgunnerArisu_TakeDamage", 0f, false);
			}
		}

		public override void PlayLevelUp()
		{
			if (!(levelCooldown > 0f) && ((BaseVoiceoverComponent)this).TryPlaySound("Play_RailgunnerArisu_LevelUp", 6f, false))
			{
				levelCooldown = 60f;
			}
		}

		public override void PlayLowHealth()
		{
			if (!(lowHealthCooldown > 0f) && ((BaseVoiceoverComponent)this).TryPlaySound("Play_RailgunnerArisu_LowHealth", 1.9f, false))
			{
				lowHealthCooldown = 60f;
			}
		}

		public override void PlaySpawn()
		{
			((BaseVoiceoverComponent)this).TryPlaySound("Play_RailgunnerArisu_Spawn", 5f, true);
		}

		public override void PlaySpecialAuthority(GenericSkill skill)
		{
			if (!(specialCooldown > 0f) && ((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseSpecial, 4f, false))
			{
				specialCooldown = 5f;
			}
		}

		public override void PlayTeleporterFinish()
		{
			((BaseVoiceoverComponent)this).TryPlaySound("Play_RailgunnerArisu_Victory", 3f, false);
		}

		public override void PlayTeleporterStart()
		{
			((BaseVoiceoverComponent)this).TryPlaySound("Play_RailgunnerArisu_TeleporterStart", 1.4f, false);
		}

		public override void PlayVictory()
		{
			((BaseVoiceoverComponent)this).TryPlaySound("Play_RailgunnerArisu_Victory", 3f, true);
		}

		protected override void Inventory_onItemAddedClient(ItemIndex itemIndex)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Invalid comparison between Unknown and I4
			//IL_0011: 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)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Invalid comparison between Unknown and I4
			((BaseVoiceoverComponent)this).Inventory_onItemAddedClient(itemIndex);
			if ((int)BaseVoiceoverComponent.scepterIndex != -1 && itemIndex == BaseVoiceoverComponent.scepterIndex)
			{
				PlayAcquireScepter();
				return;
			}
			if (itemIndex == Items.AttackSpeedAndMoveSpeed.itemIndex)
			{
				PlayCoffee();
				return;
			}
			if (itemIndex == Items.HealingPotion.itemIndex)
			{
				PlayElixir();
				return;
			}
			ItemDef itemDef = ItemCatalog.GetItemDef(itemIndex);
			if (Object.op_Implicit((Object)(object)itemDef) && (int)itemDef.deprecatedTier == 2)
			{
				PlayAcquireLegendary();
			}
		}

		public void PlayAcquireScepter()
		{
			if (!acquiredScepter)
			{
				((BaseVoiceoverComponent)this).TryPlaySound("Play_RailgunnerArisu_AcquireScepter", 5.6f, true);
				acquiredScepter = true;
			}
		}

		public void PlayAcquireLegendary()
		{
			if (Util.CheckRoll(20f, 0f, (CharacterMaster)null))
			{
				((BaseVoiceoverComponent)this).TryPlaySound("Play_RailgunnerArisu_Panpakapan", 1.25f, false);
			}
			else if (Util.CheckRoll(50f, 0f, (CharacterMaster)null))
			{
				((BaseVoiceoverComponent)this).TryPlaySound("Play_RailgunnerArisu_Relationship_Short", 4.6f, false);
			}
			else
			{
				((BaseVoiceoverComponent)this).TryPlaySound("Play_RailgunnerArisu_Relationship_Long", 15f, false);
			}
		}

		public void PlayCoffee()
		{
			if (!(coffeeCooldown > 0f) && ((BaseVoiceoverComponent)this).TryPlaySound("Play_RailgunnerArisu_Cafe_2", 2f, false))
			{
				coffeeCooldown = 60f;
			}
		}

		public void PlayElixir()
		{
			if (!(elixirCooldown > 0f) && ((BaseVoiceoverComponent)this).TryPlaySound("Play_RailgunnerArisu_Heal", 1.5f, false))
			{
				coffeeCooldown = 60f;
			}
		}

		public override void PlayShrineOfChanceSuccessServer()
		{
			((BaseVoiceoverComponent)this).TryPlayNetworkSound(nsePanpakapan, 1.25f, false);
		}

		protected override void CheckInputs()
		{
			if (Utils.GetKeyPressed(RailgunnerArisuVoiceoverPlugin.buttonTitle))
			{
				((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseTitle, 1f, false);
			}
			else if (Utils.GetKeyPressed(RailgunnerArisuVoiceoverPlugin.buttonPanpakapan))
			{
				((BaseVoiceoverComponent)this).TryPlayNetworkSound(nsePanpakapan, 1.25f, false);
			}
			else if (Utils.GetKeyPressed(RailgunnerArisuVoiceoverPlugin.buttonHikari))
			{
				((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseHikari, 1.25f, false);
			}
			else if (Utils.GetKeyPressed(RailgunnerArisuVoiceoverPlugin.buttonMahou))
			{
				((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseMahou, 2.8f, false);
			}
			else if (Utils.GetKeyPressed(RailgunnerArisuVoiceoverPlugin.buttonNakama))
			{
				((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseNakama, 2.4f, false);
			}
			else if (Utils.GetKeyPressed(RailgunnerArisuVoiceoverPlugin.buttonHurt))
			{
				((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseHurt, 0.1f, false);
			}
			else if (Utils.GetKeyPressed(RailgunnerArisuVoiceoverPlugin.buttonLevel))
			{
				((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseLevel, 3.75f, false);
			}
			else if (Utils.GetKeyPressed(RailgunnerArisuVoiceoverPlugin.buttonKougeki))
			{
				((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseKougeki, 1.2f, false);
			}
			else if (Utils.GetKeyPressed(RailgunnerArisuVoiceoverPlugin.buttonIntro))
			{
				((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseIntro, 3.8f, false);
			}
			else if (Utils.GetKeyPressed(RailgunnerArisuVoiceoverPlugin.buttonPotion))
			{
				((BaseVoiceoverComponent)this).TryPlayNetworkSound(nsePotion, 1.25f, false);
			}
			else if (Utils.GetKeyPressed(RailgunnerArisuVoiceoverPlugin.buttonIkimasu))
			{
				((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseIkimasu, 0.55f, false);
			}
			else if (Utils.GetKeyPressed(RailgunnerArisuVoiceoverPlugin.buttonReset))
			{
				((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseReset, 1.3f, false);
			}
			else if (Utils.GetKeyPressed(RailgunnerArisuVoiceoverPlugin.buttonCafe5))
			{
				((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseCafe5, 7f, false);
			}
			else if (Utils.GetKeyPressed(RailgunnerArisuVoiceoverPlugin.buttonLight))
			{
				((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseLight, 2.5f, false);
			}
		}

		public override bool ComponentEnableVoicelines()
		{
			return RailgunnerArisuVoiceoverPlugin.enableVoicelines.Value;
		}
	}
}

TendouArisTheRailgunner.dll

Decompiled 3 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using MonoMod.RuntimeDetour;
using MonoMod.RuntimeDetour.HookGen;
using RoR2;
using RoR2.ContentManagement;
using RuneFoxMods.DynamicSkins;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Rendering;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
namespace RuneFoxMods
{
	internal class Utils
	{
		public static void PrintBodyCatalog()
		{
			Debug.Log((object)"\nBodyCatalog");
			foreach (GameObject allBodyPrefab in BodyCatalog.allBodyPrefabs)
			{
				Debug.Log((object)((Object)allBodyPrefab).name);
			}
			Debug.Log((object)"\n");
		}

		public static void ReadChildren(GameObject parent, int tabs, bool includecomponents = true)
		{
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			string text = "";
			for (int i = 0; i < tabs; i++)
			{
				text += "  ";
			}
			for (int j = 0; j < parent.transform.childCount; j++)
			{
				Transform child = parent.transform.GetChild(j);
				if ((Object)(object)child == (Object)null)
				{
					break;
				}
				string text2 = ((Component)child).gameObject.activeInHierarchy.ToString();
				Debug.Log((object)(text + ((Object)child).name + " " + text2 + " " + ((Component)child).transform.position));
				if (includecomponents)
				{
					ReadComponents(((Component)child).gameObject, tabs + 1);
					Debug.Log((object)"");
				}
				ReadChildren(((Component)child).gameObject, tabs + 1, includecomponents);
			}
		}

		public static void readheiarchy(GameObject parent, bool includeComponents = true)
		{
			Debug.Log((object)((Object)parent).name);
			if (includeComponents)
			{
				ReadComponents(parent, 1);
				Debug.Log((object)"");
			}
			ReadChildren(parent, 1, includeComponents);
		}

		public static void ReadComponents(GameObject obj, int tabs)
		{
			string text = "";
			for (int i = 0; i < tabs; i++)
			{
				text += "  ";
			}
			Component[] components = obj.GetComponents(typeof(Component));
			Component[] array = components;
			foreach (Component val in array)
			{
				string text2 = "";
				Debug.Log((object)(text + "Comp: " + ((object)val).GetType().ToString() + "  " + text2));
			}
		}

		public static void PrintAllPaths(GameObject parent)
		{
			Debug.Log((object)((Object)parent).name);
			PrintAllPathsInner(parent, ((Object)parent).name);
		}

		private static void PrintAllPathsInner(GameObject parent, string parent_string)
		{
			int childCount = parent.transform.childCount;
			for (int i = 0; i < childCount; i++)
			{
				Transform child = parent.transform.GetChild(i);
				if (((Object)child).name.EndsWith("_end"))
				{
					break;
				}
				string text = parent_string + "/" + ((Object)child).name;
				Debug.Log((object)("  " + ((Object)child).name + "\t\t" + text));
				PrintAllPathsInner(((Component)child).gameObject, text);
			}
		}

		public static void PrintDynamicBone(DynamicBone DB)
		{
			//IL_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0148: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_020a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0225: Unknown result type (might be due to invalid IL or missing references)
			Debug.Log((object)("Root: " + DB.m_Root));
			Debug.Log((object)("Damping: " + DB.m_Damping));
			Debug.Log((object)("Damping Dist: " + DB.m_DampingDistrib));
			Debug.Log((object)("Elasticity: " + DB.m_Elasticity));
			Debug.Log((object)("Elasticity Dist: " + DB.m_ElasticityDistrib));
			Debug.Log((object)("Stiffness: " + DB.m_Stiffness));
			Debug.Log((object)("Stiffness Dist: " + DB.m_StiffnessDistrib));
			Debug.Log((object)("Inert: " + DB.m_Inert));
			Debug.Log((object)("Inert Dist: " + DB.m_InertDistrib));
			Debug.Log((object)("Radius: " + DB.m_Radius));
			Debug.Log((object)("Radius Dist: " + DB.m_RadiusDistrib));
			Debug.Log((object)("End Length: " + DB.m_EndLength));
			Debug.Log((object)("End Offset: " + DB.m_EndOffset));
			Debug.Log((object)("Gravity: " + DB.m_Gravity));
			Debug.Log((object)("Force: " + DB.m_Force));
			Debug.Log((object)("FreezeAxis: " + DB.m_FreezeAxis));
			Debug.Log((object)("Colliders: " + DB.m_Colliders.Count));
			foreach (DynamicBoneCollider collider in DB.m_Colliders)
			{
				Debug.Log((object)("\t Parent: " + ((Object)((Component)collider).transform).name));
				Debug.Log((object)("\t Direction: " + collider.m_Direction));
				Debug.Log((object)("\t Center " + collider.m_Center));
				Debug.Log((object)("\t Bound " + collider.m_Bound));
				Debug.Log((object)("\t Radius " + collider.m_Radius));
				Debug.Log((object)("\t Height " + collider.m_Height));
			}
			Debug.Log((object)("Exclusions: " + DB.m_Exclusions.Count));
			foreach (Transform exclusion in DB.m_Exclusions)
			{
				Debug.Log((object)("\t Transform: " + ((Object)exclusion).name));
			}
		}

		public static ChildLocator GetChildLocator(GameObject body)
		{
			ChildLocator val = null;
			Transform child = body.transform.GetChild(0);
			if (Object.op_Implicit((Object)(object)child))
			{
				Transform child2 = child.GetChild(0);
				if (Object.op_Implicit((Object)(object)child2))
				{
					val = ((Component)child2).GetComponent<ChildLocator>();
					if (Object.op_Implicit((Object)(object)val))
					{
						Debug.Log((object)"Locator Found");
					}
				}
			}
			return val;
		}

		public static Transform FindChildInTree(Transform Root, string name)
		{
			Queue<Transform> queue = new Queue<Transform>();
			queue.Enqueue(Root);
			while (queue.Count != 0)
			{
				Transform val = queue.Dequeue();
				if (((Object)val).name == name)
				{
					return val;
				}
				for (int i = 0; i < val.childCount; i++)
				{
					Transform child = val.GetChild(i);
					queue.Enqueue(child);
				}
			}
			return null;
		}

		public static string RemoveCloneNaming(string str)
		{
			return str.Remove(str.Length - 7);
		}
	}
}
namespace RuneFoxMods.DynamicSkins
{
	public static class DynamicSkinHelpers
	{
		public static SkinnedMeshRenderer[] GetBaseSkinRenderers(GameObject modelObject)
		{
			SkinnedMeshRenderer[] componentsInChildren = modelObject.GetComponentsInChildren<SkinnedMeshRenderer>(true);
			List<SkinnedMeshRenderer> list = new List<SkinnedMeshRenderer>();
			SkinnedMeshRenderer[] array = componentsInChildren;
			foreach (SkinnedMeshRenderer val in array)
			{
				if ((Object)(object)((Component)val).transform.parent == (Object)(object)modelObject.transform)
				{
					list.Add(val);
				}
			}
			return list.ToArray();
		}

		public static Transform[] BoneArrayBuilder(Transform NewBoneRoot)
		{
			List<Transform> list = new List<Transform>();
			BoneArrayBuilderHelper(NewBoneRoot, list);
			return list.ToArray();
		}

		public static void BoneArrayBuilderHelper(Transform parent, List<Transform> list)
		{
			if (!((Object)parent).name.EndsWith("_end"))
			{
				list.Add(parent);
			}
			for (int i = 0; i < parent.childCount; i++)
			{
				BoneArrayBuilderHelper(parent.GetChild(i), list);
			}
		}

		public static Transform GetArmature(GameObject obj)
		{
			return GetArmatureHelper(obj);
		}

		public static Transform GetArmatureHelper(GameObject obj)
		{
			if (((Object)obj).name.ToLower().Contains("armature"))
			{
				return obj.transform;
			}
			for (int i = 0; i < obj.transform.childCount; i++)
			{
				Transform armatureHelper = GetArmatureHelper(((Component)obj.transform.GetChild(i)).gameObject);
				if (Object.op_Implicit((Object)(object)armatureHelper))
				{
					return armatureHelper;
				}
			}
			return null;
		}

		public static Transform GetTopParent(Transform obj)
		{
			Transform val = obj;
			while ((Object)(object)val.parent != (Object)null)
			{
				val = val.parent;
			}
			return val;
		}

		public static string GetPrevBoneInList(Transform targetBone, SkinnedMeshRenderer meshRenderer)
		{
			Transform[] bones = meshRenderer.bones;
			for (int i = 0; i <= bones.Length - 1; i++)
			{
				if (((Object)bones[i + 1]).name == ((Object)targetBone).name)
				{
					return ((Object)bones[i]).name;
				}
			}
			return null;
		}

		public static int GetBoneIndexInList(Transform targetBone, SkinnedMeshRenderer meshRenderer)
		{
			Transform[] bones = meshRenderer.bones;
			for (int i = 0; i <= bones.Length; i++)
			{
				if (((Object)bones[i]).name == ((Object)targetBone).name)
				{
					return i;
				}
			}
			return -1;
		}

		public static int GetPrevBoneIndexInList(Transform targetBone, SkinnedMeshRenderer meshRenderer)
		{
			Transform[] bones = meshRenderer.bones;
			for (int i = 0; i <= bones.Length - 1; i++)
			{
				if (((Object)bones[i + 1]).name == ((Object)targetBone).name)
				{
					return i;
				}
			}
			return -1;
		}
	}
	internal class DynamicSkinManager
	{
		internal Dictionary<string, SkinDef> SkinDefs = new Dictionary<string, SkinDef>();

		private GameObject LastModelObject;

		internal Dictionary<string, SortedList<int, Modification>> ModificationList = new Dictionary<string, SortedList<int, Modification>>();

		private Dictionary<GameObject, AppliedModifications> ModifiedObjects = new Dictionary<GameObject, AppliedModifications>();

		internal ManualLogSource InstanceLogger;

		internal void AddModification(string skinNameToken, int boneIndex, Modification modification)
		{
			if (!ModificationList.TryGetValue(skinNameToken, out var value))
			{
				value = new SortedList<int, Modification>();
				ModificationList.Add(skinNameToken, value);
			}
			value.Add(boneIndex, modification);
		}

		internal void AddSkinDef(SkinDef skinDef)
		{
			SkinDefs.Add(skinDef.nameToken, skinDef);
		}

		internal void SkinDefApply(Action<SkinDef, GameObject> orig, SkinDef self, GameObject modelObject)
		{
			orig(self, modelObject);
			RemoveInvalidModelObjects();
			ModifiedObjects.TryGetValue(modelObject, out var value);
			try
			{
				if (!SkinDefs.TryGetValue(self.nameToken, out var _))
				{
					if (value != null)
					{
						ClearSkinModifications(LastModelObject, value);
					}
				}
				else if (value == null)
				{
					AppliedModifications appliedModifications = new AppliedModifications();
					ModifiedObjects.Add(modelObject, appliedModifications);
					ApplySkinModifications(self, modelObject, appliedModifications);
				}
			}
			catch (Exception ex)
			{
				InstanceLogger.LogWarning((object)"An error occured while adding accessories to a skin");
				InstanceLogger.LogError((object)ex);
			}
		}

		private void RemoveInvalidModelObjects()
		{
			foreach (GameObject item in ModifiedObjects.Keys.Where((GameObject el) => !Object.op_Implicit((Object)(object)el)).ToList())
			{
				ModifiedObjects.Remove(item);
			}
		}

		private void ClearSkinModifications(GameObject modelObject, AppliedModifications modifications)
		{
			while (modifications.BaseModelModifications.Count != 0)
			{
				Modification modification = modifications.BaseModelModifications.Pop();
				clearModification(modification, modelObject, modifications);
			}
			while (modifications.OtherModifications.Count != 0)
			{
				clearModification(modifications.OtherModifications[0], modelObject, modifications);
			}
			ModifiedObjects.Remove(modelObject);
		}

		private void ApplySkinModifications(SkinDef skindef, GameObject modelObject, AppliedModifications modifications)
		{
			CharacterModel component = modelObject.GetComponent<CharacterModel>();
			LastModelObject = modelObject;
			if (!ModificationList.TryGetValue(skindef.nameToken, out var value))
			{
				return;
			}
			foreach (KeyValuePair<int, Modification> item in value)
			{
				ApplyModification(modelObject, component, item.Value, modifications);
			}
		}

		private static void ApplyModification(GameObject modelObject, CharacterModel characterModel, Modification modification, AppliedModifications modifications)
		{
			string bodyname = modification.bodyname;
			string parentname = modification.parentname;
			Transform val = Utils.FindChildInTree(modelObject.transform, parentname);
			GameObject val2;
			if (modification.affectsbasemodel)
			{
				val2 = Object.Instantiate<GameObject>(modification.prefab, val, false);
				((Object)val2).name = Utils.RemoveCloneNaming(((Object)val2).name);
				modification.instance = val2;
				modification.inst_armature = val2;
				ModificationApplyBones(modelObject, modification, modifications);
			}
			else
			{
				val2 = Object.Instantiate<GameObject>(modification.prefab, modelObject.transform, false);
				((Object)val2).name = Utils.RemoveCloneNaming(((Object)val2).name);
				modification.instance = val2;
				Transform armature = DynamicSkinHelpers.GetArmature(val2);
				((Component)armature).transform.SetParent(val, false);
				modification.inst_armature = ((Component)armature).gameObject;
			}
			modification.instance = val2;
			if (modification.dynamicBoneData != null)
			{
				ModificationApplyDynamicBones(modelObject, modification);
			}
			ModificationAddRenderers(val2, characterModel);
			modifications.OtherModifications.Add(modification);
		}

		private static void ModificationApplyBones(GameObject modelObject, Modification modification, AppliedModifications modifications)
		{
			SkinnedMeshRenderer[] baseSkinRenderers = DynamicSkinHelpers.GetBaseSkinRenderers(modelObject);
			List<Transform> list = baseSkinRenderers[0].bones.ToList();
			Transform[] array = DynamicSkinHelpers.BoneArrayBuilder(modification.instance.transform);
			list.InsertRange(modification.boneIndex, array);
			modification.boneCount = array.Length;
			SkinnedMeshRenderer[] array2 = baseSkinRenderers;
			foreach (SkinnedMeshRenderer val in array2)
			{
				val.bones = list.ToArray();
			}
			modifications.BaseModelModifications.Push(modification);
		}

		private static void ModificationApplyDynamicBones(GameObject modelObject, Modification modification)
		{
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01da: Unknown result type (might be due to invalid IL or missing references)
			//IL_0265: Unknown result type (might be due to invalid IL or missing references)
			//IL_026a: Unknown result type (might be due to invalid IL or missing references)
			DynamicBone val = (modification.inst_dynamicBone = modification.instance.AddComponent<DynamicBone>());
			List<DynamicBoneCollider> list = new List<DynamicBoneCollider>();
			foreach (DynamicBoneColliderData collider in modification.dynamicBoneData.m_Colliders)
			{
				Transform val2 = Utils.FindChildInTree(modelObject.transform, collider.m_parent_name);
				DynamicBoneCollider val3 = ((Component)val2).gameObject.AddComponent<DynamicBoneCollider>();
				val3.m_Direction = collider.m_Direction;
				val3.m_Center = collider.m_Center;
				val3.m_Bound = collider.m_Bound;
				val3.m_Radius = collider.m_Radius;
				val3.m_Height = collider.m_Height;
				list.Add(val3);
			}
			modification.inst_DB_colliders = list;
			Transform root = (val.m_Root = Utils.FindChildInTree(modification.inst_armature.transform, modification.dynamicBoneData.m_Root));
			val.m_Damping = modification.dynamicBoneData.m_Damping;
			val.m_DampingDistrib = modification.dynamicBoneData.m_DampingDistrib;
			val.m_Elasticity = modification.dynamicBoneData.m_Elasticity;
			val.m_ElasticityDistrib = modification.dynamicBoneData.m_ElasticityDistrib;
			val.m_Stiffness = modification.dynamicBoneData.m_Stiffness;
			val.m_StiffnessDistrib = modification.dynamicBoneData.m_StiffnessDistrib;
			val.m_Inert = modification.dynamicBoneData.m_Inert;
			val.m_InertDistrib = modification.dynamicBoneData.m_InertDistrib;
			val.m_Radius = modification.dynamicBoneData.m_Radius;
			val.m_RadiusDistrib = modification.dynamicBoneData.m_RadiusDistrib;
			val.m_EndLength = modification.dynamicBoneData.m_EndLength;
			val.m_EndOffset = modification.dynamicBoneData.m_EndOffset;
			val.m_Gravity = modification.dynamicBoneData.m_Gravity;
			val.m_Force = modification.dynamicBoneData.m_Force;
			val.m_Colliders = list;
			val.m_Exclusions = new List<Transform>();
			foreach (string exclusion in modification.dynamicBoneData.m_Exclusions)
			{
				Transform val4 = Utils.FindChildInTree(root, exclusion);
				if ((Object)(object)val4 != (Object)null)
				{
					val.m_Exclusions.Add(val4);
				}
				else
				{
					Debug.LogWarning((object)"Tried to exclude a transform that could not be found");
				}
			}
			val.m_FreezeAxis = modification.dynamicBoneData.m_FreezeAxis;
		}

		private static void ModificationAddRenderers(GameObject newPart, CharacterModel characterModel)
		{
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			SkinnedMeshRenderer[] componentsInChildren = newPart.GetComponentsInChildren<SkinnedMeshRenderer>(true);
			Array.Resize(ref characterModel.baseRendererInfos, characterModel.baseRendererInfos.Length + componentsInChildren.Length);
			if (componentsInChildren.Length != 0)
			{
				int num = componentsInChildren.Length;
				SkinnedMeshRenderer[] array = componentsInChildren;
				foreach (SkinnedMeshRenderer val in array)
				{
					characterModel.baseRendererInfos[characterModel.baseRendererInfos.Length - num] = new RendererInfo
					{
						renderer = (Renderer)(object)componentsInChildren[^num],
						ignoreOverlays = false,
						defaultShadowCastingMode = (ShadowCastingMode)1,
						defaultMaterial = ((Renderer)val).sharedMaterial
					};
					num--;
				}
			}
		}

		private void clearModification(Modification modification, GameObject modelObject, AppliedModifications modifications)
		{
			if (modification.inst_DB_colliders != null)
			{
				foreach (DynamicBoneCollider inst_DB_collider in modification.inst_DB_colliders)
				{
					Object.Destroy((Object)(object)inst_DB_collider);
				}
			}
			if (modification.affectsbasemodel)
			{
				SkinnedMeshRenderer[] baseSkinRenderers = DynamicSkinHelpers.GetBaseSkinRenderers(modelObject);
				List<Transform> list = baseSkinRenderers[0].bones.ToList();
				list.RemoveRange(modification.boneIndex, modification.boneCount);
				SkinnedMeshRenderer[] array = baseSkinRenderers;
				foreach (SkinnedMeshRenderer val in array)
				{
					val.bones = list.ToArray();
				}
			}
			Object.Destroy((Object)(object)modifications.OtherModifications[0].inst_dynamicBone);
			Object.Destroy((Object)(object)modifications.OtherModifications[0].inst_armature);
			Object.Destroy((Object)(object)modifications.OtherModifications[0].instance);
			if (!modifications.OtherModifications.Remove(modification))
			{
				InstanceLogger.LogError((object)"Skin Modification was not removed");
			}
		}
	}
	internal class Modification
	{
		public string prefabpath;

		public string bodyname;

		public string parentname;

		public GameObject prefab;

		public bool affectsbasemodel;

		public DynamicBoneData dynamicBoneData;

		public string parentSkinToken;

		public int boneIndex;

		public int boneCount;

		public GameObject instance;

		public GameObject inst_armature;

		public DynamicBone inst_dynamicBone;

		public List<DynamicBoneCollider> inst_DB_colliders = new List<DynamicBoneCollider>();

		public Modification(string PrefabPath, string ParentName, string BodyName, string ParentSkinToken, int BoneIndex, bool AffectsBaseModel, AssetBundle assetBundle)
		{
			bodyname = BodyName;
			prefabpath = PrefabPath;
			parentname = ParentName;
			parentSkinToken = ParentSkinToken;
			affectsbasemodel = AffectsBaseModel;
			boneIndex = BoneIndex;
			prefab = assetBundle.LoadAsset<GameObject>(prefabpath);
			if ((Object)(object)prefab == (Object)null)
			{
				Debug.LogWarning((object)("Asset at " + PrefabPath + " was not loaded"));
			}
		}
	}
	internal class AppliedModifications
	{
		public Stack<Modification> BaseModelModifications = new Stack<Modification>();

		public List<Modification> OtherModifications = new List<Modification>();
	}
	internal class DynamicBoneData
	{
		public string m_Root;

		public float m_Damping;

		public AnimationCurve m_DampingDistrib;

		public float m_Elasticity;

		public AnimationCurve m_ElasticityDistrib;

		public float m_Stiffness;

		public AnimationCurve m_StiffnessDistrib;

		public float m_Inert;

		public AnimationCurve m_InertDistrib;

		public float m_Radius;

		public AnimationCurve m_RadiusDistrib;

		public float m_EndLength;

		public Vector3 m_EndOffset;

		public Vector3 m_Gravity;

		public Vector3 m_Force;

		public List<DynamicBoneColliderData> m_Colliders;

		public List<string> m_Exclusions;

		public FreezeAxis m_FreezeAxis;

		public DynamicBoneData(string root, float damping, AnimationCurve damping_dist, float elasticity, AnimationCurve elasticity_dist, float stiffness, AnimationCurve stiffness_dist, float inert, AnimationCurve inert_dist, float radius, AnimationCurve radius_dist, float end_length, Vector3 end_offset, Vector3 gravity, Vector3 force, List<DynamicBoneColliderData> colliders, List<string> exclusions, FreezeAxis freeze_axis)
		{
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			m_Root = root;
			m_Damping = damping;
			m_DampingDistrib = damping_dist;
			m_Elasticity = elasticity;
			m_ElasticityDistrib = elasticity_dist;
			m_Stiffness = stiffness;
			m_StiffnessDistrib = stiffness_dist;
			m_Inert = inert;
			m_InertDistrib = inert_dist;
			m_Radius = radius;
			m_RadiusDistrib = radius_dist;
			m_EndLength = end_length;
			m_EndOffset = end_offset;
			m_Gravity = gravity;
			m_Force = force;
			m_Colliders = colliders;
			m_Exclusions = exclusions;
			m_FreezeAxis = freeze_axis;
		}
	}
	internal class DynamicBoneColliderData
	{
		public string m_parent_name;

		public Direction m_Direction;

		public Vector3 m_Center;

		public Bound m_Bound;

		public float m_Radius;

		public float m_Height;

		public DynamicBoneColliderData(string parent_name, Direction direction, Vector3 Center, Bound bound, float radius, float heaight)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			m_parent_name = parent_name;
			m_Direction = direction;
			m_Center = Center;
			m_Bound = bound;
			m_Radius = radius;
			m_Height = heaight;
		}
	}
}
namespace TendouArisTheRailgunner
{
	[BepInPlugin("com.Alicket.TendouArisTheRailgunner", "TendouArisTheRailgunner", "1.0.0")]
	public class TendouArisTheRailgunnerPlugin : BaseUnityPlugin
	{
		public class DynamicSkinExtension
		{
			private Modification ArisSkinDefdressARootModification;

			private Modification ArisSkinDefdressBRootModification;

			private Modification ArisSkinDefdressCRootModification;

			private Modification ArisSkinDefdressDRootModification;

			private Modification ArisSkinDefdressERootModification;

			private Modification ArisSkinDefdressFRootModification;

			private Modification ArisSkinDefhairfrontArootModification;

			private Modification ArisSkinDefhairfrontBrootModification;

			private Modification ArisSkinDefhairrootModification;

			internal void BeforeStart()
			{
				//IL_0039: Unknown result type (might be due to invalid IL or missing references)
				_DynamicSkinManager.InstanceLogger = ((BaseUnityPlugin)Instance).Logger;
				new Hook((MethodBase)typeof(SkinDef).GetMethod("Apply"), (Delegate)new Action<Action<SkinDef, GameObject>, SkinDef, GameObject>(_DynamicSkinManager.SkinDefApply)).Apply();
			}

			internal void AfterStart()
			{
				InitializeModifications();
				InitializeDynamicBones();
				AddModificationsToList();
			}

			internal void BeforeBodyCatalogInit()
			{
				RailgunnerBodyArisSkinDefSkinAddedEvent += onSkinAdded;
			}

			internal void AfterBodyCatalogInit()
			{
			}

			private void InitializeModifications()
			{
				ArisSkinDefdressARootModification = new Modification("dressARoot.prefab", "pelvis", "RailgunnerBody", "ALICKET_SKIN_ARISSKINDEF_NAME", 116, AffectsBaseModel: true, assetBundle);
				ArisSkinDefdressBRootModification = new Modification("dressBRoot.prefab", "pelvis", "RailgunnerBody", "ALICKET_SKIN_ARISSKINDEF_NAME", 120, AffectsBaseModel: true, assetBundle);
				ArisSkinDefdressCRootModification = new Modification("dressCRoot.prefab", "pelvis", "RailgunnerBody", "ALICKET_SKIN_ARISSKINDEF_NAME", 124, AffectsBaseModel: true, assetBundle);
				ArisSkinDefdressDRootModification = new Modification("dressDRoot.prefab", "pelvis", "RailgunnerBody", "ALICKET_SKIN_ARISSKINDEF_NAME", 128, AffectsBaseModel: true, assetBundle);
				ArisSkinDefdressERootModification = new Modification("dressERoot.prefab", "pelvis", "RailgunnerBody", "ALICKET_SKIN_ARISSKINDEF_NAME", 132, AffectsBaseModel: true, assetBundle);
				ArisSkinDefdressFRootModification = new Modification("dressFRoot.prefab", "pelvis", "RailgunnerBody", "ALICKET_SKIN_ARISSKINDEF_NAME", 136, AffectsBaseModel: true, assetBundle);
				ArisSkinDefhairfrontArootModification = new Modification("hairfrontAroot.prefab", "head", "RailgunnerBody", "ALICKET_SKIN_ARISSKINDEF_NAME", 40, AffectsBaseModel: true, assetBundle);
				ArisSkinDefhairfrontBrootModification = new Modification("hairfrontBroot.prefab", "head", "RailgunnerBody", "ALICKET_SKIN_ARISSKINDEF_NAME", 44, AffectsBaseModel: true, assetBundle);
				ArisSkinDefhairrootModification = new Modification("hairroot.prefab", "head", "RailgunnerBody", "ALICKET_SKIN_ARISSKINDEF_NAME", 32, AffectsBaseModel: true, assetBundle);
			}

			private void InitializeDynamicBones()
			{
				//IL_003e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0052: Unknown result type (might be due to invalid IL or missing references)
				//IL_0066: Unknown result type (might be due to invalid IL or missing references)
				//IL_0086: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
				//IL_0119: Unknown result type (might be due to invalid IL or missing references)
				//IL_014a: Unknown result type (might be due to invalid IL or missing references)
				//IL_017b: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
				//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
				//IL_020e: Unknown result type (might be due to invalid IL or missing references)
				//IL_023f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0270: Unknown result type (might be due to invalid IL or missing references)
				//IL_02a1: Unknown result type (might be due to invalid IL or missing references)
				//IL_02d2: Unknown result type (might be due to invalid IL or missing references)
				//IL_0303: Unknown result type (might be due to invalid IL or missing references)
				//IL_036b: Unknown result type (might be due to invalid IL or missing references)
				//IL_037f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0393: Unknown result type (might be due to invalid IL or missing references)
				//IL_03b3: Unknown result type (might be due to invalid IL or missing references)
				//IL_03e4: Unknown result type (might be due to invalid IL or missing references)
				//IL_0415: Unknown result type (might be due to invalid IL or missing references)
				//IL_0446: Unknown result type (might be due to invalid IL or missing references)
				//IL_0477: Unknown result type (might be due to invalid IL or missing references)
				//IL_04a8: Unknown result type (might be due to invalid IL or missing references)
				//IL_04d9: Unknown result type (might be due to invalid IL or missing references)
				//IL_050a: Unknown result type (might be due to invalid IL or missing references)
				//IL_053b: Unknown result type (might be due to invalid IL or missing references)
				//IL_056c: Unknown result type (might be due to invalid IL or missing references)
				//IL_059d: Unknown result type (might be due to invalid IL or missing references)
				//IL_05ce: Unknown result type (might be due to invalid IL or missing references)
				//IL_05ff: Unknown result type (might be due to invalid IL or missing references)
				//IL_0630: Unknown result type (might be due to invalid IL or missing references)
				//IL_0698: Unknown result type (might be due to invalid IL or missing references)
				//IL_06ac: Unknown result type (might be due to invalid IL or missing references)
				//IL_06c0: Unknown result type (might be due to invalid IL or missing references)
				//IL_06e0: Unknown result type (might be due to invalid IL or missing references)
				//IL_0711: Unknown result type (might be due to invalid IL or missing references)
				//IL_0742: Unknown result type (might be due to invalid IL or missing references)
				//IL_0773: Unknown result type (might be due to invalid IL or missing references)
				//IL_07a4: Unknown result type (might be due to invalid IL or missing references)
				//IL_07d5: Unknown result type (might be due to invalid IL or missing references)
				//IL_0806: Unknown result type (might be due to invalid IL or missing references)
				//IL_0837: Unknown result type (might be due to invalid IL or missing references)
				//IL_0868: Unknown result type (might be due to invalid IL or missing references)
				//IL_0899: Unknown result type (might be due to invalid IL or missing references)
				//IL_08ca: Unknown result type (might be due to invalid IL or missing references)
				//IL_08fb: Unknown result type (might be due to invalid IL or missing references)
				//IL_092c: Unknown result type (might be due to invalid IL or missing references)
				//IL_095d: Unknown result type (might be due to invalid IL or missing references)
				//IL_09c5: Unknown result type (might be due to invalid IL or missing references)
				//IL_09d9: Unknown result type (might be due to invalid IL or missing references)
				//IL_09ed: Unknown result type (might be due to invalid IL or missing references)
				//IL_0a0d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0a3e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0a6f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0aa0: Unknown result type (might be due to invalid IL or missing references)
				//IL_0ad1: Unknown result type (might be due to invalid IL or missing references)
				//IL_0b02: Unknown result type (might be due to invalid IL or missing references)
				//IL_0b33: Unknown result type (might be due to invalid IL or missing references)
				//IL_0b64: Unknown result type (might be due to invalid IL or missing references)
				//IL_0b95: Unknown result type (might be due to invalid IL or missing references)
				//IL_0bc6: Unknown result type (might be due to invalid IL or missing references)
				//IL_0bf7: Unknown result type (might be due to invalid IL or missing references)
				//IL_0c28: Unknown result type (might be due to invalid IL or missing references)
				//IL_0c59: Unknown result type (might be due to invalid IL or missing references)
				//IL_0c8a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0cf2: Unknown result type (might be due to invalid IL or missing references)
				//IL_0d06: Unknown result type (might be due to invalid IL or missing references)
				//IL_0d1a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0d3a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0d6b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0d9c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0dcd: Unknown result type (might be due to invalid IL or missing references)
				//IL_0dfe: Unknown result type (might be due to invalid IL or missing references)
				//IL_0e2f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0e60: Unknown result type (might be due to invalid IL or missing references)
				//IL_0e91: Unknown result type (might be due to invalid IL or missing references)
				//IL_0ec2: Unknown result type (might be due to invalid IL or missing references)
				//IL_0ef3: Unknown result type (might be due to invalid IL or missing references)
				//IL_0f24: Unknown result type (might be due to invalid IL or missing references)
				//IL_0f55: Unknown result type (might be due to invalid IL or missing references)
				//IL_0f86: Unknown result type (might be due to invalid IL or missing references)
				//IL_0fb7: Unknown result type (might be due to invalid IL or missing references)
				//IL_101f: Unknown result type (might be due to invalid IL or missing references)
				//IL_1033: Unknown result type (might be due to invalid IL or missing references)
				//IL_1047: Unknown result type (might be due to invalid IL or missing references)
				//IL_1067: Unknown result type (might be due to invalid IL or missing references)
				//IL_1098: Unknown result type (might be due to invalid IL or missing references)
				//IL_10c9: Unknown result type (might be due to invalid IL or missing references)
				//IL_10fa: Unknown result type (might be due to invalid IL or missing references)
				//IL_112b: Unknown result type (might be due to invalid IL or missing references)
				//IL_115c: Unknown result type (might be due to invalid IL or missing references)
				//IL_118d: Unknown result type (might be due to invalid IL or missing references)
				//IL_11be: Unknown result type (might be due to invalid IL or missing references)
				//IL_11ef: Unknown result type (might be due to invalid IL or missing references)
				//IL_1220: Unknown result type (might be due to invalid IL or missing references)
				//IL_1251: Unknown result type (might be due to invalid IL or missing references)
				//IL_1282: Unknown result type (might be due to invalid IL or missing references)
				//IL_12b3: Unknown result type (might be due to invalid IL or missing references)
				//IL_12e4: Unknown result type (might be due to invalid IL or missing references)
				//IL_134c: Unknown result type (might be due to invalid IL or missing references)
				//IL_1360: Unknown result type (might be due to invalid IL or missing references)
				//IL_1374: Unknown result type (might be due to invalid IL or missing references)
				//IL_1394: Unknown result type (might be due to invalid IL or missing references)
				//IL_13c5: Unknown result type (might be due to invalid IL or missing references)
				//IL_13f6: Unknown result type (might be due to invalid IL or missing references)
				//IL_1427: Unknown result type (might be due to invalid IL or missing references)
				//IL_1458: Unknown result type (might be due to invalid IL or missing references)
				//IL_1489: Unknown result type (might be due to invalid IL or missing references)
				//IL_14ba: Unknown result type (might be due to invalid IL or missing references)
				//IL_14eb: Unknown result type (might be due to invalid IL or missing references)
				//IL_151c: Unknown result type (might be due to invalid IL or missing references)
				//IL_154d: Unknown result type (might be due to invalid IL or missing references)
				//IL_157e: Unknown result type (might be due to invalid IL or missing references)
				//IL_15af: Unknown result type (might be due to invalid IL or missing references)
				//IL_15e0: Unknown result type (might be due to invalid IL or missing references)
				//IL_1611: Unknown result type (might be due to invalid IL or missing references)
				//IL_1679: Unknown result type (might be due to invalid IL or missing references)
				//IL_168d: Unknown result type (might be due to invalid IL or missing references)
				//IL_16a1: Unknown result type (might be due to invalid IL or missing references)
				//IL_16c1: Unknown result type (might be due to invalid IL or missing references)
				//IL_16f2: Unknown result type (might be due to invalid IL or missing references)
				//IL_1723: Unknown result type (might be due to invalid IL or missing references)
				//IL_1754: Unknown result type (might be due to invalid IL or missing references)
				//IL_1785: Unknown result type (might be due to invalid IL or missing references)
				//IL_17b6: Unknown result type (might be due to invalid IL or missing references)
				//IL_17e7: Unknown result type (might be due to invalid IL or missing references)
				//IL_1818: Unknown result type (might be due to invalid IL or missing references)
				//IL_1849: Unknown result type (might be due to invalid IL or missing references)
				//IL_187a: Unknown result type (might be due to invalid IL or missing references)
				//IL_18ab: Unknown result type (might be due to invalid IL or missing references)
				//IL_18dc: Unknown result type (might be due to invalid IL or missing references)
				//IL_190d: Unknown result type (might be due to invalid IL or missing references)
				//IL_193e: Unknown result type (might be due to invalid IL or missing references)
				//IL_19a6: Unknown result type (might be due to invalid IL or missing references)
				//IL_19ba: Unknown result type (might be due to invalid IL or missing references)
				//IL_19ce: Unknown result type (might be due to invalid IL or missing references)
				//IL_19ee: Unknown result type (might be due to invalid IL or missing references)
				//IL_1a1f: Unknown result type (might be due to invalid IL or missing references)
				//IL_1a50: Unknown result type (might be due to invalid IL or missing references)
				//IL_1a81: Unknown result type (might be due to invalid IL or missing references)
				//IL_1ab2: Unknown result type (might be due to invalid IL or missing references)
				//IL_1ae3: Unknown result type (might be due to invalid IL or missing references)
				//IL_1b14: Unknown result type (might be due to invalid IL or missing references)
				//IL_1b45: Unknown result type (might be due to invalid IL or missing references)
				//IL_1b76: Unknown result type (might be due to invalid IL or missing references)
				//IL_1ba7: Unknown result type (might be due to invalid IL or missing references)
				//IL_1bd8: Unknown result type (might be due to invalid IL or missing references)
				//IL_1c09: Unknown result type (might be due to invalid IL or missing references)
				//IL_1c3a: Unknown result type (might be due to invalid IL or missing references)
				//IL_1c6b: Unknown result type (might be due to invalid IL or missing references)
				ArisSkinDefdressARootModification.dynamicBoneData = new DynamicBoneData("dressAA", 0.421f, null, 0.1f, null, 0.831f, null, 0f, null, 0.02f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
				{
					new DynamicBoneColliderData("calf.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.5f),
					new DynamicBoneColliderData("calf.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.5f),
					new DynamicBoneColliderData("chest", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.23f, 0f),
					new DynamicBoneColliderData("clavicle.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.08f, 0.3f),
					new DynamicBoneColliderData("clavicle.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.08f, 0.3f),
					new DynamicBoneColliderData("head", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.5f),
					new DynamicBoneColliderData("lower_arm.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.08f, 0.3f),
					new DynamicBoneColliderData("lower_arm.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.08f, 0.3f),
					new DynamicBoneColliderData("pelvis", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.2f, 0f),
					new DynamicBoneColliderData("stomach", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.2f, 0.6f),
					new DynamicBoneColliderData("thigh.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.4f),
					new DynamicBoneColliderData("thigh.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.4f),
					new DynamicBoneColliderData("upper_arm.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.4f),
					new DynamicBoneColliderData("upper_arm.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.4f)
				}, new List<string>(), (FreezeAxis)0);
				ArisSkinDefdressBRootModification.dynamicBoneData = new DynamicBoneData("dressBA", 0.421f, null, 0.1f, null, 0.831f, null, 0f, null, 0.02f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
				{
					new DynamicBoneColliderData("calf.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.5f),
					new DynamicBoneColliderData("calf.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.5f),
					new DynamicBoneColliderData("chest", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.23f, 0f),
					new DynamicBoneColliderData("clavicle.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.08f, 0.3f),
					new DynamicBoneColliderData("clavicle.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.08f, 0.3f),
					new DynamicBoneColliderData("head", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.5f),
					new DynamicBoneColliderData("lower_arm.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.08f, 0.3f),
					new DynamicBoneColliderData("lower_arm.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.08f, 0.3f),
					new DynamicBoneColliderData("pelvis", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.2f, 0f),
					new DynamicBoneColliderData("stomach", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.2f, 0.6f),
					new DynamicBoneColliderData("thigh.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.4f),
					new DynamicBoneColliderData("thigh.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.4f),
					new DynamicBoneColliderData("upper_arm.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.4f),
					new DynamicBoneColliderData("upper_arm.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.4f)
				}, new List<string>(), (FreezeAxis)0);
				ArisSkinDefdressCRootModification.dynamicBoneData = new DynamicBoneData("dressCA", 0.421f, null, 0.1f, null, 0.831f, null, 0f, null, 0.02f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
				{
					new DynamicBoneColliderData("calf.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.5f),
					new DynamicBoneColliderData("calf.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.5f),
					new DynamicBoneColliderData("chest", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.23f, 0f),
					new DynamicBoneColliderData("clavicle.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.08f, 0.3f),
					new DynamicBoneColliderData("clavicle.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.08f, 0.3f),
					new DynamicBoneColliderData("head", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.5f),
					new DynamicBoneColliderData("lower_arm.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.08f, 0.3f),
					new DynamicBoneColliderData("lower_arm.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.08f, 0.3f),
					new DynamicBoneColliderData("pelvis", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.2f, 0f),
					new DynamicBoneColliderData("stomach", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.2f, 0.6f),
					new DynamicBoneColliderData("thigh.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.4f),
					new DynamicBoneColliderData("thigh.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.4f),
					new DynamicBoneColliderData("upper_arm.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.4f),
					new DynamicBoneColliderData("upper_arm.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.4f)
				}, new List<string>(), (FreezeAxis)0);
				ArisSkinDefdressDRootModification.dynamicBoneData = new DynamicBoneData("dressDA", 0.421f, null, 0.1f, null, 0.831f, null, 0f, null, 0.02f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
				{
					new DynamicBoneColliderData("calf.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.5f),
					new DynamicBoneColliderData("calf.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.5f),
					new DynamicBoneColliderData("chest", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.23f, 0f),
					new DynamicBoneColliderData("clavicle.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.08f, 0.3f),
					new DynamicBoneColliderData("clavicle.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.08f, 0.3f),
					new DynamicBoneColliderData("head", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.5f),
					new DynamicBoneColliderData("lower_arm.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.08f, 0.3f),
					new DynamicBoneColliderData("lower_arm.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.08f, 0.3f),
					new DynamicBoneColliderData("pelvis", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.2f, 0f),
					new DynamicBoneColliderData("stomach", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.2f, 0.6f),
					new DynamicBoneColliderData("thigh.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.4f),
					new DynamicBoneColliderData("thigh.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.4f),
					new DynamicBoneColliderData("upper_arm.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.4f),
					new DynamicBoneColliderData("upper_arm.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.4f)
				}, new List<string>(), (FreezeAxis)0);
				ArisSkinDefdressERootModification.dynamicBoneData = new DynamicBoneData("dressEA", 0.421f, null, 0.1f, null, 0.831f, null, 0f, null, 0.02f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
				{
					new DynamicBoneColliderData("calf.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.5f),
					new DynamicBoneColliderData("calf.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.5f),
					new DynamicBoneColliderData("chest", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.23f, 0f),
					new DynamicBoneColliderData("clavicle.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.08f, 0.3f),
					new DynamicBoneColliderData("clavicle.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.08f, 0.3f),
					new DynamicBoneColliderData("head", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.5f),
					new DynamicBoneColliderData("lower_arm.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.08f, 0.3f),
					new DynamicBoneColliderData("lower_arm.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.08f, 0.3f),
					new DynamicBoneColliderData("pelvis", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.2f, 0f),
					new DynamicBoneColliderData("stomach", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.2f, 0.6f),
					new DynamicBoneColliderData("thigh.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.4f),
					new DynamicBoneColliderData("thigh.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.4f),
					new DynamicBoneColliderData("upper_arm.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.4f),
					new DynamicBoneColliderData("upper_arm.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.4f)
				}, new List<string>(), (FreezeAxis)0);
				ArisSkinDefdressFRootModification.dynamicBoneData = new DynamicBoneData("dressFA", 0.421f, null, 0.1f, null, 0.831f, null, 0f, null, 0.02f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
				{
					new DynamicBoneColliderData("calf.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.5f),
					new DynamicBoneColliderData("calf.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.5f),
					new DynamicBoneColliderData("chest", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.23f, 0f),
					new DynamicBoneColliderData("clavicle.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.08f, 0.3f),
					new DynamicBoneColliderData("clavicle.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.08f, 0.3f),
					new DynamicBoneColliderData("head", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.5f),
					new DynamicBoneColliderData("lower_arm.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.08f, 0.3f),
					new DynamicBoneColliderData("lower_arm.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.08f, 0.3f),
					new DynamicBoneColliderData("pelvis", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.2f, 0f),
					new DynamicBoneColliderData("stomach", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.2f, 0.6f),
					new DynamicBoneColliderData("thigh.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.4f),
					new DynamicBoneColliderData("thigh.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.4f),
					new DynamicBoneColliderData("upper_arm.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.4f),
					new DynamicBoneColliderData("upper_arm.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.4f)
				}, new List<string>(), (FreezeAxis)0);
				ArisSkinDefhairfrontArootModification.dynamicBoneData = new DynamicBoneData("hairfaa", 0.421f, null, 0.1f, null, 0f, null, 0f, null, 0.008f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
				{
					new DynamicBoneColliderData("calf.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.5f),
					new DynamicBoneColliderData("calf.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.5f),
					new DynamicBoneColliderData("chest", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.23f, 0f),
					new DynamicBoneColliderData("clavicle.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.08f, 0.3f),
					new DynamicBoneColliderData("clavicle.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.08f, 0.3f),
					new DynamicBoneColliderData("head", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.5f),
					new DynamicBoneColliderData("lower_arm.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.08f, 0.3f),
					new DynamicBoneColliderData("lower_arm.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.08f, 0.3f),
					new DynamicBoneColliderData("pelvis", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.2f, 0f),
					new DynamicBoneColliderData("stomach", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.2f, 0.6f),
					new DynamicBoneColliderData("thigh.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.4f),
					new DynamicBoneColliderData("thigh.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.4f),
					new DynamicBoneColliderData("upper_arm.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.4f),
					new DynamicBoneColliderData("upper_arm.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.4f)
				}, new List<string>(), (FreezeAxis)0);
				ArisSkinDefhairfrontBrootModification.dynamicBoneData = new DynamicBoneData("hairfba", 0.421f, null, 0.1f, null, 0f, null, 0f, null, 0.008f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
				{
					new DynamicBoneColliderData("calf.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.5f),
					new DynamicBoneColliderData("calf.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.5f),
					new DynamicBoneColliderData("chest", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.23f, 0f),
					new DynamicBoneColliderData("clavicle.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.08f, 0.3f),
					new DynamicBoneColliderData("clavicle.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.08f, 0.3f),
					new DynamicBoneColliderData("head", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.5f),
					new DynamicBoneColliderData("lower_arm.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.08f, 0.3f),
					new DynamicBoneColliderData("lower_arm.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.08f, 0.3f),
					new DynamicBoneColliderData("pelvis", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.2f, 0f),
					new DynamicBoneColliderData("stomach", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.2f, 0.6f),
					new DynamicBoneColliderData("thigh.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.4f),
					new DynamicBoneColliderData("thigh.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.4f),
					new DynamicBoneColliderData("upper_arm.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.4f),
					new DynamicBoneColliderData("upper_arm.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.4f)
				}, new List<string>(), (FreezeAxis)0);
				ArisSkinDefhairrootModification.dynamicBoneData = new DynamicBoneData("haira", 0.421f, null, 0.1f, null, 0.53f, null, 0f, null, 0.1f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>
				{
					new DynamicBoneColliderData("calf.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.5f),
					new DynamicBoneColliderData("calf.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.5f),
					new DynamicBoneColliderData("chest", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.23f, 0f),
					new DynamicBoneColliderData("clavicle.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.08f, 0.3f),
					new DynamicBoneColliderData("clavicle.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.08f, 0.3f),
					new DynamicBoneColliderData("head", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.5f),
					new DynamicBoneColliderData("lower_arm.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.08f, 0.3f),
					new DynamicBoneColliderData("lower_arm.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.08f, 0.3f),
					new DynamicBoneColliderData("pelvis", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.2f, 0f),
					new DynamicBoneColliderData("stomach", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.2f, 0.6f),
					new DynamicBoneColliderData("thigh.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.4f),
					new DynamicBoneColliderData("thigh.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.4f),
					new DynamicBoneColliderData("upper_arm.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.4f),
					new DynamicBoneColliderData("upper_arm.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0.4f)
				}, new List<string>(), (FreezeAxis)0);
			}

			private void AddModificationsToList()
			{
				_DynamicSkinManager.AddModification("ALICKET_SKIN_ARISSKINDEF_NAME", 116, ArisSkinDefdressARootModification);
				_DynamicSkinManager.AddModification("ALICKET_SKIN_ARISSKINDEF_NAME", 120, ArisSkinDefdressBRootModification);
				_DynamicSkinManager.AddModification("ALICKET_SKIN_ARISSKINDEF_NAME", 124, ArisSkinDefdressCRootModification);
				_DynamicSkinManager.AddModification("ALICKET_SKIN_ARISSKINDEF_NAME", 128, ArisSkinDefdressDRootModification);
				_DynamicSkinManager.AddModification("ALICKET_SKIN_ARISSKINDEF_NAME", 132, ArisSkinDefdressERootModification);
				_DynamicSkinManager.AddModification("ALICKET_SKIN_ARISSKINDEF_NAME", 136, ArisSkinDefdressFRootModification);
				_DynamicSkinManager.AddModification("ALICKET_SKIN_ARISSKINDEF_NAME", 40, ArisSkinDefhairfrontArootModification);
				_DynamicSkinManager.AddModification("ALICKET_SKIN_ARISSKINDEF_NAME", 44, ArisSkinDefhairfrontBrootModification);
				_DynamicSkinManager.AddModification("ALICKET_SKIN_ARISSKINDEF_NAME", 32, ArisSkinDefhairrootModification);
			}

			private static void onSkinAdded(object sender, SkinAddedArgs e)
			{
				_DynamicSkinManager.AddSkinDef(e.skinDef);
			}
		}

		public delegate void VoidDelegate();

		public class SkinAddedArgs : EventArgs
		{
			public SkinDef skinDef { get; }

			public GameObject bodyPrefab { get; }

			public SkinAddedArgs(SkinDef newSkinDef, GameObject newGameObject)
			{
				skinDef = newSkinDef;
				bodyPrefab = newGameObject;
			}
		}

		private class FieldException : Exception
		{
			public FieldException(string message, Exception innerException)
				: base(message, innerException)
			{
			}
		}

		private static DynamicSkinExtension _DynamicSkinExtension = new DynamicSkinExtension();

		private static DynamicSkinManager _DynamicSkinManager = new DynamicSkinManager();

		private static VoidDelegate BeforeStartDelegate;

		private static VoidDelegate AfterStartDelegate;

		private static VoidDelegate BeforeBodyCatalogDelegate;

		private static VoidDelegate AfterBodyCatalogDelegate;

		private static AssetBundle assetBundle;

		private static readonly List<Material> materialsWithRoRShader = new List<Material>();

		internal static TendouArisTheRailgunnerPlugin Instance { get; private set; }

		internal static ManualLogSource InstanceLogger
		{
			get
			{
				TendouArisTheRailgunnerPlugin instance = Instance;
				return (instance != null) ? ((BaseUnityPlugin)instance).Logger : null;
			}
		}

		private static event EventHandler<SkinAddedArgs> RailgunnerBodyArisSkinDefSkinAddedEvent;

		private void Start()
		{
			Instance = this;
			BeforeStart();
			using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("TendouArisTheRailgunner.alickettendouaristherailgunner"))
			{
				assetBundle = AssetBundle.LoadFromStream(stream);
			}
			((ResourceAvailability)(ref BodyCatalog.availability)).CallWhenAvailable((Action)BodyCatalogInit);
			HookEndpointManager.Add((MethodBase)typeof(Language).GetMethod("LoadStrings"), (Delegate)new Action<Action<Language>, Language>(LanguageLoadStrings));
			ReplaceShaders();
			AfterStart();
		}

		private void BeforeStart()
		{
			BeforeStartDelegate = (VoidDelegate)Delegate.Combine(BeforeStartDelegate, new VoidDelegate(_DynamicSkinExtension.BeforeStart));
			BeforeStartDelegate?.Invoke();
		}

		private void AfterStart()
		{
			AfterStartDelegate = (VoidDelegate)Delegate.Combine(AfterStartDelegate, new VoidDelegate(_DynamicSkinExtension.AfterStart));
			AfterStartDelegate?.Invoke();
		}

		private static void BeforeBodyCatalogInit()
		{
			BeforeBodyCatalogDelegate = (VoidDelegate)Delegate.Combine(BeforeBodyCatalogDelegate, new VoidDelegate(_DynamicSkinExtension.BeforeBodyCatalogInit));
			BeforeBodyCatalogDelegate?.Invoke();
		}

		private static void AfterBodyCatalogInit()
		{
			AfterBodyCatalogDelegate = (VoidDelegate)Delegate.Combine(AfterBodyCatalogDelegate, new VoidDelegate(_DynamicSkinExtension.AfterBodyCatalogInit));
			AfterBodyCatalogDelegate?.Invoke();
		}

		private static void ReplaceShaders()
		{
			LoadMaterialsWithReplacedShader("RoR2/Base/Shaders/HGStandard.shader", "Assets/Resources/BodyMat.mat", "Assets/Resources/GunMat.mat");
		}

		private static void LoadMaterialsWithReplacedShader(string shaderPath, params string[] materialPaths)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			Shader shader = Addressables.LoadAssetAsync<Shader>((object)shaderPath).WaitForCompletion();
			foreach (string text in materialPaths)
			{
				Material val = assetBundle.LoadAsset<Material>(text);
				val.shader = shader;
				materialsWithRoRShader.Add(val);
			}
		}

		private static void LanguageLoadStrings(Action<Language> orig, Language self)
		{
			orig(self);
			self.SetStringByToken("ALICKET_SKIN_ARISSKINDEF_NAME", "TendouAris");
			string text = self.name.ToLower();
			if (text == "zh-cn")
			{
				self.SetStringByToken("ALICKET_SKIN_ARISSKINDEF_NAME", "天童爱丽丝");
			}
		}

		private static void Nothing(Action<SkinDef> orig, SkinDef self)
		{
		}

		private static void BodyCatalogInit()
		{
			BeforeBodyCatalogInit();
			MethodInfo method = typeof(SkinDef).GetMethod("Awake", BindingFlags.Instance | BindingFlags.NonPublic);
			HookEndpointManager.Add((MethodBase)method, (Delegate)new Action<Action<SkinDef>, SkinDef>(Nothing));
			AddRailgunnerBodyArisSkinDefSkin();
			HookEndpointManager.Remove((MethodBase)method, (Delegate)new Action<Action<SkinDef>, SkinDef>(Nothing));
			AfterBodyCatalogInit();
		}

		private static void RailgunnerBodyArisSkinDefSkinAdded(SkinDef skinDef, GameObject bodyPrefab)
		{
			TendouArisTheRailgunnerPlugin.RailgunnerBodyArisSkinDefSkinAddedEvent(Instance, new SkinAddedArgs(skinDef, bodyPrefab));
		}

		private static void AddRailgunnerBodyArisSkinDefSkin()
		{
			//IL_025b: Unknown result type (might be due to invalid IL or missing references)
			string text = "RailgunnerBody";
			string text2 = "ArisSkinDef";
			try
			{
				GameObject val = BodyCatalog.FindBodyPrefab(text);
				if (!Object.op_Implicit((Object)(object)val))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin because \"" + text + "\" doesn't exist"));
					return;
				}
				ModelLocator component = val.GetComponent<ModelLocator>();
				if (!Object.op_Implicit((Object)(object)component))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelLocator\" component"));
					return;
				}
				GameObject gameObject = ((Component)component.modelTransform).gameObject;
				ModelSkinController val2 = (Object.op_Implicit((Object)(object)gameObject) ? gameObject.GetComponent<ModelSkinController>() : null);
				if (!Object.op_Implicit((Object)(object)val2))
				{
					InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelSkinController\" component"));
					return;
				}
				Renderer[] renderers = gameObject.GetComponentsInChildren<Renderer>(true);
				SkinDef skin = ScriptableObject.CreateInstance<SkinDef>();
				TryCatchThrow("Icon", delegate
				{
					skin.icon = assetBundle.LoadAsset<Sprite>("Assets\\SkinMods\\TendouArisTheRailgunner\\Icons\\ArisSkinDefIcon.png");
				});
				((Object)skin).name = text2;
				skin.nameToken = "ALICKET_SKIN_ARISSKINDEF_NAME";
				skin.rootObject = gameObject;
				TryCatchThrow("Base Skins", delegate
				{
					skin.baseSkins = Array.Empty<SkinDef>();
				});
				TryCatchThrow("Unlockable Name", delegate
				{
					skin.unlockableDef = ((IEnumerable<UnlockableDef>)ContentManager.unlockableDefs).FirstOrDefault((Func<UnlockableDef, bool>)((UnlockableDef def) => def.cachedName == "TendouAris"));
				});
				TryCatchThrow("Game Object Activations", delegate
				{
					skin.gameObjectActivations = Array.Empty<GameObjectActivation>();
				});
				TryCatchThrow("Renderer Infos", delegate
				{
					//IL_0011: Unknown result type (might be due to invalid IL or missing references)
					//IL_0030: Unknown result type (might be due to invalid IL or missing references)
					//IL_004c: Unknown result type (might be due to invalid IL or missing references)
					//IL_004d: Unknown result type (might be due to invalid IL or missing references)
					//IL_0056: Unknown result type (might be due to invalid IL or missing references)
					//IL_0075: Unknown result type (might be due to invalid IL or missing references)
					//IL_0091: Unknown result type (might be due to invalid IL or missing references)
					//IL_0092: Unknown result type (might be due to invalid IL or missing references)
					skin.rendererInfos = (RendererInfo[])(object)new RendererInfo[2]
					{
						new RendererInfo
						{
							defaultMaterial = assetBundle.LoadAsset<Material>("Assets/Resources/BodyMat.mat"),
							defaultShadowCastingMode = (ShadowCastingMode)1,
							ignoreOverlays = false,
							renderer = renderers[2]
						},
						new RendererInfo
						{
							defaultMaterial = assetBundle.LoadAsset<Material>("Assets/Resources/GunMat.mat"),
							defaultShadowCastingMode = (ShadowCastingMode)1,
							ignoreOverlays = false,
							renderer = renderers[4]
						}
					};
				});
				TryCatchThrow("Mesh Replacements", delegate
				{
					//IL_0012: Unknown result type (might be due to invalid IL or missing references)
					//IL_002f: Unknown result type (might be due to invalid IL or missing references)
					//IL_0030: Unknown result type (might be due to invalid IL or missing references)
					//IL_0039: Unknown result type (might be due to invalid IL or missing references)
					//IL_0056: Unknown result type (might be due to invalid IL or missing references)
					//IL_0057: Unknown result type (might be due to invalid IL or missing references)
					//IL_0060: Unknown result type (might be due to invalid IL or missing references)
					//IL_008b: Unknown result type (might be due to invalid IL or missing references)
					//IL_008c: Unknown result type (might be due to invalid IL or missing references)
					//IL_0095: Unknown result type (might be due to invalid IL or missing references)
					//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
					//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
					//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
					//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
					//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
					//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
					//IL_010e: Unknown result type (might be due to invalid IL or missing references)
					//IL_010f: Unknown result type (might be due to invalid IL or missing references)
					//IL_0118: Unknown result type (might be due to invalid IL or missing references)
					//IL_0135: Unknown result type (might be due to invalid IL or missing references)
					//IL_0136: Unknown result type (might be due to invalid IL or missing references)
					//IL_013f: Unknown result type (might be due to invalid IL or missing references)
					//IL_015c: Unknown result type (might be due to invalid IL or missing references)
					//IL_015d: Unknown result type (might be due to invalid IL or missing references)
					//IL_0166: Unknown result type (might be due to invalid IL or missing references)
					//IL_0183: Unknown result type (might be due to invalid IL or missing references)
					//IL_0184: Unknown result type (might be due to invalid IL or missing references)
					//IL_018e: Unknown result type (might be due to invalid IL or missing references)
					//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
					//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
					//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
					//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
					//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
					//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
					//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
					//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
					//IL_0209: Unknown result type (might be due to invalid IL or missing references)
					//IL_0227: Unknown result type (might be due to invalid IL or missing references)
					//IL_0228: Unknown result type (might be due to invalid IL or missing references)
					//IL_0232: Unknown result type (might be due to invalid IL or missing references)
					//IL_0250: Unknown result type (might be due to invalid IL or missing references)
					//IL_0251: Unknown result type (might be due to invalid IL or missing references)
					//IL_025b: Unknown result type (might be due to invalid IL or missing references)
					//IL_0279: Unknown result type (might be due to invalid IL or missing references)
					//IL_027a: Unknown result type (might be due to invalid IL or missing references)
					//IL_0284: Unknown result type (might be due to invalid IL or missing references)
					//IL_02a2: Unknown result type (might be due to invalid IL or missing references)
					//IL_02a3: Unknown result type (might be due to invalid IL or missing references)
					//IL_02ad: Unknown result type (might be due to invalid IL or missing references)
					//IL_02cb: Unknown result type (might be due to invalid IL or missing references)
					//IL_02cc: Unknown result type (might be due to invalid IL or missing references)
					//IL_02d6: Unknown result type (might be due to invalid IL or missing references)
					//IL_02f4: Unknown result type (might be due to invalid IL or missing references)
					//IL_02f5: Unknown result type (might be due to invalid IL or missing references)
					//IL_02ff: Unknown result type (might be due to invalid IL or missing references)
					//IL_031d: Unknown result type (might be due to invalid IL or missing references)
					//IL_031e: Unknown result type (might be due to invalid IL or missing references)
					//IL_0328: Unknown result type (might be due to invalid IL or missing references)
					//IL_0346: Unknown result type (might be due to invalid IL or missing references)
					//IL_0347: Unknown result type (might be due to invalid IL or missing references)
					//IL_0351: Unknown result type (might be due to invalid IL or missing references)
					//IL_036f: Unknown result type (might be due to invalid IL or missing references)
					//IL_0370: Unknown result type (might be due to invalid IL or missing references)
					//IL_037a: Unknown result type (might be due to invalid IL or missing references)
					//IL_0398: Unknown result type (might be due to invalid IL or missing references)
					//IL_0399: Unknown result type (might be due to invalid IL or missing references)
					skin.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[22]
					{
						new MeshReplacement
						{
							mesh = null,
							renderer = renderers[0]
						},
						new MeshReplacement
						{
							mesh = null,
							renderer = renderers[1]
						},
						new MeshReplacement
						{
							mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\TendouArisTheRailgunner\\Meshes\\aris_body.001.mesh"),
							renderer = renderers[2]
						},
						new MeshReplacement
						{
							mesh = null,
							renderer = renderers[3]
						},
						new MeshReplacement
						{
							mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\TendouArisTheRailgunner\\Meshes\\aris_gun.mesh"),
							renderer = renderers[4]
						},
						new MeshReplacement
						{
							mesh = null,
							renderer = renderers[5]
						},
						new MeshReplacement
						{
							mesh = null,
							renderer = renderers[6]
						},
						new MeshReplacement
						{
							mesh = null,
							renderer = renderers[7]
						},
						new MeshReplacement
						{
							mesh = null,
							renderer = renderers[8]
						},
						new MeshReplacement
						{
							mesh = null,
							renderer = renderers[9]
						},
						new MeshReplacement
						{
							mesh = null,
							renderer = renderers[10]
						},
						new MeshReplacement
						{
							mesh = null,
							renderer = renderers[11]
						},
						new MeshReplacement
						{
							mesh = null,
							renderer = renderers[12]
						},
						new MeshReplacement
						{
							mesh = null,
							renderer = renderers[13]
						},
						new MeshReplacement
						{
							mesh = null,
							renderer = renderers[14]
						},
						new MeshReplacement
						{
							mesh = null,
							renderer = renderers[15]
						},
						new MeshReplacement
						{
							mesh = null,
							renderer = renderers[16]
						},
						new MeshReplacement
						{
							mesh = null,
							renderer = renderers[17]
						},
						new MeshReplacement
						{
							mesh = null,
							renderer = renderers[18]
						},
						new MeshReplacement
						{
							mesh = null,
							renderer = renderers[19]
						},
						new MeshReplacement
						{
							mesh = null,
							renderer = renderers[20]
						},
						new MeshReplacement
						{
							mesh = null,
							renderer = renderers[21]
						}
					};
				});
				TryCatchThrow("Minion Skin Replacements", delegate
				{
					skin.minionSkinReplacements = Array.Empty<MinionSkinReplacement>();
				});
				TryCatchThrow("Projectile Ghost Replacements", delegate
				{
					skin.projectileGhostReplacements = Array.Empty<ProjectileGhostReplacement>();
				});
				Array.Resize(ref val2.skins, val2.skins.Length + 1);
				val2.skins[val2.skins.Length - 1] = skin;
				BodyCatalog.skins[BodyCatalog.FindBodyIndex(val)] = val2.skins;
				RailgunnerBodyArisSkinDefSkinAdded(skin, val);
			}
			catch (FieldException ex)
			{
				InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\""));
				InstanceLogger.LogWarning((object)("Field causing issue: " + ex.Message));
				InstanceLogger.LogError((object)ex.InnerException);
			}
			catch (Exception ex2)
			{
				InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\""));
				InstanceLogger.LogError((object)ex2);
			}
		}

		private static void TryCatchThrow(string message, Action action)
		{
			try
			{
				action?.Invoke();
			}
			catch (Exception innerException)
			{
				throw new FieldException(message, innerException);
			}
		}
	}
}