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 Seia Huntrtess v1.0.0
SeiaHuntress.dll
Decompiled 9 hours agousing System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using Microsoft.CodeAnalysis; using MonoMod.RuntimeDetour.HookGen; using MwSkinAdditions; using RoR2; using RoR2.ContentManagement; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Rendering; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("SeiaHuntress")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("SeiaHuntress")] [assembly: AssemblyTitle("SeiaHuntress")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace SeiaHuntress { public static class BoneTransformations { public static void Init(EventSub eventSub) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown //IL_0054: 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_006c: 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_007b: 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_0087: Expected O, but got Unknown //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Expected O, but got Unknown //IL_00c1: 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) //IL_00d0: 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_00dd: Expected O, but got Unknown //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Expected O, but got Unknown //IL_010b: 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_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Expected O, but got Unknown eventSub.options.boneTransformations = (BoneTransformation[])(object)new BoneTransformation[7] { new BoneTransformation("HuntressArmature/ROOT/base/stomach/chest/upper_arm.l", Vector3.one * 0.74f, new Vector3(-0.0238f, 0.081f, -0.089f), (string)null), new BoneTransformation("HuntressArmature/ROOT/base/stomach/chest/upper_arm.l/lower_arm.l", new Vector3(1f, 1.19f, 1f), Vector3.zero, (string)null), new BoneTransformation("HuntressArmature/ROOT/base/stomach/chest/upper_arm.l/lower_arm.l/hand.l", Vector3.one * 0.78f, Vector3.zero, (string)null), new BoneTransformation("HuntressArmature/ROOT/base/stomach/chest/upper_arm.r", Vector3.one * 0.74f, new Vector3(0.00238f, 0.081f, 0.089f), (TransformContexts)(-2), (string)null), new BoneTransformation("HuntressArmature/ROOT/base/stomach/chest/upper_arm.r", Vector3.one * 0.74f, Vector3.zero, (TransformContexts)1, (string)null), new BoneTransformation("HuntressArmature/ROOT/base/stomach/chest/upper_arm.r/lower_arm.r", new Vector3(1f, 1.19f, 1f), Vector3.zero, (string)null), new BoneTransformation("HuntressArmature/ROOT/base/stomach/chest/upper_arm.r/lower_arm.r/hand.r", Vector3.one * 0.78f, Vector3.zero, (string)null) }; } } public static class CorrectiveBlendShapes { public static void Init(EventSub eventSub) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Expected O, but got Unknown //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown //IL_008a: 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_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Expected O, but got Unknown //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Expected O, but got Unknown //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Expected O, but got Unknown //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Expected O, but got Unknown //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Expected O, but got Unknown //IL_0128: Expected O, but got Unknown //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Expected O, but got Unknown //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Expected O, but got Unknown eventSub.options.correctiveBlendShapes = (CorrectiveBlendShape[])(object)new CorrectiveBlendShape[3] { new CorrectiveBlendShape("HuntressMesh", "HuntressArmature/ROOT/base/pelvis/thigh.r", "RDressSidewaysCorrection", (BaseCorrectionMethod)new SegmentCorrection(-60f, 0f, new Vector3(0f, -1f, -1f), new Vector3(1f, -1f, -0.5f), Vector3.up)), new CorrectiveBlendShape("HuntressMesh", "HuntressArmature/ROOT/base/pelvis/thigh.l", "LDressSidewaysCorrection", (BaseCorrectionMethod)new SegmentCorrection(-60f, 0f, new Vector3(-1f, -1f, -0.5f), new Vector3(0f, -1f, -1f), Vector3.up)), new CorrectiveBlendShape("HuntressMesh", "DressForwardCombinedCorrection", (BaseCorrectionMethod)new DuoCorrection(new CorrectiveBlendShape("HuntressMesh", "HuntressArmature/ROOT/base/pelvis/thigh.l", "LDressForwardCorrection", (BaseCorrectionMethod)new SegmentCorrection(-65f, 30f, Vector3.right, Vector3.forward, Vector3.up)), new CorrectiveBlendShape("HuntressMesh", "HuntressArmature/ROOT/base/pelvis/thigh.r", "RDressForwardCorrection", (BaseCorrectionMethod)new SegmentCorrection(-65f, 30f, Vector3.right, Vector3.forward, Vector3.up)))) }; } } public static class Expressions { public static void Init(EventSub eventSub) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006f: 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_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Expected O, but got Unknown //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Expected O, but got Unknown //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Expected O, but got Unknown //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Expected O, but got Unknown //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014c: 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", "BrowAngry", 1, -2, 0.3f, float.PositiveInfinity, 0.3f, false), new BlendShapeAnimation("HuntressMesh", "MouthMinorGrimace", 2, -2, 0.3f, float.PositiveInfinity, 0.3f, false) }, (Func<ExpressionController, bool>)InCombat, true), new IdleAnimation((BlendShapeAnimation[])(object)new BlendShapeAnimation[3] { new BlendShapeAnimation("HuntressMesh", "EyesInjured", 0, -1, 0.3f, float.PositiveInfinity, 0.3f, true), new BlendShapeAnimation("HuntressMesh", "BrowLower", 1, -1, 0.3f, float.PositiveInfinity, 0.3f, false), new BlendShapeAnimation("HuntressMesh", "MouthMinorGrimace", 2, -1, 0.3f, float.PositiveInfinity, 0.3f, false) }, (Func<ExpressionController, bool>)LowHealth, 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.HoldoutZoneCharged = (Action<GameObject>)Delegate.Combine(eventSub.HoldoutZoneCharged, new Action<GameObject>(ExpressionOnHoldoutOnLevelOnMithrix)); 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.GetItem = (Action<GameObject, ItemIndex>)Delegate.Combine(eventSub.GetItem, new Action<GameObject, ItemIndex>(ExpressionOnItem)); eventSub.Heal = (Action<GameObject, float>)Delegate.Combine(eventSub.Heal, new Action<GameObject, float>(ExpressionOnHeavyHeal)); } private static bool LowHealth(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; } private static bool InCombat(ExpressionController expressionController) { CharacterBody characterBody = expressionController.characterBody; if (Object.op_Implicit((Object)(object)characterBody)) { return !characterBody.outOfCombat; } return false; } private static void ExpressionOnHit(GameObject body, DamageReport damageReport) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Expected O, but got Unknown ExpressionController val = default(ExpressionController); if (body.TryGetComponent<ExpressionController>(ref val)) { val.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "HighBlink", 0, 0, 0.05f, 0.3f, 0.2f, true)); val.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "BrowAngry", 1, 0, 0.05f, 0.3f, 0.2f, false)); val.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "MouthHurt", 2, 0, 0.05f, 0.3f, 0.2f, false)); } } private static void ExpressionOnDeath(GameObject body) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Expected O, but got Unknown ExpressionController val = default(ExpressionController); if (body.TryGetComponent<ExpressionController>(ref val)) { val.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "EyesDead", 0, 2, 0f, float.PositiveInfinity, 0.2f, true)); val.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "BrowLower", 1, 0, 0.2f, float.PositiveInfinity, 0.2f, false)); val.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "Mouth▲", 2, 2, 0.2f, float.PositiveInfinity, 0.2f, false)); } } private static void ExpressionOnShrineFailure(GameObject body) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Expected O, but got Unknown ExpressionController val = default(ExpressionController); if (body.TryGetComponent<ExpressionController>(ref val)) { val.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "EyesUnamused", 0, 0, 0.2f, 1f, 0.2f, false)); val.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "BrowsLower", 1, 0, 0.2f, 1f, 0.2f, false)); val.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "MouthFrown", 2, 0, 0.2f, 1f, 0.2f, false)); } } private static void ExpressionOnHoldoutOnLevelOnMithrix(GameObject body) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Expected O, but got Unknown ExpressionController val = default(ExpressionController); if (body.TryGetComponent<ExpressionController>(ref val)) { val.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "EyesPlus", 0, 0, 0f, 1.3f, 0f, false)); val.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "BrowRaise", 1, 0, 0.2f, 1f, 0.2f, false)); val.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "MouthOwO", 2, 0, 0.2f, 1f, 0.2f, false)); } } private static void ExpressionOnItem(GameObject body, ItemIndex itemIndex) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Invalid comparison between Unknown and I4 //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Expected O, but got Unknown //IL_00ec: 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_011e: Expected O, but got Unknown //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Expected O, but got Unknown //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown ExpressionController val = default(ExpressionController); if (body.TryGetComponent<ExpressionController>(ref val)) { ItemDef itemDef = ItemCatalog.GetItemDef(itemIndex); if (itemDef != null && (int)itemDef.tier == 2) { val.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "EyesBewildered", 0, 0, 0f, 1.2f, 0f, true)); val.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "BrowAngryLow", 1, 0, 0.2f, 1f, 0.2f, false)); val.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "MouthOwOOpen", 2, 0, 0.2f, 1f, 0.2f, false)); } else { val.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "HighBlinkHalf", 0, 0, 0.2f, 1f, 0.2f, true)); val.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "BrowRaise", 1, 0, 0.2f, 1f, 0.2f, false)); val.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "MouthSmile", 2, 0, 0.2f, 1f, 0.2f, false)); } } } private static void ExpressionOnHeavyHeal(GameObject body, float amount) { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Expected O, but got Unknown //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Expected O, but got Unknown ExpressionController val = default(ExpressionController); HealthComponent val2 = default(HealthComponent); if (body.TryGetComponent<ExpressionController>(ref val) && body.TryGetComponent<HealthComponent>(ref val2) && Object.op_Implicit((Object)(object)val2) && val2.fullHealth >= 0.6f * val2.fullCombinedHealth && amount >= 0.4f * val2.fullHealth) { val.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "EyesApologetic", 0, 0, 0f, 1.2f, 0f, true)); val.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "BrowsSadLow", 1, 0, 0.05f, 1.15f, 0.2f, false)); val.TryPlayAnimation(new BlendShapeAnimation("HuntressMesh", "MouthOwO", 2, 0, 0.2f, 1f, 0.2f, false)); } } } [BepInPlugin("com.VanillaVitamins.SeiaHuntress", "SeiaHuntress", "1.0.0")] public class SeiaHuntressPlugin : BaseUnityPlugin { private static EventSub eventSub; private static SkinDef[] skins = (SkinDef[])(object)new SkinDef[2]; private static AssetBundle assetBundle; private static readonly List<Material> materialsWithRoRShader = new List<Material>(); internal static SeiaHuntressPlugin Instance { get; private set; } internal static ManualLogSource InstanceLogger { get { SeiaHuntressPlugin instance = Instance; return (instance != null) ? ((BaseUnityPlugin)instance).Logger : null; } } private void Awake() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown eventSub = new EventSub(); BoneTransformations.Init(eventSub); CorrectiveBlendShapes.Init(eventSub); Expressions.Init(eventSub); } private void Start() { Instance = this; using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("SeiaHuntress.vanillavitaminsseiahuntress")) { 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(); } private static void AfterBodyCatalogInit() { eventSub.skinDefs = skins; eventSub.Init(); } private static void ReplaceShaders() { LoadMaterialsWithReplacedShader("RoR2/Base/Shaders/HGStandard.shader", "Assets/SkinAssets/SeiaHuntress/matSeiaHuntressBody.mat", "Assets/SkinAssets/SeiaHuntress/matSeiaHuntressBow.mat"); LoadMaterialsWithReplacedShader("RoR2/Base/Shaders/HGCloudRemap.shader", "Assets/SkinAssets/SeiaHuntress/matSeiaHuntressBowString.mat", "Assets/SkinAssets/SeiaHuntress/matSeiaHuntressArrow.mat", "Assets/SkinAssets/SeiaHuntress/matSeiaHuntressCharged.mat"); } private static void LoadMaterialsWithReplacedShader(string shaderPath, params string[] materialPaths) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) Shader shader = Addressables.LoadAssetAsync<Shader>((object)shaderPath).WaitForCompletion(); foreach (string text in materialPaths) { Material val = assetBundle.LoadAsset<Material>(text); val.shader = shader; materialsWithRoRShader.Add(val); } } private static void LanguageLoadStrings(Action<Language> orig, Language self) { orig(self); self.SetStringByToken("VANILLAVITAMINS_SKIN_DEFSEIAHUNTRESS_NAME", "Seia"); } private static void BodyCatalogInit() { AddHuntressBodyDefSeiaHuntressSkin(); AfterBodyCatalogInit(); } private static void HuntressBodyDefSeiaHuntressSkinAdded(SkinDef skinDef, GameObject bodyPrefab) { skins[0] = skinDef; } private static SkinDef CreateHuntressBodyDefSeiaHuntressSkin(GameObject mdl, ModelSkinController skinController) { //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: 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_014d: Unknown result type (might be due to invalid IL or missing references) Renderer[] renderers = mdl.GetComponentsInChildren<Renderer>(true); Light[] componentsInChildren = mdl.GetComponentsInChildren<Light>(true); SkinDef skin = ScriptableObject.CreateInstance<SkinDef>(); SkinDefParams skinParams = ScriptableObject.CreateInstance<SkinDefParams>(); skin.skinDefParams = skinParams; ((Object)skin).name = "DefSeiaHuntress"; skin.nameToken = "VANILLAVITAMINS_SKIN_DEFSEIAHUNTRESS_NAME"; skin.rootObject = mdl; List<string> skinnedRendererPaths = new List<string>(); Helpers.TryCatchThrow("Icon", delegate { skin.icon = assetBundle.LoadAsset<Sprite>("Assets\\SkinMods\\SeiaHuntress\\Icons\\DefSeiaHuntressIcon.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 1 is out of bounds of skins array", skinController.skins, 1) }; }); Helpers.TryCatchThrow("Renderer Infos", delegate { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0094: 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_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0127: 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_0181: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: 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_0203: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_022b: 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_0285: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: 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_0307: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Unknown result type (might be due to invalid IL or missing references) //IL_032f: Unknown result type (might be due to invalid IL or missing references) //IL_0388: 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_0392: Unknown result type (might be due to invalid IL or missing references) //IL_03b1: 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_040b: Unknown result type (might be due to invalid IL or missing references) //IL_0414: Unknown result type (might be due to invalid IL or missing references) //IL_0433: 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_048d: Unknown result type (might be due to invalid IL or missing references) //IL_0497: Unknown result type (might be due to invalid IL or missing references) //IL_04b6: 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_0511: Unknown result type (might be due to invalid IL or missing references) //IL_051b: Unknown result type (might be due to invalid IL or missing references) //IL_053a: 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_0595: Unknown result type (might be due to invalid IL or missing references) //IL_059f: Unknown result type (might be due to invalid IL or missing references) //IL_05be: 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) //IL_0619: 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/SkinAssets/SeiaHuntress/matSeiaHuntressBody.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 = null, defaultShadowCastingMode = (ShadowCastingMode)0, ignoreOverlays = false, renderer = Helpers.ThrowIfNull<Renderer>(1, "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/SkinAssets/SeiaHuntress/matSeiaHuntressBowString.mat"), defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = true, renderer = Helpers.ThrowIfNull<Renderer>(2, "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/SkinAssets/SeiaHuntress/matSeiaHuntressArrow.mat"), defaultShadowCastingMode = (ShadowCastingMode)1, 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/SkinAssets/SeiaHuntress/matSeiaHuntressArrow.mat"), defaultShadowCastingMode = (ShadowCastingMode)1, 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/SkinAssets/SeiaHuntress/matSeiaHuntressArrow.mat"), defaultShadowCastingMode = (ShadowCastingMode)1, 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/SkinAssets/SeiaHuntress/matSeiaHuntressArrow.mat"), defaultShadowCastingMode = (ShadowCastingMode)1, 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/SkinAssets/SeiaHuntress/matSeiaHuntressArrow.mat"), defaultShadowCastingMode = (ShadowCastingMode)1, 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/SkinAssets/SeiaHuntress/matSeiaHuntressArrow.mat"), defaultShadowCastingMode = (ShadowCastingMode)1, 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/SkinAssets/SeiaHuntress/matSeiaHuntressArrow.mat"), defaultShadowCastingMode = (ShadowCastingMode)1, 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/SkinAssets/SeiaHuntress/matSeiaHuntressCharged.mat"), defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = true, renderer = Helpers.ThrowIfNull<Renderer>(10, "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 }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/SkinAssets/SeiaHuntress/matSeiaHuntressBow.mat"), defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false, renderer = Helpers.ThrowIfNull<Renderer>(11, "There is no renderer with the name \"BowMesh\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "BowMesh"))), hideOnDeath = false, ignoresMaterialOverrides = false } }; }); Helpers.TryCatchThrow("MeshReplacements", delegate { //IL_0011: 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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: 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) skinParams.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[2] { new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\SeiaHuntress\\Meshes\\SeiaMesh.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 = null, renderer = Helpers.ThrowIfNull<Renderer>(1, "There is no renderer with the name \"HuntressScarfMesh\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "HuntressScarfMesh"))) } }; }); 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_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_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_019b: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_022e: 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_029b: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_0318: 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_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0377: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_03d4: Unknown result type (might be due to invalid IL or missing references) //IL_03d9: Unknown result type (might be due to invalid IL or missing references) //IL_03ef: Unknown result type (might be due to invalid IL or missing references) //IL_03f4: 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_040f: Unknown result type (might be due to invalid IL or missing references) //IL_0453: Unknown result type (might be due to invalid IL or missing references) //IL_0454: Unknown result type (might be due to invalid IL or missing references) skinParams.gameObjectActivations = (GameObjectActivation[])(object)new GameObjectActivation[5] { new GameObjectActivation { gameObject = ((Component)Helpers.ThrowIfNull<Transform>(0, "There is no renderer at path \"HuntressArmature/ROOT/base/stomach\"", mdl.transform.Find("HuntressArmature/ROOT/base/stomach"))).gameObject, shouldActivate = false, spawnPrefabOnModelObject = true, localPosition = new Vector3(0f, 0f, 0f), localRotation = new Vector3(0f, 0f, 0f), localScale = new Vector3(1f, 1f, 1f), prefab = Helpers.ClonePrefab(assetBundle.LoadAsset<GameObject>("Assets/SkinAssets/SeiaHuntress/Prefabs/StomachAdditions.prefab")) }, new GameObjectActivation { gameObject = ((Component)Helpers.ThrowIfNull<Transform>(1, "There is no renderer at path \"HuntressArmature/ROOT/base/pelvis\"", mdl.transform.Find("HuntressArmature/ROOT/base/pelvis"))).gameObject, shouldActivate = false, spawnPrefabOnModelObject = true, localPosition = new Vector3(-0.0007977168f, -0.04100994f, 0.002236098f), localRotation = new Vector3(8.452301f, 23.09747f, 3.587013f), localScale = new Vector3(1f, 1f, 1f), prefab = Helpers.ClonePrefab(assetBundle.LoadAsset<GameObject>("Assets/SkinAssets/SeiaHuntress/Prefabs/PelvisAdditions.prefab")).WithComponent<InsertBones>((Action<InsertBones>)delegate(InsertBones c) { c.rendererPaths.AddRange(skinnedRendererPaths); c.afterPath = "HuntressArmature/ROOT/base/pelvis/thigh.r/calf.r/foot.r/toe.r"; 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 child3)); c.newBones.Add(child3.GetChild(0, out var child4)); c.newBones.Add(child4.GetChild(0, out var child5)); c.newBones.Add(child5.GetChild(0, out var child6)); c.newBones.Add(child6.GetChild(0, out var _)); c.newBones.Add(child.GetChild(1, 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(child.GetChild(3, 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(child.GetChild(5, out var child20)); c.newBones.Add(child20.GetChild(0, out var child21)); c.newBones.Add(child21.GetChild(0, out var child22)); c.newBones.Add(child22.GetChild(0, out var child23)); c.newBones.Add(child23.GetChild(0, out var child24)); c.newBones.Add(child24.GetChild(0, out var _)); c.newBones.Add(child.GetChild(7, 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 _)); c.newBones.Add(child.GetChild(9, out var child32)); c.newBones.Add(child32.GetChild(0, out var child33)); c.newBones.Add(child33.GetChild(0, out var child34)); c.newBones.Add(child34.GetChild(0, out var child35)); c.newBones.Add(child35.GetChild(0, out var child36)); c.newBones.Add(child36.GetChild(0, out var _)); c.newBones.Add(child.GetChild(11, out var child38)); c.newBones.Add(child38.GetChild(0, out var child39)); c.newBones.Add(child39.GetChild(0, out var child40)); c.newBones.Add(child40.GetChild(0, out var child41)); c.newBones.Add(child41.GetChild(0, out var child42)); c.newBones.Add(child42.GetChild(0, out var _)); c.newBones.Add(child.GetChild(13, out var child44)); c.newBones.Add(child44.GetChild(0, out var child45)); c.newBones.Add(child45.GetChild(0, out var child46)); c.newBones.Add(child46.GetChild(0, out var child47)); c.newBones.Add(child47.GetChild(0, out var child48)); c.newBones.Add(child48.GetChild(0, out var _)); c.newBones.Add(child.GetChild(15, out var child50)); c.newBones.Add(child50.GetChild(0, out var child51)); c.newBones.Add(child51.GetChild(0, out var child52)); c.newBones.Add(child52.GetChild(0, out var child53)); c.newBones.Add(child53.GetChild(0, out var child54)); c.newBones.Add(child54.GetChild(0, out var _)); c.newBones.Add(child.GetChild(2, out var child56)); c.newBones.Add(child56.GetChild(0, out var child57)); c.newBones.Add(child57.GetChild(0, out var child58)); c.newBones.Add(child58.GetChild(0, out var child59)); c.newBones.Add(child59.GetChild(0, out var child60)); c.newBones.Add(child60.GetChild(0, out var _)); c.newBones.Add(child.GetChild(4, out var child62)); c.newBones.Add(child62.GetChild(0, out var child63)); c.newBones.Add(child63.GetChild(0, out var child64)); c.newBones.Add(child64.GetChild(0, out var child65)); c.newBones.Add(child65.GetChild(0, out var child66)); c.newBones.Add(child66.GetChild(0, out var _)); c.newBones.Add(child.GetChild(6, out var child68)); c.newBones.Add(child68.GetChild(0, out var child69)); c.newBones.Add(child69.GetChild(0, out var child70)); c.newBones.Add(child70.GetChild(0, out var child71)); c.newBones.Add(child71.GetChild(0, out var child72)); c.newBones.Add(child72.GetChild(0, out var _)); c.newBones.Add(child.GetChild(8, out var child74)); c.newBones.Add(child74.GetChild(0, out var child75)); c.newBones.Add(child75.GetChild(0, out var child76)); c.newBones.Add(child76.GetChild(0, out var child77)); c.newBones.Add(child77.GetChild(0, out var child78)); c.newBones.Add(child78.GetChild(0, out var _)); c.newBones.Add(child.GetChild(10, out var child80)); c.newBones.Add(child80.GetChild(0, out var child81)); c.newBones.Add(child81.GetChild(0, out var child82)); c.newBones.Add(child82.GetChild(0, out var child83)); c.newBones.Add(child83.GetChild(0, out var child84)); c.newBones.Add(child84.GetChild(0, out var _)); c.newBones.Add(child.GetChild(12, out var child86)); c.newBones.Add(child86.GetChild(0, out var child87)); c.newBones.Add(child87.GetChild(0, out var child88)); c.newBones.Add(child88.GetChild(0, out var child89)); c.newBones.Add(child89.GetChild(0, out var child90)); c.newBones.Add(child90.GetChild(0, out var _)); c.newBones.Add(child.GetChild(14, out var child92)); c.newBones.Add(child92.GetChild(0, out var child93)); c.newBones.Add(child93.GetChild(0, out var child94)); c.newBones.Add(child94.GetChild(0, out var child95)); c.newBones.Add(child95.GetChild(0, out var child96)); c.newBones.Add(child96.GetChild(0, out var _)); c.newBones.Add(transform.GetChild(1, out var child98)); c.newBones.Add(child98.GetChild(0, out var child99)); c.newBones.Add(child99.GetChild(0, out var child100)); c.newBones.Add(child100.GetChild(0, out var child101)); c.newBones.Add(child101.GetChild(0, out var child102)); c.newBones.Add(child102.GetChild(0, out var child103)); c.newBones.Add(child103.GetChild(0, out var child104)); c.newBones.Add(child104.GetChild(0, out var child105)); c.newBones.Add(child105.GetChild(0, out var child106)); c.newBones.Add(child106.GetChild(0, out var child107)); c.newBones.Add(child107.GetChild(0, out var child108)); c.newBones.Add(child108.GetChild(0, out var child109)); c.newBones.Add(child109.GetChild(0, out var child110)); c.newBones.Add(child110.GetChild(0, out var child111)); c.newBones.Add(child111.GetChild(0, out var child112)); c.newBones.Add(child112.GetChild(0, out var _)); }) }, new GameObjectActivation { gameObject = ((Component)Helpers.ThrowIfNull<Transform>(2, "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.0002017246f, 0.06302617f, -0.03521122f), localRotation = new Vector3(343.9922f, 0.04377631f, 267f / (322f * MathF.E)), localScale = new Vector3(1f, 1f, 0.9999999f), prefab = Helpers.ClonePrefab(assetBundle.LoadAsset<GameObject>("Assets/SkinAssets/SeiaHuntress/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(0, out var child)); c.newBones.Add(child.GetChild(0, out var _)); c.newBones.Add(transform.GetChild(1, out var child3)); c.newBones.Add(child3.GetChild(0, out var _)); c.newBones.Add(transform.GetChild(4, out var child5)); c.newBones.Add(child5.GetChild(0, out var child6)); c.newBones.Add(child6.GetChild(0, out var child7)); c.newBones.Add(child7.GetChild(0, out var child8)); c.newBones.Add(child8.GetChild(0, out var child9)); c.newBones.Add(child9.GetChild(0, out var _)); c.newBones.Add(transform.GetChild(2, 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 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 child19)); c.newBones.Add(child19.GetChild(0, out var _)); c.newBones.Add(child11.GetChild(1, 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 child25)); c.newBones.Add(child25.GetChild(0, 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 _)); c.newBones.Add(child11.GetChild(2, out var child30)); c.newBones.Add(child30.GetChild(0, out var child31)); c.newBones.Add(child31.GetChild(0, out var child32)); c.newBones.Add(child32.GetChild(0, out var child33)); c.newBones.Add(child33.GetChild(0, out var child34)); c.newBones.Add(child34.GetChild(0, out var child35)); c.newBones.Add(child35.GetChild(0, out var child36)); c.newBones.Add(child36.GetChild(0, out var child37)); c.newBones.Add(child37.GetChild(0, out var _)); c.newBones.Add(transform.GetChild(3, out var child39)); c.newBones.Add(child39.GetChild(0, out var child40)); c.newBones.Add(child40.GetChild(0, out var child41)); c.newBones.Add(child41.GetChild(0, out var child42)); c.newBones.Add(child42.GetChild(0, out var _)); c.newBones.Add(child39.GetChild(1, out var child44)); c.newBones.Add(child44.GetChild(0, out var child45)); c.newBones.Add(child45.GetChild(0, out var child46)); c.newBones.Add(child46.GetChild(0, out var _)); c.newBones.Add(child39.GetChild(2, out var child48)); c.newBones.Add(child48.GetChild(0, out var _)); }).WithComponent<AddDynamicColliders>((Action<AddDynamicColliders>)delegate(AddDynamicColliders c) { c.pathPairs.Add(new PathPair { path1 = "hairback", path2 = "HuntressArmature/ROOT/base/stomach/StomachAdditions" }); }) }, new GameObjectActivation { gameObject = ((Component)Helpers.ThrowIfNull<Transform>(3, "There is no renderer at path \"HuntressArmature/ROOT/base/stomach/chest/upper_arm.l/lower_arm.l/hand.l\"", mdl.transform.Find("HuntressArmature/ROOT/base/stomach/chest/upper_arm.l/lower_arm.l/hand.l"))).gameObject, shouldActivate = false, spawnPrefabOnModelObject = true, localPosition = new Vector3(-0.00537337f, -0.01406237f, 0.03941642f), localRotation = new Vector3(0.9112015f, 75.93992f, 346.8893f), localScale = new Vector3(0.9999999f, 0.9999999f, 0.9999998f), prefab = Helpers.ClonePrefab(assetBundle.LoadAsset<GameObject>("Assets/SkinAssets/SeiaHuntress/Prefabs/HandLAdditions.prefab")).WithComponent<InsertBones>((Action<InsertBones>)delegate(InsertBones c) { c.rendererPaths.AddRange(skinnedRendererPaths); c.afterPath = "HuntressArmature/ROOT/base/stomach/chest/upper_arm.l/lower_arm.l/hand.l/thumb.1.l/thumb.2.l"; Transform transform = ((Component)c).transform; c.newBones.Add(transform); c.newBones.Add(transform.GetChild(1, 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 child5)); c.newBones.Add(child5.GetChild(0, out var _)); c.newBones.Add(child.GetChild(1, 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 _)); c.newBones.Add(child.GetChild(2, 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 child15)); c.newBones.Add(child15.GetChild(0, out var _)); c.newBones.Add(child.GetChild(3, out var child17)); c.newBones.Add(child17.GetChild(0, out var child18)); c.newBones.Add(child18.GetChild(0, out var child19)); c.newBones.Add(child19.GetChild(0, out var child20)); c.newBones.Add(child20.GetChild(0, out var _)); c.newBones.Add(child.GetChild(4, 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 child25)); c.newBones.Add(child25.GetChild(0, out var _)); c.newBones.Add(transform.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 child31)); c.newBones.Add(child31.GetChild(0, out var child32)); c.newBones.Add(child32.GetChild(0, out var child33)); c.newBones.Add(child33.GetChild(0, out var child34)); c.newBones.Add(child34.GetChild(0, out var _)); c.newBones.Add(child27.GetChild(1, out var child36)); c.newBones.Add(child36.GetChild(0, out var child37)); c.newBones.Add(child37.GetChild(0, out var child38)); c.newBones.Add(child38.GetChild(0, out var child39)); c.newBones.Add(child39.GetChild(0, out var child40)); c.newBones.Add(child40.GetChild(0, out var child41)); c.newBones.Add(child41.GetChild(0, out var _)); }) }, new GameObjectActivation { gameObject = ((Component)Helpers.ThrowIfNull<Transform>(4, "There is no renderer at path \"HuntressArmature/ROOT/base/stomach/chest/upper_arm.r/lower_arm.r/hand.r\"", mdl.transform.Find("HuntressArmature/ROOT/base/stomach/chest/upper_arm.r/lower_arm.r/hand.r"))).gameObject, shouldActivate = false, spawnPrefabOnModelObject = true, localPosition = new Vector3(0.009442981f, -0.02429008f, 0.03450457f), localRotation = new Vector3(7.880761f, 287.4842f, 16.36396f), localScale = new Vector3(1f, 1f, 1f), prefab = Helpers.ClonePrefab(assetBundle.LoadAsset<GameObject>("Assets/SkinAssets/SeiaHuntress/Prefabs/HandRAdditions.prefab")).WithComponent<InsertBones>((Action<InsertBones>)delegate(InsertBones c) { c.rendererPaths.AddRange(skinnedRendererPaths); c.afterPath = "HuntressArmature/ROOT/base/stomach/chest/upper_arm.r/lower_arm.r/hand.r/thumb.1.r/thumb.2.r"; Transform transform = ((Component)c).transform; c.newBones.Add(transform); c.newBones.Add(transform.GetChild(1, 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 child5)); c.newBones.Add(child5.GetChild(0, out var _)); c.newBones.Add(child.GetChild(1, 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 _)); c.newBones.Add(child.GetChild(2, 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 child15)); c.newBones.Add(child15.GetChild(0, out var _)); c.newBones.Add(child.GetChild(3, out var child17)); c.newBones.Add(child17.GetChild(0, out var child18)); c.newBones.Add(child18.GetChild(0, out var child19)); c.newBones.Add(child19.GetChild(0, out var child20)); c.newBones.Add(child20.GetChild(0, out var _)); c.newBones.Add(child.GetChild(4, 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 child25)); c.newBones.Add(child25.GetChild(0, out var _)); c.newBones.Add(transform.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 child31)); c.newBones.Add(child31.GetChild(0, out var child32)); c.newBones.Add(child32.GetChild(0, out var child33)); c.newBones.Add(child33.GetChild(0, out var child34)); c.newBones.Add(child34.GetChild(0, out var _)); c.newBones.Add(child27.GetChild(1, out var child36)); c.newBones.Add(child36.GetChild(0, out var child37)); c.newBones.Add(child37.GetChild(0, out var child38)); c.newBones.Add(child38.GetChild(0, out var child39)); c.newBones.Add(child39.GetChild(0, out var child40)); c.newBones.Add(child40.GetChild(0, out var child41)); c.newBones.Add(child41.GetChild(0, out var _)); }) } }; }); 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 HuntressBodyDefSeiaHuntressLobbySkinAdded(SkinDef skinDef, GameObject displayPrefab) { skins[1] = skinDef; } private static void AddHuntressBodyDefSeiaHuntressSkin() { string text = "HuntressBody"; string text2 = "DefSeiaHuntress"; 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 = CreateHuntressBodyDefSeiaHuntressSkin(gameObject, val); Array.Resize(ref val.skins, val.skins.Length + 1); val.skins[val.skins.Length - 1] = val2; HuntressBodyDefSeiaHuntressSkinAdded(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 { GameObject gameObject2 = ((Component)componentInChildren).gameObject; SkinDef val4 = CreateHuntressBodyDefSeiaHuntressSkin(gameObject2, componentInChildren); Array.Resize(ref componentInChildren.skins, componentInChildren.skins.Length + 1); componentInChildren.skins[^1] = val4; HuntressBodyDefSeiaHuntressLobbySkinAdded(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); } } } public static class Helpers { private static GameObject prefabHolder; public static GameObject ClonePrefab(GameObject gameObject) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: 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 val = Object.Instantiate<GameObject>(gameObject, prefabHolder.transform); val.AddComponent<RemoveClone>(); ((Object)val).name = ((Object)gameObject).name; return val; } public static Transform GetChild(this Transform transform, int index, out Transform child) { return child = transform.GetChild(index); } public static GameObject WithComponent<T>(this GameObject gameObject, Action<T> modifier = null) where T : Component { T obj = gameObject.AddComponent<T>(); modifier?.Invoke(obj); return gameObject; } public static GameObject WithTryComponent<T>(this GameObject gameObject, Action<T> modifier = null) where T : Component { if (Object.op_Implicit((Object)(object)gameObject) && !Object.op_Implicit((Object)(object)gameObject.GetComponent<T>())) { T obj = gameObject.AddComponent<T>(); modifier?.Invoke(obj); } return gameObject; } public static T ThrowIfEquals<T>(int index, string message, T value, T expected) where T : Enum { if (value.Equals(expected)) { throw new ElementException(index, message); } return value; } public static T ThrowIfOutOfBounds<T>(int index, string message, T[] array, int elementIndex) where T : class { if (array == null || array.Length <= elementIndex) { throw new ElementException(index, message); } return array[elementIndex]; } public static T ThrowIfNull<T>(int index, string message, T value) where T : class { if (value == null) { throw new ElementException(index, message); } return value; } public static void TryCatchThrow(string message, Action action) { try { action?.Invoke(); } catch (Exception innerException) { throw new FieldException(message, innerException); } } } public class RemoveClone : MonoBehaviour { public void Awake() { string name = ((Object)this).name; ((Object)this).name = name.Substring(0, name.Length - 7); } } public class FieldException : Exception { public FieldException(string message, Exception innerException) : base(message, innerException) { } } public class ElementException : Exception { public int Index { get; } public ElementException(int index, string message) : base(message) { Index = index; } } public class InsertBones : MonoBehaviour { private readonly List<SkinnedMeshRenderer> modifiedRenderers = new List<SkinnedMeshRenderer>(); public List<string> rendererPaths = new List<string>(); public List<Transform> newBones = new List<Transform>(); public string afterPath; public void Awake() { Transform transform = ((Component)((Component)this).GetComponentInParent<ModelSkinController>()).transform; Transform value = ((Component)transform).transform.Find(afterPath); foreach (string rendererPath in rendererPaths) { Transform obj = transform.Find(rendererPath); SkinnedMeshRenderer val = ((obj != null) ? ((Component)obj).GetComponent<SkinnedMeshRenderer>() : null); if (Object.op_Implicit((Object)(object)val)) { Transform[] array = val.bones; int num = Array.IndexOf(array, value) + 1; if (num != 0) { Array.Resize(ref array, array.Length + newBones.Count); Array.Copy(array, num, array, num + newBones.Count, array.Length - newBones.Count - num); newBones.CopyTo(array, num); val.bones = array; modifiedRenderers.Add(val); } } } } public void OnDestroy() { foreach (SkinnedMeshRenderer modifiedRenderer in modifiedRenderers) { if (Object.op_Implicit((Object)(object)modifiedRenderer)) { Transform[] array = modifiedRenderer.bones; int num = Array.IndexOf(array, ((Component)this).transform); Array.Copy(array, num + newBones.Count, array, num, array.Length - num - newBones.Count); Array.Resize(ref array, array.Length - newBones.Count); modifiedRenderer.bones = array; } } modifiedRenderers.Clear(); } } public class AddDynamicColliders : MonoBehaviour { public List<PathPair> pathPairs = new List<PathPair>(); public void Awake() { Transform transform = ((Component)((Component)this).GetComponentInParent<ModelSkinController>()).transform; DynamicBone val3 = default(DynamicBone); DynamicBoneCollider item = default(DynamicBoneCollider); foreach (PathPair pathPair in pathPairs) { Transform val = ((pathPair.path1 == string.Empty) ? ((Component)this).transform : ((Component)this).transform.Find(pathPair.path1)); Transform val2 = transform.Find(pathPair.path2); if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val2) && ((Component)val).TryGetComponent<DynamicBone>(ref val3) && ((Component)val2).TryGetComponent<DynamicBoneCollider>(ref item)) { val3.m_Colliders.Add(item); } } } } [Serializable] public struct PathPair { public string path1; public string path2; } }
SeiaHuntressVoiceover.dll
Decompiled 9 hours agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BaseVoiceoverLib; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using Microsoft.CodeAnalysis; using R2API; using RiskOfOptions; using RiskOfOptions.Options; using RoR2; using RoR2.ContentManagement; using SeiaHuntressVoiceover.Components; using SeiaHuntressVoiceover.Modules; using UnityEngine; using UnityEngine.AddressableAssets; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("SeiaHuntressVoiceover")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+3b9bf1bda8861c0da1cf7ad1aee5ec7bb66f7389")] [assembly: AssemblyProduct("SeiaHuntressVoiceover")] [assembly: AssemblyTitle("SeiaHuntressVoiceover")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } } namespace SeiaHuntressVoiceover { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.Schale.SeiaHuntressVoiceover", "SeiaHuntressVoiceover", "1.0.0")] public class SeiaHuntressVoiceoverPlugin : BaseUnityPlugin { public class NSEInfo { public NetworkSoundEventDef nse; public uint akId = 0u; public string eventName = string.Empty; public NSEInfo(NetworkSoundEventDef source) { nse = source; akId = source.akId; eventName = source.eventName; } private void DisableSound() { nse.akId = 0u; nse.eventName = string.Empty; } private void EnableSound() { nse.akId = akId; nse.eventName = eventName; } public void ValidateParams() { if (akId == 0) { akId = nse.akId; } if (eventName == string.Empty) { eventName = nse.eventName; } if (!enableVoicelines.Value) { DisableSound(); } else { EnableSound(); } } } public static ConfigEntry<bool> enableVoicelines; public static ConfigEntry<KeyboardShortcut> btnTitle; public static ConfigEntry<KeyboardShortcut> btnThanks; public static ConfigEntry<KeyboardShortcut> btnHurt; public static ConfigEntry<KeyboardShortcut> btnEx1; public static ConfigEntry<KeyboardShortcut> btnEx2; public static ConfigEntry<KeyboardShortcut> btnEx3; public static ConfigEntry<KeyboardShortcut> btnExLv1; public static ConfigEntry<KeyboardShortcut> btnExLv2; public static ConfigEntry<KeyboardShortcut> btnExLv3; public static ConfigEntry<KeyboardShortcut> btnCommon; public static ConfigEntry<KeyboardShortcut> btnPointless; public static ConfigEntry<KeyboardShortcut> btnProtagonist; public static ConfigEntry<KeyboardShortcut> btnShout; public static ConfigEntry<KeyboardShortcut> btnRetire; public static ConfigEntry<KeyboardShortcut> btnBang; public static bool playedSeasonalVoiceline = false; public static AssetBundle assetBundle; public static SurvivorDef survivorDef = Addressables.LoadAssetAsync<SurvivorDef>((object)"RoR2/Base/Huntress/Huntress.asset").WaitForCompletion(); public static List<NSEInfo> nseList = new List<NSEInfo>(); public void Awake() { //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Expected O, but got Unknown //IL_0099: Expected O, but got Unknown //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Expected O, but got Unknown //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Expected O, but got Unknown //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Expected O, but got Unknown //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Expected O, but got Unknown //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Expected O, but got Unknown //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Expected O, but got Unknown //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Expected O, but got Unknown //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Expected O, but got Unknown //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Expected O, but got Unknown //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Expected O, but got Unknown //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Expected O, but got Unknown //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Expected O, but got Unknown //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Expected O, but got Unknown //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Expected O, but got Unknown //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_02d0: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Expected O, but got Unknown Files.PluginInfo = ((BaseUnityPlugin)this).Info; RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(OnLoad)); new Content().Initialize(); using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("SeiaHuntressVoiceover.seiahuntressvoiceoverbundle")) { assetBundle = AssetBundle.LoadFromStream(stream); } SoundBanks.Init(); InitNSE(); enableVoicelines = ((BaseUnityPlugin)this).Config.Bind<bool>(new ConfigDefinition("Settings", "Enable Voicelines"), true, new ConfigDescription("Enable voicelines when using the Seia Huntress Skin.", (AcceptableValueBase)null, Array.Empty<object>())); enableVoicelines.SettingChanged += EnableVoicelines_SettingChanged; btnTitle = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "Title"), KeyboardShortcut.Empty, (ConfigDescription)null); btnHurt = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "Hurt"), KeyboardShortcut.Empty, (ConfigDescription)null); btnShout = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "Shout"), KeyboardShortcut.Empty, (ConfigDescription)null); btnThanks = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "Thanks"), KeyboardShortcut.Empty, (ConfigDescription)null); btnBang = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "Bang"), KeyboardShortcut.Empty, (ConfigDescription)null); btnRetire = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "Retire"), KeyboardShortcut.Empty, (ConfigDescription)null); btnPointless = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "Pointless"), KeyboardShortcut.Empty, (ConfigDescription)null); btnProtagonist = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "Protagonist"), KeyboardShortcut.Empty, (ConfigDescription)null); btnEx1 = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "Ex 1"), KeyboardShortcut.Empty, (ConfigDescription)null); btnEx2 = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "Ex 2"), KeyboardShortcut.Empty, (ConfigDescription)null); btnEx3 = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "Ex 3"), KeyboardShortcut.Empty, (ConfigDescription)null); btnExLv1 = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "Ex Level 1"), KeyboardShortcut.Empty, (ConfigDescription)null); btnExLv2 = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "Ex Level 2"), KeyboardShortcut.Empty, (ConfigDescription)null); btnExLv3 = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "Ex Level 3"), KeyboardShortcut.Empty, (ConfigDescription)null); btnCommon = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>(new ConfigDefinition("Keybinds", "Common Skill"), KeyboardShortcut.Empty, (ConfigDescription)null); if (Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions")) { RiskOfOptionsCompat(); } } private void EnableVoicelines_SettingChanged(object sender, EventArgs e) { RefreshNSE(); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private void RiskOfOptionsCompat() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Expected O, but got Unknown //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Expected O, but got Unknown //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Expected O, but got Unknown //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Expected O, but got Unknown //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Expected O, but got Unknown //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Expected O, but got Unknown //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Expected O, but got Unknown ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(enableVoicelines)); ModSettingsManager.AddOption((BaseOption)new KeyBindOption(btnTitle)); ModSettingsManager.AddOption((BaseOption)new KeyBindOption(btnHurt)); ModSettingsManager.AddOption((BaseOption)new KeyBindOption(btnShout)); ModSettingsManager.AddOption((BaseOption)new KeyBindOption(btnThanks)); ModSettingsManager.AddOption((BaseOption)new KeyBindOption(btnBang)); ModSettingsManager.AddOption((BaseOption)new KeyBindOption(btnRetire)); ModSettingsManager.AddOption((BaseOption)new KeyBindOption(btnPointless)); ModSettingsManager.AddOption((BaseOption)new KeyBindOption(btnProtagonist)); ModSettingsManager.AddOption((BaseOption)new KeyBindOption(btnEx1)); ModSettingsManager.AddOption((BaseOption)new KeyBindOption(btnEx2)); ModSettingsManager.AddOption((BaseOption)new KeyBindOption(btnEx3)); ModSettingsManager.AddOption((BaseOption)new KeyBindOption(btnExLv1)); ModSettingsManager.AddOption((BaseOption)new KeyBindOption(btnExLv2)); ModSettingsManager.AddOption((BaseOption)new KeyBindOption(btnExLv3)); ModSettingsManager.AddOption((BaseOption)new KeyBindOption(btnCommon)); ModSettingsManager.SetModIcon(assetBundle.LoadAsset<Sprite>("seia")); } private void OnLoad() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Expected O, but got Unknown //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Expected O, but got Unknown //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Expected O, but got Unknown SkinDef val = null; SkinDef[] array = SkinCatalog.FindSkinsForBody(BodyCatalog.FindBodyIndex("HuntressBody")); SkinDef[] array2 = array; foreach (SkinDef val2 in array2) { if (((Object)val2).name == "DefSeiaHuntress") { val = val2; break; } } if (!Object.op_Implicit((Object)(object)val)) { Debug.LogError((object)"SeiaHuntressVoiceover: Seia Huntress SkinDef not found. Voicelines will not work!"); } else { VoiceoverInfo val3 = new VoiceoverInfo(typeof(SeiaHuntressVoiceoverComponent), val, "HuntressBody"); val3.selectActions = (LobbySelectActions)Delegate.Combine((Delegate?)(object)val3.selectActions, (Delegate?)new LobbySelectActions(SeiaHuntressSelect)); } RefreshNSE(); } private void SeiaHuntressSelect(GameObject mannequinObject) { if (!enableVoicelines.Value) { return; } bool flag = false; if (!playedSeasonalVoiceline) { if ((DateTime.Today.Month == 1 && DateTime.Today.Day == 1) || (DateTime.Today.Month == 12 && DateTime.Today.Day == 31)) { Util.PlaySound("Play_SeiaHuntress_Lobby_Newyear", mannequinObject); flag = true; } else if (DateTime.Today.Month == 9 && DateTime.Today.Day == 29) { Util.PlaySound("Play_SeiaHuntress_Lobby_bday", mannequinObject); flag = true; } else if (DateTime.Today.Month == 10 && (DateTime.Today.Day == 30 || DateTime.Today.Day == 31)) { Util.PlaySound("Play_SeiaHuntress_Lobby_Halloween", mannequinObject); flag = true; } else if (DateTime.Today.Month == 12 && (DateTime.Today.Day == 24 || DateTime.Today.Day == 25)) { Util.PlaySound("Play_SeiaHuntress_Lobby_xmas", mannequinObject); flag = true; } if (flag) { playedSeasonalVoiceline = true; } } if (!flag) { if (Util.CheckRoll(5f, 0f, (CharacterMaster)null)) { Util.PlaySound("Play_SeiaHuntress_Title", mannequinObject); } else { Util.PlaySound("Play_SeiaHuntress_Lobby", mannequinObject); } } } private void InitNSE() { SeiaHuntressVoiceoverComponent.nseTitle = RegisterNSE("Play_SeiaHuntress_Title"); SeiaHuntressVoiceoverComponent.nseThanks = RegisterNSE("Play_SeiaHuntress_Thanks"); SeiaHuntressVoiceoverComponent.nseShout = RegisterNSE("Play_SeiaHuntress_Shout"); SeiaHuntressVoiceoverComponent.nseHurt = RegisterNSE("Play_SeiaHuntress_Hurt"); SeiaHuntressVoiceoverComponent.nseBang = RegisterNSE("Play_SeiaHuntress_Bang"); SeiaHuntressVoiceoverComponent.nseRetire = RegisterNSE("Play_SeiaHuntress_Retire"); SeiaHuntressVoiceoverComponent.nsePointless = RegisterNSE("Play_SeiaHuntress_Pointless"); SeiaHuntressVoiceoverComponent.nseProtagonist = RegisterNSE("Play_SeiaHuntress_TpStart_3"); SeiaHuntressVoiceoverComponent.nseEx1 = RegisterNSE("Play_SeiaHuntress_Ex_1"); SeiaHuntressVoiceoverComponent.nseEx2 = RegisterNSE("Play_SeiaHuntress_Ex_2"); SeiaHuntressVoiceoverComponent.nseEx3 = RegisterNSE("Play_SeiaHuntress_Ex_3"); SeiaHuntressVoiceoverComponent.nseExLv1 = RegisterNSE("Play_SeiaHuntress_Ex_Lv_1"); SeiaHuntressVoiceoverComponent.nseExLv2 = RegisterNSE("Play_SeiaHuntress_Ex_Lv_2"); SeiaHuntressVoiceoverComponent.nseExLv3 = RegisterNSE("Play_SeiaHuntress_Ex_Lv_3"); SeiaHuntressVoiceoverComponent.nseCommon = RegisterNSE("Play_SeiaHuntress_Common"); } private NetworkSoundEventDef RegisterNSE(string eventName) { NetworkSoundEventDef val = ScriptableObject.CreateInstance<NetworkSoundEventDef>(); val.eventName = eventName; Content.networkSoundEventDefs.Add(val); nseList.Add(new NSEInfo(val)); return val; } public void RefreshNSE() { foreach (NSEInfo nse in nseList) { nse.ValidateParams(); } } } } namespace SeiaHuntressVoiceover.Modules { public class Content : IContentPackProvider { internal ContentPack contentPack = new ContentPack(); public static List<NetworkSoundEventDef> networkSoundEventDefs = new List<NetworkSoundEventDef>(); public string identifier => "com.Schale.SeiaHuntressVoiceover"; public void Initialize() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown ContentManager.collectContentPackProviders += new CollectContentPackProvidersDelegate(ContentManager_collectContentPackProviders); } private void ContentManager_collectContentPackProviders(AddContentPackProviderDelegate addContentPackProvider) { addContentPackProvider.Invoke((IContentPackProvider)(object)this); } public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args) { contentPack.identifier = identifier; contentPack.networkSoundEventDefs.Add(networkSoundEventDefs.ToArray()); args.ReportProgress(1f); yield break; } public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args) { ContentPack.Copy(contentPack, args.output); args.ReportProgress(1f); yield break; } public IEnumerator FinalizeAsync(FinalizeAsyncArgs args) { args.ReportProgress(1f); yield break; } } public static class Files { public static PluginInfo PluginInfo; internal static string assemblyDir => Path.GetDirectoryName(PluginInfo.Location); internal static void Init(PluginInfo info) { PluginInfo = info; } internal static string GetPathToFile(string folderName, string fileName) { return Path.Combine(assemblyDir, folderName, fileName); } } public static class SoundBanks { private static bool initialized; public static string SoundBankDirectory => Files.assemblyDir; public static void Init() { if (initialized) { return; } initialized = true; using Stream stream = new FileStream(SoundBankDirectory + "\\SeiaHuntressVoiceoverSoundbank.bnk", FileMode.Open); byte[] array = new byte[stream.Length]; stream.Read(array, 0, array.Length); SoundBanks.Add(array); } } } namespace SeiaHuntressVoiceover.Components { public class SeiaHuntressVoiceoverComponent : BaseVoiceoverComponent { public static NetworkSoundEventDef nseHurt; public static NetworkSoundEventDef nseTitle; public static NetworkSoundEventDef nsePointless; public static NetworkSoundEventDef nseShout; public static NetworkSoundEventDef nseEx1; public static NetworkSoundEventDef nseEx2; public static NetworkSoundEventDef nseEx3; public static NetworkSoundEventDef nseExLv1; public static NetworkSoundEventDef nseExLv2; public static NetworkSoundEventDef nseExLv3; public static NetworkSoundEventDef nseCommon; public static NetworkSoundEventDef nseBang; public static NetworkSoundEventDef nseProtagonist; public static NetworkSoundEventDef nseRetire; public static NetworkSoundEventDef nseThanks; private float levelCooldown = 0f; private float lowHealthCooldown = 0f; private float shrineFailCooldown = 0f; private float specialCooldown = 0f; private float utilityCooldown = 0f; private float secondaryCooldown = 0f; private bool acquiredScepter = false; protected override void Start() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) ((BaseVoiceoverComponent)this).Start(); if (Object.op_Implicit((Object)(object)base.inventory) && base.inventory.GetItemCountEffective(BaseVoiceoverComponent.scepterIndex) > 0) { acquiredScepter = true; } } protected override void FixedUpdate() { ((BaseVoiceoverComponent)this).FixedUpdate(); if (levelCooldown > 0f) { levelCooldown -= Time.fixedDeltaTime; } if (lowHealthCooldown > 0f) { lowHealthCooldown -= Time.fixedDeltaTime; } if (shrineFailCooldown > 0f) { shrineFailCooldown -= Time.fixedDeltaTime; } if (secondaryCooldown > 0f) { utilityCooldown -= Time.fixedDeltaTime; } if (utilityCooldown > 0f) { utilityCooldown -= Time.fixedDeltaTime; } if (specialCooldown > 0f) { specialCooldown -= Time.fixedDeltaTime; } } public override void PlayDeath() { ((BaseVoiceoverComponent)this).TryPlaySound("Play_SeiaHuntress_Defeat", 5f, true); } public override void PlayHurt(float percentHPLost) { if (percentHPLost >= 0.1f) { ((BaseVoiceoverComponent)this).TryPlaySound("Play_SeiaHuntress_Hurt", 0f, false); } } public override void PlayLevelUp() { if (!(levelCooldown > 0f) && Random.Range(0, 4) switch { 0 => ((BaseVoiceoverComponent)this).TryPlaySound("Play_SeiaHuntress_LevelUp_1", 5.3f, false), 1 => ((BaseVoiceoverComponent)this).TryPlaySound("Play_SeiaHuntress_LevelUp_2", 5.3f, false), 2 => ((BaseVoiceoverComponent)this).TryPlaySound("Play_SeiaHuntress_LevelUp_3", 5.3f, false), _ => ((BaseVoiceoverComponent)this).TryPlaySound("Play_SeiaHuntress_LevelUp_4", 5.3f, false), }) { levelCooldown = 60f; } } public override void PlayLowHealth() { if (!(lowHealthCooldown > 0f) && ((BaseVoiceoverComponent)this).TryPlaySound("Play_SeiaHuntress_Retire", 3.1f, false)) { lowHealthCooldown = 60f; } } public override void PlaySpawn() { switch (Random.Range(0, 3)) { case 0: ((BaseVoiceoverComponent)this).TryPlaySound("Play_SeiaHuntress_Battle_In_1", 2.3f, true); break; case 1: ((BaseVoiceoverComponent)this).TryPlaySound("Play_SeiaHuntress_Battle_In_2", 1.05f, true); break; default: ((BaseVoiceoverComponent)this).TryPlaySound("Play_SeiaHuntress_Formation_Select", 4.15f, true); break; } } public override void PlayTeleporterFinish() { switch (Random.Range(0, 4)) { case 0: ((BaseVoiceoverComponent)this).TryPlaySound("Play_SeiaHuntress_Victory_1", 2.75f, false); break; case 1: ((BaseVoiceoverComponent)this).TryPlaySound("Play_SeiaHuntress_Victory_2", 1.4f, false); break; case 2: ((BaseVoiceoverComponent)this).TryPlaySound("Play_SeiaHuntress_Victory_3", 2.5f, false); break; default: ((BaseVoiceoverComponent)this).TryPlaySound("Play_SeiaHuntress_Victory_4", 1.75f, false); break; } } public override void PlayTeleporterStart() { switch (Random.Range(0, 3)) { case 0: ((BaseVoiceoverComponent)this).TryPlaySound("Play_SeiaHuntress_TpStart_1", 10f, false); break; case 1: ((BaseVoiceoverComponent)this).TryPlaySound("Play_SeiaHuntress_TpStart_2", 7f, false); break; default: ((BaseVoiceoverComponent)this).TryPlaySound("Play_SeiaHuntress_TpStart_3", 2.8f, false); break; } } public override void PlaySecondaryAuthority(GenericSkill skill) { if (!(utilityCooldown > 0f) && ((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseCommon, 0.6f, false)) { secondaryCooldown = 20f; } } public override void PlayUtilityAuthority(GenericSkill skill) { if (!(utilityCooldown > 0f) && ((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseShout, 0f, false)) { utilityCooldown = 10f; } } public override void PlayVictory() { ((BaseVoiceoverComponent)this).TryPlaySound("Play_SeiaHuntress_EventLogin_Season_End", 7.4f, true); } protected override void Inventory_onItemAddedClient(ItemIndex itemIndex) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Invalid comparison between Unknown and I4 //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Invalid comparison between Unknown and I4 ((BaseVoiceoverComponent)this).Inventory_onItemAddedClient(itemIndex); if ((int)BaseVoiceoverComponent.scepterIndex != -1 && itemIndex == BaseVoiceoverComponent.scepterIndex) { PlayAcquireScepter(); return; } ItemDef itemDef = ItemCatalog.GetItemDef(itemIndex); if ((Object)(object)itemDef == (Object)(object)Items.Squid || (Object)(object)itemDef == (Object)(object)Items.Plant || (Object)(object)itemDef == (Object)(object)Items.SlowOnHit) { PlayBadItem(); } else if (Object.op_Implicit((Object)(object)itemDef) && (int)itemDef.deprecatedTier == 2) { PlayAcquireLegendary(); } } public override void PlaySpecialAuthority(GenericSkill skill) { if (!(specialCooldown > 0f)) { bool flag = false; if (Random.Range(0, 3) switch { 0 => ((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseExLv1, 1.85f, false), 1 => ((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseExLv2, 3.65f, false), _ => ((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseExLv3, 2.6f, false), }) { specialCooldown = 24f; } } } public void PlayAcquireScepter() { if (!acquiredScepter) { ((BaseVoiceoverComponent)this).TryPlaySound("Play_SeiaHuntress_ExWeapon_Get", 24.5f, true); acquiredScepter = true; } } public void PlayBadItem() { ((BaseVoiceoverComponent)this).TryPlaySound("Play_SeiaHuntress_Pointless", 1f, false); } public void PlayAcquireLegendary() { switch (Random.Range(0, 4)) { case 0: ((BaseVoiceoverComponent)this).TryPlaySound("Play_SeiaHuntress_Relationship_1", 9f, false); break; case 1: ((BaseVoiceoverComponent)this).TryPlaySound("Play_SeiaHuntress_Relationship_2", 12.7f, false); break; case 2: ((BaseVoiceoverComponent)this).TryPlaySound("Play_SeiaHuntress_Relationship_3", 5.8f, false); break; default: ((BaseVoiceoverComponent)this).TryPlaySound("Play_SeiaHuntress_Relationship_4", 9.5f, false); break; } } public override void PlayShrineOfChanceFailServer() { if (!(shrineFailCooldown > 0f) && Util.CheckRoll(15f, 0f, (CharacterMaster)null) && ((BaseVoiceoverComponent)this).TryPlayNetworkSound(nsePointless, 1f, false)) { shrineFailCooldown = 60f; } } protected override void CheckInputs() { if (Utils.GetKeyPressed(SeiaHuntressVoiceoverPlugin.btnTitle)) { ((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseTitle, 1.6f, false); } else if (Utils.GetKeyPressed(SeiaHuntressVoiceoverPlugin.btnHurt)) { ((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseHurt, 0.1f, false); } else if (Utils.GetKeyPressed(SeiaHuntressVoiceoverPlugin.btnShout)) { ((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseShout, 0.1f, false); } else if (Utils.GetKeyPressed(SeiaHuntressVoiceoverPlugin.btnBang)) { ((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseBang, 0.25f, false); } else if (Utils.GetKeyPressed(SeiaHuntressVoiceoverPlugin.btnThanks)) { ((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseThanks, 1.5f, false); } else if (Utils.GetKeyPressed(SeiaHuntressVoiceoverPlugin.btnRetire)) { ((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseRetire, 3f, false); } else if (Utils.GetKeyPressed(SeiaHuntressVoiceoverPlugin.btnPointless)) { ((BaseVoiceoverComponent)this).TryPlayNetworkSound(nsePointless, 0.95f, false); } else if (Utils.GetKeyPressed(SeiaHuntressVoiceoverPlugin.btnProtagonist)) { ((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseProtagonist, 2.8f, false); } else if (Utils.GetKeyPressed(SeiaHuntressVoiceoverPlugin.btnCommon)) { ((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseCommon, 0.6f, false); } else if (Utils.GetKeyPressed(SeiaHuntressVoiceoverPlugin.btnEx1)) { ((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseEx1, 1.75f, false); } else if (Utils.GetKeyPressed(SeiaHuntressVoiceoverPlugin.btnEx2)) { ((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseEx2, 2.65f, false); } else if (Utils.GetKeyPressed(SeiaHuntressVoiceoverPlugin.btnEx3)) { ((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseEx3, 2.7f, false); } else if (Utils.GetKeyPressed(SeiaHuntressVoiceoverPlugin.btnExLv1)) { ((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseExLv1, 1.85f, false); } else if (Utils.GetKeyPressed(SeiaHuntressVoiceoverPlugin.btnExLv2)) { ((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseExLv2, 3.6f, false); } else if (Utils.GetKeyPressed(SeiaHuntressVoiceoverPlugin.btnExLv3)) { ((BaseVoiceoverComponent)this).TryPlayNetworkSound(nseExLv3, 2.55f, false); } } public override bool ComponentEnableVoicelines() { return SeiaHuntressVoiceoverPlugin.enableVoicelines.Value; } } }