using System; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HG; using Microsoft.CodeAnalysis; using On.RoR2; using On.RoR2.UI.LogBook; using RoR2; using RoR2.UI.LogBook; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("VoidAspectRestoration")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("VoidAspectRestoration")] [assembly: AssemblyTitle("VoidAspectRestoration")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [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 VoidAspectRestoration { public enum VoidAspectAppearance { VanillaInfestor, AspectOrb } [BepInPlugin("evanr.voidaspectrestoration", "Void Aspect Restoration", "1.0.0")] public sealed class Plugin : BaseUnityPlugin { [CompilerGenerated] private static class <>O { public static hook_GetLocalizedStringByToken <0>__Language_GetLocalizedStringByToken; public static hook_TokenIsRegistered <1>__Language_TokenIsRegistered; public static hook_FixedUpdate <2>__AffixVoidBehavior_FixedUpdate; public static hook_AddTimedBuff_BuffDef_float <3>__CharacterBody_AddTimedBuff; public static hook_TakeDamageProcess <4>__HealthComponent_TakeDamageProcess; public static hook_RebuildModel <5>__PickupDisplay_RebuildModel; public static hook_SetEntry <6>__LogBookPage_SetEntry; public static Action <7>__RestoreVoidAspect; } public const string PluginGuid = "evanr.voidaspectrestoration"; public const string PluginName = "Void Aspect Restoration"; public const string PluginVersion = "1.0.0"; internal static ManualLogSource Log; private static GameObject voidAspectPickupDisplay; private static Sprite voidAspectIcon; private static ConfigEntry appearanceConfig; private void Awake() { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Expected O, but got Unknown //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Expected O, but got Unknown //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Expected O, but got Unknown //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Expected O, but got Unknown //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Expected O, but got Unknown //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown Log = ((BaseUnityPlugin)this).Logger; appearanceConfig = ((BaseUnityPlugin)this).Config.Bind("Appearance", "VoidAspectModel", VoidAspectAppearance.VanillaInfestor, "Controls the Void aspect's ground pickup and model-panel appearance. VanillaInfestor preserves the abandoned vanilla Infestor design. AspectOrb uses a dark-purple aspect orb."); object obj = <>O.<0>__Language_GetLocalizedStringByToken; if (obj == null) { hook_GetLocalizedStringByToken val = Language_GetLocalizedStringByToken; <>O.<0>__Language_GetLocalizedStringByToken = val; obj = (object)val; } Language.GetLocalizedStringByToken += (hook_GetLocalizedStringByToken)obj; object obj2 = <>O.<1>__Language_TokenIsRegistered; if (obj2 == null) { hook_TokenIsRegistered val2 = Language_TokenIsRegistered; <>O.<1>__Language_TokenIsRegistered = val2; obj2 = (object)val2; } Language.TokenIsRegistered += (hook_TokenIsRegistered)obj2; object obj3 = <>O.<2>__AffixVoidBehavior_FixedUpdate; if (obj3 == null) { hook_FixedUpdate val3 = AffixVoidBehavior_FixedUpdate; <>O.<2>__AffixVoidBehavior_FixedUpdate = val3; obj3 = (object)val3; } AffixVoidBehavior.FixedUpdate += (hook_FixedUpdate)obj3; object obj4 = <>O.<3>__CharacterBody_AddTimedBuff; if (obj4 == null) { hook_AddTimedBuff_BuffDef_float val4 = CharacterBody_AddTimedBuff; <>O.<3>__CharacterBody_AddTimedBuff = val4; obj4 = (object)val4; } CharacterBody.AddTimedBuff_BuffDef_float += (hook_AddTimedBuff_BuffDef_float)obj4; object obj5 = <>O.<4>__HealthComponent_TakeDamageProcess; if (obj5 == null) { hook_TakeDamageProcess val5 = HealthComponent_TakeDamageProcess; <>O.<4>__HealthComponent_TakeDamageProcess = val5; obj5 = (object)val5; } HealthComponent.TakeDamageProcess += (hook_TakeDamageProcess)obj5; object obj6 = <>O.<5>__PickupDisplay_RebuildModel; if (obj6 == null) { hook_RebuildModel val6 = PickupDisplay_RebuildModel; <>O.<5>__PickupDisplay_RebuildModel = val6; obj6 = (object)val6; } PickupDisplay.RebuildModel += (hook_RebuildModel)obj6; object obj7 = <>O.<6>__LogBookPage_SetEntry; if (obj7 == null) { hook_SetEntry val7 = LogBookPage_SetEntry; <>O.<6>__LogBookPage_SetEntry = val7; obj7 = (object)val7; } LogBookPage.SetEntry += (hook_SetEntry)obj7; ((ResourceAvailability)(ref PickupCatalog.availability)).CallWhenAvailable((Action)RestoreVoidAspect); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Void Aspect Restoration 1.0.0 loaded (paired appearance icons and logbook model enabled)."); } private void OnDestroy() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Expected O, but got Unknown //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Expected O, but got Unknown //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Expected O, but got Unknown object obj = <>O.<0>__Language_GetLocalizedStringByToken; if (obj == null) { hook_GetLocalizedStringByToken val = Language_GetLocalizedStringByToken; <>O.<0>__Language_GetLocalizedStringByToken = val; obj = (object)val; } Language.GetLocalizedStringByToken -= (hook_GetLocalizedStringByToken)obj; object obj2 = <>O.<1>__Language_TokenIsRegistered; if (obj2 == null) { hook_TokenIsRegistered val2 = Language_TokenIsRegistered; <>O.<1>__Language_TokenIsRegistered = val2; obj2 = (object)val2; } Language.TokenIsRegistered -= (hook_TokenIsRegistered)obj2; object obj3 = <>O.<2>__AffixVoidBehavior_FixedUpdate; if (obj3 == null) { hook_FixedUpdate val3 = AffixVoidBehavior_FixedUpdate; <>O.<2>__AffixVoidBehavior_FixedUpdate = val3; obj3 = (object)val3; } AffixVoidBehavior.FixedUpdate -= (hook_FixedUpdate)obj3; object obj4 = <>O.<3>__CharacterBody_AddTimedBuff; if (obj4 == null) { hook_AddTimedBuff_BuffDef_float val4 = CharacterBody_AddTimedBuff; <>O.<3>__CharacterBody_AddTimedBuff = val4; obj4 = (object)val4; } CharacterBody.AddTimedBuff_BuffDef_float -= (hook_AddTimedBuff_BuffDef_float)obj4; object obj5 = <>O.<4>__HealthComponent_TakeDamageProcess; if (obj5 == null) { hook_TakeDamageProcess val5 = HealthComponent_TakeDamageProcess; <>O.<4>__HealthComponent_TakeDamageProcess = val5; obj5 = (object)val5; } HealthComponent.TakeDamageProcess -= (hook_TakeDamageProcess)obj5; object obj6 = <>O.<5>__PickupDisplay_RebuildModel; if (obj6 == null) { hook_RebuildModel val6 = PickupDisplay_RebuildModel; <>O.<5>__PickupDisplay_RebuildModel = val6; obj6 = (object)val6; } PickupDisplay.RebuildModel -= (hook_RebuildModel)obj6; object obj7 = <>O.<6>__LogBookPage_SetEntry; if (obj7 == null) { hook_SetEntry val7 = LogBookPage_SetEntry; <>O.<6>__LogBookPage_SetEntry = val7; obj7 = (object)val7; } LogBookPage.SetEntry -= (hook_SetEntry)obj7; if (Object.op_Implicit((Object)(object)voidAspectPickupDisplay)) { Object.Destroy((Object)(object)voidAspectPickupDisplay); voidAspectPickupDisplay = null; } if (Object.op_Implicit((Object)(object)voidAspectIcon)) { Texture2D texture = voidAspectIcon.texture; Object.Destroy((Object)(object)voidAspectIcon); Object.Destroy((Object)(object)texture); voidAspectIcon = null; } } private static void AffixVoidBehavior_FixedUpdate(orig_FixedUpdate orig, AffixVoidBehavior self) { orig.Invoke(self); if (NetworkServer.active && Object.op_Implicit((Object)(object)((ItemBehavior)self).body)) { while (((ItemBehavior)self).body.GetBuffCount(Buffs.BearVoidReady) > 1) { ((ItemBehavior)self).body.RemoveBuff(Buffs.BearVoidReady); } } } private static void CharacterBody_AddTimedBuff(orig_AddTimedBuff_BuffDef_float orig, CharacterBody self, BuffDef buffDef, float duration) { bool flag = (Object)(object)buffDef == (Object)(object)Buffs.VoidFogMild || (Object)(object)buffDef == (Object)(object)Buffs.VoidFogStrong; if (!(NetworkServer.active && Object.op_Implicit((Object)(object)self) && self.HasBuff(Buffs.EliteVoid) && flag)) { orig.Invoke(self, buffDef, duration); } } private static void HealthComponent_TakeDamageProcess(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageInfo) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Invalid comparison between Unknown and I4 //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Invalid comparison between Unknown and I4 //IL_0027: 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_0033: Invalid comparison between Unknown and I4 //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) CharacterBody body = self.body; bool flag = (int)damageInfo.damageColorIndex == 9 && (int)damageInfo.damageType.damageSource == 16 && (damageInfo.damageType.damageTypeExtended & 0x4000) > 0; if (NetworkServer.active && Object.op_Implicit((Object)(object)body) && body.HasBuff(Buffs.EliteVoid) && flag) { return; } bool flag2 = NetworkServer.active && Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.inventory) && body.inventory.currentEquipmentIndex == Equipment.EliteVoidEquipment.equipmentIndex && body.HasBuff(Buffs.BearVoidReady) && damageInfo.damage > 0f && !damageInfo.rejected; orig.Invoke(self, damageInfo); if (flag2 && Object.op_Implicit((Object)(object)body)) { while (body.HasBuff(Buffs.BearVoidReady)) { body.RemoveBuff(Buffs.BearVoidReady); } while (body.HasBuff(Buffs.BearVoidCooldown)) { body.RemoveOldestTimedBuff(Buffs.BearVoidCooldown); } int itemCountEffective = body.inventory.GetItemCountEffective(Items.BearVoid); float num = 15f * Mathf.Pow(0.9f, (float)itemCountEffective); body.AddTimedBuff(Buffs.BearVoidCooldown, num); } } private static void RestoreVoidAspect() { EquipmentDef eliteVoidEquipment = Equipment.EliteVoidEquipment; EliteDef val = Elites.Void; EquipmentDef affixRed = Equipment.AffixRed; if (!Object.op_Implicit((Object)(object)eliteVoidEquipment)) { Log.LogError((object)"Could not restore the Void aspect because DLC1Content.Equipment.EliteVoidEquipment is null."); return; } if (!Object.op_Implicit((Object)(object)val)) { Log.LogError((object)"Could not restore the Void aspect because DLC1Content.Elites.Void is null."); return; } if (!Object.op_Implicit((Object)(object)affixRed)) { Log.LogError((object)"Could not restore the Void aspect drop chance because RoR2Content.Equipment.AffixRed is null."); return; } val.eliteEquipmentDef = eliteVoidEquipment; eliteVoidEquipment.dropOnDeathChance = affixRed.dropOnDeathChance; RestorePickupDisplay(eliteVoidEquipment, affixRed); RestorePickupIcon(eliteVoidEquipment); float dropOnDeathChance = eliteVoidEquipment.dropOnDeathChance; string text = ((dropOnDeathChance > 0f) ? $"1 in {Mathf.RoundToInt(1f / dropOnDeathChance):N0}" : "disabled"); Log.LogInfo((object)("Restored Void aspect drops using the current vanilla " + $"aspect chance: {dropOnDeathChance * 100f:0.####}% " + "(" + text + "). Reference=AffixRed.")); } private static void PickupDisplay_RebuildModel(orig_RebuildModel orig, PickupDisplay self, GameObject modelObjectOverride) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) PickupDef pickupDef = PickupCatalog.GetPickupDef(self.GetPickupIndex()); if (pickupDef == null || pickupDef.equipmentIndex != Equipment.EliteVoidEquipment.equipmentIndex || !Object.op_Implicit((Object)(object)voidAspectPickupDisplay)) { orig.Invoke(self, modelObjectOverride); return; } pickupDef.displayPrefabReference = null; pickupDef.displayPrefab = voidAspectPickupDisplay; bool activeSelf = voidAspectPickupDisplay.activeSelf; voidAspectPickupDisplay.SetActive(true); try { orig.Invoke(self, modelObjectOverride); } finally { voidAspectPickupDisplay.SetActive(activeSelf); } } private static void LogBookPage_SetEntry(orig_SetEntry orig, LogBookPage self, UserProfile userProfile, Entry entry) { //IL_0019: 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_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) bool flag = false; if (entry != null && entry.extraData is PickupIndex val) { PickupDef pickupDef = PickupCatalog.GetPickupDef(val); flag = pickupDef != null && pickupDef.equipmentIndex == Equipment.EliteVoidEquipment.equipmentIndex; } if (!flag || !Object.op_Implicit((Object)(object)voidAspectPickupDisplay)) { orig.Invoke(self, userProfile, entry); return; } entry.modelPrefabAddress = null; entry.modelPrefab = voidAspectPickupDisplay; bool activeSelf = voidAspectPickupDisplay.activeSelf; voidAspectPickupDisplay.SetActive(true); try { orig.Invoke(self, userProfile, entry); Log.LogInfo((object)"Applied the configured Void aspect model to its logbook entry."); } finally { voidAspectPickupDisplay.SetActive(activeSelf); } } private static void RestorePickupDisplay(EquipmentDef equipmentDef, EquipmentDef referenceAspect) { GameObject val = ((appearanceConfig.Value != VoidAspectAppearance.AspectOrb) ? CreateInfestorDisplay() : CreateAspectOrbDisplay(referenceAspect)); if (!Object.op_Implicit((Object)(object)val)) { Log.LogError((object)"Could not create the configured Void aspect pickup display. The existing display was left unchanged."); return; } voidAspectPickupDisplay = val; ApplyPickupDisplay(equipmentDef, val); Log.LogInfo((object)("Applied Void aspect appearance: " + $"{appearanceConfig.Value}. Display={((Object)val).name}.")); } private static void RestorePickupIcon(EquipmentDef equipmentDef) { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) string text = ((appearanceConfig.Value == VoidAspectAppearance.AspectOrb) ? "VoidAspectRestoration.Assets.VoidAspect_AspectOrb.png" : "VoidAspectRestoration.Assets.VoidAspect_Infestor.png"); Sprite val = LoadEmbeddedSprite(text); if (!Object.op_Implicit((Object)(object)val)) { Log.LogError((object)("Could not load the configured Void aspect icon: " + text + ". The existing icon was left unchanged.")); return; } PickupIndex val2 = PickupCatalog.FindPickupIndex(equipmentDef.equipmentIndex); PickupDef pickupDef = PickupCatalog.GetPickupDef(val2); if (pickupDef == null) { Log.LogError((object)"Could not find the PickupDef for the Void aspect icon."); Object.Destroy((Object)(object)val.texture); Object.Destroy((Object)(object)val); } else { voidAspectIcon = val; equipmentDef.pickupIconSprite = val; pickupDef.iconSprite = val; Log.LogInfo((object)($"Applied Void aspect icon: {appearanceConfig.Value}. " + "Resource=" + text + ".")); } } private static Sprite LoadEmbeddedSprite(string resourceName) { //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Expected O, but got Unknown //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) Assembly executingAssembly = Assembly.GetExecutingAssembly(); using Stream stream = executingAssembly.GetManifestResourceStream(resourceName); if (stream == null) { Log.LogError((object)("Embedded icon resource was not found: " + resourceName + ".")); return null; } byte[] array = new byte[checked((int)stream.Length)]; int i; int num; for (i = 0; i < array.Length; i += num) { num = stream.Read(array, i, array.Length - i); if (num == 0) { break; } } if (i != array.Length) { Log.LogError((object)("Embedded icon resource could not be read fully: " + resourceName + ".")); return null; } Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false); ((Object)val).name = Path.GetFileNameWithoutExtension(resourceName); ((Texture)val).wrapMode = (TextureWrapMode)1; ((Texture)val).filterMode = (FilterMode)1; if (!ImageConversion.LoadImage(val, array, false)) { Log.LogError((object)("Unity could not decode embedded icon: " + resourceName + ".")); Object.Destroy((Object)(object)val); return null; } Sprite val2 = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 100f); ((Object)val2).name = ((Object)val).name; return val2; } private static GameObject CreateInfestorDisplay() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_012d: 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_01a1: Unknown result type (might be due to invalid IL or missing references) //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) GameObject val = Addressables.LoadAssetAsync((object)"RoR2/DLC1/EliteVoid/DisplayAffixVoid.prefab").WaitForCompletion(); if (!Object.op_Implicit((Object)(object)val)) { Log.LogError((object)"Could not load DisplayAffixVoid.prefab for the Void aspect pickup model."); return null; } GameObject val2 = Object.Instantiate(val); ((Object)val2).name = "PickupAffixVoid_VoidAspectRestoration"; val2.SetActive(false); Object.DontDestroyOnLoad((Object)(object)val2); Transform transform = val2.transform; if (transform.childCount < 2 || transform.GetChild(0).childCount < 3 || transform.GetChild(1).childCount < 4) { Log.LogError((object)"DisplayAffixVoid.prefab no longer has the expected transform structure. The pickup model was not changed."); Object.Destroy((Object)(object)val2); return null; } transform.GetChild(0).GetChild(2).SetAsFirstSibling(); transform.GetChild(1).localPosition = new Vector3(0f, 0.7f, 0f); transform.GetChild(1).GetChild(0).localPosition = new Vector3(0f, -0.5f, -0.6f); transform.GetChild(1).GetChild(0).localScale = new Vector3(1.5f, 1.5f, 1.5f); ((Component)transform.GetChild(1).GetChild(1)).gameObject.SetActive(false); ((Component)transform.GetChild(1).GetChild(3)).gameObject.SetActive(false); transform.GetChild(0).eulerAngles = new Vector3(310f, 0f, 0f); transform.GetChild(0).localScale = new Vector3(0.75f, 0.75f, 0.75f); ItemDisplay component = val2.GetComponent(); if (Object.op_Implicit((Object)(object)component) && component.rendererInfos.Length > 4) { ArrayUtils.ArrayRemoveAtAndResize(ref component.rendererInfos, 4, 1); } ModelPanelParameters val3 = val2.GetComponent(); if (!Object.op_Implicit((Object)(object)val3)) { val3 = val2.AddComponent(); } val3.modelRotation = Quaternion.Euler(-20f, -45f, 0f); return val2; } private static GameObject CreateAspectOrbDisplay(EquipmentDef referenceAspect) { //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) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) PickupIndex val = PickupCatalog.FindPickupIndex(referenceAspect.equipmentIndex); PickupDef pickupDef = PickupCatalog.GetPickupDef(val); GameObject val2 = pickupDef?.displayPrefab; if (!Object.op_Implicit((Object)(object)val2) && pickupDef?.displayPrefabReference != null && ((AssetReference)pickupDef.displayPrefabReference).RuntimeKeyIsValid()) { val2 = ((AssetReference)pickupDef.displayPrefabReference).LoadAssetAsync().WaitForCompletion(); } if (!Object.op_Implicit((Object)(object)val2)) { Log.LogError((object)"Could not load AffixRed's aspect-orb display to create the dark-purple Void aspect orb."); return null; } GameObject val3 = Object.Instantiate(val2); ((Object)val3).name = "PickupAffixVoidOrb_VoidAspectRestoration"; val3.SetActive(false); Object.DontDestroyOnLoad((Object)(object)val3); Color baseColor = default(Color); ((Color)(ref baseColor))..ctor(0.18f, 0.015f, 0.3f, 1f); Color val4 = default(Color); ((Color)(ref val4))..ctor(0.6f, 0.08f, 1f, 1f); Renderer[] componentsInChildren = val3.GetComponentsInChildren(true); foreach (Renderer val5 in componentsInChildren) { Material[] materials = val5.materials; Material[] array = materials; foreach (Material material in array) { RecolorMaterial(material, baseColor, val4); } val5.materials = materials; } ParticleSystem[] componentsInChildren2 = val3.GetComponentsInChildren(true); foreach (ParticleSystem val6 in componentsInChildren2) { MainModule main = val6.main; ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(val4); } return val3; } private static void RecolorMaterial(Material material, Color baseColor, Color emissionColor) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) if (material.HasProperty("_Color")) { material.SetColor("_Color", baseColor); } if (material.HasProperty("_TintColor")) { material.SetColor("_TintColor", emissionColor); } if (material.HasProperty("_EmColor")) { material.SetColor("_EmColor", emissionColor); } if (material.HasProperty("_EmissionColor")) { material.SetColor("_EmissionColor", emissionColor); material.EnableKeyword("_EMISSION"); } } private static void ApplyPickupDisplay(EquipmentDef equipmentDef, GameObject display) { //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) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) PickupIndex val = PickupCatalog.FindPickupIndex(equipmentDef.equipmentIndex); PickupDef pickupDef = PickupCatalog.GetPickupDef(val); if (pickupDef == null) { Log.LogError((object)"Could not find the PickupDef for EliteVoidEquipment."); return; } equipmentDef.pickupModelReference = new AssetReferenceT(string.Empty); equipmentDef.pickupModelPrefab = display; pickupDef.displayPrefabReference = null; pickupDef.displayPrefab = display; } private static string Language_GetLocalizedStringByToken(orig_GetLocalizedStringByToken orig, Language self, string token) { return token switch { "EQUIPMENT_AFFIXVOID_NAME" => "Voidborne Curiosity", "EQUIPMENT_AFFIXVOID_PICKUP" => "Become an aspect of the Void.", "EQUIPMENT_AFFIXVOID_DESC" => "Gain 50% maximum health but reduce movement speed by 30%.
Attacks apply Collapse, and gain a recharging Void shield. Become immune to Void fog.", _ => orig.Invoke(self, token), }; } private static bool Language_TokenIsRegistered(orig_TokenIsRegistered orig, Language self, string token) { if (token == "EQUIPMENT_AFFIXVOID_NAME" || token == "EQUIPMENT_AFFIXVOID_PICKUP" || token == "EQUIPMENT_AFFIXVOID_DESC") { return true; } return orig.Invoke(self, token); } } }