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 RainrotSUL v1.6.8
RainrotSharedUtils.dll
Decompiled 5 days ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Generic; using System.Collections.ObjectModel; 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.Bootstrap; using EntityStates; using EntityStates.ArtifactShell; using EntityStates.BeetleGuardMonster; using EntityStates.Bell.BellWeapon; using EntityStates.BrotherMonster; using EntityStates.Captain.Weapon; using EntityStates.Chef; using EntityStates.ChildMonster; using EntityStates.ClayBoss; using EntityStates.Commando.CommandoWeapon; using EntityStates.Croco; using EntityStates.FalseSon; using EntityStates.FlyingVermin.Weapon; using EntityStates.GlobalSkills.LunarNeedle; using EntityStates.GrandParentBoss; using EntityStates.GreaterWispMonster; using EntityStates.Gup; using EntityStates.LemurianMonster; using EntityStates.Loader; using EntityStates.LunarWisp; using EntityStates.Mage.Weapon; using EntityStates.MiniMushroom; using EntityStates.MinorConstruct.Weapon; using EntityStates.Railgunner.Weapon; using EntityStates.Seeker; using EntityStates.TeleporterCatastrophe.DLC4.Teleporter; using EntityStates.Toolbot; using EntityStates.VagrantMonster; using EntityStates.VoidBarnacle.Weapon; using EntityStates.VoidSurvivor.Weapon; using HG.Reflection; using IL.EntityStates.Bell.BellWeapon; using IL.EntityStates.FlyingVermin.Weapon; using IL.EntityStates.Huntress.HuntressWeapon; using IL.RoR2; using IL.RoR2.Artifacts; using IL.RoR2.UI; using Mono.Cecil.Cil; using MonoMod.Cil; using MonoMod.RuntimeDetour; using On.EntityStates; using On.EntityStates.ArtifactShell; using On.EntityStates.BeetleGuardMonster; using On.EntityStates.Bell.BellWeapon; using On.EntityStates.Captain.Weapon; using On.EntityStates.Chef; using On.EntityStates.ChildMonster; using On.EntityStates.ClayBoss; using On.EntityStates.Croco; using On.EntityStates.FalseSon; using On.EntityStates.GrandParentBoss; using On.EntityStates.GreaterWispMonster; using On.EntityStates.Gup; using On.EntityStates.LemurianMonster; using On.EntityStates.Loader; using On.EntityStates.LunarWisp; using On.EntityStates.Mage.Weapon; using On.EntityStates.MiniMushroom; using On.EntityStates.Railgunner.Weapon; using On.EntityStates.Seeker; using On.EntityStates.TeleporterCatastrophe.DLC4.Teleporter; using On.EntityStates.VagrantMonster; using On.EntityStates.VoidSurvivor.Weapon; using On.RoR2; using On.RoR2.Projectile; using On.RoR2.Skills; using R2API; using R2API.Utils; using RainrotSharedUtils.Components; using RainrotSharedUtils.Difficulties; using RainrotSharedUtils.Frost; using RainrotSharedUtils.Shelters; using RainrotSharedUtils.Status; using RoR2; using RoR2.Artifacts; using RoR2.ContentManagement; using RoR2.ExpansionManagement; using RoR2.Items; using RoR2.Navigation; using RoR2.Orbs; using RoR2.Projectile; using RoR2.Skills; using RoR2.UI; using RoR2BepInExPack.GameAssetPaths.Version_1_39_0; using RoR2BepInExPack.GameAssetPathsBetter; using SnowtimeToybox; using TMPro; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; using UnityEngine.ResourceManagement.AsyncOperations; [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 = "")] [assembly: AssemblyCompany("RainrotSharedUtils")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("RainrotSharedUtils")] [assembly: AssemblyTitle("RainrotSharedUtils")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: UnverifiableCode] [module: UnverifiableCode] namespace RainrotSharedUtils { public static class Assets { internal static GameObject iceDelayBlastPrefab; public static GameObject iceNovaEffectStrong; public static GameObject iceNovaEffectWeak; public static GameObject iceNovaEffectLowPriority; public static Texture2D iceNovaRamp; public static Texture2D iceNovaRampPersistent; public static BuffDef shockMarker; public static int shockMarkerDuration = 4; public static BuffDef shockHealCooldown; public static Color32 sparkBoosterColor = new Color32((byte)35, (byte)115, byte.MaxValue, byte.MaxValue); public static BuffDef sparkBoosterBuff; public static float sparkBoosterDuration = 8f; public static float sparkBoosterAspdBonus = 0.25f; public const int maxNebulaBoosterStackCount = 5; public static float nebulaBoosterBuffDuration = 5f; public static float nebulaBoosterBuffRadius = 50f; public static GameObject sparkBoosterObject; public static EffectDef RegisterEffect(GameObject effect) { //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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_00c7: Expected O, but got Unknown if ((Object)(object)effect == (Object)null) { Debug.LogError((object)"Effect prefab was null"); return null; } EffectComponent component = effect.GetComponent<EffectComponent>(); if ((Object)(object)component == (Object)null) { Debug.LogErrorFormat("Effect prefab: \"{0}\" does not have an EffectComponent.", new object[1] { ((Object)effect).name }); return null; } VFXAttributes component2 = effect.GetComponent<VFXAttributes>(); if ((Object)(object)component2 == (Object)null) { Debug.LogErrorFormat("Effect prefab: \"{0}\" does not have a VFXAttributes component.", new object[1] { ((Object)effect).name }); return null; } ContentAddition.AddEffect(effect); return new EffectDef { prefab = effect, prefabEffectComponent = component, prefabVfxAttributes = component2, prefabName = ((Object)effect).name, spawnSoundEventName = component.soundName }; } private static Texture2D CreateNewRampTex(Gradient grad) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Expected O, but got Unknown //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) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(256, 8, (TextureFormat)4, false); Color[] array = (Color[])(object)new Color[8]; for (int i = 0; i < 256; i++) { Color val2 = grad.Evaluate((float)i / 255f); for (int j = 0; j < 8; j++) { array[j] = val2; } val.SetPixels(i, 0, 1, 8, array); } ((Texture)val).wrapMode = (TextureWrapMode)1; val.Apply(); return val; } public static void Init() { CreateFrostNovaAssets(); CreateShockReworkAssets(); } private static void CreateFrostNovaAssets() { iceNovaRamp = GetIceRemap(1.1f, 0f); iceNovaRampPersistent = GetIceRemap(0.4f, 0.1f); iceNovaEffectStrong = CreateSingleIceNova(iceNovaRamp, "Strong", 1.2f); iceNovaEffectWeak = CreateSingleIceNova(iceNovaRamp, "Weak", 0.85f); iceNovaEffectLowPriority = CreateSingleIceNova(iceNovaRamp, "LowPriority", 0.3f); iceDelayBlastPrefab = CreateIceDelayBlastPrefab(); static Texture2D GetIceRemap(float alphaMod, float alphaAdd) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_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_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_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_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_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_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: 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_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0216: 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_0237: Unknown result type (might be due to invalid IL or missing references) //IL_0241: 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) Gradient val = new Gradient(); val.mode = (GradientMode)0; val.alphaKeys = (GradientAlphaKey[])(object)new GradientAlphaKey[8] { new GradientAlphaKey(0f * alphaMod + alphaAdd, 0f), new GradientAlphaKey(0f * alphaMod + alphaAdd, 0.14f), new GradientAlphaKey(0.22f * alphaMod + alphaAdd, 0.46f), new GradientAlphaKey(0.22f * alphaMod + alphaAdd, 0.61f), new GradientAlphaKey(0.72f * alphaMod + alphaAdd, 0.63f), new GradientAlphaKey(0.72f * alphaMod + alphaAdd, 0.8f), new GradientAlphaKey(0.87f * alphaMod + alphaAdd, 0.81f), new GradientAlphaKey(0.87f * alphaMod + alphaAdd, 1f) }; val.colorKeys = (GradientColorKey[])(object)new GradientColorKey[8] { new GradientColorKey(new Color(0f + alphaAdd, 0f + alphaAdd, 0f + alphaAdd), 0f), new GradientColorKey(new Color(0f + alphaAdd, 0f + alphaAdd, 0f + alphaAdd), 0.14f), new GradientColorKey(new Color(0.179f + alphaAdd, 0.278f + alphaAdd, 0.25f + alphaAdd), 0.46f), new GradientColorKey(new Color(0.179f + alphaAdd, 0.278f + alphaAdd, 0.25f + alphaAdd), 0.61f), new GradientColorKey(new Color(0.5f + alphaAdd, 0.8f + alphaAdd, 0.75f + alphaAdd), 0.63f), new GradientColorKey(new Color(0.5f + alphaAdd, 0.8f + alphaAdd, 0.75f + alphaAdd), 0.8f), new GradientColorKey(new Color(0.6f + alphaAdd, 0.9f + alphaAdd, 0.85f + alphaAdd), 0.81f), new GradientColorKey(new Color(0.6f + alphaAdd, 0.9f + alphaAdd, 0.85f + alphaAdd), 1f) }; Gradient grad = val; return CreateNewRampTex(grad); } } private static GameObject CreateSingleIceNova(Texture2D remapTex, string s, float alphaMod) { //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/ImpactEffects/AffixWhiteExplosion"), "IceExplosion" + s, false); ParticleSystemRenderer component = ((Component)val.transform.Find("Nova Sphere")).GetComponent<ParticleSystemRenderer>(); Material val2 = Object.Instantiate<Material>(((Renderer)component).material); val2.SetTexture("_RemapTex", (Texture)(object)remapTex); Color color = val2.GetColor("_TintColor"); color.a *= alphaMod; val2.SetColor("_TintColor", color); ((Renderer)component).material = val2; RegisterEffect(val); return val; } private static GameObject CreateIceDelayBlastPrefab() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/NetworkedObjects/GenericDelayBlast"), "IceDelayBlast", false); DelayBlast component = val.GetComponent<DelayBlast>(); component.crit = false; component.procCoefficient = 1f; component.maxTimer = 0.2f; component.falloffModel = (FalloffModel)0; component.explosionEffect = iceNovaEffectWeak; component.delayEffect = CreateIceDelayEffect(); component.damageType = DamageTypeCombo.op_Implicit((DamageType)256); component.baseForce = 250f; ProjectileController val2 = val.AddComponent<ProjectileController>(); ContentAddition.AddProjectile(val); return val; } private static GameObject CreateIceDelayEffect() { GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/AffixWhiteDelayEffect"), "iceDelay", false); val.GetComponent<DestroyOnTimer>().duration = 0.2f; ParticleSystemRenderer component = ((Component)val.transform.Find("Nova Sphere")).GetComponent<ParticleSystemRenderer>(); Material val2 = Object.Instantiate<Material>(((Renderer)component).material); val2.SetTexture("_RemapTex", (Texture)(object)iceNovaRamp); ((Renderer)component).material = val2; RegisterEffect(val); return val; } private static void CreateShockReworkAssets() { AddShockDebuff(); AddShockCooldown(); CreateSparkBuff(); CreateSparkPickup(); } private static void CreateSparkPickup() { //IL_000b: 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_003a: Expected O, but got Unknown sparkBoosterObject = NewNebulaBooster("SparkBoosterPickup", sparkBoosterBuff, sparkBoosterColor, sparkBoosterDuration, 0.8f, 1.8f); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(SparkBoosterStats); } private static void SparkBoosterStats(CharacterBody sender, StatHookEventArgs args) { int buffCount = sender.GetBuffCount(sparkBoosterBuff); if (buffCount > 0) { args.attackSpeedMultAdd += sparkBoosterAspdBonus * (float)buffCount; } } private static GameObject NewNebulaBooster(string boosterName, BuffDef boosterBuff, Color32 boosterColor, float boosterDuration, float antiGravity = 1f, float pickupRangeMultiplier = 3f) { //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_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_004c: 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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0170: 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_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: 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_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0319: Unknown result type (might be due to invalid IL or missing references) //IL_0320: Unknown result type (might be due to invalid IL or missing references) GameObject val = Addressables.LoadAssetAsync<GameObject>((object)"7f9217d45f824f245862e65716abc746").WaitForCompletion(); GameObject val2 = PrefabAPI.InstantiateClone(val, boosterName, true); ParticleSystemRenderer[] componentsInChildren = val2.GetComponentsInChildren<ParticleSystemRenderer>(); foreach (ParticleSystemRenderer val3 in componentsInChildren) { string name = ((Object)((Component)val3).gameObject).name; Color32 val4 = Color32.op_Implicit(Color.white); string text = ""; if (name == "Core") { text = "matSparkPickupCore"; val4 = boosterColor; } if (name == "Trail") { text = "matSparkPickupTrail"; val4 = Color32.op_Implicit(Color.clear); } if (name == "Pulseglow") { text = "matSparkPickupGlow"; val4 = boosterColor; } if (text != "") { Material val5 = (((Renderer)val3).material = Object.Instantiate<Material>(((Renderer)val3).material)); ((Object)val5).name = text; val5.DisableKeyword("VERTEXCOLOR"); val5.SetFloat("_VertexColorOn", 0f); val5.SetColor("_TintColor", Color32.op_Implicit(val4)); } } VelocityRandomOnStart component = val2.GetComponent<VelocityRandomOnStart>(); if ((Object)(object)component != (Object)null) { component.minSpeed = 15f; component.maxSpeed = 25f; component.coneAngle = 360f; component.directionMode = (DirectionMode)0; } else { Debug.Log((object)(boosterName + " HAS NO VROS????")); } DestroyOnTimer component2 = val2.GetComponent<DestroyOnTimer>(); if ((Object)(object)component2 != (Object)null) { component2.duration = boosterDuration; } else { Debug.Log((object)(boosterName + " HAS NO DOT????")); } BeginRapidlyActivatingAndDeactivating component3 = val2.GetComponent<BeginRapidlyActivatingAndDeactivating>(); if ((Object)(object)component3 != (Object)null) { component3.delayBeforeBeginningBlinking = boosterDuration - 2f; component3.blinkFrequency = 5f; } else { Debug.Log((object)(boosterName + " HAS NO BRAAD????")); } if (antiGravity != 0f) { Rigidbody component4 = val2.GetComponent<Rigidbody>(); if (antiGravity == 1f) { component4.useGravity = true; } else { AntiGravityForce val7 = val2.AddComponent<AntiGravityForce>(); val7.rb = component4; val7.antiGravityCoefficient = antiGravity; } } HealthPickup componentInChildren = val2.GetComponentInChildren<HealthPickup>(); NebulaPickup nebulaPickup = ((Component)componentInChildren).gameObject.AddComponent<NebulaPickup>(); nebulaPickup.pickupEffect = componentInChildren.pickupEffect; nebulaPickup.baseObject = componentInChildren.baseObject; nebulaPickup.teamFilter = val2.GetComponent<TeamFilter>(); if ((Object)(object)boosterBuff != (Object)null) { nebulaPickup.buffDef = boosterBuff; } else { Debug.Log((object)(boosterName + "BOOSTER BUFFDEF WAS NULL")); } GravitatePickup componentInChildren2 = val2.GetComponentInChildren<GravitatePickup>(); if ((Object)(object)componentInChildren2 != (Object)null) { componentInChildren2.acceleration = 2f; componentInChildren2.maxSpeed = 50f; Collider component5 = ((Component)componentInChildren2).gameObject.GetComponent<Collider>(); if (component5.isTrigger) { Transform transform = ((Component)component5).transform; transform.localScale *= pickupRangeMultiplier; } } else { Debug.Log((object)(boosterName + " HAS NO GRAVITATION????")); } Object.Destroy((Object)(object)componentInChildren); ContentAddition.AddNetworkedObject(val2); return val2; } private static void CreateSparkBuff() { //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) //IL_002a: 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_0044: Unknown result type (might be due to invalid IL or missing references) sparkBoosterBuff = ScriptableObject.CreateInstance<BuffDef>(); ((Object)sparkBoosterBuff).name = "bdSparkBoost"; sparkBoosterBuff.buffColor = Color32.op_Implicit(sparkBoosterColor); sparkBoosterBuff.canStack = true; AsyncOperationHandle<Sprite> val = Addressables.LoadAssetAsync<Sprite>((object)RoR2_Base_ShockNearby.texBuffTeslaIcon_tif); val.Completed += delegate(AsyncOperationHandle<Sprite> ctx) { sparkBoosterBuff.iconSprite = ctx.Result; }; ContentAddition.AddBuffDef(sparkBoosterBuff); } private static void AddShockDebuff() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) shockMarker = ScriptableObject.CreateInstance<BuffDef>(); ((Object)shockMarker).name = "bdShockDebuff"; shockMarker.buffColor = new Color(0f, 0f, 0.6f); shockMarker.canStack = false; shockMarker.isDebuff = true; shockMarker.isHidden = true; AsyncOperationHandle<Sprite> val = Addressables.LoadAssetAsync<Sprite>((object)RoR2_Base_ShockNearby.texBuffTeslaIcon_tif); val.Completed += delegate(AsyncOperationHandle<Sprite> ctx) { shockMarker.iconSprite = ctx.Result; }; ContentAddition.AddBuffDef(shockMarker); } private static void AddShockCooldown() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) shockHealCooldown = ScriptableObject.CreateInstance<BuffDef>(); ((Object)shockHealCooldown).name = "bdShockDebuff"; shockHealCooldown.buffColor = new Color(0f, 0f, 0.6f); shockHealCooldown.canStack = true; shockHealCooldown.isDebuff = false; shockHealCooldown.isCooldown = true; AsyncOperationHandle<Sprite> val = Addressables.LoadAssetAsync<Sprite>((object)RoR2_Base_ShockNearby.texBuffTeslaIcon_tif); val.Completed += delegate(AsyncOperationHandle<Sprite> ctx) { shockHealCooldown.iconSprite = ctx.Result; }; ContentAddition.AddBuffDef(shockHealCooldown); } } public static class Extensions { public static void AddAllRecipePermutations(this CraftableDef craftableDef, RecipeIngredient[] firstSlotIngredients, RecipeIngredient[] secondSlotIngredients) { List<Recipe> list = new List<Recipe>(); foreach (RecipeIngredient ingredientL in firstSlotIngredients) { foreach (RecipeIngredient ingredientR in secondSlotIngredients) { list.Add(CraftingUtils.MakeRecipe(ingredientL, ingredientR)); } } if (craftableDef.recipes == null || craftableDef.recipes.Length == 0) { craftableDef.recipes = list.ToArray(); } else { craftableDef.recipes = craftableDef.recipes.Concat(list).ToArray(); } } public static void TryLoadAndAddIngredient<T>(this List<RecipeIngredient> list, string path, string debugName = "") where T : Object { if (CraftingUtils.LoadAsIngredient<T>(path, out var ingredient)) { list.Add(ingredient); } else { Debug.LogError((object)("CraftingUtils: Ingredient [" + debugName + "] failed to load! This could cause serious failure!")); } } public static float GetStageStopwatch(this Run instance, out bool isFirstStage) { isFirstStage = true; if ((Object)(object)instance == (Object)null) { return 0f; } isFirstStage = instance.stageClearCount == 0; float runStopwatch = instance.GetRunStopwatch(); float num = 0f; if (Object.op_Implicit((Object)(object)Stage.instance)) { num = Mathf.Floor(Stage.instance.entryStopwatchValue); } return runStopwatch - num; } public static bool IsPot(this CharacterBody self) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) return self.bodyIndex == BodyCatalog.FindBodyIndex("ExplosivePotBody"); } public static bool IsInvincible(this CharacterBody self) { return self.HasBuff(Buffs.HiddenInvincibility) || self.HasBuff(Buffs.Immune) || self.HasBuff(Buffs.Intangible) || self.HasBuff(Buffs.HiddenRejectAllDamage); } public static bool IsInvincibleOrInvisible(this CharacterBody self) { return self.IsInvincible() || self.IsInvisible(); } public static bool IsInvisible(this CharacterBody self) { CharacterModel val = default(CharacterModel); return self.HasBuff(Buffs.Cloak) || (((Component)self).TryGetComponent<CharacterModel>(ref val) && val.invisibilityCount > 0); } public static bool InteractableIsPermittedForSpawn(this GameObject interactableObject, bool disallowPickups = true) { if ((Object)(object)interactableObject == (Object)null) { return false; } InteractionProcFilter val = default(InteractionProcFilter); if (interactableObject.TryGetComponent<InteractionProcFilter>(ref val)) { return val.shouldAllowOnInteractionBeginProc; } PurchaseInteraction val2 = default(PurchaseInteraction); if (interactableObject.TryGetComponent<PurchaseInteraction>(ref val2)) { return !val2.disableSpawnOnInteraction; } DelusionChestController val3 = default(DelusionChestController); if (interactableObject.TryGetComponent<DelusionChestController>(ref val3)) { PickupPickerController val4 = default(PickupPickerController); if (interactableObject.TryGetComponent<PickupPickerController>(ref val4) && ((Behaviour)val4).enabled) { return false; } return true; } GenericPickupController val5 = default(GenericPickupController); if (interactableObject.TryGetComponent<GenericPickupController>(ref val5)) { return disallowPickups || val5.Duplicated; } if (Object.op_Implicit((Object)(object)interactableObject.GetComponent<VehicleSeat>())) { return false; } if (Object.op_Implicit((Object)(object)interactableObject.GetComponent<NetworkUIPromptController>())) { return false; } PowerPedestal val6 = default(PowerPedestal); if (interactableObject.TryGetComponent<PowerPedestal>(ref val6)) { return val6.CanTriggerFireworks; } AccessCodesNodeController val7 = default(AccessCodesNodeController); if (interactableObject.TryGetComponent<AccessCodesNodeController>(ref val7)) { return val7.CheckInteractionOrder(); } return true; } public static GameObject FixItemModel(this GameObject prefab) { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown //IL_0076: 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_00b4: Expected O, but got Unknown //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)prefab == (Object)null) { prefab = Resources.Load<GameObject>("prefabs/NullModel"); } ModelPanelParameters val = prefab.AddComponent<ModelPanelParameters>(); val.minDistance = 1f; val.maxDistance = 15f; Transform val2 = prefab.transform.Find("FocusPos"); if ((Object)(object)val2 == (Object)null) { GameObject val3 = new GameObject("FocusPos"); val2 = val3.transform; val2.parent = prefab.transform; val2.localPosition = Vector3.zero; } val.focusPointTransform = val2; Transform val4 = prefab.transform.Find("CameraPos"); if ((Object)(object)val4 == (Object)null) { GameObject val5 = new GameObject("CameraPos"); val4 = val5.transform; val4.parent = prefab.transform; val4.SetPositionAndRotation(val2.position + Vector3.forward * -7f + Vector3.right * -1f, val4.rotation); } val.cameraPositionTransform = val4; return prefab; } public static Sprite AsSprite(this Texture2D tex) { //IL_001a: 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) return Sprite.Create(tex, new Rect(0f, 0f, (float)((Texture)tex).width, (float)((Texture)tex).height), new Vector2(0.5f, 0.5f)); } public static void ReplacePickupsOnStart(this GivePickupsOnStart pickups, Action<ItemInfo> callback) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) if (callback != null) { ItemInfo[] itemInfos = pickups.itemInfos; foreach (ItemInfo obj in itemInfos) { callback(obj); } } } public static void ReplacePickupsOnStart(this GivePickupsOnStart pickups, Action<ItemDefInfo> callback) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) if (callback != null) { ItemDefInfo[] itemDefInfos = pickups.itemDefInfos; foreach (ItemDefInfo obj in itemDefInfos) { callback(obj); } } } } public static class CraftingUtils { private static RecipeIngredient[] _VanillaBossKeys; public static RecipeIngredient[] VanillaBossKeys { get { if (_VanillaBossKeys == null || _VanillaBossKeys.Length == 0) { List<RecipeIngredient> list = new List<RecipeIngredient>(); list.TryLoadAndAddIngredient<ItemDef>(RoR2_DLC3_Items_PowerPyramid.PowerPyramid_asset, "powerpyramid"); list.TryLoadAndAddIngredient<ItemDef>(RoR2_DLC3_Items_PowerCube.PowerCube_asset, "powercube"); _VanillaBossKeys = list.ToArray(); } return _VanillaBossKeys; } private set { _VanillaBossKeys = value; } } public static Recipe MakeRecipe(RecipeIngredient ingredientL, RecipeIngredient ingredientR) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown Recipe val = new Recipe(); val.ingredients = (RecipeIngredient[])(object)new RecipeIngredient[2] { ingredientL, ingredientR }; return val; } public static bool LoadAsIngredient<T>(string path, out RecipeIngredient ingredient) where T : Object { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) ingredient = null; if (string.IsNullOrWhiteSpace(path)) { return false; } Type typeFromHandle = typeof(T); if (typeFromHandle != typeof(ItemDef) && typeFromHandle != typeof(EquipmentDef)) { return false; } ingredient = GetRecipeIngredient((Object)(object)Addressables.LoadAssetAsync<T>((object)path).WaitForCompletion()); return ingredient != null; } public static bool ItemToIngredient(ItemDef item, out RecipeIngredient ingredient) { ingredient = GetRecipeIngredient((Object)(object)item); return ingredient != null; } public static bool EquipmentToIngredient(EquipmentDef item, out RecipeIngredient ingredient) { ingredient = GetRecipeIngredient((Object)(object)item); if (ingredient == null) { return false; } ingredient.isLunar = item.isLunar; ingredient.isBoss = item.isBoss; return true; } public static RecipeIngredient GetRecipeIngredient(Object pickup) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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_0041: Expected O, but got Unknown if (pickup == (Object)null || (!(pickup is ItemDef) && !(pickup is EquipmentDef))) { return null; } return new RecipeIngredient { pickup = pickup, type = (IngredientTypeIndex)0 }; } } public static class Hooks { public static void DoHooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown IcicleAuraController.Awake += new hook_Awake(AuraControllerFix); BuffWard.BuffTeam += new hook_BuffTeam(ApplyDotWard); ProjectileOverlapLimitHits.CountOverlapHits += new hook_CountOverlapHits(DecayProjectileOverlapDamage); ProjectileOverlapLimitHits.OnEnable += new hook_OnEnable(DecayProjectileRecordInitialDamage); ShockState.OnExit += new hook_OnExit(ShockSparkOnExit); ShockState.OnEnter += new hook_OnEnter(ShockBuffEnter); } private static void DecayProjectileRecordInitialDamage(orig_OnEnable orig, ProjectileOverlapLimitHits self) { orig.Invoke(self); if (self is ProjectileOverlapDecayDamage) { (self as ProjectileOverlapDecayDamage).initialDamageCoefficient = self.projectileOverlapAttack.damageCoefficient; (self as ProjectileOverlapDecayDamage).initialProcCoefficient = self.projectileOverlapAttack.overlapProcCoefficient; } } private static void DecayProjectileOverlapDamage(orig_CountOverlapHits orig, ProjectileOverlapLimitHits self) { orig.Invoke(self); if (self is ProjectileOverlapDecayDamage) { ProjectileOverlapDecayDamage projectileOverlapDecayDamage = self as ProjectileOverlapDecayDamage; if (self.hitCount < self.hitLimit) { self.projectileOverlapAttack.damageCoefficient = projectileOverlapDecayDamage.initialDamageCoefficient * projectileOverlapDecayDamage.firstHitDamageMultiplier * Mathf.Pow(projectileOverlapDecayDamage.onHitDamageMultiplier, (float)(self.hitCount - 1)); self.projectileOverlapAttack.overlapProcCoefficient = projectileOverlapDecayDamage.initialProcCoefficient * projectileOverlapDecayDamage.firstHitDamageMultiplier * Mathf.Pow(projectileOverlapDecayDamage.onHitDamageMultiplier, (float)(self.hitCount - 1)); } } } private static void AuraControllerFix(orig_Awake orig, IcicleAuraController self) { orig.Invoke(self); if (Object.op_Implicit((Object)(object)self.buffWard) && self.buffWard is DotWard dotWard) { dotWard.ownerObject = self.cachedOwnerInfo.gameObject; dotWard.ownerBody = self.cachedOwnerInfo.characterBody; } } private static void ApplyDotWard(orig_BuffTeam orig, BuffWard self, IEnumerable<TeamComponent> recipients, float radiusSqr, Vector3 currentPosition) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Invalid comparison between Unknown and I4 //IL_0084: 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_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Invalid comparison between Unknown and I4 //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: 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_0169: Unknown result type (might be due to invalid IL or missing references) if (!(self is DotWard dotWard)) { orig.Invoke(self, recipients, radiusSqr, currentPosition); } else { if (!NetworkServer.active || (int)dotWard.dotIndex == -1) { return; } GameObject ownerObject = dotWard.ownerObject; CharacterBody ownerBody = dotWard.ownerBody; Inventory ownerInventory = dotWard.ownerInventory; foreach (TeamComponent recipient in recipients) { Vector3 val = ((Component)recipient).transform.position - currentPosition; if ((int)self.shape == 1) { val.y = 0f; } if (!(((Vector3)(ref val)).sqrMagnitude <= radiusSqr)) { continue; } CharacterBody component = ((Component)recipient).GetComponent<CharacterBody>(); if (Object.op_Implicit((Object)(object)component) && (!self.requireGrounded || !Object.op_Implicit((Object)(object)component.characterMotor) || component.characterMotor.isGrounded)) { InflictDotInfo val2 = new InflictDotInfo { attackerObject = ownerObject, victimObject = ((Component)component).gameObject, totalDamage = dotWard.damageCoefficient * ownerBody.damage, damageMultiplier = 1f, dotIndex = dotWard.dotIndex, maxStacksFromAttacker = null }; if ((Object)(object)ownerInventory != (Object)null) { StrengthenBurnUtils.CheckDotForUpgrade(ownerInventory, ref val2); } DotController.InflictDot(ref val2); } } } } private static void ShockSparkOnExit(orig_OnExit orig, ShockState self) { //IL_0073: 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) if (ShockUtilsModule.UseShockSparks) { float num = self.healthFraction - ((EntityState)self).healthComponent.combinedHealthFraction; if (num >= self.healthFractionToForceExit) { GameObject lastHitAttacker = ((EntityState)self).healthComponent.lastHitAttacker; if ((Object)(object)lastHitAttacker != (Object)null) { CharacterBody component = lastHitAttacker.GetComponent<CharacterBody>(); if (Object.op_Implicit((Object)(object)component)) { Debug.Log((object)"break make spark"); NebulaPickup.CreateBoosterPickup(((EntityState)self).transform.position, component.teamComponent.teamIndex, Assets.sparkBoosterObject); } } } } orig.Invoke(self); } private static void ShockHit(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageInfo) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) if (ShockUtilsModule.UseShockSparks && ((Enum)damageInfo.damageType.damageType).HasFlag((Enum)(object)(DamageType)16777216)) { self.body.AddTimedBuff(Assets.shockMarker, (float)Assets.shockMarkerDuration); } orig.Invoke(self, damageInfo); } private static void ShockBuffEnter(orig_OnEnter orig, ShockState self) { orig.Invoke(self); if (ShockUtilsModule.UseShockSparks) { self.healthFractionToForceExit = ShockUtilsModule.shockForceExitFraction; } } private static void ShockBuffExit(orig_OnExit orig, ShockState self) { if (ShockUtilsModule.UseShockSparks && self != null && (Object)(object)((EntityState)self).characterBody != (Object)null && ((EntityState)self).characterBody.HasBuff(Assets.shockMarker)) { HealthComponent healthComponent = ((EntityState)self).healthComponent; GameObject lastHitAttacker = healthComponent.lastHitAttacker; if (!((Object)(object)lastHitAttacker == (Object)null)) { CharacterBody component = lastHitAttacker.GetComponent<CharacterBody>(); if ((Object)(object)component != (Object)null && component.maxShield > 0f && component.healthComponent?.shield != component.maxShield) { ShockHeal(component.healthComponent); } } } orig.Invoke(self); } private static void ShockHeal(HealthComponent attacker) { if (!attacker.body.HasBuff(Assets.shockHealCooldown)) { float num = (attacker.body.maxShield - attacker.shield) / attacker.body.maxShield; float num2 = attacker.body.maxShield / attacker.fullCombinedHealth; int num3 = (int)(num2 * num * 20f); for (int i = 0; i < num3; i++) { attacker.body.AddTimedBuff(Assets.shockHealCooldown, (float)(i + 1)); } attacker.ForceShieldRegen(); } } } public static class CustomScavengers { internal static bool _hooksEnabled = false; private static List<MultiExpansionSpawnCard.MasterInfo> masterInfos = new List<MultiExpansionSpawnCard.MasterInfo>(); private static bool _useCustomScavengers; private static MultiExpansionSpawnCard spawnCard; private static bool _repopulateVanillaScavengers = true; public static bool UseCustomScavengers { get { return _useCustomScavengers; } set { if (value) { SetHooks(); } _useCustomScavengers = value; } } public static bool RepopulateVanillaScavengers { get { return _repopulateVanillaScavengers; } set { _repopulateVanillaScavengers = value; } } public static void AddScavengerMaster(GameObject masterPrefab, float weight, ExpansionDef requiredExpansion = null) { MultiExpansionSpawnCard.MasterInfo item = new MultiExpansionSpawnCard.MasterInfo { masterPrefab = masterPrefab, requiredExpansion = requiredExpansion, weight = weight }; masterInfos.Add(item); } private static void SetHooks() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown if (!_hooksEnabled) { _hooksEnabled = true; RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(FinalizeSpawnCard)); Run.onRunStartGlobal += RegenerateSpawnCard; ScriptedCombatEncounter.Start += new hook_Start(OverrideTwistedScavengerEncounter); } } private static void OverrideTwistedScavengerEncounter(orig_Start orig, ScriptedCombatEncounter self) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) if (SceneCatalog.GetSceneDefForCurrentScene().nameToken == "MAP_LIMBO_TITLE") { SpawnInfo val = new SpawnInfo { spawnCard = (SpawnCard)(object)spawnCard, explicitSpawnPosition = self.spawns[0].explicitSpawnPosition }; self.spawns = (SpawnInfo[])(object)new SpawnInfo[1] { val }; } orig.Invoke(self); } private static void RegenerateSpawnCard(Run runInstance) { spawnCard.RegenerateSelection(); } private static void FinalizeSpawnCard() { SharedUtilsPlugin.LoadAsync<GameObject>(RoR2_Base_limbo.ScavLunarEncounter_prefab, (Action<GameObject>)delegate(GameObject encounterObject) { //IL_0040: 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_0056: 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_00db: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) ScriptedCombatEncounter val = default(ScriptedCombatEncounter); if (encounterObject.TryGetComponent<ScriptedCombatEncounter>(ref val)) { spawnCard = ScriptableObject.CreateInstance<MultiExpansionSpawnCard>(); spawnCard.masterInfos = masterInfos.ToArray(); ((SpawnCard)spawnCard).sendOverNetwork = true; ((SpawnCard)spawnCard).hullSize = (HullClassification)1; ((SpawnCard)spawnCard).nodeGraphType = (GraphType)0; ((SpawnCard)spawnCard).requiredFlags = (NodeFlags)2; ((SpawnCard)spawnCard).directorCreditCost = 0; ((SpawnCard)spawnCard).occupyPosition = false; ((CharacterSpawnCard)spawnCard).noElites = true; ((SpawnCard)spawnCard).eliteRules = (EliteRules)0; ((CharacterSpawnCard)spawnCard).forbiddenAsBoss = false; SpawnCard obj = val.spawns[0].spawnCard; CharacterSpawnCard val2 = (CharacterSpawnCard)(object)((obj is CharacterSpawnCard) ? obj : null); if ((Object)(object)val2 != (Object)null) { ((CharacterSpawnCard)spawnCard).loadout = val2.loadout; ((CharacterSpawnCard)spawnCard)._loadout = val2._loadout; } SpawnInfo val3 = new SpawnInfo { spawnCard = (SpawnCard)(object)spawnCard, explicitSpawnPosition = val.spawns[0].explicitSpawnPosition }; val.spawns = (SpawnInfo[])(object)new SpawnInfo[1] { val3 }; } }); } } public class MultiExpansionSpawnCard : CharacterSpawnCard { public struct MasterInfo { public GameObject masterPrefab; public ExpansionDef requiredExpansion; public float weight; } public WeightedSelection<MasterInfo> weightedMasterInfos = new WeightedSelection<MasterInfo>(8); public MasterInfo[] masterInfos; public void RegenerateSelection() { weightedMasterInfos.Clear(); MasterInfo[] array = masterInfos; for (int i = 0; i < array.Length; i++) { MasterInfo masterInfo = array[i]; if ((Object)(object)masterInfo.requiredExpansion == (Object)null || Run.instance.IsExpansionEnabled(masterInfo.requiredExpansion)) { weightedMasterInfos.AddChoice(masterInfo, masterInfo.weight); } } } public override void Spawn(Vector3 position, Quaternion rotation, DirectorSpawnRequest directorSpawnRequest, ref SpawnResult result) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) ((SpawnCard)this).prefab = weightedMasterInfos.Evaluate(Run.instance.spawnRng.nextNormalizedFloat).masterPrefab; ((CharacterSpawnCard)this).Spawn(position, rotation, directorSpawnRequest, ref result); } } public static class TwistedScavengerUtils { public static ExpansionDef dlc1 => SharedUtilsPlugin.dlc1; public static ExpansionDef dlc2 => SharedUtilsPlugin.dlc2; public static ExpansionDef dlc3 => SharedUtilsPlugin.dlc3; public static ExpansionDef dlc4 => SharedUtilsPlugin.dlc4; public static GivePickupsOnStart GetPickupOnStart(CharacterMaster master) { GivePickupsOnStart[] components = ((Component)master).GetComponents<GivePickupsOnStart>(); foreach (GivePickupsOnStart val in components) { if (((Behaviour)val).enabled) { return val; } } return null; } public static CharacterMaster CreateNewScavengerMaster(string scavNameToken, out CharacterBody scavBody) { //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_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) GameObject val = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_ScavLunar.ScavLunar1Master_prefab).WaitForCompletion(), scavNameToken + "Master", true); GameObject val2 = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_ScavLunar.ScavLunar1Body_prefab).WaitForCompletion(), scavNameToken + "Body", true); CharacterMaster component = val.GetComponent<CharacterMaster>(); scavBody = val2.GetComponent<CharacterBody>(); component.bodyPrefab = val2; scavBody.baseNameToken = scavNameToken.ToUpper() + "_NAME"; GivePickupsOnStart[] components = val.GetComponents<GivePickupsOnStart>(); foreach (GivePickupsOnStart val3 in components) { ((Behaviour)val3).enabled = false; } return component; } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.RiskOfBrainrot.RainrotSharedUtils", "RainrotSharedUtils", "1.3.6")] [R2APISubmoduleDependency(new string[] { "LanguageAPI" })] public class SharedUtilsPlugin : BaseUnityPlugin { public const string guid = "com.RiskOfBrainrot.RainrotSharedUtils"; public const string teamName = "RiskOfBrainrot"; public const string modName = "RainrotSharedUtils"; public const string version = "1.3.6"; public const string noAttackSpeedKeywordName = "Exacting"; public const string shelterKeywordToken = "2R4R_SHELTER_KEYWORD"; public const string executeKeywordToken = "2R4R_EXECUTION_KEYWORD"; public const string noAttackSpeedMultiplicativeKeywordToken = "2R4R_NOATTACKSPEEDMULTIPLICATIVE_KEYWORD"; public const string noAttackSpeedAdditiveKeywordToken = "2R4R_NOATTACKSPEEDADDITIVE_KEYWORD"; public const string noAttackSpeedKeywordToken = "2R4R_NOATTACKSPEED_KEYWORD"; public const string sparkPickupKeywordToken = "2R4R_SPARKPICKUP_KEYWORD"; public const float survivorExecuteThreshold = 0.15f; public static PluginInfo PInfo { get; private set; } public static ExpansionDef dlc1 => Addressables.LoadAssetAsync<ExpansionDef>((object)RoR2_DLC1_Common.DLC1_asset).WaitForCompletion(); public static ExpansionDef dlc2 => Addressables.LoadAssetAsync<ExpansionDef>((object)RoR2_DLC2_Common.DLC2_asset).WaitForCompletion(); public static ExpansionDef dlc3 => Addressables.LoadAssetAsync<ExpansionDef>((object)RoR2_DLC3.DLC3_asset).WaitForCompletion(); public static ExpansionDef dlc4 => Addressables.LoadAssetAsync<ExpansionDef>((object)RoR2_DLC4.DLC4_asset).WaitForCompletion(); public static float GetSurvivorExecuteThreshold(bool isBoss) { if (isBoss) { return 0.075f; } return 0.15f; } public void Awake() { Assets.Init(); ShelterUtilsModule.Init(); FrostUtilsModule.Init(); Hooks.DoHooks(); LanguageAPI.Add("2R4R_EXECUTION_KEYWORD", "<style=cKeywordName>Finisher</style><style=cSub>Enemies targeted by this skill can be <style=cIsHealth>instantly killed</style> if below " + $"<style=cIsHealth>{15.000001f}% health</style>. " + "Half as effective against Boss enemies.</style>"); LanguageAPI.Add("2R4R_NOATTACKSPEED_KEYWORD", FormatExacting("", "<style=cIsDamage>increase</style> this attack's <style=cIsDamage>total damage</style>.")); LanguageAPI.Add("2R4R_NOATTACKSPEEDMULTIPLICATIVE_KEYWORD", FormatExacting("Multiplicative", "<style=cIsDamage>multiply</style> this attack's <style=cIsDamage>total damage</style>.")); LanguageAPI.Add("2R4R_NOATTACKSPEEDADDITIVE_KEYWORD", FormatExacting("Additive", "are <style=cIsDamage>added to</style> this attack's <style=cIsDamage>damage multiplier</style>.")); LanguageAPI.Add("2R4R_SHELTER_KEYWORD", "<style=cKeywordName>Shelter</style><style=cSub>Protects from storms and fog.</style>"); LanguageAPI.Add("2R4R_SPARKPICKUP_KEYWORD", "<style=cKeywordName>Energizing Sparks</style><style=cSub>Creates <style=cIsDamage>spark pickups</style> that increase the " + $"<style=cIsDamage>attack speed</style> of all allies within <style=cIsDamage>{Assets.nebulaBoosterBuffRadius}m</style> " + $"by <style=cIsDamage>{Assets.sparkBoosterAspdBonus * 100f}%</style> for {Assets.nebulaBoosterBuffDuration} seconds. " + $"Can stack up to {5} times.</style>"); static string FormatExacting(string exactingType, string attackSpeedBonusesThen) { string text = (string.IsNullOrWhiteSpace(exactingType) ? "Exacting" : ("Exacting (" + exactingType + ")")); return "<style=cKeywordName>" + text + "</style><style=cSub>This skill will always take the same amount of time to cast, and is <style=cIsHealth>unaffected by attack speed bonuses</style>. Instead, attack speed bonuses " + attackSpeedBonusesThen + ".</style>"; } } public static void DebugBreakpoint(string methodName, int breakpointNumber = -1) { string text = "RainrotSharedUtils: " + methodName + " IL hook failed!"; if (breakpointNumber >= 0) { text += $" (breakpoint {breakpointNumber})"; } Debug.LogError((object)text); } public static AssetReferenceT<T> LoadAsync<T>(string guid, Action<T> callback) where T : Object { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) AssetReferenceT<T> val = new AssetReferenceT<T>(guid); AsyncOperationHandle<T> handle = AssetAsyncReferenceManager<T>.LoadAsset(val, (AsyncReferenceHandleUnloadType)2); if (callback == null) { return val; } if (handle.IsDone) { onCompleted(handle); return val; } handle.Completed += onCompleted; return val; void onCompleted(AsyncOperationHandle<T> val2) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Invalid comparison between Unknown and I4 if (val2.Result == null || (int)val2.Status != 1) { Debug.LogError((object)$"Failed to load asset [{val2.DebugName}] : {val2.OperationException}"); } else { callback(val2.Result); } } } } public static class Styling { public static string AsPercent(this float d) { return d * 100f + "%"; } public static string ConvertDecimal(float value) { return value * 100f + "%"; } public static string DamageColor(string text) { return "<style=cIsDamage>" + text + "</style>"; } public static string HealingColor(string text) { return "<style=cIsHealing>" + text + "</style>"; } public static string DamageValueText(float value) { return DamageColor(value.AsPercent() + " damage"); } public static string UtilityColor(string text) { return "<style=cIsUtility>" + text + "</style>"; } public static string RedText(string text) { return HealthColor(text); } public static string HealthColor(string text) { return "<style=cIsHealth>" + text + "</style>"; } public static string HexTierColor(string text) { return "<style=cDeath>" + text + "</style>"; } public static string KeywordText(string keyword, string sub) { return "<style=cKeywordName>" + keyword + "</style><style=cSub>" + sub + "</style>"; } public static string ScepterDescription(string desc) { return "\n<color=#d299ff>SCEPTER: " + desc + "</color>"; } public static string VoidColor(string text) { return "<style=cIsVoid>" + text + "</style>"; } public static string StackText(string text) { return StackColor("(" + text + " per stack)"); } public static string StackColor(string text) { return "<style=cStack>" + text + "</style>"; } public static string GetAchievementNameToken(string identifier) { return "ACHIEVEMENT_" + identifier.ToUpperInvariant() + "_NAME"; } public static string GetAchievementDescriptionToken(string identifier) { return "ACHIEVEMENT_" + identifier.ToUpperInvariant() + "_DESCRIPTION"; } public static string NumToAdj(int num) { return num switch { 1 => num + "st", 2 => num + "nd", 3 => num + "rd", _ => num + "th", }; } } } namespace RainrotSharedUtils.Status { public static class ShockUtilsModule { public static float shockForceExitFraction = 0.1f; private static bool _UseShockSparks = false; public static bool UseShockSparks { get { return _UseShockSparks; } set { if (value) { LanguageAPI.Add("KEYWORD_SHOCKING", "<style=cKeywordName>Shocking</style><style=cSub>Interrupts enemies and stuns them. The stun is broken if the target takes more than " + $"<style=cIsHealth>{shockForceExitFraction * 100f}%</style> " + "of their maximum health in damage. Breaking shock creates <style=cIsUtility>Energizing Sparks</style>.</style>"); } _UseShockSparks = true; } } public static void Init() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown SkillCatalog.Init += new hook_Init(OnSkillCatalogInit); } private static void OnSkillCatalogInit(orig_Init orig) { orig.Invoke(); if (!UseShockSparks) { return; } foreach (SkillDef allSkillDef in SkillCatalog.allSkillDefs) { if (allSkillDef.keywordTokens.Contains("KEYWORD_SHOCKING")) { string text = "2R4R_SPARKPICKUP_KEYWORD"; HGArrayUtilities.ArrayAppend<string>(ref allSkillDef.keywordTokens, ref text); } } } } } namespace RainrotSharedUtils.Frost { public static class FrostUtilsModule { public static int maxIceExplosionsPerSecond = 4; public static int iceExplosionsThisSecond = 0; public const int chillStacksMax = 6; public const float chillProcDuration = 6f; private static float iceExplosionTrackerTimer = 0f; public static GameObject iceExplosion => Assets.iceDelayBlastPrefab; public static void Init() { FixSnapfreeze(); } public static void FixedUpdate() { if (maxIceExplosionsPerSecond <= 0 || iceExplosionsThisSecond <= 0) { iceExplosionsThisSecond = 0; iceExplosionTrackerTimer = 1 / maxIceExplosionsPerSecond; return; } iceExplosionTrackerTimer -= Time.fixedDeltaTime; while (iceExplosionTrackerTimer < 0f) { iceExplosionTrackerTimer += 1 / maxIceExplosionsPerSecond; iceExplosionsThisSecond--; } } public static void FixSnapfreeze() { //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) GameObject val = Addressables.LoadAssetAsync<GameObject>((object)"65d14128d015b6946b0dec7981dfe63a").WaitForCompletion(); ProjectileImpactExplosion componentInChildren = val.GetComponentInChildren<ProjectileImpactExplosion>(); if (Object.op_Implicit((Object)(object)componentInChildren)) { componentInChildren.destroyOnEnemy = false; } } public static void CreateIceBlast(CharacterBody attackerBody, float baseForce, float damage, float procCoefficient, float radius, bool crit, Vector3 blastPosition, bool isStrongBlast = false, DamageSource damageSource = (DamageSource)0) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0048: 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_006c: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0092: 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_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active) { EffectManager.SpawnEffect(GetIceBlastEffect(isStrongBlast), new EffectData { origin = blastPosition, scale = radius }, true); BlastAttack val = new BlastAttack(); val.radius = radius; val.procCoefficient = procCoefficient; val.position = blastPosition; val.attacker = ((Component)attackerBody).gameObject; val.crit = crit; val.baseDamage = damage; val.falloffModel = (FalloffModel)0; val.baseForce = baseForce; val.teamIndex = attackerBody.teamComponent.teamIndex; val.attackerFiltering = (AttackerFiltering)2; val.damageType = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)0), (DamageTypeExtended)131072, damageSource); val.Fire(); } } public static GameObject GetIceBlastEffect(bool isStrongBlast) { if (isStrongBlast) { return Assets.iceNovaEffectStrong; } iceExplosionsThisSecond++; if (iceExplosionsThisSecond < maxIceExplosionsPerSecond) { return Assets.iceNovaEffectWeak; } return Assets.iceNovaEffectLowPriority; } public static void ApplyChillSphere(Vector3 origin, float radius, TeamIndex teamIndex, float duration = 6f, float chillCount = 3f) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: 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) //IL_002a: 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) if (!NetworkServer.active) { return; } SphereSearch val = new SphereSearch(); val.origin = origin; val.mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask; val.radius = radius; val.RefreshCandidates(); val.FilterCandidatesByHurtBoxTeam(TeamMask.GetUnprotectedTeams(teamIndex)); val.FilterCandidatesByDistinctHurtBoxEntities(); val.OrderCandidatesByDistance(); List<HurtBox> list = new List<HurtBox>(); val.GetHurtBoxes(list); val.ClearCandidates(); for (int i = 0; i < list.Count; i++) { HurtBox val2 = list[i]; CharacterBody val3 = val2.healthComponent?.body; if (Object.op_Implicit((Object)(object)val3)) { bool flag = val3.HasBuff(Buffs.FreezeImmune); bool isInFrozenState = val3.healthComponent.isInFrozenState; if (!flag && !isInFrozenState) { ApplyChillStacks(val3, 100f, chillCount, duration); } } } list.Clear(); } public static void ApplyChillStacks(CharacterMaster attackerMaster, CharacterBody vBody, float procChance, float chillCount = 1f, float chillDuration = 6f) { ApplyChillStacks(vBody, procChance, chillCount, chillDuration, Object.op_Implicit((Object)(object)attackerMaster) ? attackerMaster.luck : 1f); } public static void ApplyChillStacks(CharacterBody vBody, float procChance, float totalChillToApply = 1f, float chillDuration = 6f, float luck = 1f) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) int buffCount = vBody.GetBuffCount(Buffs.Frost); int num = 0; int num2 = 10 - 3 * num; if (buffCount > num2) { return; } totalChillToApply = Mathf.Min(totalChillToApply, (float)(num2 - buffCount)); for (int i = 0; (float)i < totalChillToApply; i++) { if (Util.CheckRoll(procChance, luck, (CharacterMaster)null)) { vBody.AddTimedBuff(Buffs.Frost.buffIndex, chillDuration); } } } } } namespace RainrotSharedUtils.Shelters { public class MockShelterComponent : ShelterProviderBehavior { public float scaleMultiplier = 1f; private Vector3 baseScale; public GameObject areaIndicatorReference; public float startingRadius; public float endRadius = 10f; public float durationBeforeShrink = 1f; public float durationForMaxShrink = 15f; private float age = 0f; private bool hasStartedShrink = false; private void Start() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)areaIndicatorReference)) { baseScale = areaIndicatorReference.transform.localScale / startingRadius; } SetSize(startingRadius); } private void FixedUpdate() { if (age >= durationForMaxShrink) { return; } age += Time.fixedDeltaTime; if (!(age < durationBeforeShrink)) { if (!hasStartedShrink) { hasStartedShrink = true; } if (age >= durationForMaxShrink) { SetSize(endRadius); return; } float num = (age - durationBeforeShrink) / durationForMaxShrink; float size = Mathf.Lerp(startingRadius, endRadius, num); SetSize(size); } } private void SetSize(float radius) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) base.fallbackRadius = radius; if (!((Object)(object)areaIndicatorReference == (Object)null)) { areaIndicatorReference.transform.localScale = radius * baseScale * scaleMultiplier; } } } public class ShelterProviderBehavior : MonoBehaviour { private static List<ShelterProviderBehavior> instancesList = new List<ShelterProviderBehavior>(); public static ReadOnlyCollection<ShelterProviderBehavior> readOnlyInstancesList = new ReadOnlyCollection<ShelterProviderBehavior>(instancesList); public HoldoutZoneController holdoutZoneController; public bool isSuperShelter = false; public bool isHazardZone = false; public float _fallbackRadius; public IZone zoneBehavior; public float fallbackRadius { get { if (!Object.op_Implicit((Object)(object)holdoutZoneController)) { return _fallbackRadius; } if (holdoutZoneController.charge <= 0f || holdoutZoneController.charge >= 1f || !((Behaviour)holdoutZoneController).isActiveAndEnabled) { return 0f; } return holdoutZoneController.currentRadius; } set { _fallbackRadius = value; } } public bool IsInBounds(Vector3 position, float radius = 0f) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: 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_0017: 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_0021: 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_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004d: 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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) Vector3 val = position; if (radius > 0f) { Vector3 val2 = position - ((Component)this).transform.position; val = position - ((Vector3)(ref val2)).normalized * radius; } if (zoneBehavior != null) { return zoneBehavior.IsInBounds(val); } if (fallbackRadius < 1f) { return false; } Vector3 val3 = val - ((Component)this).transform.position; return ((Vector3)(ref val3)).sqrMagnitude <= fallbackRadius * fallbackRadius; } private void OnEnable() { if (!ShelterUtilsModule.UseGlobalShelters && !ShelterUtilsModule.UseCustomShelters) { Debug.LogError((object)"Shelter Provider cannot initialize: Shelter Module not enabled. (Set UseGlobalShelters or UseCustomShelters to true!)"); Object.Destroy((Object)(object)this); } instancesList.Add(this); } private void OnDisable() { if (instancesList.Contains(this)) { instancesList.Remove(this); } } } public static class ShelterUtilsModule { public static bool UseGlobalShelters; public static bool UseCustomShelters; public static bool IsBodySuperSheltered(CharacterBody body, float radius = 0f) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) foreach (ShelterProviderBehavior readOnlyInstances in ShelterProviderBehavior.readOnlyInstancesList) { if (!readOnlyInstances.isSuperShelter || !readOnlyInstances.IsInBounds(body.corePosition, radius)) { continue; } return true; } return false; } public static bool IsPositionSuperSheltered(Vector3 position, float radius = 0f) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) foreach (ShelterProviderBehavior readOnlyInstances in ShelterProviderBehavior.readOnlyInstancesList) { if (!readOnlyInstances.isSuperShelter || !readOnlyInstances.IsInBounds(position, radius)) { continue; } return true; } return false; } public static bool IsBodySheltered(CharacterBody body, float radius = 0f) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) foreach (ShelterProviderBehavior readOnlyInstances in ShelterProviderBehavior.readOnlyInstancesList) { if (readOnlyInstances.isHazardZone || !readOnlyInstances.IsInBounds(body.corePosition, radius)) { continue; } return true; } return false; } public static bool IsPositionSheltered(Vector3 position, float radius = 0f) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) foreach (ShelterProviderBehavior readOnlyInstances in ShelterProviderBehavior.readOnlyInstancesList) { if (readOnlyInstances.isHazardZone || !readOnlyInstances.IsInBounds(position, radius)) { continue; } return true; } return false; } public static void Init() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //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_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Expected O, but got Unknown //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Expected O, but got Unknown //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Expected O, but got Unknown TeleporterInteraction.Awake += new hook_Awake(SheltersOnTeleporterAwake); HoldoutZoneController.Awake += new hook_Awake(SheltersOnHoldoutAwake); SphereZone.OnEnable += new hook_OnEnable(SheltersOnSphereZoneEnable); VerticalTubeZone.OnEnable += new hook_OnEnable(SheltersOnTubeZoneEnable); FogDamageController.EvaluateTeam += new hook_EvaluateTeam(EvaluateShelteredTeam); FogDamageController.GetAffectedBodiesOnTeam += new hook_GetAffectedBodiesOnTeam(GetFogAffectedBodies); GameObject val = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC2/ShrineHalcyonite.prefab").WaitForCompletion(); if (Object.op_Implicit((Object)(object)val)) { HalcyoniteShrineInteractable component = val.GetComponent<HalcyoniteShrineInteractable>(); if (Object.op_Implicit((Object)(object)component)) { ShelterProviderBehavior shelterProviderBehavior = val.AddComponent<ShelterProviderBehavior>(); shelterProviderBehavior.fallbackRadius = component.radius; } } HalcyoniteShrineInteractable.DrainConditionMet += new hook_DrainConditionMet(MockShelter_Halcyon); ChargingState.OnExit += new hook_OnExit(MockShelter_TP); OverchargingState.OnExit += new hook_OnExit(MockShelter_MajorCatastrophe); Run.onRunDestroyGlobal += SheltersOnRunDestroy; } private static void MockShelter_MajorCatastrophe(orig_OnExit orig, OverchargingState self) { HoldoutZoneController holdoutZoneController = ((BaseTeleporterState)self).teleporterInteraction.holdoutZoneController; float currentRadius = holdoutZoneController.currentRadius; GameObject gameObject = ((Component)holdoutZoneController.radiusIndicator).gameObject; MakeMockShelter(gameObject, currentRadius, 25f); orig.Invoke(self); } private static void MockShelter_TP(orig_OnExit orig, ChargingState self) { if (self is ChargingState) { orig.Invoke(self); return; } HoldoutZoneController holdoutZoneController = ((BaseTeleporterState)self).teleporterInteraction.holdoutZoneController; float currentRadius = holdoutZoneController.currentRadius; GameObject gameObject = ((Component)holdoutZoneController.radiusIndicator).gameObject; MakeMockShelter(gameObject, currentRadius, 25f); orig.Invoke(self); } private static void MockShelter_Halcyon(orig_DrainConditionMet orig, HalcyoniteShrineInteractable self) { float radius = self.radius; GameObject gameObject = self.shrineHalcyoniteBubble.gameObject; MakeMockShelter(gameObject, radius, 15f, 2f); orig.Invoke(self); } public static void MakeMockShelter(GameObject indicator, float startRadius, float endRadius, float stupidBullshit = 1f) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) if (!UseGlobalShelters) { return; } GameObject val = new GameObject(); ((Object)val).name = "MockShelter"; val.transform.position = indicator.transform.position; MockShelterComponent mockShelterComponent = val.AddComponent<MockShelterComponent>(); mockShelterComponent.startingRadius = startRadius; mockShelterComponent.endRadius = endRadius; mockShelterComponent.scaleMultiplier = stupidBullshit; if (!((Object)(object)indicator == (Object)null)) { GameObject val2 = Object.Instantiate<GameObject>(indicator, val.transform); if (!val2.activeInHierarchy) { val2.SetActive(true); } val2.transform.parent = val.transform; mockShelterComponent.areaIndicatorReference = val2; ShelterProviderBehavior shelterProviderBehavior = default(ShelterProviderBehavior); if (val2.TryGetComponent<ShelterProviderBehavior>(ref shelterProviderBehavior)) { ((Behaviour)shelterProviderBehavior).enabled = false; } } } private static void EvaluateShelteredTeam(orig_EvaluateTeam orig, FogDamageController self, TeamIndex teamIndex) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) if (!UseCustomShelters && !UseGlobalShelters) { orig.Invoke(self, teamIndex); return; } foreach (TeamComponent teamMember in TeamComponent.GetTeamMembers(teamIndex)) { CharacterBody body = teamMember.body; bool flag = self.characterBodyToStacks.ContainsKey(body); bool flag2 = IsBodySheltered(body); bool flag3 = body.HasBuff(Buffs.VoidFogStackCooldown); if (!flag2) { foreach (IZone safeZone in self.safeZones) { if (safeZone.IsInBounds(((Component)teamMember).transform.position)) { flag2 = true; break; } } } if (flag2) { if (flag) { self.characterBodyToStacks.Remove(body); if (flag3) { body.RemoveOldestTimedBuff(Buffs.VoidFogStackCooldown); } } } else if (!flag) { self.characterBodyToStacks.Add(body, 1); self.DumpArenaDamageInfo(body); body.AddTimedBuff(Buffs.VoidFogStackCooldown, self.healthFractionRampIncreaseCooldown); } else if (!flag3) { self.characterBodyToStacks[body]++; self.DumpArenaDamageInfo(body); body.AddTimedBuff(Buffs.VoidFogStackCooldown, self.healthFractionRampIncreaseCooldown); } } } private static IEnumerable<CharacterBody> GetFogAffectedBodies(orig_GetAffectedBodiesOnTeam orig, FogDamageController self, TeamIndex teamIndex) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) IEnumerable<CharacterBody> source = orig.Invoke(self, teamIndex); return source.Where((CharacterBody body) => !IsBodySheltered(body)); } private static ShelterProviderBehavior AddShelterProvider(GameObject obj, IZone zone, bool inverted = false, float radius = 0f) { ShelterProviderBehavior shelterProviderBehavior = obj.GetComponent<ShelterProviderBehavior>(); if (!Object.op_Implicit((Object)(object)shelterProviderBehavior)) { shelterProviderBehavior = obj.AddComponent<ShelterProviderBehavior>(); shelterProviderBehavior.isHazardZone = inverted; } shelterProviderBehavior.zoneBehavior = zone; shelterProviderBehavior.fallbackRadius = radius; return shelterProviderBehavior; } private static void SheltersOnRunDestroy(Run obj) { ReadOnlyCollection<ShelterProviderBehavior> readOnlyInstancesList = ShelterProviderBehavior.readOnlyInstancesList; for (int num = readOnlyInstancesList.Count - 1; num >= 0; num--) { if (Object.op_Implicit((Object)(object)readOnlyInstancesList[num])) { Object.Destroy((Object)(object)((Component)readOnlyInstancesList[num]).gameObject); } } } private static void SheltersOnTeleporterAwake(orig_Awake orig, TeleporterInteraction self) { orig.Invoke(self); if (UseGlobalShelters) { ShelterProviderBehavior shelterProviderBehavior = AddShelterProvider(((Component)self).gameObject, (IZone)(object)self.holdoutZoneController, inverted: false, self.holdoutZoneController.baseRadius); shelterProviderBehavior.holdoutZoneController = self.holdoutZoneController; shelterProviderBehavior.isSuperShelter = true; } } private static void SheltersOnTubeZoneEnable(orig_OnEnable orig, VerticalTubeZone self) { orig.Invoke(self); if (UseGlobalShelters) { AddShelterProvider(((Component)self).gameObject, (IZone)(object)self, inverted: false, self.radius); } } private static void SheltersOnSphereZoneEnable(orig_OnEnable orig, SphereZone self) { orig.Invoke(self); if (UseGlobalShelters) { AddShelterProvider(((Component)self).gameObject, (IZone)(object)self, self.isInverted, self.radius); } } private static void SheltersOnHoldoutAwake(orig_Awake orig, HoldoutZoneController self) { orig.Invoke(self); if (UseGlobalShelters) { ShelterProviderBehavior shelterProviderBehavior = AddShelterProvider(((Component)self).gameObject, (IZone)(object)self, inverted: false, self.baseRadius); shelterProviderBehavior.holdoutZoneController = self; } } } } namespace RainrotSharedUtils.Compat { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.RiskOfBrainrot.RainrotSharedCompats", "RainrotSharedCompats", "1.0.0")] [R2APISubmoduleDependency(new string[] { "LanguageAPI" })] public class SharedUtilsCompatPlugin : BaseUnityPlugin { public const string guid = "com.RiskOfBrainrot.RainrotSharedCompats"; public const string teamName = "RiskOfBrainrot"; public const string modName = "RainrotSharedCompats"; public const string version = "1.0.0"; public static PluginInfo PInfo { get; private set; } public static bool snowtimeLoaded => ModLoaded("SnowySnowtime.SnowtimeToyboxMod"); public static bool riskierLoaded => ModLoaded("com.RiskOfBrainrot.RiskierRain"); public static bool ModLoaded(string modGuid) { return !Utility.IsNullOrWhiteSpace(modGuid) && Chainloader.PluginInfos.ContainsKey(modGuid); } private void Awake() { if (snowtimeLoaded) { DoSnowtimeCompat(); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private void DoSnowtimeCompat() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: 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) DifficultyIndex snowtimeLegendaryDiffIndex = SnowtimeToyboxMod.SnowtimeLegendaryDiffIndex; MoreDifficultyStats moreDifficultyStats = DifficultyUtilsModule.GetMoreDifficultyStats(snowtimeLegendaryDiffIndex); moreDifficultyStats.startingLevelBoost = 9f; moreDifficultyStats.startingDifficultyCoefficientBoost = 0f; moreDifficultyStats.startingDifficultyDisplay = 12f; moreDifficultyStats.ambientLevelCap = int.MaxValue; moreDifficultyStats.tier2EliteStage = 3; moreDifficultyStats.tier1AndHalfEliteStage = 1; moreDifficultyStats.delayFirstStorm_ForSwanSong = true; moreDifficultyStats.desiredStormTime_ForSwanSong = 4f; moreDifficultyStats.desiredStormWarningTime_ForSwanSong = 1f; moreDifficultyStats.stormIntensifyStrength_ForSwanSong = 0.7f; DifficultyUtilsModule.difficultyCustomStats[snowtimeLegendaryDiffIndex] = moreDifficultyStats; } } } namespace RainrotSharedUtils.MoreProjectiles { public static class MoreProjectilesHooks { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func<Instruction, bool> <>9__2_0; public static Func<Instruction, bool> <>9__2_1; public static Func<Instruction, bool> <>9__2_2; public static Func<Instruction, bool> <>9__2_3; public static Func<Instruction, bool> <>9__2_4; public static Func<CharacterBody, int> <>9__2_5; public static Func<Instruction, bool> <>9__4_0; public static Func<Instruction, bool> <>9__4_2; public static Func<Instruction, bool> <>9__4_4; public static Action<Spit, Ray, float> <>9__4_5; public static Func<Instruction, bool> <>9__8_0; public static Action<ProjectileManager, GameObject, Vector3, Quaternion, GameObject, float, float, bool, DamageColorIndex, GameObject, float, PrimarySkillShurikenBehavior> <>9__8_1; public static hook_FireBfg <>9__9_0; public static hook_FireBlackhole <>9__9_1; public static hook_FireMolotov <>9__9_2; public static hook_FireGummyClone <>9__9_3; public static Func<Instruction, bool> <>9__10_0; public static Func<int, ChargeTrioBomb, int> <>9__10_1; public static Func<int, UltChannelState, int> <>9__14_0; public static Func<Instruction, bool> <>9__14_1; public static Func<int, WeaponSlam, int> <>9__15_0; public static Func<Instruction, bool> <>9__15_1; public static Func<int, FistSlam, int> <>9__16_0; public static Func<Instruction, bool> <>9__16_1; public static Func<Instruction, bool> <>9__25_1; public static Action<Orb, EntityState> <>9__25_2; internal bool <OverrideIcbmMissiles>b__2_0(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC1Content/Items", "MoreMissile"); } internal bool <OverrideIcbmMissiles>b__2_1(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt<Inventory>(x, "GetItemCountEffective"); } internal bool <OverrideIcbmMissiles>b__2_2(Instruction x) { return ILPatternMatchingExt.MatchDup(x); } internal bool <OverrideIcbmMissiles>b__2_3(Instruction x) { return ILPatternMatchingExt.MatchLdcI4(x, 0); } internal bool <OverrideIcbmMissiles>b__2_4(Instruction x) { ILLabel val = default(ILLabel); return ILPatternMatchingExt.MatchBle(x, ref val); } internal int <OverrideIcbmMissiles>b__2_5(CharacterBody body) { if (MoreProjectilesModule.IsMoreProjectilesActiveForBody(body)) { return 1; } return 0; } internal bool <MissileArtifact_VerminSpit>b__4_0(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt<BaseState>(x, "GetAimRay"); } internal bool <MissileArtifact_VerminSpit>b__4_2(Instruction x) { return ILPatternMatchingExt.MatchLdfld<BaseState>(x, "damageStat"); } internal bool <MissileArtifact_VerminSpit>b__4_4(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt<ProjectileManager>(x, "FireProjectileWithoutDamageType"); } internal void <MissileArtifact_VerminSpit>b__4_5(Spit self, Ray aimRay, float damage) { //IL_0020: 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_003c: 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_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_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_00a1: Unknown result type (might be due to invalid IL or missing references) if (MoreProjectilesModule.IsMoreProjectilesActiveForBody(((EntityState)self).characterBody) && MoreProjectilesModule.UseExpensiveProjectiles) { FireProjectileInfo fireProjectileInfo = new FireProjectileInfo { projectilePrefab = ((GenericProjectileBaseState)self).projectilePrefab, position = ((Ray)(ref aimRay)).origin, rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), owner = ((EntityState)self).gameObject, damage = damage, crit = Util.CheckRoll(((BaseState)self).critStat, ((EntityState)self).characterBody.master) }; Vector3 axis = Vector3.Cross(Vector3.up, ((Ray)(ref aimRay)).direction); MoreProjectilesModule.FireWarfareFlankProjectiles(aimRay, fireProjectileInfo, 20f, axis); } } internal bool <MissileArtifact_Shuriken>b__8_0(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt<ProjectileManager>(x, "FireProjectileWithoutDamageType"); } internal void <MissileArtifact_Shuriken>b__8_1(ProjectileManager projectileManagerInstance, GameObject projectilePrefab, Vector3 origin, Quaternion rotation, GameObject owner, float damage, float force, bool crit, DamageColorIndex damageColorIndex, GameObject target, float speedOverride, PrimarySkillShurikenBehavior behavior) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0004: 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_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004f: 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_0070: 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) projectileManagerInstance.FireProjectileWithoutDamageType(projectilePrefab, origin, rotation, owner, damage, force, crit, damageColorIndex, target, speedOverride); if (MoreProjectilesModule.IsMoreProjectilesActiveForBody(((BaseItemBodyBehavior)behavior).body)) { Ray aimRay = behavior.GetAimRay(); FireProjectileInfo fireProjectileInfo = new FireProjectileInfo { projectilePrefab = projectilePrefab, position = origin, rotation = rotation, owner = owner, damage = damage, crit = crit }; MoreProjectilesModule.FireWarfareFlankProjectiles(aimRay, fireProjectileInfo, 20f); } } internal bool <EquipmentsLol>b__9_0(orig_FireBfg orig, EquipmentSlot self) { if (orig.Invoke(self)) { MoreProjectilesModule.FireWarfareFlankProjectilesSimple(self.characterBody, 40f, RoR2_Base_BFG.BeamSphere_prefab); return true; } return false; } internal bool <EquipmentsLol>b__9_1(orig_FireBlackhole orig, EquipmentSlot self) { if (orig.Invoke(self)) { MoreProjectilesModule.FireWarfareFlankProjectilesSimple(self.characterBody, 0f, RoR2_Base_Blackhole.GravSphere_prefab); return true; } return false; } internal bool <EquipmentsLol>b__9_2(orig_FireMolotov orig, EquipmentSlot self) { if (orig.Invoke(self) && MoreProjectilesModule.UseExpensiveProjectiles) { MoreProjectilesModule.FireWarfareFlankProjectilesSimple(self.characterBody, 1f, RoR2_DLC1_Molotov.MolotovClusterProjectile_prefab); return true; } return false; } internal bool <EquipmentsLol>b__9_3(orig_FireGummyClone orig, EquipmentSlot self) { if (orig.Invoke(self) && MoreProjectilesModule.UseExpensiveProjectiles) { if (Object.op_Implicit((Object)(object)self.characterBody) && Object.op_Implicit((Object)(object)self.characterBody.master) && !self.characterBody.master.IsDeployableLimited((DeployableSlot)14)) { MoreProjectilesModule.FireWarfareFlankProjectilesSimple(self.characterBody, 0f, RoR2_DLC1_GummyClone.GummyCloneProjectile_prefab); } return true; } return false; } internal bool <MissileArtifact_ChargeTrioBomb>b__10_0(Instruction x) { return ILPatternMatchingExt.MatchLdcI4(x, 3); } internal int <MissileArtifact_ChargeTrioBomb>b__10_1(int bellCount, ChargeTrioBomb self) { if (!MoreProjectilesModule.IsMoreProjectilesActiveForBody(((EntityState)self).characterBody)) { return bellCount; } return bellCount + 2; } internal int <MissileArtifact_BrotherUltChannelState>b__14_0(int projectileCtIn, UltChannelState self) { if (MoreProjectilesModule.IsMoreProjectilesActiveForBody(((EntityState)self).characterBody)) { return projectileCtIn + 6; } return projectileCtIn; } internal bool <MissileArtifact_BrotherUltChannelState>b__14_1(Instruction x) { return ILPatternMatchingExt.MatchLdsfld<UltChannelState>(x, "waveProjectileCount"); } internal int <MissileArtifact_BrotherWeaponSlam>b__15_0(int projectileCtIn, WeaponSlam self) { if (MoreProjectilesModule.IsMoreProjectilesActiveForBody(((EntityState)self).characterBody)) { return projectileCtIn + 2; } return projectileCtIn; } internal bool <MissileArtifact_BrotherWeaponSlam>b__15_1(Instruction x) { return ILPatternMatchingExt.MatchLdsfld<WeaponSlam>(x, "waveProjectileCount"); } internal int <MissileArtifact_BrotherFistSlam>b__16_0(int projectileCtIn, FistSlam self) { if (MoreProjectilesModule.IsMoreProjectilesActiveForBody(((EntityState)self).characterBody)) { return projectileCtIn + 6; } return projectileCtIn; } internal bool <MissileArtifact_BrotherFistSlam>b__16_1(Instruction x) { return ILPatternMatchingExt.MatchLdsfld<FistSlam>(x, "waveProjectileCount"); } internal bool <MissileArtifact_FireHuntressSeekingArrow>b__25_1(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt<OrbManager>(x, "AddOrb"); } internal void <MissileArtifact_FireHuntressSeekingArrow>b__25_2(Orb orb, EntityState state) { if (MoreProjectilesModule.IsMoreProjectilesActiveForBody(state.characterBody)) { OrbManager.instance.AddOrb(orb); OrbManager.instance.AddOrb(orb); } } } public const float missileSpread = 45f; public const float projectileSpread = 20f; public static void OverrideIcbmMissiles(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0126: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); ILLabel val2 = val.DefineLabel(); if (!val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[3] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC1Content/Items", "MoreMissile"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Inventory>(x, "GetItemCountEffective"), (Instruction x) => ILPatternMatchingExt.MatchDup(x) })) { SharedUtilsPlugin.DebugBreakpoint("OverrideIcbmMissiles", 1); return; } int index = val.Index; val.Index = index - 1; val2 = val.MarkLabel(); ILLabel val3 = default(ILLabel); if (!val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[2] { (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 0), (Instruction x) => ILPatternMatchingExt.MatchBle(x, ref val3) })) { SharedUtilsPlugin.DebugBreakpoint("OverrideIcbmMissiles", 2); return; } val.Emit(OpCodes.Ldarg_1); val.EmitDelegate<Func<CharacterBody, int>>((Func<CharacterBody, int>)((CharacterBody body) => MoreProjectilesModule.IsMoreProjectilesActiveForBody(body) ? 1 : 0)); val.GotoLabel(val2, (MoveType)1, false); val.Remove(); } public static void MissileArtifact_FireProjectile(orig_FireProjectile orig, GenericProjectileBaseState self) { //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: 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_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) if (MoreProjectilesModule.IsMoreProjectilesActiveForBod