Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of MioHuntress v1.1.0
MioHuntress.dll
Decompiled 3 weeks agousing 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.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using MonoMod.RuntimeDetour.HookGen; using MwSkinAdditions; using R2API; using RiskOfOptions; using RiskOfOptions.OptionConfigs; using RiskOfOptions.Options; using RoR2; using RoR2BepInExPack.GameAssetPaths.Version_1_39_0; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Rendering; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] namespace MioHuntress; [BepInPlugin("com.Miyowi.MioHuntress", "MioHuntress", "1.1.0")] public class MioHuntressPlugin : BaseUnityPlugin { public static AssetBundle assetBundle; private static readonly List<Material> materialsWithRoRShader = new List<Material>(); internal static MioHuntressPlugin Instance { get; private set; } internal static ManualLogSource InstanceLogger { get { MioHuntressPlugin instance = Instance; if (instance == null) { return null; } return ((BaseUnityPlugin)instance).Logger; } } private void Awake() { MwSkinEvents.CreateVoiceGroups(); Assets.Init(); } private void Start() { Instance = this; using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("MioHuntress.miyowimiohuntress")) { 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(); Options.Init(); } private static void ReplaceShaders() { LoadMaterialsWithReplacedShader("RoR2/Base/Shaders/HGStandard.shader", "Assets/Skins/MioHuntress/matMio.mat", "Assets/Skins/MioHuntress/matMioBow.mat"); } private static void LoadMaterialsWithReplacedShader(string shaderPath, params string[] materialPaths) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: 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("MIYOWI_SKIN_DEFMIOHUNTRESS_NAME", "Mio"); } private static void BodyCatalogInit() { AddHuntressBodyDefMioHuntressSkin(); } private static SkinDef CreateHuntressBodyDefMioHuntressSkin(GameObject mdl, ModelSkinController skinController) { Renderer[] renderers = mdl.GetComponentsInChildren<Renderer>(true); mdl.GetComponentsInChildren<Light>(true); List<string> skinnedRendererPaths = new List<string>(); Renderer[] array = renderers; foreach (Renderer val in array) { if (val is SkinnedMeshRenderer) { skinnedRendererPaths.Add(Util.BuildPrefabTransformPath(mdl.transform, ((Component)val).transform, false, false)); } } SkinDef skin = ScriptableObject.CreateInstance<SkinDef>(); SkinDefParams skinParams = ScriptableObject.CreateInstance<SkinDefParams>(); skin.skinDefParams = skinParams; ((Object)skin).name = "DefMioHuntress"; skin.nameToken = "MIYOWI_SKIN_DEFMIOHUNTRESS_NAME"; skin.rootObject = mdl; Helpers.TryCatchThrow("Icon", delegate { skin.icon = assetBundle.LoadAsset<Sprite>("Assets\\SkinMods\\MioHuntress\\Icons\\DefMioHuntressIcon.png"); }); Helpers.TryCatchThrow("Unlockable Name", delegate { skin.unlockableDef = null; }); Helpers.TryCatchThrow("Base Skins", delegate { skin.baseSkins = (SkinDef[])(object)new SkinDef[1] { Helpers.ThrowIfOutOfBounds(0, "Index 2 is out of bounds of skins array", skinController.skins, 2) }; }); Helpers.TryCatchThrow("Game Object Activations", delegate { //IL_0010: 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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: 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_0144: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) skinParams.gameObjectActivations = (GameObjectActivation[])(object)new GameObjectActivation[2] { new GameObjectActivation { gameObject = ((Component)Helpers.ThrowIfNull<Transform>(0, "There is no renderer at path \"HuntressArmature/ROOT/base/stomach/chest/head\"", mdl.transform.Find("HuntressArmature/ROOT/base/stomach/chest/head"))).gameObject, shouldActivate = false, spawnPrefabOnModelObject = true, localPosition = new Vector3(-4.365575E-10f, 0.1948572f, 2.550246E-08f), localRotation = new Vector3(15.95592f, 182.3528f, 180.3298f), localScale = new Vector3(1f, 1f, 1.000003f), prefab = Helpers.ClonePrefab(assetBundle.LoadAsset<GameObject>("Assets/Skins/MioHuntress/Prefabs/HeadModifications.prefab")).WithComponent<InsertBones>((Action<InsertBones>)delegate(InsertBones c) { c.rendererPaths.AddRange(skinnedRendererPaths); c.afterPath = "HuntressArmature/ROOT/base/stomach/chest/head"; Transform transform = ((Component)c).transform; c.newBones.Add(transform); c.newBones.Add(transform.GetChild(3, out var child)); c.newBones.Add(child.GetChild(0, out var child2)); c.newBones.Add(child2.GetChild(0, out var child3)); c.newBones.Add(child3.GetChild(0, out var _)); c.newBones.Add(transform.GetChild(1, out var child5)); c.newBones.Add(child5.GetChild(0, out var child6)); c.newBones.Add(child6.GetChild(0, out var child7)); c.newBones.Add(child7.GetChild(0, out var _)); c.newBones.Add(transform.GetChild(2, out var child9)); c.newBones.Add(child9.GetChild(0, out var child10)); c.newBones.Add(child10.GetChild(0, out var child11)); c.newBones.Add(child11.GetChild(0, out var _)); c.newBones.Add(transform.GetChild(4, out var child13)); c.newBones.Add(child13.GetChild(0, out var child14)); c.newBones.Add(child14.GetChild(0, out var _)); c.newBones.Add(transform.GetChild(0, out var child16)); c.newBones.Add(child16.GetChild(0, out var child17)); c.newBones.Add(child17.GetChild(0, out var _)); c.newBones.Add(transform.GetChild(5, out var child19)); c.newBones.Add(child19.GetChild(0, out var child20)); c.newBones.Add(child20.GetChild(0, out var _)); c.newBones.Add(transform.GetChild(6, out var _)); }) }, new GameObjectActivation { gameObject = ((Component)Helpers.ThrowIfNull<Transform>(1, "There is no renderer at path \"HuntressArmature/ROOT/base/stomach/chest\"", mdl.transform.Find("HuntressArmature/ROOT/base/stomach/chest"))).gameObject, shouldActivate = false, spawnPrefabOnModelObject = true, localPosition = new Vector3(-5.820766E-11f, 0.3036404f, 1.869194E-08f), localRotation = new Vector3(353.8918f, 168.0402f, 180.6404f), localScale = new Vector3(1f, 0.9999999f, 1.000032f), prefab = Helpers.ClonePrefab(assetBundle.LoadAsset<GameObject>("Assets/Skins/MioHuntress/Prefabs/ChestModifications.prefab")).WithComponent<InsertBones>((Action<InsertBones>)delegate(InsertBones c) { c.rendererPaths.AddRange(skinnedRendererPaths); c.afterPath = "HuntressArmature/ROOT/base/stomach/chest/head/HeadModifications/HeadAdditions"; Transform transform = ((Component)c).transform; c.newBones.Add(transform); c.newBones.Add(transform.GetChild(0, out var child)); c.newBones.Add(child.GetChild(0, out var _)); c.newBones.Add(transform.GetChild(1, out var child3)); c.newBones.Add(child3.GetChild(0, out var _)); c.newBones.Add(transform.GetChild(2, out var child5)); c.newBones.Add(child5.GetChild(0, out var child6)); c.newBones.Add(child6.GetChild(0, out var child7)); c.newBones.Add(child7.GetChild(0, out var child8)); c.newBones.Add(child8.GetChild(0, out var _)); c.newBones.Add(transform.GetChild(3, out var child10)); c.newBones.Add(child10.GetChild(0, out var child11)); c.newBones.Add(child11.GetChild(0, out var child12)); c.newBones.Add(child12.GetChild(0, out var child13)); c.newBones.Add(child13.GetChild(0, out var _)); c.newBones.Add(transform.GetChild(4, out var child15)); c.newBones.Add(child15.GetChild(0, out var child16)); c.newBones.Add(child16.GetChild(0, out var child17)); c.newBones.Add(child17.GetChild(0, out var child18)); c.newBones.Add(child18.GetChild(0, out var _)); c.newBones.Add(transform.GetChild(5, out var child20)); c.newBones.Add(child20.GetChild(0, out var child21)); c.newBones.Add(child21.GetChild(0, out var child22)); c.newBones.Add(child22.GetChild(0, out var child23)); c.newBones.Add(child23.GetChild(0, out var _)); }) } }; }); Helpers.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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0093: 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_010b: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_024f: 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_0259: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: 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_031f: Unknown result type (might be due to invalid IL or missing references) //IL_0320: Unknown result type (might be due to invalid IL or missing references) //IL_0329: Unknown result type (might be due to invalid IL or missing references) //IL_033e: Unknown result type (might be due to invalid IL or missing references) //IL_0387: Unknown result type (might be due to invalid IL or missing references) //IL_0388: Unknown result type (might be due to invalid IL or missing references) //IL_0391: Unknown result type (might be due to invalid IL or missing references) //IL_03a6: Unknown result type (might be due to invalid IL or missing references) //IL_03ef: Unknown result type (might be due to invalid IL or missing references) //IL_03f0: Unknown result type (might be due to invalid IL or missing references) //IL_03fa: Unknown result type (might be due to invalid IL or missing references) //IL_040f: Unknown result type (might be due to invalid IL or missing references) //IL_0459: Unknown result type (might be due to invalid IL or missing references) //IL_045a: Unknown result type (might be due to invalid IL or missing references) //IL_0464: Unknown result type (might be due to invalid IL or missing references) //IL_0479: Unknown result type (might be due to invalid IL or missing references) //IL_04c3: Unknown result type (might be due to invalid IL or missing references) //IL_04c4: Unknown result type (might be due to invalid IL or missing references) skinParams.rendererInfos = (RendererInfo[])(object)new RendererInfo[11] { new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/Skins/MioHuntress/matMio.mat"), defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false, renderer = Helpers.ThrowIfNull<Renderer>(0, "There is no renderer with the name \"HuntressMesh\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "HuntressMesh"))), hideOnDeath = false, ignoresMaterialOverrides = false }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/Skins/MioHuntress/matMioBow.mat"), defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = true, renderer = Helpers.ThrowIfNull<Renderer>(1, "There is no renderer with the name \"BowMesh\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "BowMesh"))), hideOnDeath = false, ignoresMaterialOverrides = true }, new RendererInfo { defaultMaterial = null, defaultShadowCastingMode = (ShadowCastingMode)0, ignoreOverlays = true, renderer = Helpers.ThrowIfNull<Renderer>(2, "There is no renderer with the name \"HuntressScarfMesh\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "HuntressScarfMesh"))), hideOnDeath = false, ignoresMaterialOverrides = false }, new RendererInfo { defaultMaterial = Assets.bowStringMat, defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = true, renderer = Helpers.ThrowIfNull<Renderer>(3, "There is no renderer with the name \"BowString\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "BowString"))) }, new RendererInfo { defaultMaterial = Assets.arrowMat, defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = true, renderer = Helpers.ThrowIfNull<Renderer>(4, "There is no renderer with the name \"Quad 1\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "Quad 1"))) }, new RendererInfo { defaultMaterial = Assets.arrowMat, defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = true, renderer = Helpers.ThrowIfNull<Renderer>(5, "There is no renderer with the name \"Quad 2\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "Quad 2"))) }, new RendererInfo { defaultMaterial = Assets.arrowMat, defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = true, renderer = Helpers.ThrowIfNull<Renderer>(6, "There is no renderer with the name \"Quad Cluster 1\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "Quad Cluster 1"))) }, new RendererInfo { defaultMaterial = Assets.arrowMat, defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = true, renderer = Helpers.ThrowIfNull<Renderer>(7, "There is no renderer with the name \"Quad Cluster 2\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "Quad Cluster 2"))) }, new RendererInfo { defaultMaterial = Assets.arrowMat, defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = true, renderer = Helpers.ThrowIfNull<Renderer>(8, "There is no renderer with the name \"Quad Cluster 3\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "Quad Cluster 3"))) }, new RendererInfo { defaultMaterial = Assets.arrowMat, defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = true, renderer = Helpers.ThrowIfNull<Renderer>(9, "There is no renderer with the name \"Quad Cluster 4\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "Quad Cluster 4"))) }, new RendererInfo { defaultMaterial = Assets.arrowMat, defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = true, renderer = Helpers.ThrowIfNull<Renderer>(10, "There is no renderer with the name \"Quad Cluster 5\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "Quad Cluster 5"))) } }; }); Helpers.TryCatchThrow("MeshReplacements", delegate { //IL_0010: 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_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0072: 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_00cb: Unknown result type (might be due to invalid IL or missing references) skinParams.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[2] { new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\MioHuntress\\Meshes\\Body.mesh"), renderer = Helpers.ThrowIfNull<Renderer>(0, "There is no renderer with the name \"HuntressMesh\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "HuntressMesh"))) }, new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\MioHuntress\\Meshes\\JuniperBowMesh.mesh"), renderer = Helpers.ThrowIfNull<Renderer>(1, "There is no renderer with the name \"BowMesh\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "BowMesh"))) } }; }); Helpers.TryCatchThrow("Light Infos", delegate { skinParams.lightReplacements = Array.Empty<LightInfo>(); }); Helpers.TryCatchThrow("Minion Skin Replacements", delegate { skinParams.minionSkinReplacements = Array.Empty<MinionSkinReplacement>(); }); Helpers.TryCatchThrow("Projectile Ghost Replacements", delegate { skinParams.projectileGhostReplacements = Array.Empty<ProjectileGhostReplacement>(); }); return skin; } private static void AddHuntressBodyDefMioHuntressSkin() { string text = "HuntressBody"; string text2 = "DefMioHuntress"; 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; } try { 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")); } else { SkinDef val3 = CreateHuntressBodyDefMioHuntressSkin(gameObject, val2); Array.Resize(ref val2.skins, val2.skins.Length + 1); val2.skins[val2.skins.Length - 1] = val3; MwSkinEvents.Init(val3); } } catch (FieldException ex) { if (ex.InnerException is ElementException ex2) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\"")); InstanceLogger.LogWarning((object)$"Field causing issue: {ex.Message}, element: {ex2.Index}"); InstanceLogger.LogWarning((object)ex2.Message); InstanceLogger.LogError((object)ex.InnerException); } else { 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 ex3) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\"")); InstanceLogger.LogError((object)ex3); } } } public class Assets { public static Material bowStringMat; public static Material arrowMat; public static void Init() { CreateBowStringMat(); CreateArrowMat(); } private static void CreateBowStringMat() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: 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_001c: Expected O, but got Unknown //IL_002b: 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) bowStringMat = new Material(Addressables.LoadAssetAsync<Material>((object)RoR2_Base_Huntress.matBowString_mat).WaitForCompletion()); bowStringMat.SetTexture("_RemapTex", Addressables.LoadAssetAsync<Texture>((object)RoR2_Base_Common_ColorRamps.texRampEngi_png).WaitForCompletion()); } private static void CreateArrowMat() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: 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_001c: Expected O, but got Unknown //IL_002b: 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) arrowMat = new Material(Addressables.LoadAssetAsync<Material>((object)RoR2_Base_Huntress.matHuntressArrow_mat).WaitForCompletion()); arrowMat.SetTexture("_RemapTex", Addressables.LoadAssetAsync<Texture>((object)RoR2_Base_Common_ColorRamps.texRampEngi_png).WaitForCompletion()); } } public static class MwSkinEvents { public static VoiceGroup[] voiceGroups; public static VoiceArray blockDamage = new VoiceArray((VoiceInfo[])(object)new VoiceInfo[2] { new VoiceInfo("Play_MioHuntress_Block_1", 1.1f), new VoiceInfo("Play_MioHuntress_Block_2", 1.7f) }); public static VoiceArray damage = new VoiceArray((VoiceInfo[])(object)new VoiceInfo[7] { new VoiceInfo("Play_MioHuntress_Damage_1", 0.6f), new VoiceInfo("Play_MioHuntress_Damage_2", 0.8f), new VoiceInfo("Play_MioHuntress_Damage_3", 0.9f), new VoiceInfo("Play_MioHuntress_Damage_4", 0.6f), new VoiceInfo("Play_MioHuntress_Damage_5", 0.5f), new VoiceInfo("Play_MioHuntress_Damage_6", 0.5f), new VoiceInfo("Play_MioHuntress_Damage_7", 0.5f) }); public static VoiceArray death = new VoiceArray((VoiceInfo[])(object)new VoiceInfo[3] { new VoiceInfo("Play_MioHuntress_Death_1", 2.7f), new VoiceInfo("Play_MioHuntress_Death_2", 2.1f), new VoiceInfo("Play_MioHuntress_Death_3", 1f) }); public static VoiceArray defeatBossGroup = new VoiceArray((VoiceInfo[])(object)new VoiceInfo[4] { new VoiceInfo("Play_MioHuntress_Defeat_Boss_Group_1", 1.5f), new VoiceInfo("Play_MioHuntress_Defeat_Boss_Group_2", 1.3f), new VoiceInfo("Play_MioHuntress_Defeat_Boss_Group_3", 1.8f), new VoiceInfo("Play_MioHuntress_Defeat_Boss_Group_4", 1.3f) }); public static VoiceArray getItem = new VoiceArray((VoiceInfo[])(object)new VoiceInfo[5] { new VoiceInfo("Play_MioHuntress_Get_Item_1", 1f), new VoiceInfo("Play_MioHuntress_Get_Item_2", 2.5f), new VoiceInfo("Play_MioHuntress_Get_Item_3", 1.4f), new VoiceInfo("Play_MioHuntress_Get_Item_4", 1.6f), new VoiceInfo("Play_MioHuntress_Get_Item_5", 1.6f) }); public static VoiceArray heal = new VoiceArray((VoiceInfo[])(object)new VoiceInfo[2] { new VoiceInfo("Play_MioHuntress_Heal_1", 1.7f), new VoiceInfo("Play_MioHuntress_Heal_2", 1.5f) }); public static VoiceArray leavePod = new VoiceArray((VoiceInfo[])(object)new VoiceInfo[2] { new VoiceInfo("Play_MioHuntress_Leave_Pod_1", 1f), new VoiceInfo("Play_MioHuntress_Leave_Pod_2", 1.1f) }); public static VoiceArray levelUp = new VoiceArray((VoiceInfo[])(object)new VoiceInfo[3] { new VoiceInfo("Play_MioHuntress_Level_Up_1", 1.5f), new VoiceInfo("Play_MioHuntress_Level_Up_2", 1.3f), new VoiceInfo("Play_MioHuntress_Level_Up_3", 1.6f) }); public static VoiceArray lowHealth = new VoiceArray((VoiceInfo[])(object)new VoiceInfo[2] { new VoiceInfo("Play_MioHuntress_Low_Health_1", 3.4f), new VoiceInfo("Play_MioHuntress_Low_Health_2", 1.6f) }); public static VoiceArray secondary = new VoiceArray((VoiceInfo[])(object)new VoiceInfo[5] { new VoiceInfo("Play_MioHuntress_Secondary_1", 1f), new VoiceInfo("Play_MioHuntress_Secondary_2", 0.8f), new VoiceInfo("Play_MioHuntress_Secondary_3", 1.1f), new VoiceInfo("Play_MioHuntress_Secondary_4", 1.3f), new VoiceInfo("Play_MioHuntress_Secondary_5", 1.6f) }); public static VoiceArray shrineFailure = new VoiceArray((VoiceInfo[])(object)new VoiceInfo[2] { new VoiceInfo("Play_MioHuntress_Shrine_Failure_1", 0.7f), new VoiceInfo("Play_MioHuntress_Shrine_Failure_2", 0.7f) }); public static VoiceArray shrineSuccess = new VoiceArray((VoiceInfo[])(object)new VoiceInfo[3] { new VoiceInfo("Play_MioHuntress_Shrine_Success_1", 1.5f), new VoiceInfo("Play_MioHuntress_Shrine_Success_2", 0.8f), new VoiceInfo("Play_MioHuntress_Shrine_Success_3", 0.6f) }); public static VoiceArray special = new VoiceArray((VoiceInfo[])(object)new VoiceInfo[5] { new VoiceInfo("Play_MioHuntress_Special_1", 1.8f), new VoiceInfo("Play_MioHuntress_Special_2", 1.2f), new VoiceInfo("Play_MioHuntress_Special_3", 1.2f), new VoiceInfo("Play_MioHuntress_Special_4", 1.3f), new VoiceInfo("Play_MioHuntress_Special_5", 1f) }); public static VoiceArray endTP = new VoiceArray((VoiceInfo[])(object)new VoiceInfo[8] { new VoiceInfo("Play_MioHuntress_TP_End_1", 2.6f), new VoiceInfo("Play_MioHuntress_TP_End_2", 2.3f), new VoiceInfo("Play_MioHuntress_TP_End_3", 2.2f), new VoiceInfo("Play_MioHuntress_TP_End_4", 3.2f), new VoiceInfo("Play_MioHuntress_TP_End_5", 3f), new VoiceInfo("Play_MioHuntress_TP_End_6", 3f), new VoiceInfo("Play_MioHuntress_TP_End_7", 2.1f), new VoiceInfo("Play_MioHuntress_TP_End_8", 1.6f) }); public static VoiceArray startTP = new VoiceArray((VoiceInfo[])(object)new VoiceInfo[10] { new VoiceInfo("Play_MioHuntress_TP_Start_1", 2f), new VoiceInfo("Play_MioHuntress_TP_Start_2", 2.2f), new VoiceInfo("Play_MioHuntress_TP_Start_3", 1.6f), new VoiceInfo("Play_MioHuntress_TP_Start_4", 3.4f), new VoiceInfo("Play_MioHuntress_TP_Start_5", 2.8f), new VoiceInfo("Play_MioHuntress_TP_Start_6", 3f), new VoiceInfo("Play_MioHuntress_TP_Start_7", 1.6f), new VoiceInfo("Play_MioHuntress_TP_Start_8", 1.9f), new VoiceInfo("Play_MioHuntress_TP_Start_9", 1.4f), new VoiceInfo("Play_MioHuntress_TP_Start_10", 2.7f) }); private static void UpdateIDRS(SkinDef skinDef) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: 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_0079: 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_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: 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_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: 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_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02de: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_02fe: 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_0305: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_0317: Unknown result type (might be due to invalid IL or missing references) //IL_032f: Unknown result type (might be due to invalid IL or missing references) //IL_0334: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_036e: Unknown result type (might be due to invalid IL or missing references) //IL_0373: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_038e: 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_0395: Unknown result type (might be due to invalid IL or missing references) //IL_039e: Unknown result type (might be due to invalid IL or missing references) //IL_03a7: Unknown result type (might be due to invalid IL or missing references) //IL_03af: Unknown result type (might be due to invalid IL or missing references) //IL_03b4: Unknown result type (might be due to invalid IL or missing references) //IL_03b6: Unknown result type (might be due to invalid IL or missing references) //IL_03c0: Unknown result type (might be due to invalid IL or missing references) //IL_03c2: Unknown result type (might be due to invalid IL or missing references) //IL_03c9: Unknown result type (might be due to invalid IL or missing references) //IL_03ce: Unknown result type (might be due to invalid IL or missing references) //IL_03d7: Unknown result type (might be due to invalid IL or missing references) DisplayRuleGroup val = new DisplayRuleGroup { rules = (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, childName = "Head", followerPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_CritGlasses.DisplayGlasses_prefab).WaitForCompletion(), localPos = new Vector3(-0.00485f, 0.21612f, 0.08035f), localAngles = new Vector3(321.617f, 359.8309f, 0.12017f), localScale = new Vector3(0.23337f, 0.23337f, 0.23337f) } } }; SkinIDRS.AddGroupOverride(skinDef, (Object)(object)Addressables.LoadAssetAsync<ItemDef>((object)RoR2_Base_CritGlasses.CritGlasses_asset).WaitForCompletion(), val); DisplayRuleGroup val2 = new DisplayRuleGroup { rules = (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, childName = "Head", followerPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC1_CritGlassesVoid.DisplayGlassesVoid_prefab).WaitForCompletion(), localPos = new Vector3(-0.00485f, 0.21612f, 0.08035f), localAngles = new Vector3(321.617f, 359.8309f, 0.12017f), localScale = new Vector3(0.23337f, 0.23337f, 0.23337f) } } }; SkinIDRS.AddGroupOverride(skinDef, (Object)(object)Addressables.LoadAssetAsync<ItemDef>((object)RoR2_DLC1_CritGlassesVoid.CritGlassesVoid_asset).WaitForCompletion(), val2); DisplayRuleGroup val3 = new DisplayRuleGroup { rules = (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, childName = "CalfR", followerPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Hoof.DisplayHoof_prefab).WaitForCompletion(), localPos = new Vector3(0.00551f, 0.4295f, -0.03406f), localAngles = new Vector3(74.36488f, 5.74731f, 5.536f), localScale = new Vector3(0.08f, 0.08f, 0.08f) }, new ItemDisplayRule { ruleType = (ItemDisplayRuleType)1, limbMask = (LimbFlags)8 } } }; SkinIDRS.AddGroupOverride(skinDef, (Object)(object)Addressables.LoadAssetAsync<ItemDef>((object)RoR2_Base_Hoof.Hoof_asset).WaitForCompletion(), val3); DisplayRuleGroup val4 = new DisplayRuleGroup { rules = (ItemDisplayRule[])(object)new ItemDisplayRule[3] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, childName = "Head", followerPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC1_LunarSun.DisplaySunHead_prefab).WaitForCompletion(), localPos = new Vector3(-0.01795f, 0.13052f, 0.0131f), localAngles = new Vector3(0f, 0f, 0f), localScale = new Vector3(0.76757f, 0.76757f, 0.76757f) }, new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, childName = "Chest", followerPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC1_LunarSun.DisplaySunHeadNeck_prefab).WaitForCompletion(), localPos = new Vector3(-0.02662f, 0.27043f, -0.00236f), localAngles = new Vector3(8.07375f, 221.1406f, 7.7322f), localScale = new Vector3(1f, 1f, 1f) }, new ItemDisplayRule { ruleType = (ItemDisplayRuleType)1, limbMask = (LimbFlags)1 } } }; SkinIDRS.AddGroupOverride(skinDef, (Object)(object)Addressables.LoadAssetAsync<ItemDef>((object)RoR2_DLC1_LunarSun.LunarSun_asset).WaitForCompletion(), val4); } public static void Init(SkinDef skinDef) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: 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_0036: Expected O, but got Unknown //IL_003d: 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_004c: 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_0058: Expected O, but got Unknown //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Expected O, but got Unknown //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Expected O, but got Unknown //IL_00ad: 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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Expected O, but got Unknown //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Expected O, but got Unknown //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Expected O, but got Unknown //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Expected O, but got Unknown //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Expected O, but got Unknown //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Expected O, but got Unknown //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0207: 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_0229: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: 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_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_033d: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_0372: Unknown result type (might be due to invalid IL or missing references) //IL_03a6: Unknown result type (might be due to invalid IL or missing references) //IL_03a7: Unknown result type (might be due to invalid IL or missing references) //IL_03db: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_0410: Unknown result type (might be due to invalid IL or missing references) //IL_0411: Unknown result type (might be due to invalid IL or missing references) //IL_0445: 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_047a: Unknown result type (might be due to invalid IL or missing references) //IL_047b: Unknown result type (might be due to invalid IL or missing references) //IL_04af: Unknown result type (might be due to invalid IL or missing references) //IL_04b0: Unknown result type (might be due to invalid IL or missing references) //IL_04e4: Unknown result type (might be due to invalid IL or missing references) //IL_04e5: Unknown result type (might be due to invalid IL or missing references) //IL_0519: Unknown result type (might be due to invalid IL or missing references) //IL_051a: Unknown result type (might be due to invalid IL or missing references) //IL_054e: Unknown result type (might be due to invalid IL or missing references) //IL_054f: Unknown result type (might be due to invalid IL or missing references) UpdateIDRS(skinDef); EventSubOptions val = new EventSubOptions(); val.boneTransformations = (BoneTransformation[])(object)new BoneTransformation[5] { new BoneTransformation("HuntressArmature/ROOT/base/stomach/chest/upper_arm.l", Vector3.one * 0.822f, Vector3.zero, (string)null), new BoneTransformation("HuntressArmature/ROOT/base/stomach/chest/upper_arm.r", Vector3.one * 0.822f, Vector3.zero, (string)null), new BoneTransformation("HuntressArmature/ROOT/base/stomach/chest/upper_arm.r/lower_arm.r/hand.r/thumb.1.r", Vector3.one, new Vector3(-0.01f, -0.01f, 0.01f), (string)null), new BoneTransformation("HuntressArmature/ROOT/base/stomach/chest/upper_arm.l/lower_arm.l/hand.l/thumb.1.l", Vector3.one, new Vector3(0.016f, -0.03f, 0.01f), (string)null), new BoneTransformation("HuntressArmature/ROOT/base/BowRoot", Vector3.one * 0.822f, Vector3.zero, (string)null) }; val.useAnimations = true; val.blinkAnimations = (BlendShapeAnimation[])(object)new BlendShapeAnimation[1] { (BlendShapeAnimation)new BlinkBlendShapeAnimation("HuntressMesh", "LowBlink", -1, 0, 0.1f, 0f, 0.1f, false) }; val.voiceGroups = voiceGroups; val.conditionalIdleAnimations = (IdleAnimation[])(object)new IdleAnimation[2] { new IdleAnimation((BlendShapeAnimation[])(object)new BlendShapeAnimation[1] { new BlendShapeAnimation("HuntressMesh", "EyesTense", 0, -2, 0.3f, float.PositiveInfinity, 0.3f, false) }, (Func<ExpressionController, bool>)InCombat, true), new IdleAnimation((BlendShapeAnimation[])(object)new BlendShapeAnimation[1] { new BlendShapeAnimation("HuntressMesh", "BrowHurt", 1, -1, 0.3f, float.PositiveInfinity, 0.3f, false) }, (Func<ExpressionController, bool>)IsLowHealth, true) }; EventSub val2 = new EventSub(skinDef, val); val2.TakeDamage = (Action<GameObject, DamageReport>)Delegate.Combine(val2.TakeDamage, new Action<GameObject, DamageReport>(ExpressionOnHit)); val2.Death = (Action<GameObject>)Delegate.Combine(val2.Death, new Action<GameObject>(ExpressionOnDeath)); val2.ShrineFailure = (Action<GameObject>)Delegate.Combine(val2.ShrineFailure, new Action<GameObject>(ExpressionOnShrineFailure)); val2.LevelUp = (Action<GameObject>)Delegate.Combine(val2.LevelUp, new Action<GameObject>(ExpressionOnHoldoutOnLevelOnMithrix)); val2.MithrixDefeat = (Action<GameObject>)Delegate.Combine(val2.MithrixDefeat, new Action<GameObject>(ExpressionOnHoldoutOnLevelOnMithrix)); val2.HoldoutZoneCharged = (Action<GameObject>)Delegate.Combine(val2.HoldoutZoneCharged, new Action<GameObject>(ExpressionOnHoldoutOnLevelOnMithrix)); val2.GetItem = (Action<GameObject, ItemIndex>)Delegate.Combine(val2.GetItem, new Action<GameObject, ItemIndex>(ExpressionOnItem)); val2.TakeDamage = (Action<GameObject, DamageReport>)Delegate.Combine(val2.TakeDamage, new Action<GameObject, DamageReport>(LowHealthLine)); val2.Heal = (Action<GameObject, float>)Delegate.Combine(val2.Heal, new Action<GameObject, float>(HeavyHealLine)); val2.TakeDamage = (Action<GameObject, DamageReport>)Delegate.Combine(val2.TakeDamage, (Action<GameObject, DamageReport>)delegate(GameObject body, DamageReport damageReport) { if (body != null) { VoiceController component = body.GetComponent<VoiceController>(); if (component != null) { component.TryPlayRandomUniqueSoundServer(damage, body, 0.4f); } } }); val2.Death = (Action<GameObject>)Delegate.Combine(val2.Death, (Action<GameObject>)delegate(GameObject body) { if (body != null) { VoiceController component = body.GetComponent<VoiceController>(); if (component != null) { component.TryPlayRandomSoundServer(death, body, 1f); } } }); val2.DefeatBossGroup = (Action<GameObject>)Delegate.Combine(val2.DefeatBossGroup, (Action<GameObject>)delegate(GameObject body) { if (body != null) { VoiceController component = body.GetComponent<VoiceController>(); if (component != null) { component.TryPlayRandomUniqueSoundServer(defeatBossGroup, body, 1f); } } }); val2.TeleporterStart = (Action<GameObject>)Delegate.Combine(val2.TeleporterStart, (Action<GameObject>)delegate(GameObject body) { if (body != null) { VoiceController component = body.GetComponent<VoiceController>(); if (component != null) { component.TryPlayRandomUniqueSoundServer(startTP, body, 1f); } } }); val2.TeleporterEnd = (Action<GameObject>)Delegate.Combine(val2.TeleporterEnd, (Action<GameObject>)delegate(GameObject body) { if (body != null) { VoiceController component = body.GetComponent<VoiceController>(); if (component != null) { component.TryPlayRandomUniqueSoundServer(endTP, body, 1f); } } }); val2.LeavePod = (Action<GameObject>)Delegate.Combine(val2.LeavePod, (Action<GameObject>)delegate(GameObject body) { if (body != null) { VoiceController component = body.GetComponent<VoiceController>(); if (component != null) { component.TryPlayRandomUniqueSoundServer(leavePod, body, 1f); } } }); val2.GetItem = (Action<GameObject, ItemIndex>)Delegate.Combine(val2.GetItem, (Action<GameObject, ItemIndex>)delegate(GameObject body, ItemIndex itemIndex) { if (body != null) { VoiceController component = body.GetComponent<VoiceController>(); if (component != null) { component.TryPlayRandomUniqueSoundServer(getItem, body, 0.75f); } } }); val2.ShrineSuccess = (Action<GameObject>)Delegate.Combine(val2.ShrineSuccess, (Action<GameObject>)delegate(GameObject body) { if (body != null) { VoiceController component = body.GetComponent<VoiceController>(); if (component != null) { component.TryPlayRandomUniqueSoundServer(shrineSuccess, body, 1f); } } }); val2.ShrineFailure = (Action<GameObject>)Delegate.Combine(val2.ShrineFailure, (Action<GameObject>)delegate(GameObject body) { if (body != null) { VoiceController component = body.GetComponent<VoiceController>(); if (component != null) { component.TryPlayRandomUniqueSoundServer(shrineFailure, body, 1f); } } }); val2.LevelUp = (Action<GameObject>)Delegate.Combine(val2.LevelUp, (Action<GameObject>)delegate(GameObject body) { if (body != null) { VoiceController component = body.GetComponent<VoiceController>(); if (component != null) { component.TryPlayRandomUniqueSoundServer(levelUp, body, 0.25f); } } }); val2.BearDamageBlock = (Action<GameObject>)Delegate.Combine(val2.BearDamageBlock, (Action<GameObject>)delegate(GameObject body) { if (body != null) { VoiceController component = body.GetComponent<VoiceController>(); if (component != null) { component.TryPlayRandomUniqueSoundServer(blockDamage, body, 0.6f); } } }); val2.UseSpecial = (Action<GameObject>)Delegate.Combine(val2.UseSpecial, (Action<GameObject>)delegate(GameObject body) { if (body != null) { VoiceController component = body.GetComponent<VoiceController>(); if (component != null) { component.TryPlayRandomUniqueSoundServer(special, body, 0.45f); } } }); val2.UseSecondary = (Action<GameObject>)Delegate.Combine(val2.UseSecondary, (Action<GameObject>)delegate(GameObject body) { if (body != null) { VoiceController component = body.GetComponent<VoiceController>(); if (component != null) { component.TryPlayRandomUniqueSoundServer(secondary, body, 0.4f); } } }); val2.Init(); } private static bool InCombat(ExpressionController expressionController) { CharacterBody characterBody = expressionController.characterBody; if ((Object)(object)characterBody != (Object)null) { return !characterBody.outOfCombat; } return false; } private static bool IsLowHealth(ExpressionController expressionController) { CharacterBody characterBody = expressionController.characterBody; if ((Object)(object)characterBody != (Object)null) { if (characterBody == null) { return false; } HealthComponent healthComponent = characterBody.healthComponent; return ((healthComponent != null) ? new float?(healthComponent.combinedHealthFraction) : ((float?)null)) <= 0.25f; } return false; } private static void LowHealthLine(GameObject body, DamageReport damageReport) { if (damageReport == null) { return; } HealthComponent victim = damageReport.victim; if (((victim != null) ? new float?(((Component)victim).GetComponent<HealthComponent>().combinedHealthFraction) : ((float?)null)) <= 0.25f && body != null) { VoiceController component = body.GetComponent<VoiceController>(); if (component != null) { component.TryPlayRandomUniqueSoundServer(lowHealth, body, 0.8f); } } } private static void HeavyHealLine(GameObject body, float amount) { VoiceController val = ((body != null) ? body.GetComponent<VoiceController>() : null); if (val != null) { object obj; if (body == null) { obj = null; } else { CharacterBody component = body.GetComponent<CharacterBody>(); obj = ((component != null) ? component.healthComponent : null); } HealthComponent val2 = (HealthComponent)obj; if (val2 != null && amount >= 0.5f * val2.fullCombinedHealth && val2.combinedHealth < 0.5f * val2.fullCombinedHealth) { val.TryPlayRandomSoundServer(heal, body, 1f); } } } private static void ExpressionOnHit(GameObject body, DamageReport damageReport) { //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Expected O, but got Unknown //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Expected O, but got Unknown //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown if (damageReport == null) { return; } HealthComponent victim = damageReport.victim; if (((victim != null) ? new float?(((Component)victim).GetComponent<HealthComponent>().combinedHealthFraction) : ((float?)null)) > 0.25f) { ExpressionController component = body.GetComponent<ExpressionController>(); if (component != null) { component.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "HighBlink", 0, 0, 0.1f, 0.1f, 0.1f, true)); component.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "BrowHurt", 1, 0, 0.1f, 0.1f, 0.1f, false)); component.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "MouthHurt", 2, 0, 0.1f, 0.1f, 0.1f, false)); } } } private static void ExpressionOnShrineFailure(GameObject body) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown ExpressionController component = body.GetComponent<ExpressionController>(); if (component != null) { component.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "EyesDisappointed", 0, 0, 0.2f, 0.4f, 0.2f, true)); component.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "MouthFrown", 2, 0, 0.2f, 0.4f, 0.2f, false)); } } private static void ExpressionOnHoldoutOnLevelOnMithrix(GameObject body) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown ExpressionController component = body.GetComponent<ExpressionController>(); if (component != null) { component.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "BrowHappy", 1, 0, 0.2f, 0.6f, 0.2f, false)); component.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "mouth_smile_A", 2, 0, 0.2f, 0.6f, 0.2f, false)); } } private static void ExpressionOnItem(GameObject body, ItemIndex itemIndex) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Expected O, but got Unknown ExpressionController component = body.GetComponent<ExpressionController>(); if (component != null) { component.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "HighBlink", 0, 0, 0.2f, 0.6f, 0.2f, true)); component.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "BrowHappy", 1, 0, 0.2f, 0.6f, 0.2f, false)); component.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "mouth_smile_A", 2, 0, 0.2f, 0.6f, 0.2f, false)); } } private static void ExpressionOnDeath(GameObject body) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Expected O, but got Unknown ExpressionController component = body.GetComponent<ExpressionController>(); if (component != null) { component.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "HighBlink", 0, 2, 0.2f, float.PositiveInfinity, 0.2f, true)); component.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "BrowHurt", 1, 2, 0.2f, float.PositiveInfinity, 0.2f, false)); component.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "mouth_i_B", 2, 2, 0.2f, float.PositiveInfinity, 0.2f, false)); } } public static void CreateVoiceGroups() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Expected O, but got Unknown //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Expected O, but got Unknown //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Expected O, but got Unknown //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Expected O, but got Unknown //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Expected O, but got Unknown RoR2Application.onLoadFinished = (Action)Delegate.Combine(RoR2Application.onLoadFinished, new Action(Options.OnLoadFinished)); voiceGroups = (VoiceGroup[])(object)new VoiceGroup[7] { new VoiceGroup((VoiceArray[])(object)new VoiceArray[1] { leavePod }, 0.5f, 0.5f), new VoiceGroup((VoiceArray[])(object)new VoiceArray[1] { death }, 5f, 5f), new VoiceGroup((VoiceArray[])(object)new VoiceArray[1] { getItem }, 15f, 60f), new VoiceGroup((VoiceArray[])(object)new VoiceArray[2] { shrineSuccess, shrineFailure }, 10f, 20f), new VoiceGroup((VoiceArray[])(object)new VoiceArray[1] { levelUp }, 10f, 30f), new VoiceGroup((VoiceArray[])(object)new VoiceArray[6] { damage, secondary, special, blockDamage, heal, lowHealth }, 0.5f, 8f), new VoiceGroup((VoiceArray[])(object)new VoiceArray[3] { startTP, defeatBossGroup, endTP }, 5f, 10f) }; } } public class Options { private static bool? _rooEnabled; public static bool rooEnabled { get { if (!_rooEnabled.HasValue) { _rooEnabled = Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions"); } return _rooEnabled.Value; } } public static ConfigEntry<float> mioVoiceVolume { get; set; } private static void MioVoiceVolumeSettingChanged() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) AkSoundEngine.SetRTPCValue("MioHuntressVoiceVolume", mioVoiceVolume.Value * 50f); } public static void Init() { mioVoiceVolume = ((BaseUnityPlugin)MioHuntressPlugin.Instance).Config.Bind<float>("Sound", "Mio Voice Volume", 1f, "How loud Mio's voice is relative to other sound effects."); mioVoiceVolume.SettingChanged += delegate { MioVoiceVolumeSettingChanged(); }; if (rooEnabled) { RoOInit(); } } public static void OnLoadFinished() { MioVoiceVolumeSettingChanged(); } private static void RoOInit() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0015: 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) //IL_0030: 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 ModSettingsManager.AddOption((BaseOption)new StepSliderOption(mioVoiceVolume, new StepSliderConfig { min = 0f, max = 2f, increment = 0.01f })); ModSettingsManager.SetModDescription("Config options relating to the Mio Huntress skin mod."); ModSettingsManager.SetModIcon(MioHuntressPlugin.assetBundle.LoadAsset<Sprite>("Assets\\SkinMods\\MioHuntress\\Icons\\DefMioHuntressIcon.png")); } } public static class Helpers { private static GameObject prefabHolder; public static GameObject ClonePrefab(GameObject gameObject) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown if (!Object.op_Implicit((Object)(object)prefabHolder)) { prefabHolder = new GameObject("PrefabHolder"); Object.DontDestroyOnLoad((Object)(object)prefabHolder); prefabHolder.SetActive(false); } GameObject obj = Object.Instantiate<GameObject>(gameObject, prefabHolder.transform); obj.AddComponent<RemoveClone>(); ((Object)obj).name = ((Object)gameObject).name; return obj; } public static Transform GetChild(this Transform transform, int index, out Transform child) { return child = transform.GetChild(index); } public static GameObject WithComponent<T>(this GameObject gameObject, Action<T> modifier = null) where T : Component { T obj = gameObject.AddComponent<T>(); modifier?.Invoke(obj); return gameObject; } public static GameObject WithTryComponent<T>(this GameObject gameObject, Action<T> modifier = null) where T : Component { if (Object.op_Implicit((Object)(object)gameObject) && !Object.op_Implicit((Object)(object)gameObject.GetComponent<T>())) { T obj = gameObject.AddComponent<T>(); modifier?.Invoke(obj); } return gameObject; } public static T ThrowIfEquals<T>(int index, string message, T value, T expected) where T : Enum { if (value.Equals(expected)) { throw new ElementException(index, message); } return value; } public static T ThrowIfOutOfBounds<T>(int index, string message, T[] array, int elementIndex) where T : class { if (array == null || array.Length <= elementIndex) { throw new ElementException(index, message); } return array[elementIndex]; } public static T ThrowIfNull<T>(int index, string message, T value) where T : class { if (value == null) { throw new ElementException(index, message); } return value; } public static void TryCatchThrow(string message, Action action) { try { action?.Invoke(); } catch (Exception innerException) { throw new FieldException(message, innerException); } } } public class RemoveClone : MonoBehaviour { public void Awake() { ((Object)this).name = ((Object)this).name[..^7]; } } public class FieldException : Exception { public FieldException(string message, Exception innerException) : base(message, innerException) { } } public class ElementException : Exception { public int Index { get; } public ElementException(int index, string message) : base(message) { Index = index; } } public class InsertBones : MonoBehaviour { private readonly List<SkinnedMeshRenderer> modifiedRenderers = new List<SkinnedMeshRenderer>(); public List<string> rendererPaths = new List<string>(); public List<Transform> newBones = new List<Transform>(); public string afterPath; public void Awake() { Transform transform = ((Component)((Component)this).GetComponentInParent<ModelSkinController>()).transform; Transform value = ((Component)transform).transform.Find(afterPath); foreach (string rendererPath in rendererPaths) { Transform obj = transform.Find(rendererPath); SkinnedMeshRenderer val = ((obj != null) ? ((Component)obj).GetComponent<SkinnedMeshRenderer>() : null); if (Object.op_Implicit((Object)(object)val)) { Transform[] array = val.bones; int num = Array.IndexOf(array, value) + 1; if (num != 0) { Array.Resize(ref array, array.Length + newBones.Count); Array.Copy(array, num, array, num + newBones.Count, array.Length - newBones.Count - num); newBones.CopyTo(array, num); val.bones = array; modifiedRenderers.Add(val); } } } } public void OnDestroy() { foreach (SkinnedMeshRenderer modifiedRenderer in modifiedRenderers) { if (Object.op_Implicit((Object)(object)modifiedRenderer)) { Transform[] array = modifiedRenderer.bones; int num = Array.IndexOf(array, ((Component)this).transform); Array.Copy(array, num + newBones.Count, array, num, array.Length - num - newBones.Count); Array.Resize(ref array, array.Length - newBones.Count); modifiedRenderer.bones = array; } } modifiedRenderers.Clear(); } } public class AddDynamicColliders : MonoBehaviour { public List<string> paths = new List<string>(); public void Awake() { Transform transform = ((Component)((Component)this).GetComponentInParent<ModelSkinController>()).transform; List<DynamicBoneCollider> list = new List<DynamicBoneCollider>(); foreach (string path in paths) { Transform val = transform.Find(path); if (Object.op_Implicit((Object)(object)val)) { list.AddRange(((Component)val).GetComponents<DynamicBoneCollider>()); } } DynamicBone[] components = ((Component)this).GetComponents<DynamicBone>(); for (int i = 0; i < components.Length; i++) { components[i].m_Colliders.AddRange(list); } } }