Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of MeridianShard v1.1.0
StormboundAddon.dll
Decompiled 11 hours agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using EntityStates.FalseSonBoss; using HarmonyLib; using IL.EntityStates.Geode; using IL.RoR2; using Microsoft.CodeAnalysis; using MonoMod.Cil; using MonoMod.RuntimeDetour; using On; using On.EntityStates.Destructible; using On.EntityStates.FalseSonBoss; using On.EntityStates.Geode; using On.EntityStates.PrimeMeridian; using On.RoR2; using On.RoR2.Projectile; using R2API; using RoR2; using RoR2.ContentManagement; using RoR2BepInExPack.GameAssetPathsBetter; using StormboundAddon.Changes; using StormboundAddon.Modules; using StormboundFalseSon; using StormboundFalseSon.Changes; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: IgnoresAccessChecksTo("StormboundFalseSon")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("StormboundAddon")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("StormboundAddon")] [assembly: AssemblyTitle("StormboundAddon")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace StormboundAddon { 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) { _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) { _logSource.LogMessage(data); } internal static void Warning(object data) { _logSource.LogWarning(data); } } [BepInPlugin("com.Bloonjitsu7.StormboundAddon", "StormboundAddon", "1.1.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class MainPlugin : BaseUnityPlugin { public void Awake() { Log.Init(((BaseUnityPlugin)this).Logger); new ContentPacks().Initialize(); Main main = new Main(); main.Initialize(); } } } namespace StormboundAddon.Modules { public static class DamageTypes { } public static class Buffs { internal static List<BuffDef> buffDefs = new List<BuffDef>(); internal static BuffDef AddNewBuff(string buffName, Sprite buffIcon, Color buffColor, bool canStack, bool isDebuff, bool isCooldown, bool isHidden) { //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.isCooldown = isCooldown; val.isHidden = isHidden; buffDefs.Add(val); return val; } } public static class Effects { private static GameObject finder = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Mushroom.MushroomWard_prefab).WaitForCompletion(); public static List<EffectDef> effectDefs = new List<EffectDef>(); internal static void RegisterEffects() { } private static GameObject CreateTracer() { //IL_000b: 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) GameObject val = CloneTracer("RoR2/Base/Huntress/TracerHuntressSnipe.prefab", "TracerStormboundAurelioniteLaser", Color.red, new Color(1f, 0.04f, 0.04f, 1f), 2f); Object.Destroy((Object)(object)((Component)val.transform.Find("TracerHead")).gameObject); return val; } private static GameObject CloneObject(string originalObjectName, string newObjectName, Color color1, Color color2, float scaleMult = 1f, float colorTemp = 0f, bool colorMesh = true, string soundName = "", bool parentToTransform = false, bool recolor = true) { //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_00b2: 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_00ce: Unknown result type (might be due to invalid IL or missing references) GameObject val = Addressables.LoadAssetAsync<GameObject>((object)originalObjectName).WaitForCompletion(); if ((Object)(object)val == (Object)null) { Log.Warning(originalObjectName + " is null!"); return null; } Component[] componentsInChildren = val.GetComponentsInChildren(typeof(Component)); foreach (Component data in componentsInChildren) { Log.Message(data); } GameObject val2 = PrefabAPI.InstantiateClone(val, newObjectName, false); if ((Object)(object)val2.GetComponent<EffectComponent>() == (Object)null) { val2.AddComponent<EffectComponent>(); } if ((Object)(object)val2.GetComponent<VFXAttributes>() == (Object)null) { val2.AddComponent<VFXAttributes>(); } val2.GetComponent<VFXAttributes>().vfxPriority = (VFXPriority)2; val2.GetComponent<VFXAttributes>().DoNotPool = true; if (recolor) { val2.Recolor(color1, color2, scaleMult, colorTemp, colorMesh); } CreateEffectFromObject(val2, soundName, parentToTransform); return val2; } private static GameObject CloneTracer(string originalTracerName, string newTracerName, Color color1, Color color2, float widthMult = 1f, float? speed = null, float? length = null) { //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_007f: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) GameObject val = Addressables.LoadAssetAsync<GameObject>((object)originalTracerName).WaitForCompletion(); if ((Object)(object)val == (Object)null) { Log.Warning(originalTracerName + " is null!"); return null; } GameObject val2 = PrefabAPI.InstantiateClone(val, newTracerName, false); if (!Object.op_Implicit((Object)(object)val2.GetComponent<EffectComponent>())) { val2.AddComponent<EffectComponent>(); } if (!Object.op_Implicit((Object)(object)val2.GetComponent<VFXAttributes>())) { val2.AddComponent<VFXAttributes>(); } val2.GetComponent<VFXAttributes>().vfxPriority = (VFXPriority)2; val2.GetComponent<VFXAttributes>().DoNotPool = true; if (!Object.op_Implicit((Object)(object)val2.GetComponent<NetworkIdentity>())) { val2.AddComponent<NetworkIdentity>(); } val2.GetComponent<Tracer>().speed = (speed.HasValue ? speed.Value : val2.GetComponent<Tracer>().speed); val2.GetComponent<Tracer>().length = (length.HasValue ? length.Value : val2.GetComponent<Tracer>().length); val2.Recolor(color1, color2, widthMult); CreateAndAddEffectDef(val2); return val2; } private static void Recolor(this GameObject thingToColor, Color color1, Color color2, float widthMult = 1f, float colorTemp = 0f, bool colorMesh = true) { //IL_001a: 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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_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_008d: 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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Expected O, but got Unknown //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: 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_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: 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_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) bool flag = true; LineRenderer[] componentsInChildren = thingToColor.GetComponentsInChildren<LineRenderer>(); foreach (LineRenderer val in componentsInChildren) { bool flag2 = true; val.startColor = color1; val.endColor = color2; if (widthMult != 1f) { val.widthMultiplier *= widthMult; } } ParticleSystem[] componentsInChildren2 = thingToColor.GetComponentsInChildren<ParticleSystem>(); foreach (ParticleSystem val2 in componentsInChildren2) { MainModule main = val2.main; MinMaxCurve startSize = ((MainModule)(ref main)).startSize; ((MainModule)(ref main)).startSize = new MinMaxCurve(((MinMaxCurve)(ref startSize)).constant * widthMult); ((MainModule)(ref main)).startColor = new MinMaxGradient(color1); TrailModule trails = val2.trails; if (((TrailModule)(ref trails)).enabled) { Gradient val3 = new Gradient(); GradientColorKey[] array = (GradientColorKey[])(object)new GradientColorKey[2]; array[0].color = color1; array[0].time = 0f; array[1].color = color2; array[1].time = 1f; GradientAlphaKey[] array2 = (GradientAlphaKey[])(object)new GradientAlphaKey[2]; array2[0].alpha = color1.a; array2[0].time = 0f; array2[1].alpha = color2.a; array2[1].time = 1f; val3.SetKeys(array, array2); ((TrailModule)(ref trails)).colorOverLifetime = new MinMaxGradient(val3); } } Light[] componentsInChildren3 = thingToColor.GetComponentsInChildren<Light>(); foreach (Light val4 in componentsInChildren3) { if (colorTemp > 0f) { val4.colorTemperature = colorTemp; val4.useColorTemperature = true; } else { val4.useColorTemperature = false; } val4.color = color1; Transform transform = ((Component)val4).transform; transform.localScale *= widthMult; } ParticleSystemRenderer[] componentsInChildren4 = thingToColor.GetComponentsInChildren<ParticleSystemRenderer>(); foreach (ParticleSystemRenderer val5 in componentsInChildren4) { ((Renderer)val5).material.SetColor("_MainColor", color1); ((Renderer)val5).material.SetColor("_Color", color1); ((Renderer)val5).material.SetColor("_TintColor", color2); } if (colorMesh) { MeshRenderer[] componentsInChildren5 = thingToColor.GetComponentsInChildren<MeshRenderer>(); foreach (MeshRenderer val6 in componentsInChildren5) { ((Renderer)val6).material.SetColor("_MainColor", color1); ((Renderer)val6).material.SetColor("_Color", color1); ((Renderer)val6).material.SetColor("_TintColor", color2); } } } internal static void AddEffectDef(EffectDef effectDef) { effectDefs.Add(effectDef); } internal static EffectDef CreateAndAddEffectDef(GameObject effectPrefab, bool donotPool = false) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown if (donotPool) { VFXAttributes val = effectPrefab.GetComponent<VFXAttributes>(); if ((Object)(object)val == (Object)null) { val = effectPrefab.AddComponent<VFXAttributes>(); } val.DoNotPool = true; } EffectDef val2 = new EffectDef(effectPrefab); AddEffectDef(val2); return val2; } internal static void CreateEffectFromObject(GameObject newEffect, string soundName, bool parentToTransform) { //IL_0032: 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) newEffect.AddComponent<DestroyOnTimer>().duration = 6f; newEffect.AddComponent<NetworkIdentity>(); if (!Object.op_Implicit((Object)(object)newEffect.GetComponent<VFXAttributes>())) { newEffect.AddComponent<VFXAttributes>().vfxPriority = (VFXPriority)2; } EffectComponent component = newEffect.GetComponent<EffectComponent>(); if (!Object.op_Implicit((Object)(object)component)) { component = newEffect.AddComponent<EffectComponent>(); component.applyScale = true; component.effectIndex = (EffectIndex)(-1); component.parentToReferencedTransform = parentToTransform; component.positionAtReferencedTransform = true; component.soundName = soundName; } CreateAndAddEffectDef(newEffect); } } internal class ContentPacks : IContentPackProvider { internal ContentPack contentPack = new ContentPack(); public string identifier => "com.Bloonjitsu7.StormboundAddon"; public void Initialize() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown Effects.RegisterEffects(); ContentManager.collectContentPackProviders += new CollectContentPackProvidersDelegate(ContentManager_collectContentPackProviders); } private void ContentManager_collectContentPackProviders(AddContentPackProviderDelegate addContentPackProvider) { addContentPackProvider.Invoke((IContentPackProvider)(object)this); } public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args) { contentPack.identifier = identifier; contentPack.effectDefs.Add(Effects.effectDefs.ToArray()); contentPack.buffDefs.Add(Buffs.buffDefs.ToArray()); args.ReportProgress(1f); yield break; } public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args) { ContentPack.Copy(contentPack, args.output); args.ReportProgress(1f); yield break; } public IEnumerator FinalizeAsync(FinalizeAsyncArgs args) { args.ReportProgress(1f); yield break; } } } namespace StormboundAddon.Changes { public class Main { private static bool fsActive = true; private static bool laserActive = true; private static bool geodeActive = true; public static GameObject cleanseObject = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_ShrineCleanse.ShrineCleanse_prefab).WaitForCompletion(); private static List<Hook> hooks = new List<Hook>(); private static List<ILHook> ILhooks = new List<ILHook>(); public static GameObject geodePrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC2.Geode_prefab).WaitForCompletion(); public void Initialize() { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Expected O, but got Unknown //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Expected O, but got Unknown //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Expected O, but got Unknown //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Expected O, but got Unknown DumpComponents(cleanseObject); GeodeItem geodeItem = new GeodeItem(); geodeItem.Init(); MethodInfo methodInfo = AccessTools.Method(typeof(FalseSonChanges), "OnMeridianStart", (Type[])null, (Type[])null); hooks.Add(new Hook((MethodBase)methodInfo, (Delegate)new Action<Action<FalseSonChanges, orig_Start, MeridianEventTriggerInteraction>, FalseSonChanges, orig_Start, MeridianEventTriggerInteraction>(OnFalseSonChangesStart))); MethodInfo methodInfo2 = AccessTools.Method(typeof(LaserChanges), "OnMeridianStart", (Type[])null, (Type[])null); hooks.Add(new Hook((MethodBase)methodInfo2, (Delegate)new Action<Action<LaserChanges, orig_Start, MeridianEventTriggerInteraction>, LaserChanges, orig_Start, MeridianEventTriggerInteraction>(OnLaserChangesStart))); MethodInfo methodInfo3 = AccessTools.Method(typeof(GeodeChanges), "OnMeridianStart", (Type[])null, (Type[])null); hooks.Add(new Hook((MethodBase)methodInfo3, (Delegate)new Action<Action<GeodeChanges, orig_Start, MeridianEventTriggerInteraction>, GeodeChanges, orig_Start, MeridianEventTriggerInteraction>(OnGeodeChangesStart))); HeartSpawnState.OnEnter += new hook_OnEnter(OnFalseSonSpawn); LunarItemOrEquipmentCostTypeHelper.Init += new hook_Init(OnCleanseInit); fsActive = true; laserActive = true; geodeActive = true; } public void OnFalseSonSpawn(orig_OnEnter orig, HeartSpawnState self) { foreach (CharacterBody instances in CharacterBody.instancesList) { if ((Object)(object)instances.inventory != (Object)null) { instances.inventory.RemoveItemPermanent(GeodeItem.geodeItem, 1); } } orig.Invoke(self); } public void OnCleanseInit(orig_Init orig) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Invalid comparison between Unknown and I4 //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0067: 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_005c: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(); List<ItemIndex> list = new List<ItemIndex>(); ItemIndex val = (ItemIndex)0; for (ItemIndex val2 = (ItemIndex)ItemCatalog.itemCount; val < val2; val = (ItemIndex)(val + 1)) { ItemDef itemDef = ItemCatalog.GetItemDef(val); if (((int)itemDef.tier == 3 || itemDef.ContainsTag((ItemTag)5)) && !((object)itemDef).ToString().Contains("StormboundAddon")) { Log.Message(itemDef); list.Add(val); } } LunarItemOrEquipmentCostTypeHelper.lunarItemIndices = list.ToArray(); } private void OnFalseSonChangesStart(Action<FalseSonChanges, orig_Start, MeridianEventTriggerInteraction> orig, FalseSonChanges changes, orig_Start hook, MeridianEventTriggerInteraction self) { //IL_0008: 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_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Expected O, but got Unknown //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Expected O, but got Unknown //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Expected O, but got Unknown //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Expected O, but got Unknown //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Expected O, but got Unknown //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Expected O, but got Unknown //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Expected O, but got Unknown //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Expected O, but got Unknown //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Expected O, but got Unknown //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Expected O, but got Unknown //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Expected O, but got Unknown //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Expected O, but got Unknown //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Expected O, but got Unknown //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Expected O, but got Unknown //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Expected O, but got Unknown //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Expected O, but got Unknown //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Expected O, but got Unknown //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Expected O, but got Unknown //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Expected O, but got Unknown //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Expected O, but got Unknown //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Expected O, but got Unknown //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Expected O, but got Unknown //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Expected O, but got Unknown //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Expected O, but got Unknown //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Expected O, but got Unknown //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Expected O, but got Unknown //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Expected O, but got Unknown //IL_0306: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Expected O, but got Unknown //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Expected O, but got Unknown //IL_032a: Unknown result type (might be due to invalid IL or missing references) //IL_0334: Expected O, but got Unknown //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_0346: Expected O, but got Unknown //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Expected O, but got Unknown //IL_0360: Unknown result type (might be due to invalid IL or missing references) //IL_036a: Expected O, but got Unknown //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Expected O, but got Unknown GetTotalItemCountFromTeamArgs val = default(GetTotalItemCountFromTeamArgs); ((GetTotalItemCountFromTeamArgs)(ref val))..ctor(GeodeItem.geodeItem.itemIndex); val.requiresAlive = false; val.requiresConnected = true; val.onlyPlayerControlledCharacters = true; val.requiredTeam = (TeamIndex)1; int totalItemCountFromTeam = Util.GetTotalItemCountFromTeam(val); if (totalItemCountFromTeam > 0) { ((MonoBehaviour)self).StartCoroutine(DelayedMeridianMessage(self)); if (!fsActive) { fsActive = true; changes.Initialize(); } orig(changes, hook, self); return; } if (fsActive) { Log.Message("Replacing False Son Behaviour"); fsActive = false; HeartSpawnState.OnEnter -= new hook_OnEnter(changes.OnSpawn1Enter); Lightning1SpawnState.OnEnter -= new hook_OnEnter(changes.OnSpawn2Enter); Lightning2SpawnState.OnEnter -= new hook_OnEnter(changes.OnSpawn3Enter); LightningStrikeInstance.SetupDefaultBlastInfo -= new hook_SetupDefaultBlastInfo(changes.OnSetupLightning); RecalculateStatsAPI.GetStatCoefficients -= new StatHookEventHandler(changes.OnRecalcFSStats); if (Configs.eyeEnable) { SkyJumpDeathState.GiveColossusItem -= new hook_GiveColossusItem(changes.OnGiveColossusItem); } if (Configs.slamEnable) { FissureSlam.HasLoSToPlayer -= new hook_HasLoSToPlayer(changes.OnFissureSlamLoS); FissureSlam.DetonateAuthority -= new hook_DetonateAuthority(changes.OnFissureSlamDetonate); FissureSlam.OnEnter -= new hook_OnEnter(changes.OnFissureSlamEnter); FissureSlam.TriggerAnimationEvent -= new hook_TriggerAnimationEvent(changes.OnFissureSlamTriggerAnimation); FissureSlam.OnExit -= new hook_OnExit(changes.OnFissureSlamExit); SwatAwayPlayersWindup.OnEnter -= new hook_OnEnter(changes.OnSwatEnter); SwatAwayPlayersWindup.GetNextStateAuthority -= new hook_GetNextStateAuthority(changes.OnSwatState); SwatAwayPlayersSlam.OnEnter -= new hook_OnEnter(changes.OnSwatEnter2); SwatAwayPlayersSlam.OnExit -= new hook_OnExit(changes.OnSwatExit2); } if (Configs.dashEnable) { CorruptedPathsDash.OnEnter -= new hook_OnEnter(changes.OnDashEnter); CorruptedPathsDash.FixedUpdate -= new hook_FixedUpdate(changes.OnDashUpdate); HealthComponent.ProcParry -= new hook_ProcParry(changes.OnProcParry); } if (Configs.offeringEnable) { TaintedOffering.FixedUpdate -= new hook_FixedUpdate(changes.OnTaintedOfferingUpdate); TaintedOffering.OnEnter -= new hook_OnEnter(changes.OnTaintedOfferingEnter); } if (Configs.rainEnable) { LunarRain.OnEnter -= new hook_OnEnter(changes.OnLunarRainEnter); LunarRain.TryGeneratePositionsFromStage -= new hook_TryGeneratePositionsFromStage(changes.OnLunarRainGeneratePositions); KillOnTimer component = FalseSonChanges.lunarRainPrefab.GetComponent<KillOnTimer>(); component.duration = 12f; LunarRain.DetonateAuthority -= new hook_DetonateAuthority(changes.OnLunarRainDetonate); LunarRainDeathState.OnEnter -= new hook_OnEnter(changes.OnLunarSpikeEnter); LunarRainDeathState.Explode -= new hook_Explode(changes.OnLunarSpikeExplode); } if (Configs.leapEnable) { LunarGazeLeap.OnEnter -= new hook_OnEnter(changes.OnLeapEnter); LunarGazeExitLeap.OnEnter -= new hook_OnEnter(changes.OnLeapExit); } if (Configs.devastatorOrbEnable) { PrimeDevastator.OnEnter -= new hook_OnEnter(changes.OnDevastatorEnter); PrimeDevastator.FixedUpdate -= new hook_FixedUpdate(changes.OnDevastatorUpdate); PrimeDevastator.FireDevastator -= new hook_FireDevastator(changes.OnDevastatorFire); PrimeDevastatorProjectileController.Start -= new hook_Start(changes.OnDevastatorProjectileStart); PrimeDevastatorProjectileController.Update -= new hook_Update(changes.OnDevastatorProjectileUpdate); ProjectileOwnerOrbiter.AcquireOwner -= new hook_AcquireOwner(changes.OnAcquireOwner); } if (Configs.devastatorDebuffEnable) { PrimeDevastator.CreateOrbChain -= new hook_CreateOrbChain(changes.OnDevastatorOrb); } } if ((!geodeActive || !Configs.geodeEnable) && (!laserActive || !Configs.laserEnable) && !fsActive) { RunMeridianDelegate(self); } else { hook.Invoke(self); } } private void OnLaserChangesStart(Action<LaserChanges, orig_Start, MeridianEventTriggerInteraction> orig, LaserChanges changes, orig_Start hook, MeridianEventTriggerInteraction self) { //IL_0008: 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_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Expected O, but got Unknown //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Expected O, but got Unknown //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Expected O, but got Unknown //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Expected O, but got Unknown //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Expected O, but got Unknown //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Expected O, but got Unknown //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Expected O, but got Unknown GetTotalItemCountFromTeamArgs val = default(GetTotalItemCountFromTeamArgs); ((GetTotalItemCountFromTeamArgs)(ref val))..ctor(GeodeItem.geodeItem.itemIndex); val.requiresAlive = false; val.requiresConnected = true; val.onlyPlayerControlledCharacters = true; val.requiredTeam = (TeamIndex)1; int totalItemCountFromTeam = Util.GetTotalItemCountFromTeam(val); if (totalItemCountFromTeam > 0) { if (!laserActive) { laserActive = true; MeridianEventTriggerInteraction.Start -= new hook_Start(changes.OnMeridianStart); changes.Initialize(); } orig(changes, hook, self); return; } if (laserActive) { laserActive = false; LunarGazeLaserCharge.OnEnter -= new hook_OnEnter(changes.OnLaserChargeEnter); LunarGazeLaserCharge.FixedUpdate -= new hook_FixedUpdate(changes.OnLaserChargeUpdate); LunarGazeLaserFire.OnEnter -= new hook_OnEnter(changes.OnLaserFireEnter); LunarGazeLaserFire.FixedUpdate -= new hook_FixedUpdate(changes.OnLaserFireUpdate); LunarGazeLaserFire.OnExit -= new hook_OnExit(changes.OnLaserFireExit); LunarGazeLaserFire.UpdateTargettingLasers -= new hook_UpdateTargettingLasers(changes.OnLaserFireTarget); LunarGazeLaserFire.RetractLasers -= new hook_RetractLasers(changes.OnLaserFireRetract); } if ((!geodeActive || !Configs.geodeEnable) && (!laserActive || !Configs.laserEnable) && !fsActive) { RunMeridianDelegate(self); } else { hook.Invoke(self); } } private void OnGeodeChangesStart(Action<GeodeChanges, orig_Start, MeridianEventTriggerInteraction> orig, GeodeChanges changes, orig_Start hook, MeridianEventTriggerInteraction self) { //IL_0008: 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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Expected O, but got Unknown //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Expected O, but got Unknown //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Expected O, but got Unknown //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Expected O, but got Unknown //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Expected O, but got Unknown //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Expected O, but got Unknown //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Expected O, but got Unknown //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Expected O, but got Unknown //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Expected O, but got Unknown //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Expected O, but got Unknown GetTotalItemCountFromTeamArgs val = default(GetTotalItemCountFromTeamArgs); ((GetTotalItemCountFromTeamArgs)(ref val))..ctor(GeodeItem.geodeItem.itemIndex); val.requiresAlive = false; val.requiresConnected = true; val.onlyPlayerControlledCharacters = true; val.requiredTeam = (TeamIndex)1; int totalItemCountFromTeam = Util.GetTotalItemCountFromTeam(val); if (totalItemCountFromTeam > 0) { if (!geodeActive) { geodeActive = true; MeridianEventTriggerInteraction.Start -= new hook_Start(changes.OnMeridianStart); changes.Initialize(); } orig(changes, hook, self); return; } if (geodeActive) { geodeActive = false; GeodeHalcyoniteController component = GeodeChanges.geodePrefab.GetComponent<GeodeHalcyoniteController>(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } MeridianEventTriggerInteraction.HandleFSBFPhase1State -= new hook_HandleFSBFPhase1State(changes.OnPhase1State); MeridianEventTriggerInteraction.HandleFSBFPhase3State -= new hook_HandleFSBFPhase3State(changes.OnPhase3State); MeridianEventTriggerInteraction.HandleMeridianEventClearedState -= new hook_HandleMeridianEventClearedState(changes.OnClearedState); GeodeController.OnInteractionBegin -= new hook_OnInteractionBegin(changes.OnGeodeInteract); GeodeInert.FixedUpdate -= new hook_FixedUpdate(changes.OnGeodeUpdate); GlobalEventManager.onCharacterDeathGlobal -= changes.OnHalcDeath; RecalculateStatsAPI.GetStatCoefficients -= new StatHookEventHandler(changes.OnRecalcGeodeStats); if (Configs.geodeBuffs) { GeodeShatter.HandleCleanseNearbyPlayers -= new Manipulator(changes.IL_GeodeShatter); } MeridianEventTriggerInteraction.OnMiddleRingStartFalling -= new Manipulator(changes.IL_MiddleRingFalling); MeridianEventTriggerInteraction.OnOuterRingStartFalling -= new Manipulator(changes.IL_OuterRingFalling); MeridianEventTriggerInteraction.HandleEventClearedFX -= new Manipulator(changes.IL_EventClearedFX); } if ((!geodeActive || !Configs.geodeEnable) && (!laserActive || !Configs.laserEnable) && !fsActive) { RunMeridianDelegate(self); } else { hook.Invoke(self); } } public void RunMeridianDelegate(MeridianEventTriggerInteraction self) { //IL_006a: 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_0081: 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) //IL_009e: 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_00e1: 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) self.eventTriggerInteraction = ((Component)self).GetComponent<MeridianEventTriggerInteraction>(); self.startSceneAMB.Post(((Component)self).gameObject); if (NetworkServer.active) { LightningStormController.SetStormStrikePattern(self.startingLightningStrikePattern); } if (!NetworkServer.active) { self.ApplyCurrentState(); } ((MonoBehaviour)self).StartCoroutine(RemoveGeodesWithDelay(self, 5f)); Vector3 position = ((Component)self.arenaCenter).transform.position; if (NetworkServer.active) { Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(170f, position.y - 0.8f, -108.2f); GameObject val2 = Object.Instantiate<GameObject>(geodePrefab, val, Quaternion.identity); NetworkServer.Spawn(val2); } if (NetworkServer.active) { Vector3 val3 = default(Vector3); ((Vector3)(ref val3))..ctor(53.6f, position.y - 0.8f, -150.75f); GameObject val4 = Object.Instantiate<GameObject>(geodePrefab, val3, Quaternion.identity); NetworkServer.Spawn(val4); } } private IEnumerator DelayedMeridianMessage(MeridianEventTriggerInteraction self) { yield return (object)new WaitForSeconds(1.5f); if (NetworkServer.active) { Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage { baseToken = "<style=cWorldEvent>The storm rumbles in anticipation...</style>" }); } } private IEnumerator RemoveGeodesWithDelay(MeridianEventTriggerInteraction self, float delay) { yield return (object)new WaitForSeconds(delay); NetworkServer.Destroy(self.arenaGeode1); NetworkServer.Destroy(self.arenaGeode2); NetworkServer.Destroy(self.arenaGeode3); NetworkServer.Destroy(self.arenaGeode4); GameObject arenaGeode5 = GameObject.Find("GeodeInnerRing5"); if ((Object)(object)arenaGeode5 != (Object)null) { NetworkServer.Destroy(arenaGeode5); } GameObject arenaGeode6 = GameObject.Find("GeodeInnerRing4"); if ((Object)(object)arenaGeode6 != (Object)null) { NetworkServer.Destroy(arenaGeode6); } GameObject arenaGeode7 = GameObject.Find("GeodeInnerRing3"); if ((Object)(object)arenaGeode7 != (Object)null) { NetworkServer.Destroy(arenaGeode7); } GameObject arenaGeode8 = GameObject.Find("GeodeInnerRing2"); if ((Object)(object)arenaGeode8 != (Object)null) { NetworkServer.Destroy(arenaGeode8); } GameObject arenaGeode9 = GameObject.Find("GeodeInnerRing1"); if ((Object)(object)arenaGeode9 != (Object)null) { NetworkServer.Destroy(arenaGeode9); } } public static List<MethodInfo> GetAnonymousMethods(Type t, string methodName) { List<MethodInfo> list = new List<MethodInfo>(); Type[] nestedTypes = t.GetNestedTypes((BindingFlags)(-1)); Type[] array = nestedTypes; foreach (Type type in array) { if (!type.Name.Contains("<>")) { continue; } MethodInfo[] methods = type.GetMethods((BindingFlags)(-1)); foreach (MethodInfo methodInfo in methods) { if (methodInfo.Name.Contains(methodName)) { list.Add(methodInfo); } } } MethodInfo[] methods2 = t.GetMethods((BindingFlags)(-1)); foreach (MethodInfo methodInfo2 in methods2) { if (methodInfo2.Name.Contains("<") && methodInfo2.Name.Contains(methodName)) { list.Add(methodInfo2); } } return list.OrderBy((MethodInfo m) => m.Name).ToList(); } public static string GetStackDesc(float num, string type) { if (num > 0f) { return $" <style=cStack>(+{num}{type} per stack)</style>"; } if (num < 0f) { return $" <style=cStack>({num}{type} per stack)</style>"; } return ""; } public static float GetStackedStats(float baseStat, float stackStat, int itemCount) { return baseStat - stackStat + stackStat * (float)itemCount; } public static int GetStackedStatsInt(int baseStat, int stackStat, int itemCount) { return baseStat - stackStat + stackStat * itemCount; } public static float ConvertReductionIntoStackingDivision(float baseFraction, int itemCount) { float num = 1f - baseFraction; float num2 = (1f + num) / num - 2f; num2 *= (float)(itemCount - 1); return num2 + 1f; } public static void DumpComponents(GameObject gameObject) { Component[] componentsInChildren = gameObject.GetComponentsInChildren(typeof(Component)); foreach (Component data in componentsInChildren) { Log.Message(data); } } } public class GeodeItem { public static ItemDef geodeItem; public static GameObject itemPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC2.FragmentPotentialPickup_prefab).WaitForCompletion(), "StormboundAddonItem"); public static Sprite itemIcon = Addressables.LoadAssetAsync<Sprite>((object)RoR2_DLC2_FalseSon.texEnergizedCoreBuffIcon_png).WaitForCompletion(); public void Init() { CreateLang(); CreateItem(); Stage.onStageStartGlobal += OnStageStart; } public static void CreateLang() { LanguageAPI.Add("STORMBOUNDADDON_ITEM_NAME", "Meridian Shard"); string text = "A golden shard from an ancient temple, brimming with electricity."; LanguageAPI.Add("STORMBOUNDADDON_ITEM_PICKUP", text); LanguageAPI.Add("STORMBOUNDADDON_ITEM_DESC", text); } public void CreateItem() { //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Expected O, but got Unknown //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Expected O, but got Unknown //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) geodeItem = ScriptableObject.CreateInstance<ItemDef>(); ((Object)geodeItem).name = "StormboundAddonItem"; geodeItem.nameToken = "STORMBOUNDADDON_ITEM_NAME"; geodeItem.pickupToken = "STORMBOUNDADDON_ITEM_PICKUP"; geodeItem.descriptionToken = "STORMBOUNDADDON_ITEM_DESC"; geodeItem.loreToken = "STORMBOUNDADDON_ITEM_LORE"; geodeItem.pickupIconSprite = itemIcon; ModelLocator component = itemPrefab.GetComponent<ModelLocator>(); if (Object.op_Implicit((Object)(object)component)) { Log.Message(component.modelTransform.localPosition); component.modelScale *= 1.5f; component.modelTransform.localPosition = new Vector3(0f, -0.5f, 0f); } GameObject pickupModelPrefab = itemPrefab; geodeItem.pickupModelPrefab = pickupModelPrefab; geodeItem.deprecatedTier = (ItemTier)3; geodeItem.itemPickupDestroySound = "Play_Geode_Interact"; geodeItem.canRemove = false; geodeItem.hidden = false; ItemTag[] array = new ItemTag[9]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); ItemTag[] tags = (ItemTag[])(object)array; geodeItem.tags = tags; ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null); ItemAPI.Add(new CustomItem(geodeItem, val)); } public void OnStageStart(Stage stage) { //IL_003d: 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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) string cachedName = stage.sceneDef.cachedName; if (cachedName == "lemuriantemple" && NetworkServer.active) { Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(-9.17f, 23.92f, -174.18f); Vector3 zero = Vector3.zero; CreatePickupInfo val2 = default(CreatePickupInfo); ((CreatePickupInfo)(ref val2)).pickupIndex = PickupCatalog.FindPickupIndex(geodeItem.itemIndex); val2.rotation = Quaternion.identity; PickupDropletController.CreatePickupDroplet(val2, val, zero); } } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } }