Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of Overkill v1.0.2
Overkill.dll
Decompiled a year agousing System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using Overkill.Modules; using R2API; using R2API.Networking; using R2API.Networking.Interfaces; using RiskOfOptions; using RiskOfOptions.OptionConfigs; using RiskOfOptions.Options; using RoR2; using RoR2.Projectile; using ThreeEyedGames; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")] [assembly: AssemblyCompany("Overkill")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("Overkill")] [assembly: AssemblyTitle("Overkill")] [assembly: AssemblyVersion("1.0.0.0")] namespace Overkill { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.rob.Overkill", "Overkill", "1.0.2")] public class Plugin : BaseUnityPlugin { public const string MODUID = "com.rob.Overkill"; public static bool rooInstalled => Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions"); private void Awake() { Config.myConfig = ((BaseUnityPlugin)this).Config; OverkillAssets.Init(); Config.Init(); NetworkingAPI.RegisterMessageType<SyncModelExplosion>(); Hook(); } private void Hook() { GlobalEventManager.onCharacterDeathGlobal += GlobalEventManager_onCharacterDeathGlobal; } public static void SpawnBloodEffect(DamageReport damageReport) { //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_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_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_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_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) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Expected O, but got Unknown //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: 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_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01df: 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_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Expected O, but got Unknown //IL_018d: 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_0193: 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_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: 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_01a6: 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_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Expected O, but got Unknown //IL_014e: 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_015b: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: 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_0183: Expected O, but got Unknown //IL_013d: Unknown result type (might be due to invalid IL or missing references) if (!Config.enableGore.Value) { return; } CharacterBody victimBody = damageReport.victimBody; if (!Object.op_Implicit((Object)(object)victimBody)) { return; } Vector3 corePosition = victimBody.corePosition; if (OverkillAssets.bloodExplosionOverrides.ContainsKey(((Object)victimBody).name)) { EffectManager.SpawnEffect(OverkillAssets.bloodExplosionOverrides[((Object)victimBody).name], new EffectData { origin = corePosition, rotation = Quaternion.identity, color = Color32.op_Implicit(Color.white) }, true); } else if (Object.op_Implicit((Object)(object)damageReport.victimBody.modelLocator) && Object.op_Implicit((Object)(object)damageReport.victimBody.modelLocator.modelTransform)) { SurfaceDefProvider componentInChildren = ((Component)damageReport.victimBody.modelLocator.modelTransform).GetComponentInChildren<SurfaceDefProvider>(); if (Object.op_Implicit((Object)(object)componentInChildren) && Object.op_Implicit((Object)(object)componentInChildren.surfaceDef)) { Decal componentInChildren2 = OverkillAssets.genericBloodExplosionEffect.GetComponentInChildren<Decal>(); if (Object.op_Implicit((Object)(object)componentInChildren2)) { componentInChildren2.Material = Object.Instantiate<Material>(componentInChildren2.Material); componentInChildren2.Material.SetColor("_Color", componentInChildren.surfaceDef.approximateColor); } EffectManager.SpawnEffect(OverkillAssets.genericBloodExplosionEffect, new EffectData { origin = corePosition, rotation = Quaternion.identity, color = Color32.op_Implicit(componentInChildren.surfaceDef.approximateColor) }, true); } else { EffectManager.SpawnEffect(OverkillAssets.largeBloodExplosionEffect, new EffectData { origin = corePosition, rotation = Quaternion.identity, color = Color32.op_Implicit(Color.white) }, true); } } else { EffectManager.SpawnEffect(OverkillAssets.largeBloodExplosionEffect, new EffectData { origin = corePosition, rotation = Quaternion.identity, color = Color32.op_Implicit(Color.white) }, true); } } private static void GlobalEventManager_onCharacterDeathGlobal(DamageReport damageReport) { //IL_0109: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)damageReport.victimBody) || !Object.op_Implicit((Object)(object)damageReport.victimBody.healthComponent) || !(damageReport.damageDealt >= damageReport.victimBody.healthComponent.fullCombinedHealth * Config.healthThreshold.Value) || !(damageReport.victimBody.healthComponent.health <= 0f) || damageReport.victimBody.healthComponent.alive) { return; } bool flag = true; if (Object.op_Implicit((Object)(object)((Component)damageReport.victimBody).GetComponent<ProjectileController>())) { flag = false; } if (OverkillAssets.blacklist.Contains(((Object)((Component)damageReport.victimBody).gameObject).name)) { flag = false; } if (flag) { SpawnBloodEffect(damageReport); ((Component)damageReport.victimBody).gameObject.AddComponent<ExplodeModel>(); NetworkIdentity component = ((Component)damageReport.victimBody).gameObject.GetComponent<NetworkIdentity>(); if (Object.op_Implicit((Object)(object)component)) { NetMessageExtensions.Send((INetMessage)(object)new SyncModelExplosion(component.netId, ((Component)damageReport.victimBody).gameObject), (NetworkDestination)1); } } } } internal class SyncModelExplosion : INetMessage, ISerializableObject { private NetworkInstanceId netId; private GameObject target; public SyncModelExplosion() { } public SyncModelExplosion(NetworkInstanceId netId, GameObject target) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) this.netId = netId; this.target = target; } public void Deserialize(NetworkReader reader) { //IL_0003: 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) netId = reader.ReadNetworkId(); target = reader.ReadGameObject(); } public void OnReceived() { if (Object.op_Implicit((Object)(object)target)) { target.AddComponent<ExplodeModel>(); } } public void Serialize(NetworkWriter writer) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) writer.Write(netId); writer.Write(target); } } public class ExplodeModel : MonoBehaviour { private void Awake() { ((MonoBehaviour)this).Invoke("Boom", 0.1f); } private void Boom() { //IL_0014: 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_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) Rigidbody component = ((Component)this).GetComponent<Rigidbody>(); if (Object.op_Implicit((Object)(object)component)) { component.velocity = Vector3.zero; component.isKinematic = true; } CharacterMotor component2 = ((Component)this).GetComponent<CharacterMotor>(); if (Object.op_Implicit((Object)(object)component2)) { component2.rootMotion = Vector3.zero; component2.velocity = Vector3.zero; } ModelLocator component3 = ((Component)this).GetComponent<ModelLocator>(); if (Object.op_Implicit((Object)(object)component3) && Object.op_Implicit((Object)(object)component3.modelTransform)) { ((Component)component3.modelTransform).gameObject.SetActive(false); } Object.Destroy((Object)(object)this); } } } namespace Overkill.Modules { internal static class Config { public static ConfigFile myConfig; public static ConfigEntry<bool> enableGore; public static ConfigEntry<float> healthThreshold; internal static void Init() { enableGore = BindAndOptions("01 - General", "Enable Gore", defaultValue: true, "If true, spawns a bloody explosion when an enemy is overkilled. Disable for a performance boost."); healthThreshold = BindAndOptionsSlider("01 - General", "Health Threshold", 5f, "The damage threshold needed to trigger an overkill.", 1f, 50f); } public static void InitROO(Sprite modSprite, string modDescription) { if (Plugin.rooInstalled) { _InitROO(modSprite, modDescription); } } public static void _InitROO(Sprite modSprite, string modDescription) { ModSettingsManager.SetModIcon(modSprite); ModSettingsManager.SetModDescription(modDescription); } public static ConfigEntry<T> BindAndOptions<T>(string section, string name, T defaultValue, string description = "", bool restartRequired = false) { if (string.IsNullOrEmpty(description)) { description = name; } if (restartRequired) { description += " (restart required)"; } ConfigEntry<T> val = myConfig.Bind<T>(section, name, defaultValue, description); if (Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions")) { TryRegisterOption<T>(val, restartRequired); } return val; } public static ConfigEntry<float> BindAndOptionsSlider(string section, string name, float defaultValue, string description = "", float min = 0f, float max = 20f, bool restartRequired = false) { if (string.IsNullOrEmpty(description)) { description = name; } if (restartRequired) { description += " (restart required)"; } ConfigEntry<float> val = myConfig.Bind<float>(section, name, defaultValue, description); if (Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions")) { TryRegisterOptionSlider(val, min, max, restartRequired); } return val; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private static void TryRegisterOption<T>(ConfigEntry<T> entry, bool restartRequired) { //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_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_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Expected O, but got Unknown //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Expected O, but got Unknown //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Expected O, but got Unknown if (entry is ConfigEntry<float>) { ModSettingsManager.AddOption((BaseOption)new SliderOption(entry as ConfigEntry<float>, new SliderConfig { min = 0f, max = 20f, formatString = "{0:0.00}", restartRequired = restartRequired })); } if (entry is ConfigEntry<int>) { ModSettingsManager.AddOption((BaseOption)new IntSliderOption(entry as ConfigEntry<int>, restartRequired)); } if (entry is ConfigEntry<bool>) { ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(entry as ConfigEntry<bool>, restartRequired)); } if (entry is ConfigEntry<KeyboardShortcut>) { ModSettingsManager.AddOption((BaseOption)new KeyBindOption(entry as ConfigEntry<KeyboardShortcut>, restartRequired)); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private static void TryRegisterOptionSlider(ConfigEntry<float> entry, float min, float max, bool restartRequired) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000e: 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_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown ModSettingsManager.AddOption((BaseOption)new SliderOption(entry, new SliderConfig { min = min, max = max, formatString = "{0:0.00}", restartRequired = restartRequired })); } } public class OverkillAssets { internal static GameObject genericBloodExplosionEffect; internal static GameObject largeBloodExplosionEffect; internal static GameObject gupBloodExplosionEffect; internal static GameObject golemBloodExplosionEffect; internal static GameObject lunarGolemBloodExplosionEffect; internal static GameObject insectBloodExplosionEffect; internal static GameObject clayBloodExplosionEffect; internal static GameObject fireBloodExplosionEffect; internal static GameObject greenFireBloodExplosionEffect; internal static GameObject purpleFireBloodExplosionEffect; internal static GameObject healingBloodExplosionEffect; internal static Dictionary<string, GameObject> bloodExplosionOverrides = new Dictionary<string, GameObject>(); internal static List<string> blacklist = new List<string> { "GupBody(Clone)", "GeepBody(Clone)", "ExplosivePotDestructibleBody(Clone)", "FusionCellDestructibleBody(Clone)", "VultureEggBody(Clone)", "JellyfishBody(Clone)", "MiniGeodeBody(Clone)", "MinorConstructBody(Clone)", "MegaConstructBody(Clone)", "AltarSkeletonBody", "SulfurPodBody(Clone)", "BHFruitBig", "VultureEggBody(Clone)" }; public static void Init() { //IL_0051: 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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0096: 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_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: 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_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_0119: 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_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_022e: 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) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: 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_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Unknown result type (might be due to invalid IL or missing references) //IL_0316: Unknown result type (might be due to invalid IL or missing references) //IL_0329: 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) using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Overkill.overkill_bank.bnk")) { byte[] array = new byte[stream.Length]; stream.Read(array, 0, array.Length); SoundBanks.Add(array); } Config.InitROO(null, "Badass"); Material val = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/blackbeach/matBloodDecal.mat").WaitForCompletion()); val.SetTexture("_MaskTex", Addressables.LoadAssetAsync<Texture>((object)"RoR2/Base/ClayBruiser/texClayBruiserDeathDecalMask.png").WaitForCompletion()); val.SetTexture("_MainTex", (Texture)null); Material val2 = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/blackbeach/matBloodDecal.mat").WaitForCompletion()); val2.SetTexture("_MaskTex", Addressables.LoadAssetAsync<Texture>((object)"RoR2/Base/ClayBruiser/texClayBruiserDeathDecalMask.png").WaitForCompletion()); val2.SetTexture("_MainTex", (Texture)null); val2.SetColor("_Color", Color.red); genericBloodExplosionEffect = CreateBloodExplosionEffect("RavagerGenericBloodExplosion", Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Common/VFX/matBloodGeneric.mat").WaitForCompletion(), 1f, val); largeBloodExplosionEffect = CreateBloodExplosionEffect("RavagerLargeBloodExplosion", Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Common/VFX/matBloodHumanLarge.mat").WaitForCompletion(), 3f, val2); gupBloodExplosionEffect = CreateBloodExplosionEffect("RavagerGupBloodExplosion", Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/Gup/matGupBlood.mat").WaitForCompletion(), 1f, Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/FireballsOnHit/matFireMeatballDecal.mat").WaitForCompletion()); golemBloodExplosionEffect = CreateBloodExplosionEffect("RavagerGolemBloodExplosion", Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Titan/matTitanLaserGlob.mat").WaitForCompletion(), 1f, Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/VoidSurvivor/matVoidPodImpactDecal.mat").WaitForCompletion()); lunarGolemBloodExplosionEffect = CreateBloodExplosionEffect("RavagerLunarGolemBloodExplosion", Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/LunarGolem/matLunarGolemExplosion.mat").WaitForCompletion(), 1f, Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/LunarExploder/matLunarExploderDeathDecal.mat").WaitForCompletion()); insectBloodExplosionEffect = CreateBloodExplosionEffect("RavagerInsectBloodExplosion", Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/AcidLarva/matAcidLarvaBlood.mat").WaitForCompletion(), 1f, Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Beetle/matBeetleQueenAcidDecal.mat").WaitForCompletion()); clayBloodExplosionEffect = CreateBloodExplosionEffect("RavagerClayBloodExplosion", Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Common/VFX/matBloodClayLarge.mat").WaitForCompletion(), 1f, Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/ClayBruiser/matClayGooDecalSplat.mat").WaitForCompletion()); fireBloodExplosionEffect = CreateBloodExplosionEffect("RavagerFireBloodExplosion", Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Common/VFX/matFirePillarParticle.mat").WaitForCompletion(), 1f, Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/Molotov/matMolotovDecal.mat").WaitForCompletion()); greenFireBloodExplosionEffect = CreateBloodExplosionEffect("RavagerGreenFireBloodExplosion", Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/GreaterWisp/matOmniExplosion1GreaterWisp.mat").WaitForCompletion(), 1f, Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/AcidLarva/matAcidLarvaDeathDecal.mat").WaitForCompletion()); purpleFireBloodExplosionEffect = CreateBloodExplosionEffect("RavagerPurpleFireBloodExplosion", Addressables.LoadAssetAsync<Material>((object)"RoR2/Junk/AncientWisp/matAncientWillowispSpiral.mat").WaitForCompletion(), 1f, Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/Molotov/matMolotovDecal.mat").WaitForCompletion()); healingBloodExplosionEffect = CreateBloodExplosionEffect("RavagerHealingBloodExplosion", Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Beetle/matBeetleQueenAcidFizz.mat").WaitForCompletion(), 1f, Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/AcidLarva/matAcidLarvaDeathDecal.mat").WaitForCompletion()); bloodExplosionOverrides = new Dictionary<string, GameObject> { { "GolemBody(Clone)", golemBloodExplosionEffect }, { "TitanBody(Clone)", golemBloodExplosionEffect }, { "GupBody(Clone)", gupBloodExplosionEffect }, { "GeepBody(Clone)", gupBloodExplosionEffect }, { "GipBody(Clone)", gupBloodExplosionEffect }, { "ClayBruiserBody(Clone)", clayBloodExplosionEffect }, { "ClayGrenadierBody(Clone)", clayBloodExplosionEffect }, { "MoffeinClayManBody(Clone)", clayBloodExplosionEffect }, { "AcidLarvaBody(Clone)", insectBloodExplosionEffect }, { "LunarConstructBody(Clone)", lunarGolemBloodExplosionEffect }, { "LunarWispBody(Clone)", lunarGolemBloodExplosionEffect }, { "LunarGolemBody(Clone)", lunarGolemBloodExplosionEffect }, { "LunarExploderBody(Clone)", lunarGolemBloodExplosionEffect }, { "BellBody(Clone)", golemBloodExplosionEffect }, { "BodyBrassMonolith(Clone)", golemBloodExplosionEffect }, { "WispBody(Clone)", fireBloodExplosionEffect }, { "GreaterWispBody(Clone)", greenFireBloodExplosionEffect }, { "MoffeinAncientWispBody(Clone)", purpleFireBloodExplosionEffect }, { "RoboBallMiniBody(Clone)", golemBloodExplosionEffect }, { "RoboBallBossBody(Clone)", golemBloodExplosionEffect }, { "SuperRoboBallBossBody(Clone)", golemBloodExplosionEffect }, { "NewtBody(Clone)", lunarGolemBloodExplosionEffect }, { "AffixEarthHealerBody(Clone)", healingBloodExplosionEffect } }; } private static GameObject CreateBloodExplosionEffect(string effectName, Material bloodMat, float scale = 1f, Material decalMat = null) { //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_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_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) GameObject val = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Brother/BrotherSlamImpact.prefab").WaitForCompletion(), effectName, true); DestroyOnTimer component = val.GetComponent<DestroyOnTimer>(); if (Object.op_Implicit((Object)(object)component)) { component.duration = 360f; } ((Component)val.transform.Find("Spikes, Small")).gameObject.SetActive(false); ((Component)val.transform.Find("PP")).gameObject.SetActive(false); ((Component)val.transform.Find("Point light")).gameObject.SetActive(false); ((Renderer)((Component)val.transform.Find("Flash Lines")).GetComponent<ParticleSystemRenderer>()).material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Common/VFX/matOpaqueDustLargeDirectional.mat").WaitForCompletion(); ((Renderer)((Component)val.transform.GetChild(3)).GetComponent<ParticleSystemRenderer>()).material = bloodMat; ((Renderer)((Component)val.transform.Find("Flash Lines, Fire")).GetComponent<ParticleSystemRenderer>()).material = bloodMat; ((Renderer)((Component)val.transform.GetChild(6)).GetComponent<ParticleSystemRenderer>()).material = bloodMat; ((Renderer)((Component)val.transform.Find("Fire")).GetComponent<ParticleSystemRenderer>()).material = bloodMat; MainModule main = ((Component)val.transform.Find("Fire")).GetComponent<ParticleSystem>().main; ((MainModule)(ref main)).startLifetimeMultiplier = 0.7f; main = ((Component)val.transform.Find("Flash Lines, Fire")).GetComponent<ParticleSystem>().main; ((MainModule)(ref main)).startLifetimeMultiplier = 0.5f; main = ((Component)val.transform.GetChild(6)).GetComponent<ParticleSystem>().main; ((MainModule)(ref main)).startLifetimeMultiplier = 0.6f; ((Renderer)((Component)val.transform.Find("Physics")).GetComponent<ParticleSystemRenderer>()).material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/MagmaWorm/matFracturedGround.mat").WaitForCompletion(); ((Component)val.transform.Find("Decal")).GetComponent<Decal>().Material = decalMat; ((Component)val.transform.Find("Decal")).GetComponent<AnimateShaderAlpha>().timeMax = 360f; ((Component)val.transform.Find("Decal")).transform.localPosition = Vector3.zero; ((Component)val.transform.Find("Decal")).transform.localScale = Vector3.one * 8f; ((Component)val.transform.Find("FoamSplash")).gameObject.SetActive(false); ((Component)val.transform.Find("FoamBilllboard")).gameObject.SetActive(false); ((Component)val.transform.Find("Dust")).gameObject.SetActive(false); ((Component)val.transform.Find("Dust, Directional")).gameObject.SetActive(false); val.transform.localScale = Vector3.one * scale; ContentAddition.AddEffect(val); val.GetComponent<EffectComponent>().soundName = "sfx_rob_overkill"; ParticleSystemColorFromEffectData val2 = val.AddComponent<ParticleSystemColorFromEffectData>(); val2.particleSystems = (ParticleSystem[])(object)new ParticleSystem[4] { ((Component)val.transform.Find("Fire")).GetComponent<ParticleSystem>(), ((Component)val.transform.Find("Flash Lines, Fire")).GetComponent<ParticleSystem>(), ((Component)val.transform.GetChild(6)).GetComponent<ParticleSystem>(), ((Component)val.transform.GetChild(3)).GetComponent<ParticleSystem>() }; val2.effectComponent = val.GetComponent<EffectComponent>(); return val; } } }