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 Remove Claptrap v1.2.0
RemoveClaptrap.dll
Decompiled 6 months agousing System; using System.Collections; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using HG; using On.RoR2; using RoR2; using UnityEngine; [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("RemoveClaptrap")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("RemoveClaptrap")] [assembly: AssemblyTitle("RemoveClaptrap")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace RemoveClaptrap; [BepInPlugin("com.claptraphater.RemoveClaptrap", "REMOVE CLAPTRAP", "1.2.0")] public class RemoveClaptrap : BaseUnityPlugin { public static string[] thingsThatMightBeClaptrap = new string[10] { "claptrap", "cl4p-tp", "clap-trap", "cl4p-tr4p", "cl4ptp", "claptp", "clap-tp", "clapbot", "trapbot", "clapchef" }; public static int claptrapsFound = 0; public void Awake() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Expected O, but got Unknown //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Expected O, but got Unknown //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Expected O, but got Unknown //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Expected O, but got Unknown //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Expected O, but got Unknown //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Expected O, but got Unknown //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Expected O, but got Unknown //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Expected O, but got Unknown //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Expected O, but got Unknown //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Expected O, but got Unknown //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Expected O, but got Unknown Debug.LogWarning((object)"LETS SEE YOU GET PAST THIS, FUCKER"); SurvivorCatalog.SetSurvivorDefs += new hook_SetSurvivorDefs(SurvivorCatalog_SetSurvivorDefs); BodyCatalog.SetBodyPrefabs += new hook_SetBodyPrefabs(BodyCatalog_SetBodyPrefabs); MasterCatalog.SetEntries += new hook_SetEntries(MasterCatalog_SetEntries); ArtifactCatalog.SetArtifactDefs += new hook_SetArtifactDefs(ArtifactCatalog_SetArtifactDefs); BuffCatalog.SetBuffDefs += new hook_SetBuffDefs(BuffCatalog_SetBuffDefs); EffectCatalog.SetEntries += new hook_SetEntries(EffectCatalog_SetEntries); EliteCatalog.SetEliteDefs += new hook_SetEliteDefs(EliteCatalog_SetEliteDefs); EntityStateCatalog.SetElements += new hook_SetElements(EntityStateCatalog_SetElements); EquipmentCatalog.SetEquipmentDefs += new hook_SetEquipmentDefs(EquipmentCatalog_SetEquipmentDefs); GameEndingCatalog.SetGameEndingDefs += new hook_SetGameEndingDefs(GameEndingCatalog_SetGameEndingDefs); GameModeCatalog.SetGameModes += new hook_SetGameModes(GameModeCatalog_SetGameModes); ItemCatalog.SetItemDefs += new hook_SetItemDefs(ItemCatalog_SetItemDefs); MusicTrackCatalog.SetEntries += new hook_SetEntries(MusicTrackCatalog_SetEntries); PickupCatalog.SetEntries += new hook_SetEntries(PickupCatalog_SetEntries); ProjectileCatalog.SetProjectilePrefabs += new hook_SetProjectilePrefabs(ProjectileCatalog_SetProjectilePrefabs); SceneCatalog.SetSceneDefs += new hook_SetSceneDefs(SceneCatalog_SetSceneDefs); SurfaceDefCatalog.SetSurfaceDefs += new hook_SetSurfaceDefs(SurfaceDefCatalog_SetSurfaceDefs); UnlockableCatalog.SetUnlockableDefs += new hook_SetUnlockableDefs(UnlockableCatalog_SetUnlockableDefs); SkinCatalog.FindSkinsForBody += new hook_FindSkinsForBody(SkinCatalog_FindSkinsForBody); RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, (Action)delegate { if (claptrapsFound == 0) { Debug.LogWarning((object)"Hunt completed. No Claptraps found."); } else { Debug.LogError((object)$"Hunt completed. {claptrapsFound} Claptraps eliminated."); } }); } private SkinDef[] SkinCatalog_FindSkinsForBody(orig_FindSkinsForBody orig, BodyIndex bodyIndex) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) SkinDef[] array = orig.Invoke(bodyIndex); int num = array.Length; for (int i = 0; i < num; i++) { string[] array2 = thingsThatMightBeClaptrap; foreach (string value in array2) { if (array[i].nameToken.ToLower().Contains(value)) { Debug.LogError((object)"CLAPTRAP IDENTIFIED. PURGING."); ArrayUtils.ArrayRemoveAtAndResize<SkinDef>(ref array, i, 1); ArrayUtils.ArrayRemoveAtAndResize<SkinDef>(ref ((Component)BodyCatalog.bodyPrefabs[bodyIndex].GetComponent<ModelLocator>().modelTransform).GetComponent<ModelSkinController>().skins, i, 1); ArrayUtils.ArrayRemoveAtAndResize<SkinDef>(ref BodyCatalog.skins[bodyIndex], i, 1); claptrapsFound++; } } } return array; } private void UnlockableCatalog_SetUnlockableDefs(orig_SetUnlockableDefs orig, UnlockableDef[] newEntries) { int num = newEntries.Length; for (int i = 0; i < num; i++) { string[] array = thingsThatMightBeClaptrap; foreach (string value in array) { if (newEntries[i].nameToken.ToLower().Contains(value)) { Debug.LogError((object)"CLAPTRAP IDENTIFIED. PURGING."); ArrayUtils.ArrayRemoveAtAndResize<UnlockableDef>(ref newEntries, i, 1); claptrapsFound++; } } } orig.Invoke(newEntries); } private void SurfaceDefCatalog_SetSurfaceDefs(orig_SetSurfaceDefs orig, SurfaceDef[] newEntries) { int num = newEntries.Length; for (int i = 0; i < num; i++) { string[] array = thingsThatMightBeClaptrap; foreach (string value in array) { if (((Object)newEntries[i]).name.ToLower().Contains(value)) { Debug.LogError((object)"CLAPTRAP IDENTIFIED. PURGING."); ArrayUtils.ArrayRemoveAtAndResize<SurfaceDef>(ref newEntries, i, 1); claptrapsFound++; } } } orig.Invoke(newEntries); } private IEnumerator SceneCatalog_SetSceneDefs(orig_SetSceneDefs orig, SceneDef[] newEntries) { int c = newEntries.Length; for (int i = 0; i < c; i++) { string[] array = thingsThatMightBeClaptrap; foreach (string fucker in array) { if (newEntries[i].nameToken.ToLower().Contains(fucker)) { Debug.LogError((object)"CLAPTRAP IDENTIFIED. PURGING."); ArrayUtils.ArrayRemoveAtAndResize<SceneDef>(ref newEntries, i, 1); claptrapsFound++; } } } yield return orig.Invoke(newEntries); } private void ProjectileCatalog_SetProjectilePrefabs(orig_SetProjectilePrefabs orig, GameObject[] newEntries) { int num = newEntries.Length; for (int i = 0; i < num; i++) { string[] array = thingsThatMightBeClaptrap; foreach (string value in array) { if (((Object)newEntries[i]).name.ToLower().Contains(value)) { Debug.LogError((object)"CLAPTRAP IDENTIFIED. PURGING."); ArrayUtils.ArrayRemoveAtAndResize<GameObject>(ref newEntries, i, 1); claptrapsFound++; } } } orig.Invoke(newEntries); } private void PickupCatalog_SetEntries(orig_SetEntries orig, PickupDef[] newEntries) { int num = newEntries.Length; for (int i = 0; i < num; i++) { string[] array = thingsThatMightBeClaptrap; foreach (string value in array) { if (newEntries[i].nameToken.ToLower().Contains(value)) { Debug.LogError((object)"CLAPTRAP IDENTIFIED. PURGING."); ArrayUtils.ArrayRemoveAtAndResize<PickupDef>(ref newEntries, i, 1); claptrapsFound++; } } } orig.Invoke(newEntries); } private void MusicTrackCatalog_SetEntries(orig_SetEntries orig, MusicTrackDef[] newEntries) { int num = newEntries.Length; for (int i = 0; i < num; i++) { string[] array = thingsThatMightBeClaptrap; foreach (string value in array) { if (newEntries[i].cachedName.ToLower().Contains(value)) { Debug.LogError((object)"CLAPTRAP IDENTIFIED. PURGING."); ArrayUtils.ArrayRemoveAtAndResize<MusicTrackDef>(ref newEntries, i, 1); claptrapsFound++; } } } orig.Invoke(newEntries); } private void ItemCatalog_SetItemDefs(orig_SetItemDefs orig, ItemDef[] newEntries) { int num = newEntries.Length; for (int i = 0; i < num; i++) { string[] array = thingsThatMightBeClaptrap; foreach (string value in array) { if (newEntries[i].nameToken.ToLower().Contains(value)) { Debug.LogError((object)"CLAPTRAP IDENTIFIED. PURGING."); ArrayUtils.ArrayRemoveAtAndResize<ItemDef>(ref newEntries, i, 1); claptrapsFound++; } } } orig.Invoke(newEntries); } private void GameModeCatalog_SetGameModes(orig_SetGameModes orig, Run[] newEntries) { int num = newEntries.Length; for (int i = 0; i < num; i++) { string[] array = thingsThatMightBeClaptrap; foreach (string value in array) { if (newEntries[i].nameToken.ToLower().Contains(value)) { Debug.LogError((object)"CLAPTRAP IDENTIFIED. PURGING."); ArrayUtils.ArrayRemoveAtAndResize<Run>(ref newEntries, i, 1); claptrapsFound++; } } } orig.Invoke(newEntries); } private void GameEndingCatalog_SetGameEndingDefs(orig_SetGameEndingDefs orig, GameEndingDef[] newEntries) { int num = newEntries.Length; for (int i = 0; i < num; i++) { string[] array = thingsThatMightBeClaptrap; foreach (string value in array) { if (newEntries[i].cachedName.ToLower().Contains(value)) { Debug.LogError((object)"CLAPTRAP IDENTIFIED. PURGING."); ArrayUtils.ArrayRemoveAtAndResize<GameEndingDef>(ref newEntries, i, 1); claptrapsFound++; } } } orig.Invoke(newEntries); } private void EquipmentCatalog_SetEquipmentDefs(orig_SetEquipmentDefs orig, EquipmentDef[] newEntries) { int num = newEntries.Length; for (int i = 0; i < num; i++) { string[] array = thingsThatMightBeClaptrap; foreach (string value in array) { if (((Object)newEntries[i]).name.ToLower().Contains(value)) { Debug.LogError((object)"CLAPTRAP IDENTIFIED. PURGING."); ArrayUtils.ArrayRemoveAtAndResize<EquipmentDef>(ref newEntries, i, 1); claptrapsFound++; } } } orig.Invoke(newEntries); } private IEnumerator EntityStateCatalog_SetElements(orig_SetElements orig, Type[] newEntries1, EntityStateConfiguration[] newEntries2) { int c1 = newEntries1.Length; for (int j = 0; j < c1; j++) { string[] array = thingsThatMightBeClaptrap; foreach (string fucker in array) { if (newEntries1[j].Name.ToLower().Contains(fucker)) { Debug.LogError((object)"CLAPTRAP IDENTIFIED. PURGING."); ArrayUtils.ArrayRemoveAtAndResize<Type>(ref newEntries1, j, 1); claptrapsFound++; } } } int c2 = newEntries2.Length; for (int i = 0; i < c2; i++) { string[] array2 = thingsThatMightBeClaptrap; foreach (string fucker2 in array2) { if (((Object)newEntries2[i]).name.ToLower().Contains(fucker2)) { Debug.LogError((object)"CLAPTRAP IDENTIFIED. PURGING."); ArrayUtils.ArrayRemoveAtAndResize<EntityStateConfiguration>(ref newEntries2, i, 1); claptrapsFound++; } } } yield return orig.Invoke(newEntries1, newEntries2); } private void EliteCatalog_SetEliteDefs(orig_SetEliteDefs orig, EliteDef[] newEntries) { int num = newEntries.Length; for (int i = 0; i < num; i++) { string[] array = thingsThatMightBeClaptrap; foreach (string value in array) { if (((Object)newEntries[i]).name.ToLower().Contains(value)) { Debug.LogError((object)"CLAPTRAP IDENTIFIED. PURGING."); ArrayUtils.ArrayRemoveAtAndResize<EliteDef>(ref newEntries, i, 1); claptrapsFound++; } } } orig.Invoke(newEntries); } private void EffectCatalog_SetEntries(orig_SetEntries orig, EffectDef[] newEntries) { int num = newEntries.Length; for (int i = 0; i < num; i++) { string[] array = thingsThatMightBeClaptrap; foreach (string value in array) { if (newEntries[i].prefabName.ToLower().Contains(value)) { Debug.LogError((object)"CLAPTRAP IDENTIFIED. PURGING."); ArrayUtils.ArrayRemoveAtAndResize<EffectDef>(ref newEntries, i, 1); claptrapsFound++; } } } orig.Invoke(newEntries); } private void BuffCatalog_SetBuffDefs(orig_SetBuffDefs orig, BuffDef[] newEntries) { int num = newEntries.Length; for (int i = 0; i < num; i++) { string[] array = thingsThatMightBeClaptrap; foreach (string value in array) { if (((Object)newEntries[i]).name.ToLower().Contains(value)) { Debug.LogError((object)"CLAPTRAP IDENTIFIED. PURGING."); ArrayUtils.ArrayRemoveAtAndResize<BuffDef>(ref newEntries, i, 1); claptrapsFound++; } } } orig.Invoke(newEntries); } private void ArtifactCatalog_SetArtifactDefs(orig_SetArtifactDefs orig, ArtifactDef[] newEntries) { int num = newEntries.Length; for (int i = 0; i < num; i++) { string[] array = thingsThatMightBeClaptrap; foreach (string value in array) { if (newEntries[i].nameToken.ToLower().Contains(value)) { Debug.LogError((object)"CLAPTRAP IDENTIFIED. PURGING."); ArrayUtils.ArrayRemoveAtAndResize<ArtifactDef>(ref newEntries, i, 1); claptrapsFound++; } } } orig.Invoke(newEntries); } private void MasterCatalog_SetEntries(orig_SetEntries orig, GameObject[] newEntries) { int num = newEntries.Length; for (int i = 0; i < num; i++) { string[] array = thingsThatMightBeClaptrap; foreach (string value in array) { if (((Object)newEntries[i]).name.ToLower().Contains(value)) { Debug.LogError((object)"CLAPTRAP IDENTIFIED. PURGING."); ArrayUtils.ArrayRemoveAtAndResize<GameObject>(ref newEntries, i, 1); claptrapsFound++; } } } orig.Invoke(newEntries); } private void BodyCatalog_SetBodyPrefabs(orig_SetBodyPrefabs orig, GameObject[] newEntries) { int num = newEntries.Length; for (int i = 0; i < num; i++) { string[] array = thingsThatMightBeClaptrap; foreach (string value in array) { if (((Object)newEntries[i]).name.ToLower().Contains(value)) { Debug.LogError((object)"CLAPTRAP IDENTIFIED. PURGING."); ArrayUtils.ArrayRemoveAtAndResize<GameObject>(ref newEntries, i, 1); claptrapsFound++; } } } orig.Invoke(newEntries); } private void SurvivorCatalog_SetSurvivorDefs(orig_SetSurvivorDefs orig, SurvivorDef[] newEntries) { int num = newEntries.Length; for (int i = 0; i < num; i++) { string[] array = thingsThatMightBeClaptrap; foreach (string value in array) { if (newEntries[i].cachedName.ToLower().Contains(value) || newEntries[i].displayNameToken.ToLower().Contains(value)) { Debug.LogError((object)"CLAPTRAP IDENTIFIED. PURGING."); ArrayUtils.ArrayRemoveAtAndResize<SurvivorDef>(ref newEntries, i, 1); claptrapsFound++; } } } orig.Invoke(newEntries); } }