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 v2.0.0
MioHuntress.dll
Decompiled 2 days ago
The result has been truncated due to the large size, download it to view full contents!
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.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 RoR2.ContentManagement; using RoR2BepInExPack.GameAssetPathsBetter; 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", "2.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class MioHuntressPlugin : BaseUnityPlugin { private static AssetBundle assetBundle; private static readonly List<Material> materialsWithRoRShader = new List<Material>(); private static EventSub eventSub; private static SkinDef[] skins = (SkinDef[])(object)new SkinDef[4]; private static GameObject bowStringModificationsPrefab; 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 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(); AfterStart(); } private void AfterStart() { Options.Init(assetBundle); Texture val = assetBundle.LoadAsset<Texture>("texMioIcon.png"); Texture val2 = assetBundle.LoadAsset<Texture>("texMioIconAlt.png"); eventSub.options.customIcons = (Texture[])(object)new Texture[4] { val, val, val2, val2 }; SetupBowStringModifications(); } private static void AfterBodyCatalogInit() { eventSub.skinDefs = skins; eventSub.Init(); } private static void ReplaceShaders() { LoadMaterialsWithReplacedShader("RoR2/Base/Shaders/HGStandard.shader", "Assets/Skins/MioHuntress2.0/matMio.mat", "Assets/Skins/MioHuntress2.0/matMioBow.mat", "Assets/Skins/MioHuntress2.0/matMioAlt.mat"); LoadMaterialsWithReplacedShader("RoR2/Base/Shaders/HGCloudRemap.shader", "Assets/Skins/MioHuntress2.0/matInvisible.mat", "Assets/Skins/MioHuntress2.0/matMioHuntressBowString.mat", "Assets/Skins/MioHuntress2.0/matMioHuntressCharged.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"); self.SetStringByToken("MIYOWI_SKIN_DEFMIOHUNTRESSALT_NAME", "Mio (Alt)"); } private static void BodyCatalogInit() { AddHuntressBodyDefMioHuntressSkin(); AddHuntressBodyDefMioHuntressAltSkin(); AfterBodyCatalogInit(); } private static void HuntressBodyDefMioHuntressSkinAdded(SkinDef skinDef, GameObject bodyPrefab) { skins[0] = skinDef; AdditionalSkinSetup(skinDef); CustomIDRS.Init(skinDef); } private static SkinDef CreateHuntressBodyDefMioHuntressSkin(GameObject mdl, ModelSkinController skinController) { //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: 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_013a: Unknown result type (might be due to invalid IL or missing references) Renderer[] renderers = mdl.GetComponentsInChildren<Renderer>(true); mdl.GetComponentsInChildren<Light>(true); 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; List<string> skinnedRendererPaths = new List<string>(); 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("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_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_020b: 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_0283: 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_028d: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: 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_0306: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_032e: 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_03b0: Unknown result type (might be due to invalid IL or missing references) //IL_0409: Unknown result type (might be due to invalid IL or missing references) //IL_040a: Unknown result type (might be due to invalid IL or missing references) //IL_0413: Unknown result type (might be due to invalid IL or missing references) //IL_0432: Unknown result type (might be due to invalid IL or missing references) //IL_048b: Unknown result type (might be due to invalid IL or missing references) //IL_048c: Unknown result type (might be due to invalid IL or missing references) //IL_0496: Unknown result type (might be due to invalid IL or missing references) //IL_04b5: Unknown result type (might be due to invalid IL or missing references) //IL_050f: Unknown result type (might be due to invalid IL or missing references) //IL_0510: 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_0539: Unknown result type (might be due to invalid IL or missing references) //IL_0593: Unknown result type (might be due to invalid IL or missing references) //IL_0594: Unknown result type (might be due to invalid IL or missing references) //IL_059e: Unknown result type (might be due to invalid IL or missing references) //IL_05bd: Unknown result type (might be due to invalid IL or missing references) //IL_0617: Unknown result type (might be due to invalid IL or missing references) //IL_0618: Unknown result type (might be due to invalid IL or missing references) skinParams.rendererInfos = (RendererInfo[])(object)new RendererInfo[12] { new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/Skins/MioHuntress2.0/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/MioHuntress2.0/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 = assetBundle.LoadAsset<Material>("Assets/Skins/MioHuntress2.0/matInvisible.mat"), defaultShadowCastingMode = (ShadowCastingMode)0, ignoreOverlays = true, renderer = Helpers.ThrowIfNull<Renderer>(3, "There is no renderer with the name \"Quad 1\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "Quad 1"))), hideOnDeath = false, ignoresMaterialOverrides = false }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/Skins/MioHuntress2.0/matInvisible.mat"), defaultShadowCastingMode = (ShadowCastingMode)0, ignoreOverlays = true, renderer = Helpers.ThrowIfNull<Renderer>(4, "There is no renderer with the name \"Quad 2\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "Quad 2"))), hideOnDeath = false, ignoresMaterialOverrides = false }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/Skins/MioHuntress2.0/matInvisible.mat"), defaultShadowCastingMode = (ShadowCastingMode)0, ignoreOverlays = true, renderer = Helpers.ThrowIfNull<Renderer>(5, "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"))), hideOnDeath = false, ignoresMaterialOverrides = false }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/Skins/MioHuntress2.0/matInvisible.mat"), defaultShadowCastingMode = (ShadowCastingMode)0, ignoreOverlays = true, renderer = Helpers.ThrowIfNull<Renderer>(6, "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"))), hideOnDeath = false, ignoresMaterialOverrides = false }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/Skins/MioHuntress2.0/matInvisible.mat"), defaultShadowCastingMode = (ShadowCastingMode)0, ignoreOverlays = true, renderer = Helpers.ThrowIfNull<Renderer>(7, "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"))), hideOnDeath = false, ignoresMaterialOverrides = false }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/Skins/MioHuntress2.0/matInvisible.mat"), defaultShadowCastingMode = (ShadowCastingMode)0, ignoreOverlays = true, renderer = Helpers.ThrowIfNull<Renderer>(8, "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"))), hideOnDeath = false, ignoresMaterialOverrides = false }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/Skins/MioHuntress2.0/matInvisible.mat"), defaultShadowCastingMode = (ShadowCastingMode)0, ignoreOverlays = true, renderer = Helpers.ThrowIfNull<Renderer>(9, "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"))), hideOnDeath = false, ignoresMaterialOverrides = false }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/Skins/MioHuntress2.0/matMioHuntressBowString.mat"), defaultShadowCastingMode = (ShadowCastingMode)0, ignoreOverlays = true, renderer = Helpers.ThrowIfNull<Renderer>(10, "There is no renderer with the name \"BowString\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "BowString"))), hideOnDeath = false, ignoresMaterialOverrides = false }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/Skins/MioHuntress2.0/matMioHuntressCharged.mat"), defaultShadowCastingMode = (ShadowCastingMode)0, ignoreOverlays = true, renderer = Helpers.ThrowIfNull<Renderer>(11, "There is no renderer with the name \"Flash\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "Flash"))), hideOnDeath = false, ignoresMaterialOverrides = false } }; }); 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"))) } }; }); MeshReplacement[] meshReplacements = skinParams.meshReplacements; foreach (MeshReplacement val in meshReplacements) { if (val.renderer is SkinnedMeshRenderer) { skinnedRendererPaths.Add(Util.BuildPrefabTransformPath(mdl.transform, ((Component)val.renderer).transform, false, false)); } } 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) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0236: 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_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) skinParams.gameObjectActivations = (GameObjectActivation[])(object)new GameObjectActivation[3] { 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(-0.0009427496f, 0.1946448f, -0.06537789f), localRotation = new Vector3(343.7658f, 0.04256714f, 0.3053787f), localScale = new Vector3(1f, 0.9999999f, 1f), prefab = Helpers.ClonePrefab(assetBundle.LoadAsset<GameObject>("Assets/Skins/MioHuntress2.0/Prefabs/HeadAdditions.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 child4)); c.newBones.Add(child4.GetChild(0, out var _)); c.newBones.Add(transform.GetChild(5, 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 child9)); c.newBones.Add(child9.GetChild(0, out var _)); c.newBones.Add(transform.GetChild(6, 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 child14)); c.newBones.Add(child14.GetChild(0, out var _)); c.newBones.Add(transform.GetChild(4, 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(0, out var child20)); c.newBones.Add(child20.GetChild(0, out var child21)); c.newBones.Add(child21.GetChild(0, out var _)); c.newBones.Add(transform.GetChild(1, out var child23)); c.newBones.Add(child23.GetChild(0, out var child24)); c.newBones.Add(child24.GetChild(0, out var _)); c.newBones.Add(transform.GetChild(2, 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(0.0002261881f, 0.1013495f, -0.00408528f), localRotation = new Vector3(6.11269f, 359.6244f, -1.827997E-07f), localScale = new Vector3(0.9999999f, 1f, 0.9999999f), prefab = Helpers.ClonePrefab(assetBundle.LoadAsset<GameObject>("Assets/Skins/MioHuntress2.0/Prefabs/ChestAdditions.prefab")).WithComponent<InsertBones>((Action<InsertBones>)delegate(InsertBones c) { c.rendererPaths.AddRange(skinnedRendererPaths); c.afterPath = "HuntressArmature/ROOT/base/stomach/chest/head/HeadAdditions/FaceDetails"; 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 child2)); c.newBones.Add(child2.GetChild(0, out var _)); c.newBones.Add(transform.GetChild(1, out var child4)); c.newBones.Add(child4.GetChild(0, out var child5)); c.newBones.Add(child5.GetChild(0, out var _)); c.newBones.Add(transform.GetChild(2, out var child7)); c.newBones.Add(child7.GetChild(0, out var child8)); c.newBones.Add(child8.GetChild(0, 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 child12)); c.newBones.Add(child12.GetChild(0, out var _)); c.newBones.Add(child7.GetChild(1, out var child14)); c.newBones.Add(child14.GetChild(0, 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(child7.GetChild(2, 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 child24)); c.newBones.Add(child24.GetChild(0, out var _)); c.newBones.Add(child7.GetChild(3, out var child26)); c.newBones.Add(child26.GetChild(0, out var child27)); c.newBones.Add(child27.GetChild(0, out var child28)); c.newBones.Add(child28.GetChild(0, out var child29)); c.newBones.Add(child29.GetChild(0, out var child30)); c.newBones.Add(child30.GetChild(0, out var _)); }) }, new GameObjectActivation { gameObject = ((Component)Helpers.ThrowIfNull<Transform>(2, "There is no renderer at path \"HuntressArmature/ROOT/base/BowRoot/BowStringIKTarget/HelperBowString\"", mdl.transform.Find("HuntressArmature/ROOT/base/BowRoot/BowStringIKTarget/HelperBowString"))).gameObject, shouldActivate = false, spawnPrefabOnModelObject = true, localPosition = new Vector3(-0.05f, -0.1f, -0.05f), localRotation = new Vector3(270f, 270f, 0f), localScale = new Vector3(1f, 1f, 1f), prefab = Helpers.ClonePrefab(assetBundle.LoadAsset<GameObject>("Assets/Skins/MioHuntress2.0/Prefabs/BowInsert.prefab")) } }; }); 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 HuntressBodyDefMioHuntressLobbySkinAdded(SkinDef skinDef, GameObject displayPrefab) { skins[1] = skinDef; AdditionalSkinSetup(skinDef); } private static void AddHuntressBodyDefMioHuntressSkin() { string text = "HuntressBody"; string text2 = "DefMioHuntress"; GameObject bodyPrefab = BodyCatalog.FindBodyPrefab(text); if (!Object.op_Implicit((Object)(object)bodyPrefab)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin because \"" + text + "\" doesn't exist")); return; } try { ModelLocator component = bodyPrefab.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 val = (Object.op_Implicit((Object)(object)gameObject) ? gameObject.GetComponent<ModelSkinController>() : null); if (!Object.op_Implicit((Object)(object)val)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelSkinController\" component")); return; } SkinDef val2 = CreateHuntressBodyDefMioHuntressSkin(gameObject, val); Array.Resize(ref val.skins, val.skins.Length + 1); val.skins[val.skins.Length - 1] = val2; HuntressBodyDefMioHuntressSkinAdded(val2, bodyPrefab); } 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); } try { SurvivorDef val3 = ((IEnumerable<SurvivorDef>)ContentManager.survivorDefs).FirstOrDefault((Func<SurvivorDef, bool>)((SurvivorDef d) => (Object)(object)d.bodyPrefab == (Object)(object)bodyPrefab)); if (!Object.op_Implicit((Object)(object)val3)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" lobby skin to \"" + text + "\" because SurvivorDef doesn't exist")); return; } GameObject displayPrefab = val3.displayPrefab; ModelSkinController componentInChildren = displayPrefab.GetComponentInChildren<ModelSkinController>(); if (!Object.op_Implicit((Object)(object)componentInChildren)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" lobby skin to \"" + text + "\" because it doesn't have \"ModelSkinController\" component")); } else { SkinDef val4 = CreateHuntressBodyDefMioHuntressSkin(((Component)componentInChildren).gameObject, componentInChildren); Array.Resize(ref componentInChildren.skins, componentInChildren.skins.Length + 1); componentInChildren.skins[^1] = val4; HuntressBodyDefMioHuntressLobbySkinAdded(val4, displayPrefab); } } catch (FieldException ex4) { if (ex4.InnerException is ElementException ex5) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" lobby skin to \"" + text + "\"")); InstanceLogger.LogWarning((object)$"Field causing issue: {ex4.Message}, element: {ex5.Index}"); InstanceLogger.LogWarning((object)ex5.Message); InstanceLogger.LogError((object)ex4.InnerException); } else { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" lobby skin to \"" + text + "\"")); InstanceLogger.LogWarning((object)("Field causing issue: " + ex4.Message)); InstanceLogger.LogError((object)ex4.InnerException); } } catch (Exception ex6) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" lobby skin to \"" + text + "\"")); InstanceLogger.LogError((object)ex6); } } private static void HuntressBodyDefMioHuntressAltSkinAdded(SkinDef skinDef, GameObject bodyPrefab) { skins[2] = skinDef; AdditionalSkinSetup(skinDef); CustomIDRS.Init(skinDef); } private static SkinDef CreateHuntressBodyDefMioHuntressAltSkin(GameObject mdl, ModelSkinController skinController) { //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: 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_013a: Unknown result type (might be due to invalid IL or missing references) Renderer[] renderers = mdl.GetComponentsInChildren<Renderer>(true); mdl.GetComponentsInChildren<Light>(true); SkinDef skin = ScriptableObject.CreateInstance<SkinDef>(); SkinDefParams skinParams = ScriptableObject.CreateInstance<SkinDefParams>(); skin.skinDefParams = skinParams; ((Object)skin).name = "DefMioHuntressAlt"; skin.nameToken = "MIYOWI_SKIN_DEFMIOHUNTRESSALT_NAME"; skin.rootObject = mdl; List<string> skinnedRendererPaths = new List<string>(); Helpers.TryCatchThrow("Icon", delegate { skin.icon = assetBundle.LoadAsset<Sprite>("Assets\\SkinMods\\MioHuntress\\Icons\\DefMioHuntressAltIcon.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("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_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_020b: 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_0283: 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_028d: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: 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_0306: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_032e: 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_03b0: Unknown result type (might be due to invalid IL or missing references) //IL_0409: Unknown result type (might be due to invalid IL or missing references) //IL_040a: Unknown result type (might be due to invalid IL or missing references) //IL_0413: Unknown result type (might be due to invalid IL or missing references) //IL_0432: Unknown result type (might be due to invalid IL or missing references) //IL_048b: Unknown result type (might be due to invalid IL or missing references) //IL_048c: Unknown result type (might be due to invalid IL or missing references) //IL_0496: Unknown result type (might be due to invalid IL or missing references) //IL_04b5: Unknown result type (might be due to invalid IL or missing references) //IL_050f: Unknown result type (might be due to invalid IL or missing references) //IL_0510: 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_0539: Unknown result type (might be due to invalid IL or missing references) //IL_0593: Unknown result type (might be due to invalid IL or missing references) //IL_0594: Unknown result type (might be due to invalid IL or missing references) //IL_059e: Unknown result type (might be due to invalid IL or missing references) //IL_05bd: Unknown result type (might be due to invalid IL or missing references) //IL_0617: Unknown result type (might be due to invalid IL or missing references) //IL_0618: Unknown result type (might be due to invalid IL or missing references) skinParams.rendererInfos = (RendererInfo[])(object)new RendererInfo[12] { new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/Skins/MioHuntress2.0/matMioAlt.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/MioHuntress2.0/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 = assetBundle.LoadAsset<Material>("Assets/Skins/MioHuntress2.0/matInvisible.mat"), defaultShadowCastingMode = (ShadowCastingMode)0, ignoreOverlays = true, renderer = Helpers.ThrowIfNull<Renderer>(3, "There is no renderer with the name \"Quad 1\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "Quad 1"))), hideOnDeath = false, ignoresMaterialOverrides = false }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/Skins/MioHuntress2.0/matInvisible.mat"), defaultShadowCastingMode = (ShadowCastingMode)0, ignoreOverlays = true, renderer = Helpers.ThrowIfNull<Renderer>(4, "There is no renderer with the name \"Quad 2\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "Quad 2"))), hideOnDeath = false, ignoresMaterialOverrides = false }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/Skins/MioHuntress2.0/matInvisible.mat"), defaultShadowCastingMode = (ShadowCastingMode)0, ignoreOverlays = true, renderer = Helpers.ThrowIfNull<Renderer>(5, "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"))), hideOnDeath = false, ignoresMaterialOverrides = false }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/Skins/MioHuntress2.0/matInvisible.mat"), defaultShadowCastingMode = (ShadowCastingMode)0, ignoreOverlays = true, renderer = Helpers.ThrowIfNull<Renderer>(6, "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"))), hideOnDeath = false, ignoresMaterialOverrides = false }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/Skins/MioHuntress2.0/matInvisible.mat"), defaultShadowCastingMode = (ShadowCastingMode)0, ignoreOverlays = true, renderer = Helpers.ThrowIfNull<Renderer>(7, "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"))), hideOnDeath = false, ignoresMaterialOverrides = false }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/Skins/MioHuntress2.0/matInvisible.mat"), defaultShadowCastingMode = (ShadowCastingMode)0, ignoreOverlays = true, renderer = Helpers.ThrowIfNull<Renderer>(8, "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"))), hideOnDeath = false, ignoresMaterialOverrides = false }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/Skins/MioHuntress2.0/matInvisible.mat"), defaultShadowCastingMode = (ShadowCastingMode)0, ignoreOverlays = true, renderer = Helpers.ThrowIfNull<Renderer>(9, "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"))), hideOnDeath = false, ignoresMaterialOverrides = false }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/Skins/MioHuntress2.0/matMioHuntressBowString.mat"), defaultShadowCastingMode = (ShadowCastingMode)0, ignoreOverlays = true, renderer = Helpers.ThrowIfNull<Renderer>(10, "There is no renderer with the name \"BowString\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "BowString"))), hideOnDeath = false, ignoresMaterialOverrides = false }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/Skins/MioHuntress2.0/matMioHuntressCharged.mat"), defaultShadowCastingMode = (ShadowCastingMode)0, ignoreOverlays = true, renderer = Helpers.ThrowIfNull<Renderer>(11, "There is no renderer with the name \"Flash\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "Flash"))), hideOnDeath = false, ignoresMaterialOverrides = false } }; }); 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"))) } }; }); MeshReplacement[] meshReplacements = skinParams.meshReplacements; foreach (MeshReplacement val in meshReplacements) { if (val.renderer is SkinnedMeshRenderer) { skinnedRendererPaths.Add(Util.BuildPrefabTransformPath(mdl.transform, ((Component)val.renderer).transform, false, false)); } } 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) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0236: 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_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) skinParams.gameObjectActivations = (GameObjectActivation[])(object)new GameObjectActivation[3] { 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(-0.0009427496f, 0.1946448f, -0.06537789f), localRotation = new Vector3(343.7658f, 0.04256714f, 0.3053787f), localScale = new Vector3(1f, 0.9999999f, 1f), prefab = Helpers.ClonePrefab(assetBundle.LoadAsset<GameObject>("Assets/Skins/MioHuntress2.0/Prefabs/HeadAdditions.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 child4)); c.newBones.Add(child4.GetChild(0, out var _)); c.newBones.Add(transform.GetChild(5, 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 child9)); c.newBones.Add(child9.GetChild(0, out var _)); c.newBones.Add(transform.GetChild(6, 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 child14)); c.newBones.Add(child14.GetChild(0, out var _)); c.newBones.Add(transform.GetChild(4, 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(0, out var child20)); c.newBones.Add(child20.GetChild(0, out var child21)); c.newBones.Add(child21.GetChild(0, out var _)); c.newBones.Add(transform.GetChild(1, out var child23)); c.newBones.Add(child23.GetChild(0, out var child24)); c.newBones.Add(child24.GetChild(0, out var _)); c.newBones.Add(transform.GetChild(2, 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(0.0002261881f, 0.1013495f, -0.00408528f), localRotation = new Vector3(6.11269f, 359.6244f, -1.827997E-07f), localScale = new Vector3(0.9999999f, 1f, 0.9999999f), prefab = Helpers.ClonePrefab(assetBundle.LoadAsset<GameObject>("Assets/Skins/MioHuntress2.0/Prefabs/ChestAdditions.prefab")).WithComponent<InsertBones>((Action<InsertBones>)delegate(InsertBones c) { c.rendererPaths.AddRange(skinnedRendererPaths); c.afterPath = "HuntressArmature/ROOT/base/stomach/chest/head/HeadAdditions/FaceDetails"; 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 child2)); c.newBones.Add(child2.GetChild(0, out var _)); c.newBones.Add(transform.GetChild(1, out var child4)); c.newBones.Add(child4.GetChild(0, out var child5)); c.newBones.Add(child5.GetChild(0, out var _)); c.newBones.Add(transform.GetChild(2, out var child7)); c.newBones.Add(child7.GetChild(0, out var child8)); c.newBones.Add(child8.GetChild(0, 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 child12)); c.newBones.Add(child12.GetChild(0, out var _)); c.newBones.Add(child7.GetChild(1, out var child14)); c.newBones.Add(child14.GetChild(0, 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(child7.GetChild(2, 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 child24)); c.newBones.Add(child24.GetChild(0, out var _)); c.newBones.Add(child7.GetChild(3, out var child26)); c.newBones.Add(child26.GetChild(0, out var child27)); c.newBones.Add(child27.GetChild(0, out var child28)); c.newBones.Add(child28.GetChild(0, out var child29)); c.newBones.Add(child29.GetChild(0, out var child30)); c.newBones.Add(child30.GetChild(0, out var _)); }) }, new GameObjectActivation { gameObject = ((Component)Helpers.ThrowIfNull<Transform>(2, "There is no renderer at path \"HuntressArmature/ROOT/base/BowRoot/BowStringIKTarget/HelperBowString\"", mdl.transform.Find("HuntressArmature/ROOT/base/BowRoot/BowStringIKTarget/HelperBowString"))).gameObject, shouldActivate = false, spawnPrefabOnModelObject = true, localPosition = new Vector3(-0.05f, -0.1f, -0.05f), localRotation = new Vector3(270f, 270f, 0f), localScale = new Vector3(1f, 1f, 1f), prefab = Helpers.ClonePrefab(assetBundle.LoadAsset<GameObject>("Assets/Skins/MioHuntress2.0/Prefabs/BowInsert.prefab")) } }; }); 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 HuntressBodyDefMioHuntressAltLobbySkinAdded(SkinDef skinDef, GameObject displayPrefab) { skins[3] = skinDef; AdditionalSkinSetup(skinDef); } private static void AddHuntressBodyDefMioHuntressAltSkin() { string text = "HuntressBody"; string text2 = "DefMioHuntressAlt"; GameObject bodyPrefab = BodyCatalog.FindBodyPrefab(text); if (!Object.op_Implicit((Object)(object)bodyPrefab)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin because \"" + text + "\" doesn't exist")); return; } try { ModelLocator component = bodyPrefab.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 val = (Object.op_Implicit((Object)(object)gameObject) ? gameObject.GetComponent<ModelSkinController>() : null); if (!Object.op_Implicit((Object)(object)val)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelSkinController\" component")); return; } SkinDef val2 = CreateHuntressBodyDefMioHuntressAltSkin(gameObject, val); Array.Resize(ref val.skins, val.skins.Length + 1); val.skins[val.skins.Length - 1] = val2; HuntressBodyDefMioHuntressAltSkinAdded(val2, bodyPrefab); } 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); } try { SurvivorDef val3 = ((IEnumerable<SurvivorDef>)ContentManager.survivorDefs).FirstOrDefault((Func<SurvivorDef, bool>)((SurvivorDef d) => (Object)(object)d.bodyPrefab == (Object)(object)bodyPrefab)); if (!Object.op_Implicit((Object)(object)val3)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" lobby skin to \"" + text + "\" because SurvivorDef doesn't exist")); return; } GameObject displayPrefab = val3.displayPrefab; ModelSkinController componentInChildren = displayPrefab.GetComponentInChildren<ModelSkinController>(); if (!Object.op_Implicit((Object)(object)componentInChildren)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" lobby skin to \"" + text + "\" because it doesn't have \"ModelSkinController\" component")); } else { SkinDef val4 = CreateHuntressBodyDefMioHuntressAltSkin(((Component)componentInChildren).gameObject, componentInChildren); Array.Resize(ref componentInChildren.skins, componentInChildren.skins.Length + 1); componentInChildren.skins[^1] = val4; HuntressBodyDefMioHuntressAltLobbySkinAdded(val4, displayPrefab); } } catch (FieldException ex4) { if (ex4.InnerException is ElementException ex5) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" lobby skin to \"" + text + "\"")); InstanceLogger.LogWarning((object)$"Field causing issue: {ex4.Message}, element: {ex5.Index}"); InstanceLogger.LogWarning((object)ex5.Message); InstanceLogger.LogError((object)ex4.InnerException); } else { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" lobby skin to \"" + text + "\"")); InstanceLogger.LogWarning((object)("Field causing issue: " + ex4.Message)); InstanceLogger.LogError((object)ex4.InnerException); } } catch (Exception ex6) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" lobby skin to \"" + text + "\"")); InstanceLogger.LogError((object)ex6); } } private void Awake() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Expected O, but got Unknown eventSub = new EventSub(); VoiceLines.Init(eventSub); BoneTransformations.Init(eventSub); Expressions.Init(eventSub); } private static void AdditionalSkinSetup(SkinDef skinDef) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: 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_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) Renderer[] componentsInChildren = skinDef.rootObject.GetComponentsInChildren<Renderer>(true); skinDef.skinDefParams.gameObjectActivations = skinDef.skinDefParams.gameObjectActivations.Concat((IEnumerable<GameObjectActivation>)(object)new GameObjectActivation[1] { new GameObjectActivation { gameObject = Helpers.ThrowIfNull<GameObject>(3, "There is no renderer with the name \"BowString\"", ((Component)((IEnumerable<Renderer>)componentsInChildren).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "BowString"))).gameObject), shouldActivate = false, spawnPrefabOnModelObject = true, localPosition = Vector3.zero, localRotation = Vector3.zero, localScale = Vector3.one, prefab = bowStringModificationsPrefab } }).ToArray(); } private static void SetupBowStringModifications() { bowStringModificationsPrefab = assetBundle.LoadAsset<GameObject>("BowStringModifications"); bowStringModificationsPrefab.AddComponent<BowStringModificationController>(); } } public static class BoneTransformations { public static void Init(EventSub eventSub) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006b: 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_007c: Expected O, but got Unknown //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Expected O, but got Unknown //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00db: 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_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Expected O, but got Unknown //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Expected O, but got Unknown eventSub.options.boneTransformations = (BoneTransformation[])(object)new BoneTransformation[7] { new BoneTransformation("HuntressArmature/ROOT/base/stomach/chest/upper_arm.l", new Vector3(1f, 0.71f, 1f), Vector3.zero, (string)null), new BoneTransformation("HuntressArmature/ROOT/base/stomach/chest/upper_arm.l/lower_arm.l", new Vector3(1f, 1.43f, 1f), Vector3.zero, (string)null), new BoneTransformation("HuntressArmature/ROOT/base/stomach/chest/upper_arm.l/lower_arm.l/hand.l", Vector3.one * 0.71f, Vector3.zero, (string)null), new BoneTransformation("HuntressArmature/ROOT/base/stomach/chest/upper_arm.r", new Vector3(1f, 0.71f, 1f), Vector3.zero, (string)null), new BoneTransformation("HuntressArmature/ROOT/base/stomach/chest/upper_arm.r/lower_arm.r", new Vector3(1f, 1.43f, 1f), Vector3.zero, (string)null), new BoneTransformation("HuntressArmature/ROOT/base/stomach/chest/upper_arm.r/lower_arm.r/hand.r", Vector3.one * 0.71f, Vector3.zero, (string)null), new BoneTransformation("HuntressArmature/ROOT/base/BowRoot/IKArmTarget.l", Vector3.one, new Vector3(0.1f, -0.04f, 0.01f), (string)null) }; } } public class BowStringModificationController : MonoBehaviour { private Transform start; private Transform end; private LineBetweenTransforms line; private void Start() { LineRenderer val = default(LineRenderer); if (Object.op_Implicit((Object)(object)((Component)this).transform.parent) && ((Component)((Component)this).transform.parent).TryGetComponent<LineRenderer>(ref val)) { val.startWidth = 0.1f; val.endWidth = 0.1f; } LineRenderer val2 = default(LineRenderer); if (((Component)this).TryGetComponent<LineRenderer>(ref val2)) { val2.startWidth = 0.3f; val2.endWidth = 0.3f; } line = ((Component)this).GetComponent<LineBetweenTransforms>(); } private void Update() { if (!Object.op_Implicit((Object)(object)start) || !Object.op_Implicit((Object)(object)end)) { UpdateLine(); } } private void UpdateLine() { if (!Object.op_Implicit((Object)(object)start)) { start = ((Component)this).transform.parent.parent.Find("HuntressArmature/ROOT/base/BowRoot/BowStringIKTarget/HelperBowString/BowInsert/Head"); } if (!Object.op_Implicit((Object)(object)end)) { end = ((Component)this).transform.parent.parent.Find("HuntressArmature/ROOT/base/BowRoot/BowBase"); } if (Object.op_Implicit((Object)(object)start) && Object.op_Implicit((Object)(object)end) && Object.op_Implicit((Object)(object)line)) { line.transformNodes = (Transform[])(object)new Transform[2] { start, end }; } } } public static class CustomIDRS { public static void Init(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_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: 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_00ec: 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_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_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: 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_0293: Unknown result type (might be due to invalid IL or missing references) //IL_0298: 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_0323: 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_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, followerPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_CritGlasses.DisplayGlasses_prefab).WaitForCompletion(), childName = "Head", localPos = new Vector3(2E-05f, 0.1525f, 0.05202f), localAngles = new Vector3(352.4553f, 359.893f, 0.09502f), localScale = new Vector3(0.17955f, 0.18537f, 0.18537f) } } }; 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, followerPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC1_CritGlassesVoid.DisplayGlassesVoid_prefab).WaitForCompletion(), childName = "Head", localPos = new Vector3(-1E-05f, 0.1644f, 0.05036f), localAngles = new Vector3(352f, 359.8309f, 0.09f), localScale = new Vector3(0.20679f, 0.16287f, 0.18985f) } } }; 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, followerPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Hoof.DisplayHoof_prefab).WaitForCompletion(), childName = "CalfR", localPos = new Vector3(-0.01184f, 0.34949f, -0.10662f), localAngles = new Vector3(74.36488f, 5.74731f, 5.536f), localScale = new Vector3(0.07f, 0.07f, 0.09412f) }, 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, followerPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC1_LunarSun.DisplaySunHead_prefab).WaitForCompletion(), childName = "Head", localPos = new Vector3(-0.01795f, 0.15196f, 0.0058f), localAngles = new Vector3(0f, 0f, 0f), localScale = new Vector3(0.76757f, 0.76757f, 0.76757f) }, new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC1_LunarSun.DisplaySunHeadNeck_prefab).WaitForCompletion(), childName = "Chest", localPos = new Vector3(-0.01223f, 0.31435f, -0.02169f), localAngles = new Vector3(0.97329f, 216.7622f, 5.13123f), localScale = new Vector3(0.80274f, 0.80274f, 0.80274f) }, 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 class Expressions { public static void Init(EventSub eventSub) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Expected O, but got Unknown //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Expected O, but got Unknown //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Expected O, but got Unknown //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Expected O, but got Unknown //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Expected O, but got Unknown //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Expected O, but got Unknown //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Expected O, but got Unknown //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Expected O, but got Unknown eventSub.options.blinkAnimations = (BlendShapeAnimation[])(object)new BlendShapeAnimation[1] { (BlendShapeAnimation)new BlinkBlendShapeAnimation("HuntressMesh", "LowBlink", -1, 0, 0.1f, 0f, 0.1f, false) }; eventSub.options.conditionalIdleAnimations = (IdleAnimation[])(object)new IdleAnimation[2] { new IdleAnimation((BlendShapeAnimation[])(object)new BlendShapeAnimation[2] { new BlendShapeAnimation("HuntressMesh", "EyesFierce", 0, -2, 0.15f, float.PositiveInfinity, 0.15f, false), new BlendShapeAnimation("HuntressMesh", "BrowAngry", 1, -2, 0.15f, float.PositiveInfinity, 0.15f, false) }, (Func<ExpressionController, bool>)InCombat, true), new IdleAnimation((BlendShapeAnimation[])(object)new BlendShapeAnimation[4] { new BlendShapeAnimation("HuntressMesh", "EyesHurt", 0, -1, 0.15f, float.PositiveInfinity, 0.15f, true), new BlendShapeAnimation("HuntressMesh", "BrowHurt", 1, -1, 0.15f, float.PositiveInfinity, 0.15f, false), new BlendShapeAnimation("HuntressMesh", "MouthGrimaceSmall", 2, -1, 0.15f, float.PositiveInfinity, 0.15f, false), new BlendShapeAnimation("HuntressMesh", "EarsSad", 3, -1, 0.1f, float.PositiveInfinity, 0.1f, false) }, (Func<ExpressionController, bool>)IsLowHealth, true) }; eventSub.options.useAnimations = true; eventSub.TakeDamage = (Action<GameObject, DamageReport>)Delegate.Combine(eventSub.TakeDamage, new Action<GameObject, DamageReport>(ExpressionOnHit)); eventSub.Death = (Action<GameObject>)Delegate.Combine(eventSub.Death, new Action<GameObject>(ExpressionOnDeath)); eventSub.ShrineFailure = (Action<GameObject>)Delegate.Combine(eventSub.ShrineFailure, new Action<GameObject>(ExpressionOnShrineFailure)); eventSub.LevelUp = (Action<GameObject>)Delegate.Combine(eventSub.LevelUp, new Action<GameObject>(ExpressionOnHoldoutOnLevelOnMithrix)); eventSub.MithrixDefeat = (Action<GameObject>)Delegate.Combine(eventSub.MithrixDefeat, new Action<GameObject>(ExpressionOnHoldoutOnLevelOnMithrix)); eventSub.HoldoutZoneCharged = (Action<GameObject>)Delegate.Combine(eventSub.HoldoutZoneCharged, new Action<GameObject>(ExpressionOnHoldoutOnLevelOnMithrix)); eventSub.GetItem = (Action<GameObject, ItemIndex>)Delegate.Combine(eventSub.GetItem, new Action<GameObject, ItemIndex>(ExpressionOnItem)); } private static void ExpressionOnHit(GameObject body, DamageReport damageReport) { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Expected O, but got Unknown //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Expected O, but got Unknown //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Expected O, but got Unknown HealthComponent val = default(HealthComponent); ExpressionController val2 = default(ExpressionController); if (Object.op_Implicit((Object)(object)damageReport?.victim) && ((Component)damageReport.victim).TryGetComponent<HealthComponent>(ref val) && val.combinedHealthFraction > 0.25f && body.TryGetComponent<ExpressionController>(ref val2)) { val2.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "HighBlink", 0, 0, 0.05f, 0.2f, 0.1f, true)); val2.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "BrowScared", 1, 0, 0.05f, 0.2f, 0.1f, false)); val2.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "MouthHurt", 2, 0, 0.05f, 0.2f, 0.1f, false)); val2.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "EarsSad", 3, 0, 0.05f, 0.2f, 0.1f, false)); } } private static void ExpressionOnShrineFailure(GameObject body) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Expected O, but got Unknown //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Expected O, but got Unknown ExpressionController val = default(ExpressionController); if (body.TryGetComponent<ExpressionController>(ref val)) { val.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "EyesBored", 0, 0, 0.15f, 0.4f, 0.15f, true)); val.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "BrowBored", 1, 0, 0.15f, 0.4f, 0.15f, false)); val.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "MouthGrimaceSmall", 2, 0, 0.15f, 0.4f, 0.15f, false)); val.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "EarsAnnoyed", 3, 0, 0.1f, 0.4f, 0.1f, false)); } } private static void ExpressionOnHoldoutOnLevelOnMithrix(GameObject body) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Expected O, but got Unknown //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Expected O, but got Unknown ExpressionController val = default(ExpressionController); if (body.TryGetComponent<ExpressionController>(ref val)) { val.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "HighBlink", 0, 0, 0.15f, 0.6f, 0.15f, true)); val.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "BrowHappy", 1, 0, 0.15f, 0.6f, 0.15f, false)); val.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "MouthGrin", 2, 0, 0.15f, 0.6f, 0.15f, false)); val.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "EarsPerked", 3, 0, 0.1f, 0.6f, 0.1f, 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 val = default(ExpressionController); if (body.TryGetComponent<ExpressionController>(ref val)) { val.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "HighBlink", 0, 0, 0.15f, 0.6f, 0.15f, true)); val.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "BrowHappy", 1, 0, 0.15f, 0.6f, 0.15f, false)); val.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "MouthSmile", 2, 0, 0.15f, 0.6f, 0.15f, false)); } } private static void ExpressionOnDeath(GameObject body) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Expected O, but got Unknown //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Expected O, but got Unknown ExpressionController val = default(ExpressionController); if (body.TryGetComponent<ExpressionController>(ref val)) { val.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "HighBlink", 0, 2, 0.05f, float.PositiveInfinity, 0.2f, true)); val.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "BrowHappy", 1, 2, 0.05f, float.PositiveInfinity, 0.2f, false)); val.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "MouthGrimaceLarge", 2, 2, 0.05f, float.PositiveInfinity, 0.2f, false)); val.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "EarsSad", 3, 2, 0.05f, float.PositiveInfinity, 0.2f, false)); } } private static bool InCombat(ExpressionController expressionController) { CharacterBody characterBody = expressionController.characterBody; if (Object.op_Implicit((Object)(object)characterBody)) { return !characterBody.outOfCombat; } return false; } private static bool IsLowHealth(ExpressionController expressionController) { CharacterBody characterBody = expressionController.characterBody; if (Object.op_Implicit((Object)(object)characterBody) && Object.op_Implicit((Object)(object)characterBody.healthComponent)) { return characterBody.healthComponent.combinedHealthFraction <= 0.25f; } return false; } } public class Options { public static AssetBundle assetBundle; 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(AssetBundle assetBundle) { Options.assetBundle = assetBundle; 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(); } RoR2Application.onLoadFinished = (Action)Delegate.Combine(RoR2Application.onLoadFinished, new Action(OnLoadFinished)); } 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(assetBundle.LoadAsset<Sprite>("Assets\\SkinMods\\MioHuntress\\Icons\\DefMioHuntressIcon.png")); } } public static class VoiceLines { 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) }); public static void Init(EventSub eventSub) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Expected O, but got Unknown //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Expected O, but got Unknown //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Expected O, but got Unknown eventSub.options.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) }; eventSub.TakeDamage = (Action<GameObject, DamageReport>)Delegate.Combine(eventSub.TakeDamage, new Action<GameObject, DamageReport>(LowHealthLine)); eventSub.Heal = (Action<GameObject, float>)Delegate.Combine(eventSub.Heal, new Action<GameObject, float>(HeavyHealLine)); eventSub.TakeDamage = (Action<GameObject, DamageReport>)Delegate.Combine(eventSub.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); } } }); eventSub.Death = (Action<GameObject>)Delegate.Combine(eventSub.Death, (Action<GameObject>)delegate(GameObject body) { if (body != null) { VoiceController component = body.GetComponent<VoiceController>(); if (component != null) { component.TryPlayRandomSoundServer(death, body, 1f); } } }); eventSub.DefeatBossGroup = (Action<GameObject>)Delegate.Combine(eventSub.DefeatBossGroup, (Action<GameObject>)delegate(GameObject body) { if (body != null) { VoiceController component = body.GetComponent<VoiceController>(); if (component != null) { component.TryPlayRandomUniqueSoundServer(defeatBossGroup, body, 1f); } } }); eventSub.TeleporterStart = (Action<GameObject>)Delegate.Combine(eventSub.TeleporterStart, (Action<GameObject>)delegate(GameObject body) { if (body != null) { VoiceController component = body.GetComponent<VoiceController>(); if (component != null) { component.TryPlayRandomUniqueSoundServer(startTP, body, 1f); } } }); eventSub.TeleporterEnd = (Action<GameObject>)Delegate.Combine(eventSub.TeleporterEnd, (Action<GameObject>)delegate(GameObject body) { if (body != null) { VoiceController component = body.GetComponent<VoiceController>(); if (component != null) { component.TryPlayRandomUniqueSoundServer(endTP, body, 1f); } } }); eventSub.LeavePod = (Action<GameObject>)Delegate.Combine(eventSub.LeavePod, (Action<GameObject>)delegate(GameObject body) { if (body != null) { VoiceController component = body.GetComponent<VoiceController>(); if (component != null) { component.TryPlayRandomUniqueSoundServer(leavePod, body, 1f); } } }); eventSub.GetItem = (Action<GameObject, ItemIndex>)Delegate.Combine(eventSub.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); } } }); eventSub.ShrineSuccess = (Action<GameObject>)Delegate.Combine(eventSub.ShrineSuccess, (Action<GameObject>)delegate(GameObject body) { if (body != null) { VoiceController component = body.GetComponent<VoiceController>(); if (component != null) { component.TryPlayRandomUniqueSoundServer(shrineSuccess, body, 1f); } } }); eventSub.ShrineFailure = (Action<GameObject>)Delegate.Combine(eventSub.ShrineFailure, (Action<GameObject>)delegate(GameObject body) { if (body != null) { VoiceController component = body.GetComponent<VoiceController>(); if (component != null) { component.TryPlayRandomUniqueSoundServer(shrineFailure, body, 1f); } } }); eventSub.LevelUp = (Action<GameObject>)Delegate.Combine(eventSub.LevelUp, (Action<GameObject>)delegate(GameObject body) { if (body != null) { VoiceController component = body.GetComponent<VoiceController>(); if (component != null) { component.TryPlayRandomUniqueSoundServer(levelUp, body, 0.25f); } } }); eventSub.BearDamageBlock = (Action<GameObject>)Delegate.Combine(eventSub.BearDamageBlock, (Action<GameObject>)delegate(GameObject body) { if (body != null) { VoiceController component = body.GetComponent<VoiceController>(); if (component != null) { component.TryPlayRandomUniqueSoundServer(blockDamage, body, 0.6f); } } }); eventSub.UseSpecial = (Action<GameObject>)Delegate.Combine(eventSub.UseSpecial, (Action<GameObject>)delegate(GameObject body) { if (body != null) { VoiceController component = body.GetComponent<VoiceController>(); if (component != null) { component.TryPlayRandomUniqueSoundServer(special, body, 0.45f); } } }); eventSub.UseSecondary = (Action<GameObject>)Delegate.Combine(eventSub.UseSecondary, (Action<GameObject>)delegate(GameObject body) { if (body != null) { VoiceController component = body.GetComponent<VoiceController>(); if (component != null) { component.TryPlayRandomUniqueSoundServer(secondary, body, 0.4f); } } }); } 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); } } } } 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