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.Toolbot; using EntityStates.VagrantMonster; using EntityStates.VoidBarnacle.Weapon; using EntityStates.VoidSurvivor.Weapon; 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 Inferno; using Inferno.Skill_Misc; 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.BrotherMonster; 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.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.Orbs; using RoR2.Projectile; using RoR2.Skills; using RoR2BepInExPack.GameAssetPaths.Version_1_39_0; using RoR2BepInExPack.GameAssetPathsBetter; using SnowtimeToybox; 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: 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(); 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(); 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("Prefabs/Effects/ImpactEffects/AffixWhiteExplosion"), "IceExplosion" + s, false); ParticleSystemRenderer component = ((Component)val.transform.Find("Nova Sphere")).GetComponent(); Material val2 = Object.Instantiate(((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("Prefabs/NetworkedObjects/GenericDelayBlast"), "IceDelayBlast", false); DelayBlast component = val.GetComponent(); 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(); ContentAddition.AddProjectile(val); return val; } private static GameObject CreateIceDelayEffect() { GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/Effects/AffixWhiteDelayEffect"), "iceDelay", false); val.GetComponent().duration = 0.2f; ParticleSystemRenderer component = ((Component)val.transform.Find("Nova Sphere")).GetComponent(); Material val2 = Object.Instantiate(((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((object)"7f9217d45f824f245862e65716abc746").WaitForCompletion(); GameObject val2 = PrefabAPI.InstantiateClone(val, boosterName, true); ParticleSystemRenderer[] componentsInChildren = val2.GetComponentsInChildren(); 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(((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(); 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(); if ((Object)(object)component2 != (Object)null) { component2.duration = boosterDuration; } else { Debug.Log((object)(boosterName + " HAS NO DOT????")); } BeginRapidlyActivatingAndDeactivating component3 = val2.GetComponent(); 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(); if (antiGravity == 1f) { component4.useGravity = true; } else { AntiGravityForce val7 = val2.AddComponent(); val7.rb = component4; val7.antiGravityCoefficient = antiGravity; } } HealthPickup componentInChildren = val2.GetComponentInChildren(); NebulaPickup nebulaPickup = ((Component)componentInChildren).gameObject.AddComponent(); nebulaPickup.pickupEffect = componentInChildren.pickupEffect; nebulaPickup.baseObject = componentInChildren.baseObject; nebulaPickup.teamFilter = val2.GetComponent(); if ((Object)(object)boosterBuff != (Object)null) { nebulaPickup.buffDef = boosterBuff; } else { Debug.Log((object)(boosterName + "BOOSTER BUFFDEF WAS NULL")); } GravitatePickup componentInChildren2 = val2.GetComponentInChildren(); if ((Object)(object)componentInChildren2 != (Object)null) { componentInChildren2.acceleration = 2f; componentInChildren2.maxSpeed = 50f; Collider component5 = ((Component)componentInChildren2).gameObject.GetComponent(); 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(); ((Object)sparkBoosterBuff).name = "bdSparkBoost"; sparkBoosterBuff.buffColor = Color32.op_Implicit(sparkBoosterColor); sparkBoosterBuff.canStack = true; AsyncOperationHandle val = Addressables.LoadAssetAsync((object)RoR2_Base_ShockNearby.texBuffTeslaIcon_tif); val.Completed += delegate(AsyncOperationHandle 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(); ((Object)shockMarker).name = "bdShockDebuff"; shockMarker.buffColor = new Color(0f, 0f, 0.6f); shockMarker.canStack = false; shockMarker.isDebuff = true; shockMarker.isHidden = true; AsyncOperationHandle val = Addressables.LoadAssetAsync((object)RoR2_Base_ShockNearby.texBuffTeslaIcon_tif); val.Completed += delegate(AsyncOperationHandle 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(); ((Object)shockHealCooldown).name = "bdShockDebuff"; shockHealCooldown.buffColor = new Color(0f, 0f, 0.6f); shockHealCooldown.canStack = true; shockHealCooldown.isDebuff = false; shockHealCooldown.isCooldown = true; AsyncOperationHandle val = Addressables.LoadAssetAsync((object)RoR2_Base_ShockNearby.texBuffTeslaIcon_tif); val.Completed += delegate(AsyncOperationHandle ctx) { shockHealCooldown.iconSprite = ctx.Result; }; ContentAddition.AddBuffDef(shockHealCooldown); } } 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 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(); 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(); 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(); 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(); } } } [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 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", "FinisherEnemies targeted by this skill can be instantly killed if below " + $"{15.000001f}% health. " + "Half as effective against Boss enemies."); LanguageAPI.Add("2R4R_NOATTACKSPEED_KEYWORD", FormatExacting("", "increase this attack's total damage.")); LanguageAPI.Add("2R4R_NOATTACKSPEEDMULTIPLICATIVE_KEYWORD", FormatExacting("Multiplicative", "multiply this attack's total damage.")); LanguageAPI.Add("2R4R_NOATTACKSPEEDADDITIVE_KEYWORD", FormatExacting("Additive", "are added to this attack's damage multiplier.")); LanguageAPI.Add("2R4R_SHELTER_KEYWORD", "ShelterProtects from storms and fog."); LanguageAPI.Add("2R4R_SPARKPICKUP_KEYWORD", "Energizing SparksCreates spark pickups that increase the " + $"attack speed of all allies within {Assets.nebulaBoosterBuffRadius}m " + $"by {Assets.sparkBoosterAspdBonus * 100f}% for {Assets.nebulaBoosterBuffDuration} seconds. " + $"Can stack up to {5} times."); static string FormatExacting(string exactingType, string attackSpeedBonusesThen) { string text = (string.IsNullOrWhiteSpace(exactingType) ? "Exacting" : ("Exacting (" + exactingType + ")")); return "" + text + "This skill will always take the same amount of time to cast, and is unaffected by attack speed bonuses. Instead, attack speed bonuses " + attackSpeedBonusesThen + "."; } } 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); } } } 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", "ShockingInterrupts enemies and stuns them. The stun is broken if the target takes more than " + $"{shockForceExitFraction * 100f}% " + "of their maximum health in damage. Breaking shock creates Energizing Sparks."); } _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(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((object)"65d14128d015b6946b0dec7981dfe63a").WaitForCompletion(); ProjectileImpactExplosion componentInChildren = val.GetComponentInChildren(); 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 list = new List(); 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 FixedUpdate() { //IL_0077: 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_0087: Unknown result type (might be due to invalid IL or missing references) if (age >= durationForMaxShrink) { return; } age += Time.fixedDeltaTime; if (!(age > durationBeforeShrink)) { return; } if (!hasStartedShrink) { hasStartedShrink = true; if (Object.op_Implicit((Object)(object)areaIndicatorReference)) { baseScale = areaIndicatorReference.transform.localScale / startingRadius; } } 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 instancesList = new List(); public static ReadOnlyCollection readOnlyInstancesList = new ReadOnlyCollection(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 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((object)"RoR2/DLC2/ShrineHalcyonite.prefab").WaitForCompletion(); if (Object.op_Implicit((Object)(object)val)) { HalcyoniteShrineInteractable component = val.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { ShelterProviderBehavior shelterProviderBehavior = val.AddComponent(); shelterProviderBehavior.fallbackRadius = component.radius; } } HalcyoniteShrineInteractable.DrainConditionMet += new hook_DrainConditionMet(MockShelter_Halcyon); ChargingState.OnExit += new hook_OnExit(MockShelter_TP); Run.onRunDestroyGlobal += SheltersOnRunDestroy; } private static void MockShelter_TP(orig_OnExit orig, ChargingState 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_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.startingRadius = startRadius; mockShelterComponent.endRadius = endRadius; mockShelterComponent.scaleMultiplier = stupidBullshit; if (!((Object)(object)indicator == (Object)null)) { GameObject val2 = Object.Instantiate(indicator, val.transform); if (!val2.activeInHierarchy) { val2.SetActive(true); } val2.transform.parent = val.transform; mockShelterComponent.areaIndicatorReference = val2; ShelterProviderBehavior shelterProviderBehavior = default(ShelterProviderBehavior); if (val2.TryGetComponent(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 GetFogAffectedBodies(orig_GetAffectedBodiesOnTeam orig, FogDamageController self, TeamIndex teamIndex) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) IEnumerable 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(); if (!Object.op_Implicit((Object)(object)shelterProviderBehavior)) { shelterProviderBehavior = obj.AddComponent(); shelterProviderBehavior.isHazardZone = inverted; } shelterProviderBehavior.zoneBehavior = zone; shelterProviderBehavior.fallbackRadius = radius; return shelterProviderBehavior; } private static void SheltersOnRunDestroy(Run obj) { ReadOnlyCollection 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 delegate bool orig_ChangeAmbientCap(Main main, Run run, RuleBook ruleBook); 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 infernoLoaded => ModLoaded("HIFU.Inferno"); 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 (infernoLoaded) { DoInfernoCompat(); } 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; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private static void DoInfernoCompat() { //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_0074: Unknown result type (might be due to invalid IL or missing references) DifficultyIndex infernoDiffIndex = Main.InfernoDiffIndex; MoreDifficultyStats moreDifficultyStats = DifficultyUtilsModule.GetMoreDifficultyStats(infernoDiffIndex); moreDifficultyStats.startingLevelBoost = Main.LevelDiffBoost.Value; moreDifficultyStats.startingDifficultyDisplay = Main.LevelDiffBoost.Value; moreDifficultyStats.ambientLevelCap = int.MaxValue; moreDifficultyStats.tier2EliteStage = 4; moreDifficultyStats.tier1AndHalfEliteStage = 2; moreDifficultyStats.delayFirstStorm_ForSwanSong = false; moreDifficultyStats.desiredStormTime_ForSwanSong = 3.5f; moreDifficultyStats.desiredStormWarningTime_ForSwanSong = 1f; moreDifficultyStats.stormIntensifyStrength_ForSwanSong = 0.6f; DifficultyUtilsModule.difficultyCustomStats[infernoDiffIndex] = moreDifficultyStats; DifficultyUtilsModule.CompensateRewardsForDifficultyBoost = true; Run.onRunStartGlobal += RemoveInfernoHooks; } private static void RemoveInfernoHooks(Run obj) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown if (riskierLoaded) { Run.RecalculateDifficultyCoefficentInternal -= new hook_RecalculateDifficultyCoefficentInternal(Hooks.AmbientLevelBoost); } } public static void InfernoAmbientCap(orig_ChangeAmbientCap orig, Main main, Run run, RuleBook ruleBook) { } } } namespace RainrotSharedUtils.MoreProjectiles { public static class MoreProjectilesHooks { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__2_0; public static Func <>9__2_1; public static Func <>9__2_2; public static Func <>9__2_3; public static Func <>9__2_4; public static Func <>9__2_5; public static Func <>9__4_0; public static Func <>9__4_2; public static Func <>9__4_4; public static Action <>9__4_5; public static Func <>9__8_0; public static Action <>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 <>9__10_0; public static Func <>9__10_1; public static Func <>9__25_1; public static Action <>9__25_2; internal bool b__2_0(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC1Content/Items", "MoreMissile"); } internal bool b__2_1(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, "GetItemCountEffective"); } internal bool b__2_2(Instruction x) { return ILPatternMatchingExt.MatchDup(x); } internal bool b__2_3(Instruction x) { return ILPatternMatchingExt.MatchLdcI4(x, 0); } internal bool b__2_4(Instruction x) { ILLabel val = default(ILLabel); return ILPatternMatchingExt.MatchBle(x, ref val); } internal int b__2_5(CharacterBody body) { if (MoreProjectilesModule.IsMoreProjectilesActiveForBody(body)) { return 1; } return 0; } internal bool b__4_0(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, "GetAimRay"); } internal bool b__4_2(Instruction x) { return ILPatternMatchingExt.MatchLdfld(x, "damageStat"); } internal bool b__4_4(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, "FireProjectileWithoutDamageType"); } internal void 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.FireWarfareProjectiles(aimRay, fireProjectileInfo, 20f, axis); } } internal bool b__8_0(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, "FireProjectileWithoutDamageType"); } internal void 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(((ItemBehavior)behavior).body)) { Ray aimRay = behavior.GetAimRay(); FireProjectileInfo fireProjectileInfo = new FireProjectileInfo { projectilePrefab = projectilePrefab, position = origin, rotation = rotation, owner = owner, damage = damage, crit = crit }; MoreProjectilesModule.FireWarfareProjectiles(aimRay, fireProjectileInfo, 20f); } } internal bool b__9_0(orig_FireBfg orig, EquipmentSlot self) { if (orig.Invoke(self)) { MoreProjectilesModule.FireWarfareProjectilesSimple(self.characterBody, 40f, RoR2_Base_BFG.BeamSphere_prefab); return true; } return false; } internal bool b__9_1(orig_FireBlackhole orig, EquipmentSlot self) { if (orig.Invoke(self)) { MoreProjectilesModule.FireWarfareProjectilesSimple(self.characterBody, 0f, RoR2_Base_Blackhole.GravSphere_prefab); return true; } return false; } internal bool b__9_2(orig_FireMolotov orig, EquipmentSlot self) { if (orig.Invoke(self) && MoreProjectilesModule.UseExpensiveProjectiles) { MoreProjectilesModule.FireWarfareProjectilesSimple(self.characterBody, 1f, RoR2_DLC1_Molotov.MolotovClusterProjectile_prefab); return true; } return false; } internal bool 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.FireWarfareProjectilesSimple(self.characterBody, 0f, RoR2_DLC1_GummyClone.GummyCloneProjectile_prefab); } return true; } return false; } internal bool b__10_0(Instruction x) { return ILPatternMatchingExt.MatchLdcI4(x, 3); } internal int b__10_1(int bellCount, ChargeTrioBomb self) { if (!MoreProjectilesModule.IsMoreProjectilesActiveForBody(((EntityState)self).characterBody)) { return bellCount; } return bellCount + 2; } internal bool b__25_1(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, "AddOrb"); } internal void 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[3] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC1Content/Items", "MoreMissile"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(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[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 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.IsMoreProjectilesActiveForBody(((EntityState)self).characterBody) && ((EntityState)self).isAuthority) { bool flag = false; bool flag2 = false; float spread = 20f; if ((self is FireConstructBeam && MoreProjectilesModule.UseExpensiveProjectiles) || self is FireFMJ || self is FireGrenadeLauncher) { flag = true; } else { if (self is Spit && MoreProjectilesModule.UseExpensiveProjectiles) { flag = true; flag2 = true; } if (self is Fire) { flag = true; spread = 45f; } } if (flag) { Ray val = ((BaseState)self).GetAimRay(); val = self.ModifyProjectileAimRay(val); ((Ray)(ref val)).direction = Util.ApplySpread(((Ray)(ref val)).direction, self.minSpread, self.maxSpread, 1f, 1f, 0f, self.projectilePitchBonus); FireProjectileInfo val2 = new FireProjectileInfo { projectilePrefab = self.projectilePrefab, position = ((Ray)(ref val)).origin, rotation = Util.QuaternionSafeLookRotation(((Ray)(ref val)).direction), owner = ((EntityState)self).gameObject, damage = ((BaseState)self).damageStat * self.damageCoefficient, crit = Util.CheckRoll(((BaseState)self).critStat, ((EntityState)self).characterBody.master), force = self.force }; ProjectileManager.instance.FireProjectile(val2); Vector3 val3 = Vector3.Cross(Vector3.up, ((Ray)(ref val)).direction); if (!flag2) { val3 = Vector3.Cross(((Ray)(ref val)).direction, val3); } MoreProjectilesModule.FireWarfareProjectiles(val, val2, spread, val3); return; } } orig.Invoke(self); } public static void MissileArtifact_VerminSpit(ILContext il) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); int aimRayLoc = 0; int damageLoc = 0; if (!val.TryGotoNext((MoveType)0, new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "GetAimRay"), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref aimRayLoc) })) { SharedUtilsPlugin.DebugBreakpoint("MissileArtifact_VerminSpit", 1); return; } if (!val.TryGotoNext((MoveType)0, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "damageStat") }) || !val.TryGotoNext((MoveType)0, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref damageLoc) })) { SharedUtilsPlugin.DebugBreakpoint("MissileArtifact_VerminSpit", 2); return; } if (!val.TryGotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "FireProjectileWithoutDamageType") })) { SharedUtilsPlugin.DebugBreakpoint("MissileArtifact_VerminSpit", 3); return; } val.Emit(OpCodes.Ldarg_0); val.Emit(OpCodes.Ldloc, aimRayLoc); val.Emit(OpCodes.Ldloc, damageLoc); val.EmitDelegate>((Action)delegate(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.FireWarfareProjectiles(aimRay, fireProjectileInfo, 20f, axis); } }); } public static void MissileArtifact_ChildSpark(orig_FireBomb orig, SparkBallFire self) { orig.Invoke(self); MoreProjectilesModule.FireWarfareProjectilesSimple(((EntityState)self).characterBody, SparkBallFire.bombDamageCoefficient, SparkBallFire.projectilePrefab); } public static void MissileArtifact_LemurianFireball(orig_OnEnter orig, FireFireball self) { orig.Invoke(self); if (MoreProjectilesModule.UseExpensiveProjectiles) { MoreProjectilesModule.FireWarfareProjectilesSimple(((EntityState)self).characterBody, FireFireball.damageCoefficient, FireFireball.projectilePrefab); } } public static void MissileArtifact_GupDeathEnter(orig_OnEnter orig, BaseSplitDeath self) { if (MoreProjectilesModule.IsMoreProjectilesActiveForBody(((EntityState)self).characterBody) && MoreProjectilesModule.UseExpensiveProjectiles) { self.spawnCount = 3; } orig.Invoke(self); } public static void MissileArtifact_Shuriken(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0057: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (!val.TryGotoNext((MoveType)0, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "FireProjectileWithoutDamageType") })) { SharedUtilsPlugin.DebugBreakpoint("MissileArtifact_Shuriken"); return; } val.Remove(); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Action)delegate(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(((ItemBehavior)behavior).body)) { Ray aimRay = behavior.GetAimRay(); FireProjectileInfo fireProjectileInfo = new FireProjectileInfo { projectilePrefab = projectilePrefab, position = origin, rotation = rotation, owner = owner, damage = damage, crit = crit }; MoreProjectilesModule.FireWarfareProjectiles(aimRay, fireProjectileInfo, 20f); } }); } public static void EquipmentsLol() { //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_0020: Expected O, but got Unknown //IL_003a: 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_0045: Expected O, but got Unknown //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) //IL_006a: Expected O, but got Unknown //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_008f: Expected O, but got Unknown object obj = <>c.<>9__9_0; if (obj == null) { hook_FireBfg val = delegate(orig_FireBfg orig, EquipmentSlot self) { if (orig.Invoke(self)) { MoreProjectilesModule.FireWarfareProjectilesSimple(self.characterBody, 40f, RoR2_Base_BFG.BeamSphere_prefab); return true; } return false; }; <>c.<>9__9_0 = val; obj = (object)val; } EquipmentSlot.FireBfg += (hook_FireBfg)obj; object obj2 = <>c.<>9__9_1; if (obj2 == null) { hook_FireBlackhole val2 = delegate(orig_FireBlackhole orig, EquipmentSlot self) { if (orig.Invoke(self)) { MoreProjectilesModule.FireWarfareProjectilesSimple(self.characterBody, 0f, RoR2_Base_Blackhole.GravSphere_prefab); return true; } return false; }; <>c.<>9__9_1 = val2; obj2 = (object)val2; } EquipmentSlot.FireBlackhole += (hook_FireBlackhole)obj2; object obj3 = <>c.<>9__9_2; if (obj3 == null) { hook_FireMolotov val3 = delegate(orig_FireMolotov orig, EquipmentSlot self) { if (orig.Invoke(self) && MoreProjectilesModule.UseExpensiveProjectiles) { MoreProjectilesModule.FireWarfareProjectilesSimple(self.characterBody, 1f, RoR2_DLC1_Molotov.MolotovClusterProjectile_prefab); return true; } return false; }; <>c.<>9__9_2 = val3; obj3 = (object)val3; } EquipmentSlot.FireMolotov += (hook_FireMolotov)obj3; object obj4 = <>c.<>9__9_3; if (obj4 == null) { hook_FireGummyClone val4 = delegate(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.FireWarfareProjectilesSimple(self.characterBody, 0f, RoR2_DLC1_GummyClone.GummyCloneProjectile_prefab); } return true; } return false; }; <>c.<>9__9_3 = val4; obj4 = (object)val4; } EquipmentSlot.FireGummyClone += (hook_FireGummyClone)obj4; } public static void MissileArtifact_ChargeTrioBomb(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (!val.TryGotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 3) })) { SharedUtilsPlugin.DebugBreakpoint("MissileArtifact_ChargeTrioBomb", 1); return; } val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)((int bellCount, ChargeTrioBomb self) => (!MoreProjectilesModule.IsMoreProjectilesActiveForBody(((EntityState)self).characterBody)) ? bellCount : (bellCount + 2))); } public static Transform MissileArtifact_FindTrioBombTransform(orig_FindTargetChildTransformFromBombIndex orig, ChargeTrioBomb self) { Transform val = orig.Invoke(self); if ((Object)(object)val == (Object)null && self.currentBombIndex >= 3) { val = GenerateTransform(((EntityState)self).transform, self.currentBombIndex); } return val; Transform GenerateTransform(Transform parent, int index) { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) float num = 3.8f; float num2 = 0f; int num3 = 7; float num4 = num; float num5 = MathF.PI * 2f / (float)num3; int num6 = Mathf.FloorToInt((float)(index / 2)); int num7 = ((index % 2 == 0) ? 1 : (-1)); float num8 = num2 + num5 * (float)num6 * (float)num7; float num9 = Mathf.Sin(num8) * num4; float num10 = Mathf.Cos(num8) * num4; float num11 = 0f; Vector3 localPosition = default(Vector3); ((Vector3)(ref localPosition))..ctor(num9, num10, num11); GameObject val2 = new GameObject(); ((Object)val2).name = "ProjectilePosition" + self.currentBombIndex; val2.transform.parent = parent; val2.transform.localPosition = localPosition; val2.transform.localScale = Vector3.one; val2.transform.rotation = Quaternion.identity; return val2.transform; } } public static void MissileArtifact_VagrantTrackingBomb(orig_FireBomb orig, FireTrackingBomb self) { orig.Invoke(self); MoreProjectilesModule.FireWarfareProjectilesSimple(((EntityState)self).characterBody, FireTrackingBomb.bombDamageCoefficient, FireTrackingBomb.projectilePrefab); } public static void MissileArtifact_GreaterWispFireCannons(orig_OnEnter orig, FireCannons self) { //IL_003a: 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) orig.Invoke(self); if (!MoreProjectilesModule.IsMoreProjectilesActiveForBody(((EntityState)self).characterBody)) { return; } Ray aimRay = ((BaseState)self).GetAimRay(); if (!((EntityState)self).isAuthority || !Object.op_Implicit((Object)(object)((EntityState)self).modelLocator) || !Object.op_Implicit((Object)(object)((EntityState)self).modelLocator.modelTransform)) { return; } ChildLocator component = ((Component)((EntityState)self).modelLocator.modelTransform).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { int num = component.FindChildIndex("MuzzleLeft"); int num2 = component.FindChildIndex("MuzzleRight"); Transform val = component.FindChild(num); Transform val2 = component.FindChild(num2); if (Object.op_Implicit((Object)(object)val)) { FireProjectilesFromTransform(val); } if (Object.op_Implicit((Object)(object)val2)) { FireProjectilesFromTransform(val2); } } void FireProjectilesFromTransform(Transform transform) { //IL_0011: 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_0026: 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_0028: 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_0046: 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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)transform == (Object)null)) { Vector3 val3 = Vector3.Cross(Vector3.up, ((Ray)(ref aimRay)).direction); Vector3 axis = val3; FireProjectileInfo fireProjectileInfo = new FireProjectileInfo { projectilePrefab = self.projectilePrefab, position = transform.position, rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), owner = ((EntityState)self).gameObject, damage = ((BaseState)self).damageStat * self.damageCoefficient, crit = Util.CheckRoll(((EntityState)self).characterBody.crit, ((EntityState)self).characterBody.master) }; MoreProjectilesModule.FireWarfareProjectiles(aimRay, fireProjectileInfo, 20f, axis); } } } public static void MissileArtifact_BrotherFistSlam(orig_OnEnter orig, FistSlam self) { orig.Invoke(self); if (MoreProjectilesModule.IsMoreProjectilesActiveForBody(((EntityState)self).characterBody)) { FistSlam.waveProjectileCount *= 2; } } public static void MissileArtifact_BrotherUltChannelState(orig_OnEnter orig, UltChannelState self) { orig.Invoke(self); if (MoreProjectilesModule.IsMoreProjectilesActiveForBody(((EntityState)self).characterBody)) { UltChannelState.waveProjectileCount += 2; } } public static void MissileArtifact_BrotherWeaponSlam(orig_OnEnter orig, WeaponSlam self) { orig.Invoke(self); if (MoreProjectilesModule.IsMoreProjectilesActiveForBody(((EntityState)self).characterBody)) { WeaponSlam.waveProjectileCount += 2; } } public static void MissileArtifact_GrandpaVacuum(orig_Fire orig, FireSecondaryProjectile self) { //IL_0071: 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_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) if (!MoreProjectilesModule.IsMoreProjectilesActiveForBody(((EntityState)self).characterBody)) { orig.Invoke(self); return; } self.hasFired = true; if (Object.op_Implicit((Object)(object)self.muzzleEffectPrefab)) { EffectManager.SimpleMuzzleFlash(self.muzzleEffectPrefab, ((EntityState)self).gameObject, self.muzzleName, false); } if (!((EntityState)self).isAuthority || !Object.op_Implicit((Object)(object)self.projectilePrefab)) { return; } Ray aimRay = ((BaseState)self).GetAimRay(); Transform modelTransform = ((EntityState)self).GetModelTransform(); if (Object.op_Implicit((Object)(object)modelTransform)) { ChildLocator component = ((Component)modelTransform).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { ((Ray)(ref aimRay)).origin = ((Component)component.FindChild(self.muzzleName)).transform.position; } } FireProjectileInfo val = new FireProjectileInfo { projectilePrefab = self.projectilePrefab, position = ((Ray)(ref aimRay)).origin, rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), owner = ((EntityState)self).gameObject, damage = ((BaseState)self).damageStat * self.damageCoefficient, force = self.force, crit = Util.CheckRoll(((BaseState)self).critStat, ((EntityState)self).characterBody.master) }; ProjectileManager.instance.FireProjectile(val); MoreProjectilesModule.FireWarfareProjectiles(aimRay, val, 45f); } public static void MissileArtifact_DunestriderRoller(orig_FireSingleTarball orig, FireTarball self, string targetMuzzle) { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: 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) if (!MoreProjectilesModule.IsMoreProjectilesActiveForBody(((EntityState)self).characterBody)) { orig.Invoke(self, targetMuzzle); return; } ((EntityState)self).PlayCrossfade("Body", "FireTarBall", 0.1f); Util.PlaySound(FireTarball.attackSoundString, ((EntityState)self).gameObject); self.aimRay = ((BaseState)self).GetAimRay(); if (Object.op_Implicit((Object)(object)self.modelTransform)) { ChildLocator component = ((Component)self.modelTransform).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { Transform val = component.FindChild(targetMuzzle); if (Object.op_Implicit((Object)(object)val)) { ((Ray)(ref self.aimRay)).origin = val.position; } } } ((BaseState)self).AddRecoil(-1f * FireTarball.recoilAmplitude, -2f * FireTarball.recoilAmplitude, -1f * FireTarball.recoilAmplitude, 1f * FireTarball.recoilAmplitude); if (Object.op_Implicit((Object)(object)FireTarball.effectPrefab)) { EffectManager.SimpleMuzzleFlash(FireTarball.effectPrefab, ((EntityState)self).gameObject, targetMuzzle, false); } if (((EntityState)self).isAuthority) { Vector3 up = Vector3.up; Vector3 val2 = Vector3.ProjectOnPlane(((Ray)(ref self.aimRay)).direction, up); FireProjectileInfo val3 = new FireProjectileInfo { projectilePrefab = FireTarball.projectilePrefab, position = ((Ray)(ref self.aimRay)).origin, rotation = Util.QuaternionSafeLookRotation(val2), owner = ((EntityState)self).gameObject, damage = ((BaseState)self).damageStat * FireTarball.damageCoefficient, force = 0f, crit = Util.CheckRoll(((BaseState)self).critStat, ((EntityState)self).characterBody.master) }; ProjectileManager.instance.FireProjectile(val3); Ray aimRay = default(Ray); ((Ray)(ref aimRay)).origin = ((Ray)(ref self.aimRay)).origin; ((Ray)(ref aimRay)).direction = val2; MoreProjectilesModule.FireWarfareProjectiles(aimRay, val3, 45f); } ((EntityState)self).characterBody.AddSpreadBloom(FireTarball.spreadBloomValue); } public static void MissileArtifact_BeetleGuardRoller(orig_FixedUpdate orig, FireSunder self) { //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_0099: 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_00a9: 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_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: 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_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) if (!MoreProjectilesModule.IsMoreProjectilesActiveForBody(((EntityState)self).characterBody)) { orig.Invoke(self); return; } ((EntityState)self).fixedAge = ((EntityState)self).fixedAge + Time.fixedDeltaTime; if (Object.op_Implicit((Object)(object)self.modelAnimator) && self.modelAnimator.GetFloat("FireSunder.activate") > 0.5f && !self.hasAttacked) { if (((EntityState)self).isAuthority && Object.op_Implicit((Object)(object)self.modelTransform)) { Ray aimRay = ((BaseState)self).GetAimRay(); ((Ray)(ref aimRay)).origin = self.handRTransform.position; Vector3 up = Vector3.up; FireProjectileInfo val = new FireProjectileInfo { projectilePrefab = FireSunder.projectilePrefab, position = ((Ray)(ref aimRay)).origin, rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), owner = ((EntityState)self).gameObject, damage = ((BaseState)self).damageStat * FireSunder.damageCoefficient, force = FireSunder.forceMagnitude, crit = Util.CheckRoll(((BaseState)self).critStat, ((EntityState)self).characterBody.master) }; ProjectileManager.instance.FireProjectile(val); MoreProjectilesModule.FireWarfareProjectiles(aimRay, val, 20f); } self.hasAttacked = true; EntityState.Destroy((Object)(object)self.rightHandChargeEffect); } if (((EntityState)self).fixedAge >= self.duration && ((EntityState)self).isAuthority) { ((EntityState)self).outer.SetNextStateToMain(); } } public static void MissileArtifact_ChimeraSeekingBomb(orig_FireBomb orig, SeekingBomb self) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: 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_0137: 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_0140: 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) if (!MoreProjectilesModule.IsMoreProjectilesActiveForBody(((EntityState)self).characterBody)) { orig.Invoke(self); return; } Util.PlaySound(SeekingBomb.fireBombSoundString, ((EntityState)self).gameObject); Ray aimRay = ((BaseState)self).GetAimRay(); Transform modelTransform = ((EntityState)self).GetModelTransform(); if (Object.op_Implicit((Object)(object)modelTransform)) { ChildLocator component = ((Component)modelTransform).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { ((Ray)(ref aimRay)).origin = ((Component)component.FindChild(SeekingBomb.muzzleName)).transform.position; } } if (((EntityState)self).isAuthority) { Vector3 val = Vector3.Cross(Vector3.up, ((Ray)(ref aimRay)).direction); Vector3 val2 = Vector3.Cross(((Ray)(ref aimRay)).direction, val); FireProjectileInfo val3 = new FireProjectileInfo { projectilePrefab = SeekingBomb.projectilePrefab, position = ((Ray)(ref aimRay)).origin, rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), owner = ((EntityState)self).gameObject, damage = ((BaseState)self).damageStat * SeekingBomb.bombDamageCoefficient, force = SeekingBomb.bombForce, crit = Util.CheckRoll(((BaseState)self).critStat, ((EntityState)self).characterBody.master) }; ProjectileManager.instance.FireProjectile(val3); MoreProjectilesModule.FireWarfareProjectiles(aimRay, val3, 45f); } Util.PlaySound(SeekingBomb.spinDownSoundString, ((EntityState)self).gameObject); ((EntityState)self).PlayCrossfade("Gesture", "BombStop", 0.2f); } public static void MissileArtifact_TitanRock(orig_Fire orig, TitanRockController self) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0083: 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_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: 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_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0168: 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_016b: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0176: 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_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) if (!MoreProjectilesModule.IsMoreProjectilesActiveForBody(self.ownerCharacterBody)) { orig.Invoke(self); } else if (NetworkServer.active && Object.op_Implicit((Object)(object)self.ownerInputBank)) { Vector3 position = self.fireTransform.position; Vector3 val = self.ownerInputBank.aimDirection; RaycastHit val2 = default(RaycastHit); if (Util.CharacterRaycast(self.owner, new Ray(self.ownerInputBank.aimOrigin, self.ownerInputBank.aimDirection), ref val2, float.PositiveInfinity, LayerMask.op_Implicit(LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask) | LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask)), (QueryTriggerInteraction)0)) { val = ((RaycastHit)(ref val2)).point - position; } float num = (Object.op_Implicit((Object)(object)self.ownerCharacterBody) ? self.ownerCharacterBody.damage : 1f); ProjectileManager.instance.FireProjectile(new FireProjectileInfo { crit = self.isCrit, damage = self.damageCoefficient * num, damageColorIndex = (DamageColorIndex)0, force = self.damageForce, owner = self.owner, position = position, projectilePrefab = self.projectilePrefab, rotation = Util.QuaternionSafeLookRotation(val), target = null }); Vector3 val3 = Vector3.Cross(Vector3.up, val); Vector3 val4 = Vector3.Cross(val, val3); FireProjectileInfo val5 = new FireProjectileInfo { projectilePrefab = self.projectilePrefab, position = position, rotation = Util.QuaternionSafeLookRotation(val), owner = ((Component)self).gameObject, damage = self.damageCoefficient * num, force = self.damageForce, crit = self.isCrit }; ProjectileManager.instance.FireProjectile(val5); Ray aimRay = default(Ray); ((Ray)(ref aimRay)).origin = position; ((Ray)(ref aimRay)).direction = val; MoreProjectilesModule.FireWarfareProjectiles(aimRay, val5, 20f); } } public static void MissileArtifact_FireMeatballs(orig_FireMeatballs orig, WormBodyPositions2 self, Vector3 impactNormal, Vector3 impactPosition, Vector3 forward, int meatballCount, float meatballAngle, float meatballForce) { //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_001c: Unknown result type (might be due to invalid IL or missing references) if (MoreProjectilesModule.IsMoreProjectilesActiveForBody(self.characterBody)) { meatballCount *= 2; } orig.Invoke(self, impactNormal, impactPosition, forward, meatballCount, meatballAngle, meatballForce); } public static void MissileArtifact_ReliquaryFlares(orig_FixedUpdate orig, FireSolarFlares self) { //IL_0069: 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_008a: 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_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: 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_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016b: 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_0175: Unknown result type (might be due to invalid IL or missing references) if (!MoreProjectilesModule.IsMoreProjectilesActiveForBody(((EntityState)self).characterBody)) { orig.Invoke(self); } else if (NetworkServer.active) { float num = self.duration / (float)self.projectileCount; if (((EntityState)self).fixedAge >= (float)self.projectilesFired * num) { self.projectilesFired++; FireProjectileInfo val = new FireProjectileInfo { owner = ((EntityState)self).gameObject, position = ((EntityState)self).transform.position + self.currentRotation * Vector3.forward * FireSolarFlares.radius, rotation = self.currentRotation, projectilePrefab = FireSolarFlares.projectilePrefab }; ((FireProjectileInfo)(ref val)).fuseOverride = FireSolarFlares.projectileFuse; val.useFuseOverride = true; ((FireProjectileInfo)(ref val)).speedOverride = FireSolarFlares.projectileSpeed; val.useSpeedOverride = true; val.damage = ((BaseState)self).damageStat * FireSolarFlares.projectileDamageCoefficient; val.force = FireSolarFlares.projectileForce; ProjectileManager.instance.FireProjectile(val); Vector3 up = Vector3.up; Ray aimRay = default(Ray); ((Ray)(ref aimRay)).origin = val.position; ((Ray)(ref aimRay)).direction = self.currentRotation * Vector3.forward; MoreProjectilesModule.FireWarfareProjectiles(aimRay, val, 45f, up); self.currentRotation *= self.deltaRotation; } if (((EntityState)self).fixedAge >= self.duration) { ((EntityState)self).outer.SetNextStateToMain(); } } } public static void MissileArtifact_MushrumSporeGrenade(orig_FireGrenade orig, SporeGrenade self, string targetMuzzle) { //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_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_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Expected O, but got Unknown //IL_006b: 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_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008a: 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_0056: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_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_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_0105: 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_0121: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: 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_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0187: 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_0190: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_0306: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Unknown result type (might be due to invalid IL or missing references) //IL_031f: Unknown result type (might be due to invalid IL or missing references) //IL_0324: Unknown result type (might be due to invalid IL or missing references) //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_0336: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_0341: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_034a: Unknown result type (might be due to invalid IL or missing references) //IL_034f: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_0368: Unknown result type (might be due to invalid IL or missing references) //IL_036d: Unknown result type (might be due to invalid IL or missing references) //IL_0377: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: 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_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) if (!MoreProjectilesModule.IsMoreProjectilesActiveForBody(((EntityState)self).characterBody)) { orig.Invoke(self, targetMuzzle); return; } Ray aimRay = ((BaseState)self).GetAimRay(); Ray val = default(Ray); ((Ray)(ref val))..ctor(((Ray)(ref aimRay)).origin, Vector3.up); Transform val2 = ((BaseState)self).FindModelChild(targetMuzzle); if (Object.op_Implicit((Object)(object)val2)) { ((Ray)(ref val)).origin = val2.position; } BullseyeSearch val3 = new BullseyeSearch(); val3.searchOrigin = ((Ray)(ref aimRay)).origin; val3.searchDirection = ((Ray)(ref aimRay)).direction; val3.filterByLoS = false; val3.teamMaskFilter = TeamMask.allButNeutral; if (Object.op_Implicit((Object)(object)((EntityState)self).teamComponent)) { ((TeamMask)(ref val3.teamMaskFilter)).RemoveTeam(((EntityState)self).teamComponent.teamIndex); } val3.sortMode = (SortMode)2; val3.RefreshCandidates(); HurtBox val4 = val3.GetResults().FirstOrDefault(); bool flag = false; Vector3 val5 = Vector3.zero; RaycastHit val6 = default(RaycastHit); if (Object.op_Implicit((Object)(object)val4)) { val5 = ((Component)val4).transform.position; flag = true; } else if (Physics.Raycast(aimRay, ref val6, 1000f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask) | LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask), (QueryTriggerInteraction)1)) { val5 = ((RaycastHit)(ref val6)).point; flag = true; } float speedOverride = SporeGrenade.projectileVelocity; if (flag) { Vector3 val7 = val5 - ((Ray)(ref val)).origin; Vector2 val8 = default(Vector2); ((Vector2)(ref val8))..ctor(val7.x, val7.z); float num = ((Vector2)(ref val8)).magnitude; Vector2 val9 = val8 / num; if (num < SporeGrenade.minimumDistance) { num = SporeGrenade.minimumDistance; } if (num > SporeGrenade.maximumDistance) { num = SporeGrenade.maximumDistance; } float num2 = Trajectory.CalculateInitialYSpeed(SporeGrenade.timeToTarget, val7.y); float num3 = num / SporeGrenade.timeToTarget; Vector3 direction = default(Vector3); ((Vector3)(ref direction))..ctor(val9.x * num3, num2, val9.y * num3); speedOverride = ((Vector3)(ref direction)).magnitude; ((Ray)(ref val)).direction = direction; } Quaternion rotation = Util.QuaternionSafeLookRotation(((Ray)(ref val)).direction + Random.insideUnitSphere * 0.05f); FireProjectileInfo val10 = new FireProjectileInfo { projectilePrefab = SporeGrenade.projectilePrefab, position = ((Ray)(ref val)).origin, rotation = rotation, owner = ((EntityState)self).gameObject, damage = ((BaseState)self).damageStat * SporeGrenade.damageCoefficient, crit = Util.CheckRoll(((BaseState)self).critStat, ((EntityState)self).characterBody.master), force = 0f }; ((FireProjectileInfo)(ref val10)).speedOverride = speedOverride; FireProjectileInfo val11 = val10; ProjectileManager.instance.FireProjectile(val11); Vector3 val12 = (Object.op_Implicit((Object)(object)((EntityState)self).inputBank) ? ((EntityState)self).inputBank.aimDirection : ((EntityState)self).characterBody.transform.position); FireProjectileInfo val13 = val11; val13.rotation = Util.QuaternionSafeLookRotation(Quaternion.AngleAxis(45f, val12) * (((Ray)(ref val)).direction + Random.insideUnitSphere * 0.05f)); ProjectileManager.instance.FireProjectile(val13); FireProjectileInfo val14 = val11; val14.rotation = Util.QuaternionSafeLookRotation(Quaternion.AngleAxis(-45f, val12) * (((Ray)(ref val)).direction + Random.insideUnitSphere * 0.05f)); ProjectileManager.instance.FireProjectile(val14); } public static void MissileArtifact_FireHuntressSeekingArrow(ILContext il) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); int orbLoc = 0; if (!val.TryGotoNext((MoveType)2, new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref orbLoc), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "AddOrb") })) { Debug.LogError((object)"IABM Huntress fail"); return; } val.Emit(OpCodes.Ldloc, orbLoc); val.Emit(OpCodes.Ldarg, 0); val.EmitDelegate>((Action)delegate(Orb orb, EntityState state) { if (MoreProjectilesModule.IsMoreProjectilesActiveForBody(state.characterBody)) { OrbManager.instance.AddOrb(orb); OrbManager.instance.AddOrb(orb); } }); } public static void MissileArtifact_SeekerPunch(orig_FireGauntlet orig, SpiritPunch self) { orig.Invoke(self); MoreProjectilesModule.FireWarfareProjectilesSimple(((EntityState)self).characterBody, self.damageCoefficient, self.projectilePrefab); } public static void MissileArtifact_SonSurvivorSpike(orig_FireLunarSpike orig, LunarSpikes self) { orig.Invoke(self); MoreProjectilesModule.FireWarfareProjectilesSimple(((EntityState)self).characterBody, self.damageCoefficient, self.projectilePrefab); } public static void MissileArtifact_LodrPylon(orig_OnEnter orig, ThrowPylon self) { orig.Invoke(self); MoreProjectilesModule.FireWarfareProjectilesSimple(((EntityState)self).characterBody, ThrowPylon.damageCoefficient, ThrowPylon.projectilePrefab); } public static void MissileArtifact_ArtiBolts(orig_FireGauntlet orig, FireFireBolt self) { orig.Invoke(self); MoreProjectilesModule.FireWarfareProjectilesSimple(((EntityState)self).characterBody, self.damageCoefficient, self.projectilePrefab); } public static void MissileArtifact_CaptainTazer(orig_Fire orig, FireTazer self) { orig.Invoke(self); MoreProjectilesModule.FireWarfareProjectilesSimple(((EntityState)self).characterBody, FireTazer.damageCoefficient, FireTazer.projectilePrefab); } public static void MissileArtifact_ViendSecondary(orig_FireProjectiles orig, FireMegaBlasterBase self) { orig.Invoke(self); MoreProjectilesModule.FireWarfareProjectilesSimple(((EntityState)self).characterBody, self.damageCoefficient, self.projectilePrefab); } public static void MissileArtifact_ChefCleaver(orig_OnEnter orig, Dice self) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: 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_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_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: 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_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0192: 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) orig.Invoke(self); if (((EntityState)self).isAuthority && !self.hasBoost && MoreProjectilesModule.IsMoreProjectilesActiveForBody(((EntityState)self).characterBody)) { Ray aimRay = ((BaseState)self).GetAimRay(); Vector3 val = Vector3.Cross(Vector3.up, ((Ray)(ref aimRay)).direction); Vector3 val2 = Vector3.Cross(((Ray)(ref aimRay)).direction, val); FireProjectileInfo val3 = new FireProjectileInfo { projectilePrefab = self.projectilePrefab, position = ((Ray)(ref aimRay)).origin, rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), owner = ((EntityState)self).gameObject, damage = ((BaseState)self).damageStat * self.damageCoefficient, force = self.force, crit = Util.CheckRoll(((BaseState)self).critStat, ((EntityState)self).characterBody.master) }; FireProjectileInfo val4 = val3; val3.rotation = Util.QuaternionSafeLookRotation(Quaternion.AngleAxis(-45f, val2) * ((Ray)(ref aimRay)).direction); val4.rotation = Util.QuaternionSafeLookRotation(Quaternion.AngleAxis(45f, val2) * ((Ray)(ref aimRay)).direction); if (!NetworkServer.active && Object.op_Implicit((Object)(object)self.chefController)) { self.chefController.CacheCleaverProjectileFireInfo(val3); } ProjectileManager.instance.FireProjectile(val3); if (!NetworkServer.active && Object.op_Implicit((Object)(object)self.chefController)) { self.chefController.CacheCleaverProjectileFireInfo(val4); } ProjectileManager.instance.FireProjectile(val4); } } public static void MissileArtifact_RailerPistol(orig_FireBullet orig, FirePistol self, Ray aimRay) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: 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_0108: 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_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_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_014b: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: 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_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) if (!MoreProjectilesModule.IsMoreProjectilesActiveForBody(((EntityState)self).characterBody)) { orig.Invoke(self, aimRay); return; } ((BaseState)self).StartAimMode(aimRay, 2f, false); Util.PlaySound(self.fireSoundString, ((EntityState)self).gameObject); EffectManager.SimpleMuzzleFlash(self.muzzleFlashPrefab, ((EntityState)self).gameObject, self.muzzleName, false); ((EntityState)self).PlayAnimation(self.animationLayerName, self.animationStateName, self.animationPlaybackRateParam, self.duration, 0f); ((BaseState)self).AddRecoil(self.recoilYMin, self.recoilYMax, self.recoilXMin, self.recoilXMax); if (((EntityState)self).isAuthority) { float num = 0f; if (Object.op_Implicit((Object)(object)((EntityState)self).characterBody)) { num = ((EntityState)self).characterBody.spreadBloomAngle; } Quaternion val = Quaternion.AngleAxis((float)Random.Range(0, 360), Vector3.forward); Quaternion val2 = Quaternion.AngleAxis(Random.Range(0f, self.baseInaccuracyDegrees + num), Vector3.left); Quaternion rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction, Vector3.up) * val * val2; FireProjectileInfo val3 = new FireProjectileInfo { projectilePrefab = self.projectilePrefab, position = ((Ray)(ref aimRay)).origin, rotation = rotation, owner = ((EntityState)self).gameObject, damage = ((BaseState)self).damageStat * self.damageCoefficient, crit = ((BaseState)self).RollCrit(), force = self.force, procChainMask = default(ProcChainMask), damageColorIndex = (DamageColorIndex)0 }; ProjectileManager.instance.FireProjectile(val3); MoreProjectilesModule.FireWarfareProjectiles(aimRay, val3, 20f); ((EntityState)self).characterBody.characterMotor.ApplyForce((0f - self.selfKnockbackForce) * ((Ray)(ref aimRay)).direction, false, false); } ((EntityState)self).characterBody.AddSpreadBloom(self.spreadBloomValue); } public static void MissileArtifact_ThrowBombHeresy(orig_Fire orig, BaseThrowBombState self) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0105: 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_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (MoreProjectilesModule.IsMoreProjectilesActiveForBody(((EntityState)self).characterBody) && ((EntityState)self).isAuthority && self is ThrowLunarSecondary) { Ray aimRay = ((BaseState)self).GetAimRay(); if ((Object)(object)self.projectilePrefab != (Object)null) { float num = Util.Remap(self.charge, 0f, 1f, self.minDamageCoefficient, self.maxDamageCoefficient); float force = self.charge * self.force; FireProjectileInfo val = new FireProjectileInfo { projectilePrefab = self.projectilePrefab, position = ((Ray)(ref aimRay)).origin, rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), owner = ((EntityState)self).gameObject, damage = ((BaseState)self).damageStat * num, force = force, crit = ((BaseState)self).RollCrit() }; self.ModifyProjectile(ref val); ProjectileManager.instance.FireProjectile(val); MoreProjectilesModule.FireWarfareProjectiles(aimRay, val, 20f); } if (Object.op_Implicit((Object)(object)((EntityState)self).characterMotor)) { ((EntityState)self).characterMotor.ApplyForce(((Ray)(ref aimRay)).direction * ((0f - self.selfForce) * self.charge), false, false); } } } public static void MissileArtifact_ViendCorruptSecondary(orig_OnEnter orig, FireCorruptDisks self) { if (MoreProjectilesModule.IsMoreProjectilesActiveForBody(((EntityState)self).characterBody)) { self.projectileCount = 3; self.yawPerProjectile = 20f; } orig.Invoke(self); } } public static class MoreProjectilesModule { public delegate bool MoreProjectilesEventHandler(CharacterBody sender); [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_OnEnter <>9__11_0; internal void b__11_0(orig_OnEnter orig, FireSpit self) { orig.Invoke(self); if (!(self is FireDiseaseProjectile)) { FireWarfareProjectilesSimple(((EntityState)self).characterBody, ((BaseState)self).damageStat, self.projectilePrefab); } } } public static bool UseExpensiveProjectiles = true; private static bool _hooksEnabled = false; private static event MoreProjectilesEventHandler _moreProjectilesProvider; public static event MoreProjectilesEventHandler MoreProjectilesProvider { add { if (MoreProjectilesModule._moreProjectilesProvider == null) { MoreProjectilesModule._moreProjectilesProvider = value.Invoke; SetHooks(); } else { _moreProjectilesProvider += value; } } remove { _moreProjectilesProvider -= value; } } private static bool idk(CharacterBody sender) { return false; } public static bool IsMoreProjectilesActiveForBody(CharacterBody sender) { if (!_hooksEnabled) { return false; } Delegate[] invocationList = MoreProjectilesModule._moreProjectilesProvider.GetInvocationList(); for (int i = 0; i < invocationList.Length; i++) { MoreProjectilesEventHandler moreProjectilesEventHandler = (MoreProjectilesEventHandler)invocationList[i]; if (moreProjectilesEventHandler(sender)) { return true; } } return false; } private static void SetHooks() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Expected O, but got Unknown //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Expected O, but got Unknown //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Expected O, but got Unknown //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Expected O, but got Unknown //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Expected O, but got Unknown //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Expected O, but got Unknown //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Expected O, but got Unknown //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Expected O, but got Unknown //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Expected O, but got Unknown //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Expected O, but got Unknown //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Expected O, but got Unknown //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Expected O, but got Unknown //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Expected O, but got Unknown //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Expected O, but got Unknown //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Expected O, but got Unknown //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Expected O, but got Unknown //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Expected O, but got Unknown //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Expected O, but got Unknown //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Expected O, but got Unknown //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Expected O, but got Unknown //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Expected O, but got Unknown //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Expected O, but got Unknown //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Expected O, but got Unknown //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Expected O, but got Unknown //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Expected O, but got Unknown //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Expected O, but got Unknown //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Expected O, but got Unknown //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Expected O, but got Unknown //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Expected O, but got Unknown //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Expected O, but got Unknown if (_hooksEnabled) { return; } _hooksEnabled = true; MissileUtils.FireMissile_Vector3_CharacterBody_ProcChainMask_GameObject_float_bool_GameObject_DamageColorIndex_Vector3_float_bool += new Manipulator(MoreProjectilesHooks.OverrideIcbmMissiles); GenericProjectileBaseState.FireProjectile += new hook_FireProjectile(MoreProjectilesHooks.MissileArtifact_FireProjectile); Spit.FireProjectile += new Manipulator(MoreProjectilesHooks.MissileArtifact_VerminSpit); BaseThrowBombState.Fire += new hook_Fire(MoreProjectilesHooks.MissileArtifact_ThrowBombHeresy); PrimarySkillShurikenBehavior.FireShuriken += new Manipulator(MoreProjectilesHooks.MissileArtifact_Shuriken); MoreProjectilesHooks.EquipmentsLol(); FireMegaBlasterBase.FireProjectiles += new hook_FireProjectiles(MoreProjectilesHooks.MissileArtifact_ViendSecondary); FireCorruptDisks.OnEnter += new hook_OnEnter(MoreProjectilesHooks.MissileArtifact_ViendCorruptSecondary); FireTazer.Fire += new hook_Fire(MoreProjectilesHooks.MissileArtifact_CaptainTazer); FireFireBolt.FireGauntlet += new hook_FireGauntlet(MoreProjectilesHooks.MissileArtifact_ArtiBolts); ThrowPylon.OnEnter += new hook_OnEnter(MoreProjectilesHooks.MissileArtifact_LodrPylon); FirePistol.FireBullet += new hook_FireBullet(MoreProjectilesHooks.MissileArtifact_RailerPistol); SpiritPunch.FireGauntlet += new hook_FireGauntlet(MoreProjectilesHooks.MissileArtifact_SeekerPunch); LunarSpikes.FireLunarSpike += new hook_FireLunarSpike(MoreProjectilesHooks.MissileArtifact_SonSurvivorSpike); Dice.OnEnter += new hook_OnEnter(MoreProjectilesHooks.MissileArtifact_ChefCleaver); object obj = <>c.<>9__11_0; if (obj == null) { hook_OnEnter val = delegate(orig_OnEnter orig, FireSpit self) { orig.Invoke(self); if (!(self is FireDiseaseProjectile)) { FireWarfareProjectilesSimple(((EntityState)self).characterBody, ((BaseState)self).damageStat, self.projectilePrefab); } }; <>c.<>9__11_0 = val; obj = (object)val; } FireSpit.OnEnter += (hook_OnEnter)obj; FireSeekingArrow.FireOrbArrow += new Manipulator(MoreProjectilesHooks.MissileArtifact_FireHuntressSeekingArrow); SporeGrenade.FireGrenade += new hook_FireGrenade(MoreProjectilesHooks.MissileArtifact_MushrumSporeGrenade); FireSolarFlares.FixedUpdate += new hook_FixedUpdate(MoreProjectilesHooks.MissileArtifact_ReliquaryFlares); WormBodyPositions2.FireMeatballs += new hook_FireMeatballs(MoreProjectilesHooks.MissileArtifact_FireMeatballs); TitanRockController.Fire += new hook_Fire(MoreProjectilesHooks.MissileArtifact_TitanRock); FireFireball.OnEnter += new hook_OnEnter(MoreProjectilesHooks.MissileArtifact_LemurianFireball); FireTrackingBomb.FireBomb += new hook_FireBomb(MoreProjectilesHooks.MissileArtifact_VagrantTrackingBomb); SeekingBomb.FireBomb += new hook_FireBomb(MoreProjectilesHooks.MissileArtifact_ChimeraSeekingBomb); FireSunder.FixedUpdate += new hook_FixedUpdate(MoreProjectilesHooks.MissileArtifact_BeetleGuardRoller); FireTarball.FireSingleTarball += new hook_FireSingleTarball(MoreProjectilesHooks.MissileArtifact_DunestriderRoller); FireSecondaryProjectile.Fire += new hook_Fire(MoreProjectilesHooks.MissileArtifact_GrandpaVacuum); SparkBallFire.FireBomb += new hook_FireBomb(MoreProjectilesHooks.MissileArtifact_ChildSpark); BaseSplitDeath.OnEnter += new hook_OnEnter(MoreProjectilesHooks.MissileArtifact_GupDeathEnter); FistSlam.OnEnter += new hook_OnEnter(MoreProjectilesHooks.MissileArtifact_BrotherFistSlam); WeaponSlam.OnEnter += new hook_OnEnter(MoreProjectilesHooks.MissileArtifact_BrotherWeaponSlam); UltChannelState.OnEnter += new hook_OnEnter(MoreProjectilesHooks.MissileArtifact_BrotherUltChannelState); FireCannons.OnEnter += new hook_OnEnter(MoreProjectilesHooks.MissileArtifact_GreaterWispFireCannons); ChargeTrioBomb.FixedUpdate += new Manipulator(MoreProjectilesHooks.MissileArtifact_ChargeTrioBomb); ChargeTrioBomb.FindTargetChildTransformFromBombIndex += new hook_FindTargetChildTransformFromBombIndex(MoreProjectilesHooks.MissileArtifact_FindTrioBombTransform); } public static void FireWarfareProjectilesSimple(CharacterBody body, float damageCoefficient, string assetGuid) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) GameObject projectilePrefab = Addressables.LoadAssetAsync((object)assetGuid).WaitForCompletion(); FireWarfareProjectilesSimple(body, damageCoefficient, projectilePrefab); } public static void FireWarfareProjectilesSimple(CharacterBody body, float damageCoefficient, GameObject projectilePrefab) { //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_0028: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_008c: 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_008e: Unknown result type (might be due to invalid IL or missing references) if (body.hasEffectiveAuthority && IsMoreProjectilesActiveForBody(body)) { Ray aimRay = body.equipmentSlot.GetAimRay(); FireProjectileInfo fireProjectileInfo = new FireProjectileInfo { projectilePrefab = projectilePrefab, position = ((Ray)(ref aimRay)).origin, rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), owner = ((Component)body).gameObject, damage = body.damage * damageCoefficient, crit = Util.CheckRoll(body.crit, body.master) }; FireWarfareProjectiles(aimRay, fireProjectileInfo, 20f); } } internal static void FireWarfareProjectiles(Ray aimRay, FireProjectileInfo fireProjectileInfo, float spread) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_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_0020: 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_0024: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.Cross(Vector3.up, ((Ray)(ref aimRay)).direction); Vector3 axis = Vector3.Cross(((Ray)(ref aimRay)).direction, val); FireWarfareProjectiles(aimRay, fireProjectileInfo, spread, axis); } internal static void FireWarfareProjectiles(Ray aimRay, FireProjectileInfo fireProjectileInfo, float spread, Vector3 axis) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: 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_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: 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) fireProjectileInfo.rotation = Util.QuaternionSafeLookRotation(Quaternion.AngleAxis(spread, axis) * ((Ray)(ref aimRay)).direction); ProjectileManager.instance.FireProjectile(fireProjectileInfo); fireProjectileInfo.rotation = Util.QuaternionSafeLookRotation(Quaternion.AngleAxis(0f - spread, axis) * ((Ray)(ref aimRay)).direction); ProjectileManager.instance.FireProjectile(fireProjectileInfo); } } } namespace RainrotSharedUtils.Difficulties { internal static class DifficultyStatHooks { internal static void CacheDifficultyStats(orig_OnRuleBookUpdated orig, Run self, NetworkRuleBook networkRuleBookComponent) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) DifficultyUtilsModule.cachedDifficultyStats = DifficultyUtilsModule.GetMoreDifficultyStats(networkRuleBookComponent.ruleBook.FindDifficulty()); if (DifficultyUtilsModule.cachedDifficultyStats.ambientLevelCap != -1) { Run.ambientLevelCap = DifficultyUtilsModule.cachedDifficultyStats.ambientLevelCap; } else { Run.ambientLevelCap = 99; } orig.Invoke(self, networkRuleBookComponent); } internal static void DoBoostedTpContrast() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) if (!DifficultyUtilsModule._tpContrasted) { DifficultyUtilsModule._tpContrasted = true; AssetReferenceT val = new AssetReferenceT(RoR2_Base_Teleporters.matTeleporterFresnelOverlay_mat); AsyncOperationHandle val2 = AssetAsyncReferenceManager.LoadAsset(val, (AsyncReferenceHandleUnloadType)2); val2.Completed += delegate(AsyncOperationHandle ctx) { Material result = ctx.Result; result.SetFloat("_SoftFactor", 2f); result.SetFloat("_BrightnessBoost", 10.34f); result.SetFloat("_AlphaBoost", 4.01f); result.SetFloat("_AlphaBias", 0.05f); result.SetFloat("_FresnelPower", 4.23f); result.SetFloat("_OffsetAmount", 0.18f); result.SetFloat("_OffsetAmt", 0.18f); result.SetFloat("_VertexOffsetAmt", 0.18f); }; } } internal static void CompensateBossCredits(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); if (!val.TryGotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "compensatedDifficultyCoefficient") })) { SharedUtilsPlugin.DebugBreakpoint("CompensateBossCredits"); return; } val.EmitDelegate>((Func)((float difficultyCoefficient) => (!DifficultyUtilsModule.ValidateCachedDifficultyStats() || !DifficultyUtilsModule.cachedDifficultyStats.compensateBossCredits) ? difficultyCoefficient : (difficultyCoefficient - DifficultyUtilsModule.cachedDifficultyStats.startingDifficultyCoefficientBoost))); } [SystemInitializer(new Type[] { typeof(CombatDirector) })] internal static void FixEliteSpawn() { EliteTierDef[] eliteTiers = CombatDirector.eliteTiers; foreach (EliteTierDef val in eliteTiers) { List list = val.eliteTypes.ToList(); if (val.eliteTypes.Contains(Elites.FireHonor) && !val.eliteTypes.Contains(Elites.AurelioniteHonor)) { val.isAvailable = (EliteRules rules) => !IsPastMinimumStage(isTier2: false) && (CombatDirector.IsEliteOnlyArtifactActive() || ((int)rules == 0 && GetForceNextSpawnAsElite())); } if (val.eliteTypes.Contains(Elites.Aurelionite)) { val.isAvailable = (EliteRules rules) => IsPastMinimumStage(isTier2: false) && CombatDirector.NotEliteOnlyArtifactActive() && (int)rules == 0; } if (val.eliteTypes.Contains(Elites.AurelioniteHonor)) { val.isAvailable = (EliteRules rules) => IsPastMinimumStage(isTier2: false) && (CombatDirector.IsEliteOnlyArtifactActive() || ((int)rules == 0 && GetForceNextSpawnAsElite())); } if (val.eliteTypes.Contains(Elites.Poison) || val.eliteTypes.Contains(Elites.Haunted)) { val.isAvailable = (EliteRules rules) => (int)rules == 0 && IsPastMinimumStage(isTier2: true); } } static bool GetForceNextSpawnAsElite() { Debug.LogError((object)DifficultyUtilsModule.forceNextSpawnAsElite); return false; } static bool IsPastMinimumStage(bool isTier2) { int num = (isTier2 ? 4 : 2); if (DifficultyUtilsModule.UseDifficultyStats && DifficultyUtilsModule.ValidateCachedDifficultyStats()) { num = (isTier2 ? DifficultyUtilsModule.cachedDifficultyStats.tier2EliteStage : DifficultyUtilsModule.cachedDifficultyStats.tier1AndHalfEliteStage) - 1; } return Run.instance.stageClearCount >= num; } } internal static void OverridePromoteIfHonor(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (!val.TryGotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "IsArtifactEnabled") })) { SharedUtilsPlugin.DebugBreakpoint("OverridePromoteIfHonor"); return; } val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)((bool isHonor, CharacterMaster master) => isHonor || DifficultyUtilsModule.IsForceEliteTrueForMaster(master))); } internal static void ForceEliteMonsterWave(orig_PrepareNewMonsterWave orig, CombatDirector self, DirectorCard monsterCard) { if (monsterCard != null && monsterCard.IsAvailable()) { SpawnCard spawnCard = monsterCard.GetSpawnCard(); CharacterSpawnCard card = (CharacterSpawnCard)(object)((spawnCard is CharacterSpawnCard) ? spawnCard : null); DifficultyUtilsModule.forceNextSpawnAsElite = DifficultyUtilsModule.IsForceEliteTrueForSpawncard(card); } orig.Invoke(self, monsterCard); } internal static bool ForceEliteSpawn(orig_AttemptSpawnOnTarget orig, CombatDirector self, Transform spawnTarget, PlacementMode placementMode) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) if (self.currentMonsterCard != null && self.currentMonsterCard.IsAvailable()) { SpawnCard spawnCard = self.currentMonsterCard.GetSpawnCard(); CharacterSpawnCard card = (CharacterSpawnCard)(object)((spawnCard is CharacterSpawnCard) ? spawnCard : null); DifficultyUtilsModule.forceNextSpawnAsElite = DifficultyUtilsModule.IsForceEliteTrueForSpawncard(card); } return orig.Invoke(self, spawnTarget, placementMode); } internal static void ForceEliteType(orig_ResetEliteType orig, CombatDirector self) { if (self.currentMonsterCard != null && self.currentMonsterCard.IsAvailable()) { SpawnCard spawnCard = self.currentMonsterCard.GetSpawnCard(); CharacterSpawnCard card = (CharacterSpawnCard)(object)((spawnCard is CharacterSpawnCard) ? spawnCard : null); DifficultyUtilsModule.forceNextSpawnAsElite = DifficultyUtilsModule.IsForceEliteTrueForSpawncard(card); } orig.Invoke(self); } internal static void ForceEliteBossGroup(orig_OnMemberDiscovered orig, BossGroup self, CharacterMaster memberMaster) { orig.Invoke(self, memberMaster); if (NetworkServer.active && Object.op_Implicit((Object)(object)memberMaster)) { CharacterBody body = memberMaster.GetBody(); if (Object.op_Implicit((Object)(object)body) && !body.isElite) { EliteOnlyArtifactManager.PromoteIfHonor(memberMaster, Run.instance.spawnRng, (EliteDef[])null); } } } internal static void TeleporterParticleScale(orig_OnEnter orig, BaseTeleporterState self) { //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: 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) orig.Invoke(self); if (!DifficultyUtilsModule.ValidateCachedDifficultyStats()) { return; } float teleporterParticleRangeMultiplier = DifficultyUtilsModule.cachedDifficultyStats.teleporterParticleRangeMultiplier; TeleporterInteraction component = ((EntityState)self).GetComponent(); if (!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)component.modelChildLocator)) { return; } Transform val = ((Component)component).transform.Find("TeleporterBaseMesh/BuiltInEffects/PassiveParticle, Sphere"); if (Object.op_Implicit((Object)(object)val)) { if (teleporterParticleRangeMultiplier <= 0f) { ((Component)val).gameObject.SetActive(false); return; } ((Component)val).gameObject.SetActive(true); val.localScale = Vector3.one * DifficultyUtilsModule.DefaultTeleParticleRadius * teleporterParticleRangeMultiplier; } } internal static void FixGoldRewards(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0009: 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) ILCursor val = new ILCursor(il); val.Emit(OpCodes.Ldarg_1); val.EmitDelegate>((Func)delegate(uint money) { float compensatedDifficultyFraction = DifficultyUtilsModule.GetCompensatedDifficultyFraction(); float num = (float)money * compensatedDifficultyFraction * DifficultyUtilsModule.GoldRewardMultiplierGlobal; uint num2 = (uint)Mathf.FloorToInt(num); if (Util.CheckRoll0To1(num - (float)num2, 0f, (CharacterMaster)null)) { num2++; } return num2; }); val.Emit(OpCodes.Starg, 1); } internal static void FixExpRewards(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0009: 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) ILCursor val = new ILCursor(il); val.Emit(OpCodes.Ldarg_1); val.EmitDelegate>((Func)delegate(uint exp) { float compensatedDifficultyFraction = DifficultyUtilsModule.GetCompensatedDifficultyFraction(); return (uint)Mathf.CeilToInt((float)exp * compensatedDifficultyFraction * DifficultyUtilsModule.ExpRewardMultiplierGlobal); }); val.Emit(OpCodes.Starg, 1); } internal static void RecalculateDifficultyCoefficient_DifficultyStats(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); AddAmbientLevelBoost(val); val.Index = 0; AddDifficultyCoefficientBoost(val); } internal static void CorrectDifficultyBar(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); if (!val.TryGotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "get_ambientLevel") })) { SharedUtilsPlugin.DebugBreakpoint("CorrectDifficultyBar"); return; } val.EmitDelegate>((Func)((float levelIn) => (!DifficultyUtilsModule.ValidateCachedDifficultyStats()) ? levelIn : (levelIn + DifficultyUtilsModule.cachedDifficultyStats.startingDifficultyDisplay - DifficultyUtilsModule.cachedDifficultyStats.startingLevelBoost))); } internal static void AddDifficultyCoefficientBoost(ILCursor c) { if (!c.TryGotoNext((MoveType)0, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "compensatedDifficultyCoefficient") })) { SharedUtilsPlugin.DebugBreakpoint("AddDifficultyCoefficientBoost", 1); return; } c.EmitDelegate>((Func)((float compensatedDifficultyCoefficient) => (!DifficultyUtilsModule.ValidateCachedDifficultyStats()) ? compensatedDifficultyCoefficient : (compensatedDifficultyCoefficient + DifficultyUtilsModule.cachedDifficultyStats.startingDifficultyCoefficientBoost))); } internal static void AddAmbientLevelBoost(ILCursor c) { if (!c.TryGotoNext((MoveType)0, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "set_ambientLevel") })) { SharedUtilsPlugin.DebugBreakpoint("AddAmbientLevelBoost"); return; } c.EmitDelegate>((Func)((float ambientLevel) => (!DifficultyUtilsModule.ValidateCachedDifficultyStats()) ? ambientLevel : (ambientLevel + DifficultyUtilsModule.cachedDifficultyStats.startingLevelBoost))); } } public class MoreDifficultyStats { public enum StartingDifficulty { Easy = 0, Medium = 3, Hard = 6, VeryHard = 9, Insane = 12 } public float startingDifficultyDisplay = 0f; public float startingLevelBoost = 0f; public float startingDifficultyCoefficientBoost = 0f; public bool compensateBossCredits = true; public int ambientLevelCap = -1; public int tier2EliteStage = 6; public int tier1AndHalfEliteStage = 3; public float teleporterParticleRangeMultiplier = 1f; public float desiredStormTime_ForSwanSong = -1f; public float desiredStormWarningTime_ForSwanSong = -1f; public bool delayFirstStorm_ForSwanSong = true; public float stormIntensifyStrength_ForSwanSong = -1f; public DifficultyIndex difficultyIndex { get; private set; } = (DifficultyIndex)(-1); public MoreDifficultyStats(DifficultyIndex difficultyIndex) { //IL_0002: 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) this.difficultyIndex = difficultyIndex; } } public static class DifficultyUtilsModule { public delegate bool ForceEliteMasterEventHandler(CharacterMaster sender); public delegate bool ForceEliteSpawnEventHandler(CharacterSpawnCard card); internal static bool _hooksEnabled = false; internal static bool _hooksEnabledForceElite = false; internal static bool _tpContrasted = false; public static bool CompensateRewardsForDifficultyScaling = false; public static bool CompensateRewardsForDifficultyBoost = false; public static float BoostedRewardCompensationCoefficient = 0f; public static float GoldRewardMultiplierGlobal = 1f; public static float ExpRewardMultiplierGlobal = 1f; public static float DefaultTeleParticleRadius = 1f; internal static bool _useDifficultyStats; private static bool _boostTeleporterContrast; internal static bool forceNextSpawnAsElite; public static Dictionary difficultyCustomStats = new Dictionary(); public static bool UseDifficultyStats { get { return _useDifficultyStats; } set { if (value) { SetHooks(); } _useDifficultyStats = value; } } public static bool BoostTeleporterContrast { get { return _boostTeleporterContrast; } set { if (value) { DifficultyStatHooks.DoBoostedTpContrast(); } _boostTeleporterContrast = value; } } public static MoreDifficultyStats cachedDifficultyStats { get; internal set; } = null; private static event ForceEliteMasterEventHandler _forceEliteMasterProvider; public static event ForceEliteMasterEventHandler ForceEliteMasterProvider { add { if (DifficultyUtilsModule._forceEliteMasterProvider == null) { DifficultyUtilsModule._forceEliteMasterProvider = value.Invoke; } else { _forceEliteMasterProvider += value; } } remove { _forceEliteMasterProvider -= value; } } private static event ForceEliteSpawnEventHandler _forceEliteSpawnProvider; public static event ForceEliteSpawnEventHandler ForceEliteSpawnProvider { add { if (DifficultyUtilsModule._forceEliteSpawnProvider == null) { DifficultyUtilsModule._forceEliteSpawnProvider = value.Invoke; } else { _forceEliteSpawnProvider += value; } } remove { _forceEliteSpawnProvider -= value; } } public static void EnableAll() { UseDifficultyStats = true; BoostTeleporterContrast = true; CompensateRewardsForDifficultyScaling = true; CompensateRewardsForDifficultyBoost = true; } public static bool IsForceEliteTrueForMaster(CharacterMaster sender) { if (!_hooksEnabledForceElite) { return false; } if ((Object)(object)sender == (Object)null) { return false; } Delegate[] invocationList = DifficultyUtilsModule._forceEliteMasterProvider.GetInvocationList(); for (int i = 0; i < invocationList.Length; i++) { ForceEliteMasterEventHandler forceEliteMasterEventHandler = (ForceEliteMasterEventHandler)invocationList[i]; if (forceEliteMasterEventHandler(sender)) { return true; } } return false; } public static bool IsForceEliteTrueForSpawncard(CharacterSpawnCard card) { if (!_hooksEnabledForceElite) { return false; } if ((Object)(object)card == (Object)null) { return false; } Delegate[] invocationList = DifficultyUtilsModule._forceEliteSpawnProvider.GetInvocationList(); for (int i = 0; i < invocationList.Length; i++) { ForceEliteSpawnEventHandler forceEliteSpawnEventHandler = (ForceEliteSpawnEventHandler)invocationList[i]; if (forceEliteSpawnEventHandler(card)) { return true; } } return false; } public static MoreDifficultyStats GetMoreDifficultyStats(DifficultyIndex difficulty) { //IL_0006: 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_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) if (difficultyCustomStats.ContainsKey(difficulty)) { return difficultyCustomStats[difficulty]; } MoreDifficultyStats moreDifficultyStats = new MoreDifficultyStats(difficulty); difficultyCustomStats.Add(difficulty, moreDifficultyStats); return moreDifficultyStats; } public static bool ValidateCachedDifficultyStats() { //IL_0022: 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_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Invalid comparison between Unknown and I4 //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Invalid comparison between Unknown and I4 //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) bool flag = cachedDifficultyStats != null; if ((Object)(object)Run.instance == (Object)null) { return flag; } DifficultyIndex selectedDifficulty = Run.instance.selectedDifficulty; if ((int)selectedDifficulty == -1 || (int)selectedDifficulty == 11) { return flag; } if (!flag || cachedDifficultyStats.difficultyIndex != Run.instance.selectedDifficulty) { cachedDifficultyStats = GetMoreDifficultyStats(Run.instance.selectedDifficulty); } return true; } public static float GetCompensatedDifficultyFraction() { if (!UseDifficultyStats) { return 1f; } float num = GetCompensatedStageEntryDifficulty(); return (1f + num) / (1f + Run.instance.compensatedDifficultyCoefficient); static float GetCompensatedStageEntryDifficulty() { if (!CompensateRewardsForDifficultyScaling && !CompensateRewardsForDifficultyBoost) { return Run.instance.compensatedDifficultyCoefficient; } float num2 = (CompensateRewardsForDifficultyScaling ? Stage.instance.entryDifficultyCoefficient : Run.instance.difficultyCoefficient); if (CompensateRewardsForDifficultyBoost && BoostedRewardCompensationCoefficient == 1f) { return num2; } if (!ValidateCachedDifficultyStats()) { return num2; } float num3 = (CompensateRewardsForDifficultyBoost ? BoostedRewardCompensationCoefficient : 0f); return num2 + cachedDifficultyStats.startingDifficultyCoefficientBoost * (1f - num3); } } public static float GetAmbientLevelBoost() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Invalid comparison between Unknown and I4 //IL_0051: Unknown result type (might be due to invalid IL or missing references) if (!UseDifficultyStats) { return 1f; } if (cachedDifficultyStats == null) { if ((Object)(object)Run.instance == (Object)null || (int)Run.instance.selectedDifficulty == -1) { return 0f; } cachedDifficultyStats = GetMoreDifficultyStats(Run.instance.selectedDifficulty); } return cachedDifficultyStats.startingLevelBoost; } private static void SetHooksForceElite() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown if (!_hooksEnabledForceElite) { _hooksEnabledForceElite = true; EliteOnlyArtifactManager.PromoteIfHonor += new Manipulator(DifficultyStatHooks.OverridePromoteIfHonor); EliteOnlyArtifactManager.PromoteIfHonorAndApplyStats += new Manipulator(DifficultyStatHooks.OverridePromoteIfHonor); BossGroup.OnMemberDiscovered += new hook_OnMemberDiscovered(DifficultyStatHooks.ForceEliteBossGroup); } } private static bool ForceSpawnToBeElite(orig_Spawn orig, CombatDirector self, SpawnCard spawnCard, EliteDef eliteDef, Transform spawnTarget, MonsterSpawnDistance spawnDistance, bool preventOverhead, float valueMultiplier, PlacementMode placementMode, bool singleScaledBoss) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) return orig.Invoke(self, spawnCard, eliteDef, spawnTarget, spawnDistance, preventOverhead, valueMultiplier, placementMode, singleScaledBoss); } private static void SetHooks() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Expected O, but got Unknown //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Expected O, but got Unknown //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Expected O, but got Unknown //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Expected O, but got Unknown //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Expected O, but got Unknown if (!_hooksEnabled) { _hooksEnabled = true; SetHooksForceElite(); Run.OnRuleBookUpdated += new hook_OnRuleBookUpdated(DifficultyStatHooks.CacheDifficultyStats); DifficultyBarController.DoBarUpdates += new Manipulator(DifficultyStatHooks.CorrectDifficultyBar); Run.RecalculateDifficultyCoefficentInternal += new Manipulator(DifficultyStatHooks.RecalculateDifficultyCoefficient_DifficultyStats); BaseTeleporterState.OnEnter += new hook_OnEnter(DifficultyStatHooks.TeleporterParticleScale); ChargingState.OnEnter += new Manipulator(DifficultyStatHooks.CompensateBossCredits); ILHook val = new ILHook((MethodBase)typeof(DeathRewards).GetMethod("set_goldReward", (BindingFlags)(-1)), new Manipulator(DifficultyStatHooks.FixGoldRewards)); ILHook val2 = new ILHook((MethodBase)typeof(DeathRewards).GetMethod("set_expReward", (BindingFlags)(-1)), new Manipulator(DifficultyStatHooks.FixExpRewards)); } } } } namespace RainrotSharedUtils.Components { public class DotWard : BuffWard { public DotIndex dotIndex = (DotIndex)(-1); public float damageCoefficient = 1f; private ProjectileController _projectileController; private GameObject _ownerObject; private CharacterBody _ownerBody; private Inventory _ownerInventory; public ProjectileController projectileController { get { if ((Object)(object)_projectileController == (Object)null) { _projectileController = ((Component)this).GetComponent(); } return _projectileController; } set { _projectileController = value; } } public GameObject ownerObject { get { if ((Object)(object)_ownerObject == (Object)null && (Object)(object)projectileController != (Object)null) { _ownerObject = projectileController.owner; } return _ownerObject; } set { _ownerObject = value; } } public CharacterBody ownerBody { get { if ((Object)(object)_ownerBody == (Object)null && (Object)(object)ownerObject != (Object)null) { _ownerBody = ownerObject.GetComponent(); } return _ownerBody; } set { _ownerBody = value; } } public Inventory ownerInventory { get { if ((Object)(object)_ownerInventory == (Object)null && (Object)(object)ownerBody != (Object)null) { _ownerInventory = ownerBody.inventory; } return _ownerInventory; } set { _ownerInventory = value; } } } public class NebulaPickup : MonoBehaviour { public BuffDef buffDef; [Tooltip("The base object to destroy when this pickup is consumed.")] public GameObject baseObject; [Tooltip("The team filter object which determines who can pick up this pack.")] public TeamFilter teamFilter; public GameObject pickupEffect; private bool alive = true; private void OnTriggerStay(Collider other) { //IL_0025: 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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Expected O, but got Unknown if ((Object)(object)other != (Object)null && NetworkServer.active && alive && TeamComponent.GetObjectTeam(((Component)other).gameObject) == teamFilter.teamIndex) { CharacterBody component = ((Component)other).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { ApplyNebulaBooster(buffDef, component); EffectManager.SpawnEffect(pickupEffect, new EffectData { origin = ((Component)this).transform.position }, true); Object.Destroy((Object)(object)baseObject); } } } public static void ApplyNebulaBooster(BuffDef buffDef, CharacterBody targetBody) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active || !Object.op_Implicit((Object)(object)buffDef)) { return; } AddBoosterBuff(buffDef, targetBody); IEnumerable teamMembers = TeamComponent.GetTeamMembers(targetBody.teamComponent.teamIndex); foreach (TeamComponent item in teamMembers) { if (!((Object)(object)item != (Object)(object)targetBody.teamComponent)) { continue; } Vector3 val = ((Component)item).transform.position - targetBody.corePosition; if (((Vector3)(ref val)).sqrMagnitude <= Assets.nebulaBoosterBuffRadius * Assets.nebulaBoosterBuffRadius) { CharacterBody body = item.body; if (Object.op_Implicit((Object)(object)body)) { AddBoosterBuff(buffDef, body); } } } } public static void AddBoosterBuff(BuffDef buffDef, CharacterBody body) { body.AddTimedBuff(buffDef, Assets.nebulaBoosterBuffDuration, 5); } public static void CreateBoosterPickup(Vector3 spawnPoint, TeamIndex team, GameObject boosterPrefab, int boosterCount = 1) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: 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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)boosterPrefab != (Object)null)) { return; } for (int i = 0; i < boosterCount; i++) { GameObject val = Object.Instantiate(boosterPrefab, spawnPoint, Random.rotation); val.GetComponent().teamIndex = team; VelocityRandomOnStart component = val.GetComponent(); if ((Object)(object)component != (Object)null) { component.baseDirection = new Vector3((float)Random.Range(-1, 1), Random.Range(-0.6f, 0.2f), (float)Random.Range(-1, 1)); } NetworkServer.Spawn(val); } } } public class NebulaGravitate : GravitatePickup { private void FixedUpdate() { //IL_001d: 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) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)base.gravitateTarget)) { Rigidbody rigidbody = base.rigidbody; Vector3 velocity = base.rigidbody.velocity; Vector3 val = ((Component)base.gravitateTarget).transform.position - ((Component)this).transform.position; rigidbody.velocity = Vector3.MoveTowards(velocity, ((Vector3)(ref val)).normalized * base.maxSpeed, base.acceleration); } } } [RequireComponent(typeof(ProjectileDamage))] public class ProjectileIncreaseDamageAfterDistance : MonoBehaviour { private ProjectileDamage projectileDamage; public float requiredDistance = 21f; public float damageMultiplierOnIncrease = 1f; public GameObject effectPrefab; private Vector3 initialPosition; private bool damageIncreased; private float requiredDistanceSqr => requiredDistance * requiredDistance; private void OnEnable() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) initialPosition = ((Component)this).transform.position; projectileDamage = ((Component)this).GetComponent(); } private void FixedUpdate() { //IL_0027: 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_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Expected O, but got Unknown if (!NetworkServer.active || damageIncreased) { return; } Vector3 val = ((Component)this).transform.position - initialPosition; float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; if (sqrMagnitude >= requiredDistanceSqr) { damageIncreased = true; ProjectileDamage obj = projectileDamage; obj.damage *= damageMultiplierOnIncrease; if ((Object)(object)effectPrefab != (Object)null) { EffectData val2 = new EffectData { origin = ((Component)this).transform.position }; EffectManager.SpawnEffect(effectPrefab, val2, true); } } } } public class ProjectileOverlapDecayDamage : ProjectileOverlapLimitHits { internal float initialDamageCoefficient = 1f; internal float initialProcCoefficient = 1f; public float firstHitDamageMultiplier = 1f; public float onHitDamageMultiplier = 1f; } }