Some mods may be broken due to the recent Alloyed Collective update.
Decompiled source of HedgehogUtils v1.1.5
HedgehogUtils.dll
Decompiled 15 hours ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using EntityStates; using HG; using HG.BlendableTypes; using HG.Reflection; using HarmonyLib; using HedgehogUtils.Boost; using HedgehogUtils.Boost.EntityStates; using HedgehogUtils.Forms; using HedgehogUtils.Forms.EntityStates; using HedgehogUtils.Forms.SuperForm; using HedgehogUtils.Forms.SuperForm.EntityStates; using HedgehogUtils.Internal; using HedgehogUtils.Launch; using HedgehogUtils.Miscellaneous; using JetBrains.Annotations; using LookingGlass.ItemStatsNameSpace; using LookingGlass.LookingGlassLanguage; using Microsoft.CodeAnalysis; using On.RoR2; using On.RoR2.UI; using R2API; using R2API.Networking; using R2API.Networking.Interfaces; using RiskOfOptions; using RiskOfOptions.OptionConfigs; using RiskOfOptions.Options; using RoR2; using RoR2.Audio; using RoR2.ContentManagement; using RoR2.Hologram; using RoR2.Navigation; using RoR2.Skills; using RoR2.UI; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.Rendering.PostProcessing; using UnityEngine.ResourceManagement.AsyncOperations; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: OptIn] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("HedgehogUtils")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+d415c9949e589080237d53ec5fa52cd25814a99c")] [assembly: AssemblyProduct("HedgehogUtils")] [assembly: AssemblyTitle("HedgehogUtils")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.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 HedgehogUtils { public static class Assets { private const string assetbundleName = "hedgehogutilsbundle"; private const string dllName = "HedgehogUtils.dll"; internal static AssetBundle mainAssetBundle; internal static GameObject powerBoostFlashEffect; internal static GameObject powerBoostAuraEffect; public static GameObject boostHUD; internal static GameObject launchAuraEffect; internal static GameObject launchCritAuraEffect; internal static GameObject launchHitEffect; internal static GameObject launchCritHitEffect; internal static GameObject launchWallCollisionEffect; internal static GameObject launchWallCollisionLargeEffect; public static Material superFormOverlay; public static Material rainbowGlowMaterial; public static Material rainbowGlowSubtleMaterial; public static GameObject superFormTransformationEffect; public static GameObject transformationEmeraldSwirl; public static GameObject superFormAura; public static GameObject superFormWarning; public static LoopSoundDef superLoopSoundDef; public static GameObject superFormPPVolume; public static Material ringMaterial; public static GameObject chaosSnapInEffect; public static GameObject chaosSnapOutEffect; public static Material chaosSnapMaterial; public static NetworkSoundEventDef chaosSnapSoundEventDef; public static NetworkSoundEventDef chaosSnapLargeSoundEventDef; public static void Initialize() { LoadAssetBundle(); LoadSoundbank(); Miscellaneous(); BoostAndLaunch(); SuperForm(); } internal static void LoadAssetBundle() { try { if ((Object)(object)mainAssetBundle == (Object)null) { mainAssetBundle = AssetBundle.LoadFromFile(Assembly.GetExecutingAssembly().Location.Replace("HedgehogUtils.dll", "hedgehogutilsbundle")); } } catch (Exception ex) { Log.Error("Failed to load assetbundle. Make sure your assetbundle name is setup correctly\n" + ex); } } internal static void LoadSoundbank() { using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("HedgehogUtils.HedgehogUtilsBank.bnk"); byte[] array = new byte[stream.Length]; stream.Read(array, 0, array.Length); SoundBanks.Add(array); } public static void BoostAndLaunch() { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) powerBoostFlashEffect = MaterialSwap(LoadEffect("SonicPowerBoostFlash", parentToTransform: true), "RoR2/Base/Common/VFX/matDistortionFaded.mat", "Distortion"); powerBoostAuraEffect = LoadAsyncedEffect("SonicPowerBoostAura"); boostHUD = mainAssetBundle.LoadAsset<GameObject>("BoostMeter"); launchAuraEffect = CreateNewBoostAura("DS_GAMING_HEDGEHOG_UTILS_LAUNCH_AURA_VFX", 1f, 0.4f, new Color(1f, 1f, 1f), new Color(0.7f, 0.7f, 0.7f), new Color(0.4f, 0.45f, 0.5f), Color.black); launchCritAuraEffect = CreateNewBoostAura("DS_GAMING_HEDGEHOG_UTILS_LAUNCH_CRIT_AURA_VFX", 1f, 0.4f, new Color(1f, 1f, 1f), new Color(0.7f, 0.7f, 0.7f), new Color(0.8f, 0.1f, 0.2f), new Color(0.3f, 0f, 0f)); AsyncOperationHandle<GameObject> val = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/ArmorReductionOnHit/PulverizedEffect.prefab"); val.Completed += delegate(AsyncOperationHandle<GameObject> x) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) launchHitEffect = CreateLaunchHitEffect(x.Result, "HedgehogUtilsLaunchHitEffect", new Color(1f, 0.8f, 0.4f), new Color(0.8f, 0.8f, 0.8f)); launchCritHitEffect = CreateLaunchHitEffect(x.Result, "HedgehogUtilsLaunchCritHitEffect", new Color(1f, 0.1f, 0.2f), new Color(0.9f, 0.7f, 0.7f)); }; AsyncOperationHandle<GameObject> val2 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/SurvivorPod/PodGroundImpact.prefab"); val2.Completed += delegate(AsyncOperationHandle<GameObject> x) { //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: 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_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_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_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) launchWallCollisionLargeEffect = PrefabAPI.InstantiateClone(x.Result, "HedgehogUtilsLaunchWallCollisionLarge"); launchWallCollisionLargeEffect.AddComponent<NetworkIdentity>(); launchWallCollisionLargeEffect.GetComponent<ShakeEmitter>().wave.amplitude = 0.4f; Object.Destroy((Object)(object)launchWallCollisionLargeEffect.GetComponent<AlignToNormal>()); Object.Destroy((Object)(object)((Component)launchWallCollisionLargeEffect.transform.Find("Particles/Flash")).gameObject); Object.Destroy((Object)(object)((Component)launchWallCollisionLargeEffect.transform.Find("Particles/Sparks")).gameObject); Object.Destroy((Object)(object)((Component)launchWallCollisionLargeEffect.transform.Find("Particles/Point Light")).gameObject); ShapeModule shape = ((Component)launchWallCollisionLargeEffect.transform.Find("Particles/Dust, Directional")).GetComponent<ParticleSystem>().shape; ((ShapeModule)(ref shape)).radius = 6f; launchWallCollisionLargeEffect.GetComponent<EffectComponent>().soundName = ""; launchWallCollisionEffect = PrefabAPI.InstantiateClone(x.Result, "HedgehogUtilsLaunchWallCollision"); launchWallCollisionEffect.AddComponent<NetworkIdentity>(); Object.Destroy((Object)(object)launchWallCollisionEffect.GetComponent<AlignToNormal>()); Object.Destroy((Object)(object)((Component)launchWallCollisionEffect.transform.Find("Particles/Flash")).gameObject); Object.Destroy((Object)(object)((Component)launchWallCollisionEffect.transform.Find("Particles/Sparks")).gameObject); Object.Destroy((Object)(object)((Component)launchWallCollisionEffect.transform.Find("Particles/Point Light")).gameObject); Object.Destroy((Object)(object)((Component)launchWallCollisionEffect.transform.Find("Particles/Debris, 3D")).gameObject); Object.Destroy((Object)(object)launchWallCollisionEffect.GetComponent<ShakeEmitter>()); GameObject gameObject = ((Component)launchWallCollisionEffect.transform.Find("Particles/Dust, Directional")).gameObject; MainModule main = gameObject.GetComponent<ParticleSystem>().main; MinMaxCurve startLifetime = ((MainModule)(ref main)).startLifetime; ((MinMaxCurve)(ref startLifetime)).constantMax = 0.3f; ((MinMaxCurve)(ref startLifetime)).constantMax = 0.6f; ((MainModule)(ref main)).startLifetime = startLifetime; MinMaxCurve startSize = ((MainModule)(ref main)).startSize; ((MinMaxCurve)(ref startSize)).constantMin = 0.4f; ((MinMaxCurve)(ref startSize)).constantMax = 1.3f; ((MainModule)(ref main)).startSize = startSize; GameObject gameObject2 = ((Component)launchWallCollisionEffect.transform.Find("Particles/Dust")).gameObject; MainModule main2 = gameObject2.GetComponent<ParticleSystem>().main; MinMaxCurve startLifetime2 = ((MainModule)(ref main2)).startLifetime; ((MinMaxCurve)(ref startLifetime2)).constantMin = 0.6f; ((MinMaxCurve)(ref startLifetime2)).constantMax = 1.4f; ((MainModule)(ref main2)).startLifetime = startLifetime2; MinMaxCurve startSize2 = ((MainModule)(ref main2)).startSize; ((MinMaxCurve)(ref startSize2)).constantMin = 1.5f; ((MinMaxCurve)(ref startSize2)).constantMax = 3f; ((MainModule)(ref main2)).startSize = startSize2; ParticleSystem component = ((Component)launchWallCollisionEffect.transform.Find("Particles/Debris")).gameObject.GetComponent<ParticleSystem>(); EmissionModule emission = component.emission; Burst burst = ((EmissionModule)(ref emission)).GetBurst(0); ((Burst)(ref burst)).count = MinMaxCurve.op_Implicit(10f); EmissionModule emission2 = component.emission; ((EmissionModule)(ref emission2)).SetBurst(0, burst); launchWallCollisionEffect.GetComponent<EffectComponent>().soundName = ""; AddNewEffectDef(launchWallCollisionEffect, "Play_hedgehogutils_launch_collide"); AddNewEffectDef(launchWallCollisionLargeEffect, "Play_hedgehogutils_launch_collide_large"); }; } private static GameObject CreateLaunchHitEffect(GameObject baseHitEffect, string name, Color ringColor, Color beamColor) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: 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_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) GameObject val = PrefabAPI.InstantiateClone(baseHitEffect, name); val.AddComponent<NetworkIdentity>(); Object.Destroy((Object)(object)val.GetComponent<ParticleSystem>()); MainModule main = ((Component)val.transform.Find("Ring")).gameObject.GetComponent<ParticleSystem>().main; ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(ringColor); MainModule main2 = ((Component)val.transform.Find("Beams")).gameObject.GetComponent<ParticleSystem>().main; ((MainModule)(ref main2)).startColor = MinMaxGradient.op_Implicit(beamColor); Object.Destroy((Object)(object)((Component)val.transform.Find("Mesh")).gameObject); Object.Destroy((Object)(object)((Component)val.transform.Find("Point Light")).gameObject); val.GetComponent<EffectComponent>().soundName = "Play_beetle_guard_impact"; AddNewEffectDef(val, ""); return val; } public static void SuperForm() { //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: 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_0081: 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_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) superFormTransformationEffect = LoadEffect("SonicSuperTransformation"); if (Object.op_Implicit((Object)(object)superFormTransformationEffect)) { ShakeEmitter val = superFormTransformationEffect.AddComponent<ShakeEmitter>(); val.amplitudeTimeDecay = true; val.duration = 0.7f; val.radius = 200f; val.scaleShakeRadiusWithLocalScale = false; val.wave = new Wave { amplitude = 0.7f, frequency = 40f, cycleOffset = 0f }; } ReplaceRainbow(superFormTransformationEffect.transform.Find("Rainbow")); transformationEmeraldSwirl = LoadEffect("SonicChaosEmeraldSwirl"); superFormAura = LoadAsyncedEffect("SonicSuperAura"); ReplaceRainbow(superFormAura.transform.Find("Rainbow"), subtle: true); superFormWarning = LoadEffect("SonicSuperWarning"); superFormWarning.AddComponent<DestroyOnExitForm>(); EffectComponent component = superFormWarning.GetComponent<EffectComponent>(); component.parentToReferencedTransform = true; AsyncOperationHandle<Material> val2 = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/LunarGolem/matLunarGolemShield.mat"); val2.Completed += delegate(AsyncOperationHandle<Material> x) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_0030: 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) superFormOverlay = new Material(x.Result); superFormOverlay.SetColor("_TintColor", new Color(1f, 0.8f, 0.4f, 1f)); superFormOverlay.SetColor("_EmissionColor", new Color(1f, 0.8f, 0.4f, 1f)); superFormOverlay.SetFloat("_OffsetAmount", 0.01f); }; superLoopSoundDef = ScriptableObject.CreateInstance<LoopSoundDef>(); superLoopSoundDef.startSoundName = "Play_hedgehogutils_super_loop"; superLoopSoundDef.stopSoundName = "Stop_hedgehogutils_super_loop"; superFormPPVolume = mainAssetBundle.LoadAsset<GameObject>("SonicSuperPostProcess"); PostProcessVolume component2 = superFormPPVolume.GetComponent<PostProcessVolume>(); component2.sharedProfile = Addressables.LoadAssetAsync<PostProcessProfile>((object)"RoR2/Base/title/PostProcessing/ppLocalGrandparent.asset").WaitForCompletion(); } public static void ReplaceRainbow(Transform particle, bool subtle = false) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) ParticleSystemRenderer component = ((Component)particle).GetComponent<ParticleSystemRenderer>(); ((Renderer)component).sharedMaterial = (subtle ? rainbowGlowSubtleMaterial : rainbowGlowMaterial); component.mesh = Addressables.LoadAssetAsync<Mesh>((object)"RoR2/Base/Common/VFX/mdlVFXDonut1.fbx").WaitForCompletion(); } public static void Miscellaneous() { //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_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Expected O, but got Unknown //IL_00d2: 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) rainbowGlowMaterial = new Material(Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC2/Elites/EliteBead/matEliteBeadSpikeGrowthRing.mat").WaitForCompletion()); rainbowGlowMaterial.SetTexture("_RemapTex", mainAssetBundle.LoadAsset<Texture>("texRampRainbow")); rainbowGlowMaterial.SetFloat("_Boost", 10f); rainbowGlowSubtleMaterial = new Material(rainbowGlowMaterial); rainbowGlowSubtleMaterial.SetFloat("_Boost", 1.5f); AsyncOperationHandle<Material> val = Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC2/Elites/EliteAurelionite/matEliteAurelioniteAffixOverlay.mat"); val.Completed += delegate(AsyncOperationHandle<Material> x) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) ringMaterial = new Material(x.Result); ringMaterial.SetFloat("_NormalStrength", 0f); ringMaterial.SetColor("_Color", new Color(0.9f, 0.8f, 0.1f, 1f)); }; chaosSnapMaterial = new Material(Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Huntress/matHuntressSwipe.mat").WaitForCompletion()); chaosSnapMaterial.SetTexture("_RemapTex", Addressables.LoadAssetAsync<Texture>((object)"RoR2/Base/Common/ColorRamps/texRampLightning2.png").WaitForCompletion()); chaosSnapInEffect = CreateChaosSnapEffect("ChaosSnapInVFX", teleportIn: true); chaosSnapOutEffect = CreateChaosSnapEffect("ChaosSnapOutVFX", teleportIn: false); chaosSnapSoundEventDef = CreateNetworkSoundEventDef("Play_hedgehogutils_teleport"); chaosSnapLargeSoundEventDef = CreateNetworkSoundEventDef("Play_hedgehogutils_teleport_large"); } public static GameObject CreateChaosSnapEffect(string assetBundlePrefabName, bool teleportIn) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: 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) GameObject val = mainAssetBundle.LoadAsset<GameObject>(assetBundlePrefabName); VFXAttributes val2 = val.AddComponent<VFXAttributes>(); val2.vfxPriority = (VFXPriority)1; ParticleSystem component = ((Component)val.transform.Find("TeleportLine")).GetComponent<ParticleSystem>(); ParticleSystemRenderer component2 = ((Component)component).GetComponent<ParticleSystemRenderer>(); ParticleSystem component3 = ((Component)val.transform.Find("Distortion")).GetComponent<ParticleSystem>(); ParticleSystemRenderer component4 = ((Component)component3).GetComponent<ParticleSystemRenderer>(); ParticleSystem component5 = ((Component)val.transform.Find("Flash")).GetComponent<ParticleSystem>(); ParticleSystemRenderer component6 = ((Component)component5).GetComponent<ParticleSystemRenderer>(); val.AddComponent<DestroyOnParticleEnd>().trackedParticleSystem = component; ScaleParticleSystemDuration val3 = val.AddComponent<ScaleParticleSystemDuration>(); val3.initialDuration = 0.5f; val3.particleSystems = (ParticleSystem[])(object)new ParticleSystem[3] { component, component3, component5 }; Transform val4 = val.transform.Find("Point Light"); val2.optionalLights = (Light[])(object)new Light[1] { ((Component)val4).GetComponent<Light>() }; LightIntensityCurve val5 = ((Component)val4).gameObject.AddComponent<LightIntensityCurve>(); val5.curve = (teleportIn ? AnimationCurve.EaseInOut(0f, 0f, 1f, 1f) : AnimationCurve.EaseInOut(0f, 1f, 1f, 0f)); val5.timeMax = 0.5f; ((Renderer)component2).sharedMaterial = chaosSnapMaterial; ((Renderer)component4).sharedMaterial = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Common/VFX/matInverseDistortion.mat").WaitForCompletion(); ((Renderer)component6).sharedMaterial = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Common/VFX/matGenericFlash.mat").WaitForCompletion(); EffectComponent val6 = val.AddComponent<EffectComponent>(); val6.applyScale = true; val6.applyScaleFirst = true; val6.positionAtReferencedTransform = false; val.AddComponent<ChaosSnapVFX>().reverse = teleportIn; AddNewEffectDef(val); return val; } public static GameObject MaterialSwap(GameObject prefab, string assetPath, string pathToParticle = "") { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) Transform val = prefab.transform.Find(pathToParticle); if (Object.op_Implicit((Object)(object)val)) { ((Renderer)((Component)val).GetComponent<ParticleSystemRenderer>()).sharedMaterial = Addressables.LoadAssetAsync<Material>((object)assetPath).WaitForCompletion(); } return prefab; } public static GameObject MaterialSwap(GameObject prefab, Material material, string pathToParticle = "") { Transform val = prefab.transform.Find(pathToParticle); if (Object.op_Implicit((Object)(object)val)) { ((Renderer)((Component)val).GetComponent<ParticleSystemRenderer>()).sharedMaterial = material; } return prefab; } public static GameObject CreateNewBoostFlash(string name, float size, float alpha, Color color1, Color color2, Color color3, Color lightColor) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: 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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: 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_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: 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_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: 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_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //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) GameObject val = PrefabAPI.InstantiateClone(powerBoostFlashEffect, name); AddNewEffectDef(val); MainModule main = ((Component)val.transform.Find("BlueCone")).GetComponent<ParticleSystem>().main; MinMaxCurve startSize = ((MainModule)(ref main)).startSize; ((MainModule)(ref main)).startSize = new MinMaxCurve(((MinMaxCurve)(ref startSize)).constant * size); MainModule main2 = ((Component)val.transform.Find("BlueCone/BlueCone2")).GetComponent<ParticleSystem>().main; startSize = ((MainModule)(ref main2)).startSize; ((MainModule)(ref main2)).startSize = new MinMaxCurve(((MinMaxCurve)(ref startSize)).constant * size); ParticleSystemRenderer component = ((Component)val.transform.Find("BlueCone")).GetComponent<ParticleSystemRenderer>(); ((Renderer)component).material = CreateNewBoostMaterial(alpha, color1, color2, color3); ParticleSystemRenderer component2 = ((Component)val.transform.Find("BlueCone/BlueCone2")).GetComponent<ParticleSystemRenderer>(); ((Renderer)component2).material = CreateNewBoostMaterial(alpha, color1, color2, color3); MainModule main3 = ((Component)val.transform.Find("BlueCone/StartFlash")).GetComponent<ParticleSystem>().main; if (lightColor == Color.black) { LightsModule lights = ((Component)val.transform.Find("BlueCone/StartFlash")).GetComponent<ParticleSystem>().lights; ((LightsModule)(ref lights)).enabled = false; } else { ((MainModule)(ref main3)).startColor = MinMaxGradient.op_Implicit(lightColor); ((Component)val.transform.Find("BlueCone/StartFlash/Point Light")).GetComponent<Light>().color = lightColor; } return val; } public static GameObject CreateNewBoostAura(string name, float size, float alpha, Color color1, Color color2, Color color3, Color lightColor) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) GameObject val = PrefabAPI.InstantiateClone(powerBoostAuraEffect, name); Transform obj = val.transform.Find("Aura"); obj.localScale *= size; ((Renderer)((Component)val.transform.Find("Aura")).GetComponent<MeshRenderer>()).material = CreateNewBoostMaterial(alpha, color1, color2, color3); if (lightColor == Color.black) { ((Behaviour)((Component)val.transform.Find("Point Light")).GetComponent<Light>()).enabled = false; } else { ((Component)val.transform.Find("Point Light")).GetComponent<Light>().color = lightColor; } return val; } private static Material CreateNewBoostMaterial(float alpha, Color color1, Color color2, Color color3) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0036: 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) Material val = new Material(mainAssetBundle.LoadAsset<Material>("matPowerBoost")); val.SetFloat("_AlphaBoost", alpha); val.SetColor("_Color1", color1); val.SetColor("_Color2", color2); val.SetColor("_Color3", color3); return val; } private static NetworkSoundEventDef CreateNetworkSoundEventDef(string eventName) { NetworkSoundEventDef val = ScriptableObject.CreateInstance<NetworkSoundEventDef>(); val.akId = AkSoundEngine.GetIDFromString(eventName); val.eventName = eventName; Content.AddNetworkSoundEventDef(val); return val; } private static GameObject LoadEffect(string resourceName) { return LoadEffect(resourceName, "", parentToTransform: false); } private static GameObject LoadEffect(string resourceName, string soundName) { return LoadEffect(resourceName, soundName, parentToTransform: false); } private static GameObject LoadEffect(string resourceName, bool parentToTransform) { return LoadEffect(resourceName, "", parentToTransform); } private static GameObject LoadAsyncedEffect(string resourceName) { GameObject val = mainAssetBundle.LoadAsset<GameObject>(resourceName); val.AddComponent<NetworkIdentity>(); return val; } private static GameObject LoadEffect(string resourceName, string soundName, bool parentToTransform) { //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) GameObject val = mainAssetBundle.LoadAsset<GameObject>(resourceName); if (!Object.op_Implicit((Object)(object)val)) { Log.Error("Failed to load effect: " + resourceName + " because it does not exist in the AssetBundle"); return null; } val.AddComponent<DestroyOnTimer>().duration = 12f; val.AddComponent<NetworkIdentity>(); VFXAttributes val2 = val.AddComponent<VFXAttributes>(); val2.vfxPriority = (VFXPriority)2; val2.DoNotPool = true; EffectComponent val3 = val.AddComponent<EffectComponent>(); val3.applyScale = false; val3.effectIndex = (EffectIndex)(-1); val3.parentToReferencedTransform = parentToTransform; val3.positionAtReferencedTransform = true; val3.soundName = soundName; AddNewEffectDef(val, soundName); return val; } private static void AddNewEffectDef(GameObject effectPrefab) { AddNewEffectDef(effectPrefab, ""); } private static void AddNewEffectDef(GameObject effectPrefab, string soundName) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown EffectDef val = new EffectDef(); val.prefab = effectPrefab; val.prefabEffectComponent = effectPrefab.GetComponent<EffectComponent>(); val.prefabName = ((Object)effectPrefab).name; val.prefabVfxAttributes = effectPrefab.GetComponent<VFXAttributes>(); val.spawnSoundEventName = soundName; Content.AddEffectDef(val); } } public static class Buffs { public static BuffDef superFormBuff; public static BuffDef launchedBuff; public static BuffDef chaosSnapRandomIdentifierBuff; internal static void RegisterBuffs() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_004a: 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) superFormBuff = AddNewBuff("bdHedgehogSuperForm", Assets.mainAssetBundle.LoadAsset<Sprite>("texSuperBuffIcon"), Color.white, canStack: false, isDebuff: false, hidden: false); launchedBuff = AddNewBuff("bdHedgehogLaunch", LegacyResourcesAPI.Load<BuffDef>("BuffDefs/Weak").iconSprite, new Color(1f, 1f, 1f), canStack: false, isDebuff: false, hidden: true); chaosSnapRandomIdentifierBuff = AddNewBuff("bdHedgehogChaosSnap", LegacyResourcesAPI.Load<BuffDef>("BuffDefs/Weak").iconSprite, new Color(1f, 1f, 1f), canStack: false, isDebuff: false, hidden: true); } internal static BuffDef AddNewBuff(string buffName, Sprite buffIcon, Color buffColor, bool canStack, bool isDebuff, bool hidden) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) BuffDef val = ScriptableObject.CreateInstance<BuffDef>(); ((Object)val).name = buffName; val.buffColor = buffColor; val.canStack = canStack; val.isDebuff = isDebuff; val.eliteDef = null; val.iconSprite = buffIcon; val.isHidden = hidden; Content.AddBuffDef(val); return val; } } public static class Config { public static ConfigEntry<bool> EnableLogs() { return ((BaseUnityPlugin)HedgehogUtilsPlugin.instance).Config.Bind<bool>("Misc.", "Enable Logs", false, "This controls whether this mod will put any information in the logs. This information can help the mod creator fix issues should any come up, but it does impact performance a bit. Default is false."); } public static ConfigEntry<bool> AnnounceSuperTransformation() { return ((BaseUnityPlugin)HedgehogUtilsPlugin.instance).Config.Bind<bool>("Forms", "Announce Super Transformation", false, "If true, a message will be sent in chat when someone transforms. The message will include the name of the player who transformed. The message won't be sent for anyone who transforms in the 10 second window after someone else transforms. Host's config takes priority. Default is false."); } public static ConfigEntry<int> EmeraldsPerStage() { return ((BaseUnityPlugin)HedgehogUtilsPlugin.instance).Config.Bind<int>("Chaos Emeralds", "Emeralds Per Stage", 3, "The maximum number of Chaos Emeralds that can spawn in one stage. Host's config takes priority. Default is 3."); } public static ConfigEntry<int> EmeraldsPerSimulacrumStage() { return ((BaseUnityPlugin)HedgehogUtilsPlugin.instance).Config.Bind<int>("Chaos Emeralds", "Emeralds Per Simulacrum Stage", 5, "The maximum number of Chaos Emeralds that can spawn in one stage in Simulacrum. Host's config takes priority. Default is 5."); } public static ConfigEntry<int> EmeraldCost() { return ((BaseUnityPlugin)HedgehogUtilsPlugin.instance).Config.Bind<int>("Chaos Emeralds", "Cost", 50, "How much it costs to buy a Chaos Emerald. Host's config takes priority. Default is 50.\nFor reference:\nChest: 25\nLarge Chest: 50\nAltar of Gold: 200\nLegendary Chest: 400"); } public static ConfigEntry<FormItemSharing> NeededItemSharing() { return ((BaseUnityPlugin)HedgehogUtilsPlugin.instance).Config.Bind<FormItemSharing>("Chaos Emeralds", "Item Sharing", FormItemSharing.All, "Handles how Chaos Emeralds are shared between teammates and determines who has permission to transform based on the items they have. The restrictions only apply to the first person to transform and don't apply to anyone who transforms in the 10 second window afterwards. Host's config takes priority. Default is All.\n\nAssuming all items have been collected across the team...\nAll: Anyone, whether they HAVE ANY ITEMS OR NOT, can transform.\nContributor: Players that have AT LEAST ONE of the needed items can transform\nMajorityRule: The player(s) with the MAJORITY number of the needed items can transform\nNone: Only the player with ALL items can transform\n\nWARNING: A mod that lets you drop items to your teammates is reccommended if you are changing this setting. Otherwise, transforming may be impossible if items are split between players in certain ways."); } public static ConfigEntry<bool> SuperFormInvincible() { return ((BaseUnityPlugin)HedgehogUtilsPlugin.instance).Config.Bind<bool>("Super Form", "Invincible", true, $"Whether the Super form grants complete invincibility. Without invincibility, the Super form grants {200} armor. Host's config takes priority. Default is true."); } public static ConfigEntry<float> SuperFormDuration() { return ((BaseUnityPlugin)HedgehogUtilsPlugin.instance).Config.Bind<float>("Super Form", "Duration", 50f, "How long the Super form will last in seconds. Host's config takes priority. Default is 50."); } public static ConfigEntry<bool> ConsumeEmeraldsOnUse() { return ((BaseUnityPlugin)HedgehogUtilsPlugin.instance).Config.Bind<bool>("Super Form", "Consume Emeralds On Use", true, "Whether the Chaos Emeralds will be consumed when transforming into Super Sonic. If not, the emeralds will stay but won't be able to be used until the next stage. Host's config takes priority. Default is true."); } public static ConfigEntry<bool> SuperFormPostProcessing() { return ((BaseUnityPlugin)HedgehogUtilsPlugin.instance).Config.Bind<bool>("Super Form", "Post Processing", true, "Whether the Super form subtly tints the screen yellow. Default is true."); } public static ConfigEntry<bool> LaunchBodyBlacklist() { return ((BaseUnityPlugin)HedgehogUtilsPlugin.instance).Config.Bind<bool>("Launch", "Use Body Blacklist", true, "Determines whether certain characters, such as final bosses and worms, are impossible to be launched. Regardless of what this value is set to, launching may fail for other reasons, such as the target having knockback immunity or being too high mass. Host's config takes priority. Default is true."); } public static ConfigEntry<float> BoostMeterLocationX() { return ((BaseUnityPlugin)HedgehogUtilsPlugin.instance).Config.Bind<float>("Boost", "X Location", 90f, "X Coordinate of the boost meter's location relative to the crosshair. Default is 90."); } public static ConfigEntry<float> BoostMeterLocationY() { return ((BaseUnityPlugin)HedgehogUtilsPlugin.instance).Config.Bind<float>("Boost", "Y Location", -50f, "Y Coordinate of the boost meter's location relative to the crosshair. Default is -50."); } public static void RiskOfOptionsSetup() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0058: 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_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Expected O, but got Unknown //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Expected O, but got Unknown //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Expected O, but got Unknown //IL_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 //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Expected O, but got Unknown //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Expected O, but got Unknown //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Expected O, but got Unknown //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Expected O, but got Unknown //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Expected O, but got Unknown //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Expected O, but got Unknown //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Expected O, but got Unknown //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Expected O, but got Unknown //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Expected O, but got Unknown //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Expected O, but got Unknown Sprite modIcon = Assets.mainAssetBundle.LoadAsset<Sprite>("texSuperBuffIcon"); ModSettingsManager.SetModIcon(modIcon); ModSettingsManager.AddOption((BaseOption)new IntSliderOption(EmeraldsPerStage(), new IntSliderConfig { min = 1, max = 7 })); ModSettingsManager.AddOption((BaseOption)new IntSliderOption(EmeraldsPerSimulacrumStage(), new IntSliderConfig { min = 1, max = 7 })); ModSettingsManager.AddOption((BaseOption)new IntSliderOption(EmeraldCost(), new IntSliderConfig { min = 0, max = 400 })); EmeraldCost().SettingChanged += ChaosEmeraldInteractable.UpdateInteractableCost; ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(ConsumeEmeraldsOnUse())); ConsumeEmeraldsOnUse().SettingChanged += SuperFormDef.UpdateConsumeEmeraldsConfig; ModSettingsManager.AddOption((BaseOption)new ChoiceOption((ConfigEntryBase)(object)NeededItemSharing())); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(AnnounceSuperTransformation())); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(SuperFormInvincible())); SuperFormInvincible().SettingChanged += SuperFormDef.UpdateSuperFormInvincibleConfig; ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(SuperFormPostProcessing())); ModSettingsManager.AddOption((BaseOption)new SliderOption(SuperFormDuration(), new SliderConfig { min = 15f, max = 600f, formatString = "{0:0}s" })); SuperFormDuration().SettingChanged += SuperFormDef.UpdateSuperFormDurationConfig; ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(EnableLogs())); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(LaunchBodyBlacklist())); float min = -500f; float max = 500f; ModSettingsManager.AddOption((BaseOption)new SliderOption(BoostMeterLocationX(), new SliderConfig { min = min, max = max, formatString = "{0:0}" })); ModSettingsManager.AddOption((BaseOption)new SliderOption(BoostMeterLocationY(), new SliderConfig { min = min, max = max, formatString = "{0:0}" })); } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.ds_gaming.HedgehogUtils", "HedgehogUtils", "1.1.5")] public class HedgehogUtilsPlugin : BaseUnityPlugin { public const string PluginGUID = "com.ds_gaming.HedgehogUtils"; public const string PluginAuthor = "ds_gaming"; public const string PluginName = "HedgehogUtils"; public const string PluginVersion = "1.1.5"; public const string Prefix = "DS_GAMING_HEDGEHOG_UTILS_"; public static HedgehogUtilsPlugin instance; public static bool lookingGlassLoaded; public static bool riskOfOptionsLoaded; public void Awake() { instance = this; Log.Init(((BaseUnityPlugin)this).Logger); lookingGlassLoaded = Chainloader.PluginInfos.ContainsKey("droppod.lookingglass"); Log.Message("Looking Glass exists? " + lookingGlassLoaded); riskOfOptionsLoaded = Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions"); Log.Message("Risk of Options exists? " + riskOfOptionsLoaded); Assets.Initialize(); Buffs.RegisterBuffs(); Items.RegisterItems(); SuperFormDef.Initialize(); HedgehogUtils.Miscellaneous.DamageTypes.Initialize(); ChaosEmeraldInteractable.Initialize(); Stats.Initialize(); Artifact.Initialize(); HedgehogUtils.Launch.DamageTypes.Initialize(); LaunchManager.Initialize(); ChaosSnapManager.Initialize(); MomentumStats.Initialize(); OnHooks.Initialize(); Language.Initialize(); States.RegisterStates(); if (riskOfOptionsLoaded) { Config.RiskOfOptionsSetup(); } NetworkingAPI.RegisterMessageType<NetworkTransformation>(); new ContentPacks().Initialize(); } } public static class Helpers { public static string ScepterDescription(string desc) { return "\n<color=#d299ff>SCEPTER: " + desc + "</color>"; } public static string SuperFormText(string desc) { return "<color=#ffee00>" + desc + "</color>"; } public static T[] Append<T>(ref T[] array, List<T> list) { int num = array.Length; int count = list.Count; Array.Resize(ref array, num + count); list.CopyTo(array, num); return array; } public static Func<T[], T[]> AppendDel<T>(List<T> list) { return (T[] r) => Append(ref r, list); } public static void RemoveTempOrPermanentItem(this Inventory inventory, ItemIndex item, int count) { //IL_000f: 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_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)inventory)) { int num = count; if (inventory.GetItemCountTemp(item) > 0) { int num2 = Math.Min(inventory.GetItemCountTemp(item), num); inventory.RemoveItemTemp(item, (float)num2); num -= num2; } if (num > 0) { inventory.RemoveItemPermanent(item, Math.Min(inventory.GetItemCountPermanent(item), num)); } } } public static bool Flying(GameObject gameObject, out ICharacterFlightParameterProvider flight) { if (Object.op_Implicit((Object)(object)gameObject)) { flight = gameObject.GetComponent<ICharacterFlightParameterProvider>(); return Flying(flight); } flight = null; return false; } public static bool Flying(GameObject gameObject) { ICharacterFlightParameterProvider flight; return Flying(gameObject, out flight); } public static bool Flying(ICharacterFlightParameterProvider flight) { return flight != null && flight.isFlying; } public static void EndChrysalis(GameObject gameObject) { if (NetworkServer.active) { JetpackController val = JetpackController.FindJetpackController(gameObject); if (Object.op_Implicit((Object)(object)val) && val.stopwatch >= val.duration) { Object.Destroy((Object)(object)((Component)val).gameObject); } } } public static T CopySkillDef<T>(SkillDef originDef) where T : SkillDef { //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_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) T val = ScriptableObject.CreateInstance<T>(); ((SkillDef)val).skillName = originDef.skillName; ((Object)(object)val).name = ((Object)originDef).name; ((SkillDef)val).skillNameToken = originDef.skillNameToken; ((SkillDef)val).skillDescriptionToken = originDef.skillDescriptionToken; ((SkillDef)val).icon = originDef.icon; ((SkillDef)val).activationState = originDef.activationState; ((SkillDef)val).activationStateMachineName = originDef.activationStateMachineName; ((SkillDef)val).baseMaxStock = originDef.baseMaxStock; ((SkillDef)val).baseRechargeInterval = originDef.baseRechargeInterval; ((SkillDef)val).beginSkillCooldownOnSkillEnd = originDef.beginSkillCooldownOnSkillEnd; ((SkillDef)val).canceledFromSprinting = originDef.canceledFromSprinting; ((SkillDef)val).forceSprintDuringState = originDef.forceSprintDuringState; ((SkillDef)val).fullRestockOnAssign = originDef.fullRestockOnAssign; ((SkillDef)val).interruptPriority = originDef.interruptPriority; ((SkillDef)val).resetCooldownTimerOnUse = originDef.resetCooldownTimerOnUse; ((SkillDef)val).isCombatSkill = originDef.isCombatSkill; ((SkillDef)val).mustKeyPress = originDef.mustKeyPress; ((SkillDef)val).cancelSprintingOnActivation = originDef.cancelSprintingOnActivation; ((SkillDef)val).rechargeStock = originDef.rechargeStock; ((SkillDef)val).requiredStock = originDef.requiredStock; ((SkillDef)val).stockToConsume = originDef.stockToConsume; ((SkillDef)val).keywordTokens = originDef.keywordTokens; return val; } public static T CopyBoostSkillDef<T>(HedgehogUtils.Boost.SkillDefs.BoostSkillDef originDef) where T : SkillDef, HedgehogUtils.Boost.SkillDefs.IBoostSkill { //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_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) SerializableEntityStateType boostIdleState = originDef.boostIdleState; SerializableEntityStateType brakeState = originDef.brakeState; T val = CopySkillDef<T>((SkillDef)(object)originDef); val.boostIdleState = boostIdleState; val.brakeState = brakeState; val.boostHUDColor = originDef.boostHUDColor; return val; } public static T CopyBoostSkillDef<T>(HedgehogUtils.Boost.SkillDefs.RequiresFormBoostSkillDef originDef) where T : SkillDef, HedgehogUtils.Boost.SkillDefs.IBoostSkill { //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_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) SerializableEntityStateType boostIdleState = originDef.boostIdleState; SerializableEntityStateType brakeState = originDef.brakeState; T val = CopySkillDef<T>((SkillDef)(object)originDef); val.boostIdleState = boostIdleState; val.brakeState = brakeState; val.boostHUDColor = originDef.boostHUDColor; return val; } } public static class Language { public const string launchKeyword = "DS_GAMING_HEDGEHOG_UTILS_LAUNCH_KEYWORD"; public const string momentumPassiveNameToken = "DS_GAMING_HEDGEHOG_UTILS_MOMENTUM_PASSIVE_NAME"; public const string momentumPassiveDescriptionToken = "DS_GAMING_HEDGEHOG_UTILS_MOMENTUM_PASSIVE_DESCRIPTION"; public const string EGGFACE_LINE_0 = " /"; public const string EGGFACE_LINE_1 = "X\\ / O___O"; public const string EGGFACE_LINE_2 = " \\H\\L=_/ \\_="; public const string EGGFACE_LINE_3 = " _+X/\\| | |/"; public const string EGGFACE_LINE_4 = " \\"; public static void Initialize() { string text = "<color=#ffee00>"; LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_SUPER_FORM_PREFIX", "Super {0}"); LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_SUPER_FORM", "Super"); LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_SUPER_FORM_ANNOUNCE_TEXT", text + "<size=110%>{0} has transformed into their {1} form!</color></size>"); LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_SUPER_FORM_ANNOUNCE_TEXT_2P", text + "<size=110%>You transformed into your {1} form!</color></size>"); LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_ARTIFACT_CHAOS_EMERALD_NAME", "Artifact of Chaos Emeralds"); LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_ARTIFACT_CHAOS_EMERALD_DESCRIPTION", "The Chaos Emeralds are scattered across the planet."); LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_EMERALD_TEMPLE_NAME", "Chaos Emerald"); LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_EMERALD_TEMPLE_CONTEXT", "Receive Emerald"); LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_EMERALD_TEMPLE_INSPECT", "When activated by a survivor the Chaos Emerald will be dropped. Once all seven are collected, survivors can transform into their Super form."); LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_EMERALD_TEMPLE_TITLE", "Chaos Emerald"); LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_EMERALD_TEMPLE_YELLOW", "Chaos Emerald: Yellow"); LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_EMERALD_TEMPLE_BLUE", "Chaos Emerald: Blue"); LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_EMERALD_TEMPLE_RED", "Chaos Emerald: Red"); LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_EMERALD_TEMPLE_GRAY", "Chaos Emerald: Gray"); LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_EMERALD_TEMPLE_GREEN", "Chaos Emerald: Green"); LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_EMERALD_TEMPLE_CYAN", "Chaos Emerald: Cyan"); LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_EMERALD_TEMPLE_PURPLE", "Chaos Emerald: Purple"); string text2 = " of the <style=cIsUtility>seven</style> Chaos Emeralds." + Environment.NewLine + string.Format("When all <style=cIsUtility>seven</style> are collected by you and/or other players, press {0} to transform into your {1} for {2} seconds. Transforming increases <style=cIsDamage>damage</style> by <style=cIsDamage>+{3}%</style>. Increases <style=cIsDamage>attack speed</style> by <style=cIsDamage>+{4}%</style>. Increases <style=cIsUtility>movement speed</style> by <style=cIsUtility>+{5}%</style>. Grants <style=cIsHealing>complete invincibility</style> and <style=cIsUtility>flight</style>. Certain <style=cIsUtility>characters</style> have {6}.", Helpers.SuperFormText("V"), Helpers.SuperFormText("Super Form"), Helpers.SuperFormText(50f.ToString()), 100f, 30.000002f, 100f, Helpers.SuperFormText("all of their skills upgraded")) + Environment.NewLine + Environment.NewLine + "This will <style=cIsUtility>consume</style> all seven Chaos Emeralds."; string text3 = $"One out of seven. When all are collected, transform into your Super form by pressing V, granting invincibility, flight, and incredible power for {50f} seconds. Consumed on use."; LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_YELLOW_EMERALD", "Chaos Emerald: <style=cIsDamage>Yellow</style>"); LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_YELLOW_EMERALD_PICKUP", text3); LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_YELLOW_EMERALD_DESC", "<style=cIsDamage>One</style>" + text2); LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_BLUE_EMERALD", "Chaos Emerald: <color=#2b44d6>Blue</color>"); LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_BLUE_EMERALD_PICKUP", text3); LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_BLUE_EMERALD_DESC", "<color=#2b44d6>One</color>" + text2); LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_RED_EMERALD", "Chaos Emerald: <style=cDeath>Red</style>"); LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_RED_EMERALD_PICKUP", text3); LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_RED_EMERALD_DESC", "<style=cDeath>One</style>" + text2); LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_GRAY_EMERALD", "Chaos Emerald: <color=#b8c5d6>Gray</color>"); LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_GRAY_EMERALD_PICKUP", text3); LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_GRAY_EMERALD_DESC", "<color=#b8c5d6>One</color>" + text2); LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_GREEN_EMERALD", "Chaos Emerald: <style=cIsHealing>Green</style>"); LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_GREEN_EMERALD_PICKUP", text3); LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_GREEN_EMERALD_DESC", "<style=cIsHealing>One</style>" + text2); LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_CYAN_EMERALD", "Chaos Emerald: <style=cIsUtility>Cyan</style>"); LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_CYAN_EMERALD_PICKUP", text3); LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_CYAN_EMERALD_DESC", "<style=cIsUtility>One</style>" + text2); LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_PURPLE_EMERALD", "Chaos Emerald: <color=#c437c0>Purple</color>"); LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_PURPLE_EMERALD_PICKUP", text3); LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_PURPLE_EMERALD_DESC", "<color=#c437c0>One</color>" + text2); string text4 = "\n\n<style=cMono>Translation Errors:</style>\n"; int num = 3; LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_BLUE_EMERALD_LORE", EggFace("<style=cMono>Welcome to the Egg-Net archives.", num - 13, "$ Combing for data relevant to", num, "$ \"Ancients and Chaos Emeralds\"...", num, "$ Results found in folder: Starfall", num, "$ Translating audio file...", num) + "$ Displaying result [1/7].</style>\n\nThat sight is burned into my memory. The sight of the fiery rift burned straight through the planet's surface. Our entire homeworld crumbled to the sheer power of that entity mere moments after its appearance eclipsed our sun. I'm one of the few that made it off the planet before the attack.\n\nSeven Chaos Emeralds divided amongst our ships provided enough power for us to escape, flying blindly into outer space. The Chaos Emeralds continuously produce energy. One emerald is enough to power a small fleet of ships, all flying fast enough to outrun that thing that destroyed our world. With the power of the emeralds, we could flee indefinitely.\n\nWe could continue furthering the gap between us such that it could never reach us again. We could keep on running. Never turn back.\n\nWho am I kidding? Running endlessly would be unbearable. Who could possibly live like that forever?"); LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_CYAN_EMERALD_LORE", EggFace("<style=cMono>Welcome to the Egg-Net archives.", num - 13, "$ Combing for data relevant to", num, "$ \"Ancients and Chaos Emeralds\"...", num, "$ Results found in folder: Starfall", num, "$ Translating audio file...", num) + "$ Displaying result [2/7].</style>\n\nThere's far more to the Chaos Emeralds than we know about. It couldn't have just been random chance that drew us to this world. The emeralds reacted to something.. no.. something took control of the emeralds, and by extension, our ships. We were forced to land on this planet by that force.\n\nWe landed not far from its source, a lone emerald much like our Chaos Emeralds, but far larger. Fascinating how things from different worlds have such a deep connection to eachother. This connection needs to be studied further, I believe it can lead to a breakthrough in our understanding of these emeralds. Imagine what miracles could come from further harnessing the emeralds' power.\n\nSince our arrival on this planet, we have been scanning this planet. With this, we'll know everything we need to know about this planet, including information on all of its native life.\n\nThe initial results of our scans show no signs of developed civilizations. We will continue gathering data as time goes on, but these initial results paint a clear picture of what this planet's native inhabitants are like. This world is primitive, many millenia behind us. Hypothetically speaking, there would be nothing on this planet that could resist an incursion from us.\n\nWe will isolate ourselves on this uninhabited archipelago to avoid interfering too much with this world's life. With our numbers so slim, these islands have plenty of room for us. Besides, we are no conquerors.\n\nNo one should have their home taken away from them."); LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_GRAY_EMERALD_LORE", EggFace("<style=cMono>Welcome to the Egg-Net archives.", num - 13, "$ Combing for data relevant to", num, "$ \"Ancients and Chaos Emeralds\"...", num, "$ Results found in folder: Starfall", num, "$ Translating audio file...", num) + "$ Displaying result [3/7].</style>\n\nThoughts are power. The power of the Chaos Emeralds is closely tied to the user's thoughts. Our hearts enrich the power of the Chaos Emeralds, which in turn, grant us protection in our dire moments. To preserve our thoughts is to preserve the power to keep moving. To preserve our past is to preserve our future. That is the foundation on which Cyber Space was created.\n\nCyber Space is a dimension which stored information on everything about us. Our history, our memories, our desires. Every aspect of us as individuals can be uploaded and stored in Cyber Space at any time. The digital copies of us can think, feel, and speak just as their true selves can. It's too late for those we lost from our homeworld. But with this, we can \"save people\". We will never truly lose someone ever again.\n\nMaybe that's a bit too optimistic. As much I want to truly be able to save people, I can't ignore that the copies stored in Cyber Space are not perfect recreations of their true selves.\n\nStrange results have repeatedly appeared in stress tests of the system. When left unchecked for too long, the functioning minds of people within Cyber Space tend to trap themselves within a loop. Memories with strong emotions tied to them, especially those of regret, fester until they gradually take over the mind's ability to process information. Their perception of time and the world around them start to degrade, confusing past with present.\n\nThese issues can be managed with maintenance, but the existence of these problems is concerning. Is it a flaw in Cyber Space's data storage? Or, is the problem not with Cyber Space, but something that originates from much deeper within the mind? Memory truly is a finicky thing."); LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_GREEN_EMERALD_LORE", EggFace("<style=cMono>Welcome to the Egg-Net archives.", num - 13, "$ Combing for data relevant to", num, "$ \"Ancients and Chaos Emeralds\"...", num, "$ Results found in folder: Starfall", num, "$ Translating audio file...", num) + "$ Displaying result [4/7].</style>\n\nSorry for the danger we've brought upon this world.\n\nThat entity has been detected quickly approaching this planet. It must've followed us after we escaped its last attack. I had thought it to be a mindless destructive force, but these actions imply a level of intelligence and determination. Running away will only delay its inevitable return while putting more lives in harm's way.\n\nThe Chaos Emeralds bring our thoughts to life. Thoughts of fear had manifested as the speed that let us escape its previous attack.\n\nLet the emeralds sense that there are no longer thoughts of cowardice among our warriors.\n\nLet them sense our resolve to protect this planet we now call home.\n\nLet our hearts draw out their true power. Only that power could stand before that monster's unthinkable might."); LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_PURPLE_EMERALD_LORE", EggFace("<style=cMono>Welcome to the Egg-Net archives.", num - 13, "$ Combing for data relevant to", num, "$ \"Ancients and Chaos Emeralds\"...", num, "$ Results found in folder: Starfall", num, "$ Translating audio file...", num) + "$ Displaying result [5/7].</style>\n\nBefore now, I believed the power of the Chaos Emeralds to be limitless. That entity has made the limits of their power very clear. Our emerald-fueled weapons, with enough force to destroy the planet we stand on, seemed to do nothing against it.\n\nAs it overpowered our best efforts at destroying it, it spoke to us.\n\nIt called itself [The End]. It spoke in our language. It spoke with intelligence and conviction. It spoke of moments of our past that it should never have had a chance to witness.\n\nIt knows every one of us on a personal level. Why would a being with no purpose other than to indiscriminately destroy need to know so much? Is it just another means to an end for it? [The End] is more than just powerful. It's cunning.\n\nWith any attempts at destroying it failing, it was decided we would contain it. Cyber Space turned into [The End]'s prison, completely cut off from the outside world. No matter how great its power, it cannot tear down the walls between dimensions through brute force alone.\n\n[The End] is sealed within Cyber Space. It has no means of escaping on its own. It has no way of interacting with anything outside of Cyber Space.\n\nSo why...\n\nWhy can I still hear it speak?" + text4 + "# [The End] could not be fully translated."); LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_RED_EMERALD_LORE", EggFace("<style=cMono>Welcome to the Egg-Net archives.", num - 13, "$ Combing for data relevant to", num, "$ \"Ancients and Chaos Emeralds\"...", num, "$ Results found in folder: Starfall", num, "$ Translating audio file...", num) + "$ Displaying result [6/7].</style>\n\nI keep forgetting things. No... \"forgetting\" isn't the right word. These memories were never mine to begin with. It's all just environmental data being pulled into my mind. It never stays long. That outside information never meshes well with my head. My real memories end at that moment from thousands of years ago. The last time my consciousness was uploaded here into Cyber Space.\n\nLooking back on it objectively, things had gone quite well. We put a stop to [The End] without bringing destruction to this planet. With that great threat gone, the remainders of our people were able to fade away in peace.\n\nI'm... not exactly sure what happened to us after our battle with [The End]. What happened to the real me? No information was recorded by our people after the battle. All I know is that we didn't last long. If there was a danger, I'm sure there would be some hint as to what it was. I can only assume our last moments were in peace. That's the best conclusion anyone could hope for.\n\nJust escaping our home planet and stopping [The End] from attacking further has been a miracle. Every second we've had since this began has been a gift from the Chaos Emeralds. Now the Chaos Emeralds are our parting gift to this planet. Should they face more great dangers in the future, the Chaos Emeralds will protect them as they had protected us.\n\nAs for me and what's left of our civilization, we'll remain in seclusion so [The End]'s prison can never be found. Not much different from what we've been doing. I've needed some time alone to think anyway..." + text4 + "# [The End] could not be fully translated."); LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_YELLOW_EMERALD_LORE", EggFace("<style=cMono>Welcome to the Egg-Net archives.", num - 13, "$ Combing for data relevant to", num, "$ \"Ancients and Chaos Emeralds\"...", num, "$ Results found in folder: Starfall", num, "$ Translating audio file...", num) + "$ Displaying result [7/7].</style>\n\nIf you were able, would you go change the past? I know of our future and I am satisfied with how everything went. Even if I could return to the past, there's nothing I could do to improve the final outcome of our battle. Yet, I can't stop imagining how things could have gone differently... How I... could have done more than I did.\n\nIt's stupid. I don't know why I keep thinking about this. Going back in time is a delusion. Theoretically, the Chaos Emeralds could warp time and space, but there's no way a living being could withstand it. Only something carefully designed to interface with the emeralds' power would be able to harness their power to such an extent. It would be a dream to go back into my past, even if only to put my mind at ease. Then again, dreams are all I have left. What's the harm in forgetting the present and dreaming once again? The present is for them, not for us.\n\nMaybe this time my dreams will take a different path. Maybe someone will come to save me. Maybe I'll be able to save someone else.\n\nMaybe that will be enough for me to move on."); LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_LAUNCH_KEYWORD", "<style=CKeywordName>Launch</style><style=cSub>Turn the hit enemy into a projectile that <style=cIsUtility>flys in the direction hit</style> and <style=cIsDamage>deals damage</style> to other enemies it hits equal to the damage that launched it.</style>"); LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_MOMENTUM_PASSIVE_NAME", "Momentum"); LanguageAPI.Add("DS_GAMING_HEDGEHOG_UTILS_MOMENTUM_PASSIVE_DESCRIPTION", "<style=cIsUtility>Build up speed</style> by <style=cIsUtility>running down hill</style> to move up to <style=cIsUtility>100% faster</style>. <style=cIsHealth>Lose speed by running up hill to move up to 33% slower.</style>\nIf <style=cIsUtility>flying</style>, <style=cIsUtility>build up speed</style> by <style=cIsUtility>moving in a straight line.</style>"); } public static string EggFace(string line0, int adjust0, string line1, int adjust1, string line2, int adjust2, string line3, int adjust3, string line4, int adjust4) { int num = line0.Length + adjust0; string[] array = new string[5] { line0, line1, line2, line3, line4 }; int[] array2 = new int[5] { adjust0, adjust1, adjust2, adjust3, adjust4 }; for (int i = 1; i < 4; i++) { if (array[i].Length + array2[i] > num) { num = array[i].Length + array2[i]; } } StringBuilder stringBuilder = new StringBuilder(); string[] array3 = new string[5] { " /", "X\\ / O___O", " \\H\\L=_/ \\_=", " _+X/\\| | |/", " \\" }; for (int j = 0; j < array3.Length; j++) { stringBuilder.Append(array[j]); for (int k = 0; k < num - (array[j].Length + array2[j]) + 1; k++) { stringBuilder.Append(" "); } stringBuilder.Append(array3[j]); stringBuilder.Append("\n"); } return stringBuilder.ToString(); } } internal static class Log { private static ManualLogSource _logSource; internal static void Init(ManualLogSource logSource) { _logSource = logSource; } internal static void Debug(object data) { _logSource.LogDebug(data); } internal static void Error(object data) { if (Config.EnableLogs().Value) { _logSource.LogError(data); } } internal static void Fatal(object data) { _logSource.LogFatal(data); } internal static void Info(object data) { _logSource.LogInfo(data); } internal static void Message(object data) { if (Config.EnableLogs().Value) { _logSource.LogMessage(data); } } internal static void Warning(object data) { if (Config.EnableLogs().Value) { _logSource.LogWarning(data); } } } public static class OnHooks { [CompilerGenerated] private static class <>O { public static hook_OnDeath <0>__DontDieWhileLaunched; public static hook_TakeDamageForce_DamageInfo_bool_bool <1>__DontDoNormalKnockbackWhenLaunched; public static hook_TakeDamage <2>__TakeDamageHook; public static hook_GetBestBodyName <3>__SuperNamePrefix; public static hook_Start <4>__SceneDirectorOnStart; public static Action <5>__LookingGlassSetup; public static hook_Start <6>__EmeraldDropSound; public static hook_CanApplyAmmoPack <7>__CanApplyAmmoPackToBoost; public static hook_ApplyAmmoPack <8>__ApplyAmmoPackToBoost; public static hook_Awake <9>__CreateBoostMeterUI; } public static void Initialize() { //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_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Expected O, but got Unknown //IL_0111: 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_011c: Expected O, but got Unknown //IL_0132: 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_013d: Expected O, but got Unknown //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Expected O, but got Unknown object obj = <>O.<0>__DontDieWhileLaunched; if (obj == null) { hook_OnDeath val = DontDieWhileLaunched; <>O.<0>__DontDieWhileLaunched = val; obj = (object)val; } CharacterDeathBehavior.OnDeath += (hook_OnDeath)obj; object obj2 = <>O.<1>__DontDoNormalKnockbackWhenLaunched; if (obj2 == null) { hook_TakeDamageForce_DamageInfo_bool_bool val2 = DontDoNormalKnockbackWhenLaunched; <>O.<1>__DontDoNormalKnockbackWhenLaunched = val2; obj2 = (object)val2; } HealthComponent.TakeDamageForce_DamageInfo_bool_bool += (hook_TakeDamageForce_DamageInfo_bool_bool)obj2; object obj3 = <>O.<2>__TakeDamageHook; if (obj3 == null) { hook_TakeDamage val3 = TakeDamageHook; <>O.<2>__TakeDamageHook = val3; obj3 = (object)val3; } HealthComponent.TakeDamage += (hook_TakeDamage)obj3; object obj4 = <>O.<3>__SuperNamePrefix; if (obj4 == null) { hook_GetBestBodyName val4 = SuperNamePrefix; <>O.<3>__SuperNamePrefix = val4; obj4 = (object)val4; } Util.GetBestBodyName += (hook_GetBestBodyName)obj4; object obj5 = <>O.<4>__SceneDirectorOnStart; if (obj5 == null) { hook_Start val5 = SceneDirectorOnStart; <>O.<4>__SceneDirectorOnStart = val5; obj5 = (object)val5; } SceneDirector.Start += (hook_Start)obj5; if (HedgehogUtilsPlugin.lookingGlassLoaded) { RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(LookingGlassSetup)); } object obj6 = <>O.<6>__EmeraldDropSound; if (obj6 == null) { hook_Start val6 = EmeraldDropSound; <>O.<6>__EmeraldDropSound = val6; obj6 = (object)val6; } GenericPickupController.Start += (hook_Start)obj6; object obj7 = <>O.<7>__CanApplyAmmoPackToBoost; if (obj7 == null) { hook_CanApplyAmmoPack val7 = CanApplyAmmoPackToBoost; <>O.<7>__CanApplyAmmoPackToBoost = val7; obj7 = (object)val7; } GenericSkill.CanApplyAmmoPack += (hook_CanApplyAmmoPack)obj7; object obj8 = <>O.<8>__ApplyAmmoPackToBoost; if (obj8 == null) { hook_ApplyAmmoPack val8 = ApplyAmmoPackToBoost; <>O.<8>__ApplyAmmoPackToBoost = val8; obj8 = (object)val8; } GenericSkill.ApplyAmmoPack += (hook_ApplyAmmoPack)obj8; object obj9 = <>O.<9>__CreateBoostMeterUI; if (obj9 == null) { hook_Awake val9 = CreateBoostMeterUI; <>O.<9>__CreateBoostMeterUI = val9; obj9 = (object)val9; } HUD.Awake += (hook_Awake)obj9; } private static void DontDieWhileLaunched(orig_OnDeath orig, CharacterDeathBehavior self) { CharacterBody val = default(CharacterBody); if (!((Component)self).gameObject.TryGetComponent<CharacterBody>(ref val) || !val.HasBuff(Buffs.launchedBuff)) { Log.Warning("Death"); orig.Invoke(self); } } private static void DontDoNormalKnockbackWhenLaunched(orig_TakeDamageForce_DamageInfo_bool_bool orig, HealthComponent self, DamageInfo damageInfo, bool alwaysApply, bool disableAirControlUntilCollision) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) if (!DamageAPI.HasModdedDamageType(ref damageInfo.damageType, HedgehogUtils.Launch.DamageTypes.launch) && !DamageAPI.HasModdedDamageType(ref damageInfo.damageType, HedgehogUtils.Launch.DamageTypes.launchOnKill)) { orig.Invoke(self, damageInfo, alwaysApply, disableAirControlUntilCollision); } } private static void TakeDamageHook(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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_006e: Expected O, but got Unknown //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) FormComponent formComponent = default(FormComponent); if (NetworkServer.active && Object.op_Implicit((Object)(object)self) && ((Component)self).gameObject.TryGetComponent<FormComponent>(ref formComponent) && Object.op_Implicit((Object)(object)formComponent.activeForm) && formComponent.activeForm.invincible) { damageInfo.rejected = true; EffectManager.SpawnEffect(AssetReferences.damageRejectedPrefab, new EffectData { origin = damageInfo.position }, true); } orig.Invoke(self, damageInfo); if (NetworkServer.active && Object.op_Implicit((Object)(object)self) && !damageInfo.rejected && !self.body.HasBuff(Buffs.chaosSnapRandomIdentifierBuff) && DamageAPI.HasModdedDamageType(damageInfo, HedgehogUtils.Miscellaneous.DamageTypes.chaosSnapRandom) && Object.op_Implicit((Object)(object)ChaosSnapManager.instance)) { ChaosSnapManager.instance.TeleportBodyToRandomNode(self.body, 30f, 50f); self.body.AddTimedBuff(Buffs.chaosSnapRandomIdentifierBuff, 1f); } CharacterBody val = default(CharacterBody); if (!NetworkServer.active || (!DamageAPI.HasModdedDamageType(ref damageInfo.damageType, HedgehogUtils.Launch.DamageTypes.launch) && (!DamageAPI.HasModdedDamageType(ref damageInfo.damageType, HedgehogUtils.Launch.DamageTypes.launchOnKill) || self.alive)) || DamageAPI.HasModdedDamageType(ref damageInfo.damageType, HedgehogUtils.Miscellaneous.DamageTypes.chaosSnapRandom) || !Object.op_Implicit((Object)(object)damageInfo.attacker) || !damageInfo.attacker.TryGetComponent<CharacterBody>(ref val) || !LaunchManager.AttackCanLaunch(self, val, damageInfo)) { return; } Vector3 val2 = ((Vector3)(ref damageInfo.force)).normalized; if (!DamageAPI.HasModdedDamageType(ref damageInfo.damageType, HedgehogUtils.Launch.DamageTypes.removeLaunchAutoAim)) { if (Object.op_Implicit((Object)(object)self.body) && Object.op_Implicit((Object)(object)self.body.characterMotor) && self.body.characterMotor.isGrounded) { val2 = LaunchManager.AngleAwayFromGround(val2, self.body.characterMotor.estimatedGroundNormal); } val2 = LaunchManager.AngleTowardsEnemies(val2, ((Component)self).transform.position, ((Component)self).gameObject, val.teamComponent.teamIndex); val2 = ((Vector3)(ref val2)).normalized; } LaunchManager.Launch(self.body, val, val2, damageInfo.damage, damageInfo.crit, damageInfo.procCoefficient); } public static void LookingGlassSetup() { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Expected I4, but got Unknown //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Expected I4, but got Unknown //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Expected I4, but got Unknown //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Expected I4, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Expected I4, but got Unknown //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Expected I4, but got Unknown //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Expected I4, but got Unknown if (Language.languagesByName.TryGetValue("en", out var value)) { RegisterLookingGlassBuff(value, Buffs.superFormBuff, "Super Form", $"Immune to all attacks. Gain <style=cIsDamage>+{100f}% damage</style>, <style=cIsUtility>+{30.000002f}% attack speed</style>, and <style=cIsUtility>+{100f}% base movement speed</style>."); } ItemStatsDef val = new ItemStatsDef(); val.descriptions.Add("Unique Emeralds: "); val.valueTypes.Add((ValueType)7); val.measurementUnits.Add((MeasurementUnits)4); val.calculateValuesNew = delegate { List<float> list = new List<float>(); if (HedgehogUtils.Forms.Forms.formToHandlerObject.TryGetValue(SuperFormDef.superFormDef, out var value2)) { SuperSonicHandler superSonicHandler = default(SuperSonicHandler); if (value2.TryGetComponent<SuperSonicHandler>(ref superSonicHandler)) { list.Add(7 - ((SyncedItemTracker)superSonicHandler.itemTracker).missingItems.Count); } } else { list.Add(-1f); } return list; }; ItemDefinitions.allItemDefinitions.Add((int)Items.redEmerald.itemIndex, val); ItemDefinitions.allItemDefinitions.Add((int)Items.yellowEmerald.itemIndex, val); ItemDefinitions.allItemDefinitions.Add((int)Items.greenEmerald.itemIndex, val); ItemDefinitions.allItemDefinitions.Add((int)Items.blueEmerald.itemIndex, val); ItemDefinitions.allItemDefinitions.Add((int)Items.purpleEmerald.itemIndex, val); ItemDefinitions.allItemDefinitions.Add((int)Items.cyanEmerald.itemIndex, val); ItemDefinitions.allItemDefinitions.Add((int)Items.grayEmerald.itemIndex, val); } private static void RegisterLookingGlassBuff(Language language, BuffDef buff, string name, string description) { LookingGlassLanguageAPI.SetupToken(language, "NAME_" + ((Object)buff).name, name); LookingGlassLanguageAPI.SetupToken(language, "DESCRIPTION_" + ((Object)buff).name, description); } private static string SuperNamePrefix(orig_GetBestBodyName orig, GameObject bodyObject) { FormComponent formComponent = default(FormComponent); if (Object.op_Implicit((Object)(object)bodyObject) && bodyObject.TryGetComponent<FormComponent>(ref formComponent) && Object.op_Implicit((Object)(object)formComponent.activeForm) && !Language.IsTokenInvalid(((Object)formComponent.activeForm).name + "_PREFIX")) { string text = orig.Invoke(bodyObject); return Language.GetStringFormatted(((Object)formComponent.activeForm).name + "_PREFIX", new object[1] { text }); } return orig.Invoke(bodyObject); } private static void EmeraldDropSound(orig_Start orig, GenericPickupController self) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Invalid comparison between Unknown and I4 //IL_0058: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (!Object.op_Implicit((Object)(object)self) || !Object.op_Implicit((Object)(object)self.pickupDisplay)) { return; } UniquePickup pickup = self.pickup; PickupDef pickupDef = ((PickupIndex)(ref pickup.pickupIndex)).pickupDef; if (pickupDef == null) { return; } ItemIndex itemIndex = pickupDef.itemIndex; if ((int)itemIndex != -1) { ItemDef itemDef = ItemCatalog.GetItemDef(itemIndex); if (Object.op_Implicit((Object)(object)itemDef) && (Object)(object)itemDef._itemTierDef == (Object)(object)Items.emeraldTier) { Util.PlaySound("Play_hedgehogutils_emerald_spawn", ((Component)self).gameObject); } } } private static void SceneDirectorOnStart(orig_Start orig, SceneDirector self) { //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Invalid comparison between Unknown and I4 //IL_01c8: 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_0207: Expected O, but got Unknown orig.Invoke(self); if (!NetworkServer.active) { return; } NetworkServer.Spawn(Object.Instantiate<GameObject>(ChaosSnapManager.prefab)); SceneDef sceneDefForCurrentScene = SceneCatalog.GetSceneDefForCurrentScene(); FormDef[] formsCatalog = FormCatalog.formsCatalog; foreach (FormDef formDef in formsCatalog) { bool flag = formDef.enabled(formDef); if (!HedgehogUtils.Forms.Forms.formToHandlerObject.ContainsKey(formDef) && flag) { Log.Message("Spawning new handler object for form " + ((object)formDef).ToString()); NetworkServer.Spawn(Object.Instantiate<GameObject>(GeneralExtensions.GetValueSafe<FormDef, GameObject>(HedgehogUtils.Forms.Forms.formToHandlerPrefab, formDef))); FormHandler formHandler = GeneralExtensions.GetValueSafe<FormDef, GameObject>(HedgehogUtils.Forms.Forms.formToHandlerObject, formDef).GetComponent(typeof(FormHandler)) as FormHandler; formHandler.SetEvents(flag); } else { Log.Message("Did NOT spawn handler object for form " + ((object)formDef).ToString()); } } SuperSonicHandler superSonicHandler = default(SuperSonicHandler); if (!HedgehogUtils.Forms.Forms.formToHandlerObject.TryGetValue(SuperFormDef.superFormDef, out var value) || !value.TryGetComponent<SuperSonicHandler>(ref superSonicHandler)) { return; } superSonicHandler.FilterOwnedEmeralds(); if (SuperSonicHandler.available.Count > 0 && Object.op_Implicit((Object)(object)sceneDefForCurrentScene) && (int)sceneDefForCurrentScene.sceneType == 1 && !sceneDefForCurrentScene.cachedName.Contains("moon") && !sceneDefForCurrentScene.cachedName.Contains("voidraid") && !sceneDefForCurrentScene.cachedName.Contains("voidstage")) { int num = ((Run.instance is InfiniteTowerRun) ? Config.EmeraldsPerSimulacrumStage().Value : Config.EmeraldsPerStage().Value); SpawnCard val = ScriptableObject.CreateInstance<SpawnCard>(); val.nodeGraphType = (GraphType)0; val.sendOverNetwork = true; val.prefab = ChaosEmeraldInteractable.prefabBase; for (int j = 0; j < num && j < SuperSonicHandler.available.Count; j++) { DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest(val, ChaosEmeraldInteractable.placementRule, Run.instance.stageRng)); } } } private static bool CanApplyAmmoPackToBoost(orig_CanApplyAmmoPack orig, GenericSkill self) { //IL_000c: 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) Type typeFromHandle = typeof(HedgehogUtils.Boost.EntityStates.Boost); SerializableEntityStateType activationState = self.activationState; if (typeFromHandle.IsAssignableFrom(((SerializableEntityStateType)(ref activationState)).stateType)) { BoostLogic component = ((Component)self.characterBody).GetComponent<BoostLogic>(); if (Object.op_Implicit((Object)(object)component)) { return component.boostMeter < component.maxBoostMeter; } } return orig.Invoke(self); } private static void ApplyAmmoPackToBoost(orig_ApplyAmmoPack orig, GenericSkill self) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); Type typeFromHandle = typeof(HedgehogUtils.Boost.EntityStates.Boost); SerializableEntityStateType activationState = self.activationState; if (typeFromHandle.IsAssignableFrom(((SerializableEntityStateType)(ref activationState)).stateType)) { BoostLogic component = ((Component)self.characterBody).GetComponent<BoostLogic>(); if (Object.op_Implicit((Object)(object)component)) { component.AddBoost(25f); } } } public static void CreateBoostMeterUI(orig_Awake orig, HUD self) { orig.Invoke(self); BoostHUD boostHUD = ((Component)self).gameObject.AddComponent<BoostHUD>(); GameObject boostMeter = Object.Instantiate<GameObject>(Assets.boostHUD, ((Component)self).transform.Find("MainContainer/MainUIArea/CrosshairCanvas")); boostHUD.boostMeter = boostMeter; } } public static class States { internal static void RegisterStates() { Content.AddEntityState(typeof(InteractablePurchased)); Content.AddEntityState(typeof(SuperSonic)); Content.AddEntityState(typeof(SuperSonicTransformation)); Content.AddEntityState(typeof(Launched)); Content.AddEntityState(typeof(BoostIdle)); Content.AddEntityState(typeof(Brake)); } } } namespace HedgehogUtils.Miscellaneous { public class ChaosSnapManager : MonoBehaviour { [CompilerGenerated] private sealed class <TeleportAfterDelay>d__7 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public CharacterBody target; public Vector3 teleportFootPosition; public float startDuration; public float endDuration; public ChaosSnapManager <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <TeleportAfterDelay>d__7(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; TeleportVFX(target, target.corePosition, teleportIn: true, startDuration, useTemporaryOverlay: true); <>2__current = (object)new WaitForSeconds(startDuration); <>1__state = 1; return true; case 1: <>1__state = -1; if (Object.op_Implicit((Object)(object)target)) { TeleportVFX(target, VFXPosition(target, teleportFootPosition), teleportIn: false, endDuration, useTemporaryOverlay: true); TeleportHelper.TeleportBody(target, teleportFootPosition, true); } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static ChaosSnapManager instance; public static GameObject prefab; public static Material tempOverlayMaterial; public static void Initialize() { //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) tempOverlayMaterial = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Huntress/matHuntressFlashBright.mat").WaitForCompletion(); prefab = PrefabAPI.CreateEmptyPrefab("HedgehogUtilsChaosSnapManager"); prefab.AddComponent<ChaosSnapManager>(); } public void Start() { if (!Object.op_Implicit((Object)(object)instance)) { instance = this; } else { Object.Destroy((Object)(object)this); } } public void Teleport(CharacterBody target, Vector3 teleportFootPosition) { //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_0008: 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_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Invalid comparison between Unknown and I4 //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Invalid comparison between Unknown and I4 HullClassification hullClassification = target.hullClassification; HullClassification val = hullClassification; float num = (((int)val == 1) ? 0.35f : (((int)val != 2) ? 0.25f : 0.55f)); Teleport(target, teleportFootPosition, num, num); } public void Teleport(CharacterBody target, Vector3 teleportFootPosition, float startDuration, float endDuration) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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_0011: Unknown result type (might be due to invalid IL or missing references) if (startDuration > 0f) { ((MonoBehaviour)this).StartCoroutine(TeleportAfterDelay(target, teleportFootPosition, startDuration, endDuration)); return; } TeleportVFX(target, target.corePosition, teleportIn: true, 0.2f, useTemporaryOverlay: false); TeleportVFX(target, VFXPosition(target, teleportFootPosition), teleportIn: false, endDuration, useTemporaryOverlay: true); TeleportHelper.TeleportBody(target, teleportFootPosition, true); } [IteratorStateMachine(typeof(<TeleportAfterDelay>d__7))] private IEnumerator TeleportAfterDelay(CharacterBody target, Vector3 teleportFootPosition, float startDuration, float endDuration) { //IL_0015: 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) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <TeleportAfterDelay>d__7(0) { <>4__this = this, target = target, teleportFootPosition = teleportFootPosition, startDuration = startDuration, endDuration = endDuration }; } public bool TeleportBodyToRandomNode(CharacterBody target, float minDistance, float maxDistance) { //IL_0003: 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) if (GetRandomTeleportNode(target, target.footPosition, out var destination, minDistance, maxDistance) && Object.op_Implicit((Object)(object)target.characterDirection)) { instance.Teleport(target, destination); return true; } return false; } public static void TeleportVFX(CharacterBody target, Vector3 position, bool teleportIn, float duration, bool useTemporaryOverlay) { //IL_0002: Unknown