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 REPOCAOS v69.0.6
RepoCaosMod.dll
Decompiled a year agousing System; using System.CodeDom.Compiler; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using ExitGames.Client.Photon; using HarmonyLib; using Photon.Pun; using Photon.Realtime; using RepoCaos; using RepoCaosMod.Resources; using TMPro; using Unity.AI.Navigation; using UnityEngine; using UnityEngine.AI; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("RepoCaosMod")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("ReviOS 11 24.12")] [assembly: AssemblyProduct("RepoCaosMod")] [assembly: AssemblyCopyright("Copyright © ReviOS 11 24.12 2025")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("b62091cf-1bc7-4d0e-be7b-011b6b98bf30")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.0.0.0")] namespace RepoCaosMod.Scripts { internal class ItemVolumePatch { [HarmonyPatch(typeof(ItemVolume), "Start")] public class StatsManagerPatchItems { [HarmonyPrefix] public static bool Prefix(ItemVolume __instance) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Invalid comparison between Unknown and I4 //IL_002e: 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) if ((int)__instance.itemVolume == 3 || (int)__instance.itemVolume == 8 || !Plugin.ChangeShop.Value) { return true; } __instance.itemVolume = (itemVolume)6; __instance.itemSecretShopType = (itemSecretShopType)0; return true; } } } internal class StatsManagerPatch { [HarmonyPatch(typeof(StatsManager), "Update")] public class StatsManagerPatchItems { [HarmonyPrefix] public static bool Prefix(StatsManager __instance) { if (itemCount != __instance.itemDictionary.Count && Plugin.ChangeShop.Value) { itemCount = __instance.itemDictionary.Count; foreach (Item value in __instance.itemDictionary.Values) { value.maxAmount = 100; value.maxAmountInShop = 100; } ShopManager.instance.itemUpgradesAmount = 100; } return true; } } [HarmonyPatch(typeof(StatsManager), "GetItemsUpgradesPurchased")] public class StatsManagerGetItemsUpgradesPurchasedPatch { [HarmonyPrefix] public static bool Prefix(StatsManager __instance, string itemName, ref int __result) { if (Plugin.ChangeShop.Value) { __result = __instance.itemsUpgradesPurchased[itemName] * 2; } return true; } } [HarmonyPatch(typeof(StatsManager), "SaveGame")] public class StatsManagerSaveGame { [HarmonyPrefix] public static bool Prefix(StatsManager __instance, string fileName, ref string ___teamName) { ___teamName = "R.E.P.O.C.A.O.S."; return true; } } private static int itemCount; } } namespace RepoCaosMod.Scripts.Menu { internal class MainMenuPatcher { [HarmonyPatch(typeof(MenuButton), "Awake")] public class MenuButtonsDisabler { [HarmonyPrefix] public static bool Prefix(MenuButton __instance) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) if (((Object)((Component)__instance).gameObject).name == "Menu Button - singleplayer") { ((Behaviour)__instance).enabled = false; ((Graphic)((Component)((Component)__instance).transform.GetChild(0)).GetComponent<TMP_Text>()).color = new Color(0.5f, 0.5f, 0.5f, 0.2f); return true; } return true; } } } } namespace RepoCaosMod.Scripts.Levels { internal class ArcticLevelPatch { [HarmonyPatch(typeof(Module), "Start")] public class ModulePatcher { [HarmonyPrefix] public static bool Prefix(Module __instance) { //IL_0072: Unknown result type (might be due to invalid IL or missing references) if (((Object)((Component)__instance).gameObject).name.Contains("Module - Arctic - DE - 1 - Bathroom Stalls")) { GameObject gameObject = ((Component)((Component)__instance).transform.GetChild(2).GetChild(0).GetChild(8)).gameObject; GameObject val = Object.Instantiate<GameObject>(gameObject, gameObject.transform); val.transform.SetParent(gameObject.transform.parent); val.transform.localPosition = new Vector3(0.782f, 0.099f, -6.319f); } return true; } } } internal class ArenaLevelPatcher { [HarmonyPatch(typeof(Module), "Start")] public class ModulePatcher { [HarmonyPrefix] public static bool Prefix(Module __instance) { //IL_0049: 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_008f: 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_00d0: 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_0116: 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_0157: Unknown result type (might be due to invalid IL or missing references) //IL_017a: 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_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) if (((Object)((Component)__instance).gameObject).name.Contains("Start Room - Arena")) { ((Component)__instance).transform.GetChild(2).GetChild(10).localScale = new Vector3(2f * ((Component)__instance).transform.GetChild(2).GetChild(10).localScale.x, 1f * ((Component)__instance).transform.GetChild(2).GetChild(10).localScale.y, 2f * ((Component)__instance).transform.GetChild(2).GetChild(10).localScale.z); ((Component)__instance).transform.GetChild(2).GetChild(11).localScale = new Vector3(2f * ((Component)__instance).transform.GetChild(2).GetChild(11).localScale.x, 1f * ((Component)__instance).transform.GetChild(2).GetChild(11).localScale.y, 2f * ((Component)__instance).transform.GetChild(2).GetChild(11).localScale.z); ((Component)__instance).transform.GetChild(2).GetChild(12).localScale = new Vector3(2f * ((Component)__instance).transform.GetChild(2).GetChild(12).localScale.x, 1f * ((Component)__instance).transform.GetChild(2).GetChild(12).localScale.y, 2f * ((Component)__instance).transform.GetChild(2).GetChild(12).localScale.z); ((Component)__instance).transform.GetChild(2).GetChild(12).GetChild(0) .localScale = new Vector3(0.5f * ((Component)__instance).transform.GetChild(2).GetChild(12).GetChild(0) .localScale.x, 1f * ((Component)__instance).transform.GetChild(2).GetChild(12).GetChild(0) .localScale.y, 0.5f * ((Component)__instance).transform.GetChild(2).GetChild(12).GetChild(0) .localScale.z); } return true; } } [HarmonyPatch(typeof(Arena), "Update")] public class ArenaTimeSlower { [HarmonyPrefix] public static bool Prefix(Arena __instance, ref float ___stateTimer) { return true; } } } internal class Forcelevel { } internal class RunManagerPatch { [HarmonyPatch(typeof(RunManager), "Update")] public class RunManagerSetMusic { [HarmonyPrefix] public static bool Prefix(RunManager __instance) { if (__instance.levelCurrent.ResourcePath == "Main Menu" && !ChangedMainMenuSong && Plugin.ReplaceMenuMusic.Value) { ChangedMainMenuSong = true; AssetBundle val = AssetBundle.LoadFromMemory(Resource1.audios); __instance.levelCurrent.ConstantMusicPreset.clip = val.LoadAsset<AudioClip>("Flint And Steel Chicken Jockey"); __instance.levelCurrent.ConstantMusicPreset.volume = 0.2f; } return true; } } private static string lastL = ""; private static bool ChangedMainMenuSong = false; } internal class ManorLevelPatcher { [HarmonyPatch(typeof(Module), "Start")] public class SaunaModulePatcher { [HarmonyPrefix] public static bool Prefix(Module __instance) { //IL_006c: 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_00fe: 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_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_02ff: 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) //IL_03a7: Unknown result type (might be due to invalid IL or missing references) //IL_03d3: Unknown result type (might be due to invalid IL or missing references) //IL_03ff: Unknown result type (might be due to invalid IL or missing references) //IL_042b: Unknown result type (might be due to invalid IL or missing references) //IL_049e: Unknown result type (might be due to invalid IL or missing references) //IL_04bf: Unknown result type (might be due to invalid IL or missing references) if (((Object)((Component)__instance).gameObject).name.Contains("Module - Manor - DE - 1 - Sauna")) { GameObject gameObject = ((Component)((Component)__instance).transform.GetChild(1).GetChild(3).GetChild(7)).gameObject; GameObject val = Object.Instantiate<GameObject>(gameObject); val.transform.SetParent(gameObject.transform.parent); val.transform.localPosition = new Vector3(4.421f, -0.138f, -3.763f); val.transform.localRotation = Quaternion.Euler(-16f, -90f, 0f); } if (((Object)((Component)__instance).gameObject).name.Contains("Module - Manor - DE - 1 - Wardrobe")) { GameObject gameObject2 = ((Component)((Component)__instance).transform.GetChild(9)).gameObject; GameObject val2 = Object.Instantiate<GameObject>(gameObject2); val2.transform.SetParent(gameObject2.transform.parent); val2.transform.localPosition = new Vector3(0f, 0f, -4.831f); val2.transform.localRotation = Quaternion.Euler(0f, 0f, 0f); } if (((Object)((Component)__instance).gameObject).name.Contains("Module - Manor - DE - 1 - Small Kitchen")) { GameObject gameObject3 = ((Component)((Component)__instance).transform.GetChild(1).GetChild(1).GetChild(0) .GetChild(1) .GetChild(0)).gameObject; GameObject val3 = Object.Instantiate<GameObject>(gameObject3); val3.transform.SetParent(gameObject3.transform.parent); val3.transform.localPosition = new Vector3(-3f, 0f, 1.79f); val3.transform.localRotation = Quaternion.Euler(0f, -40f, 0f); } if (((Object)((Component)__instance).gameObject).name.Contains("Module - Manor - DE - 1 - Boilers")) { GameObject gameObject4 = ((Component)((Component)__instance).transform.GetChild(5).GetChild(1).GetChild(2) .GetChild(1) .GetChild(0)).gameObject; GameObject val4 = Object.Instantiate<GameObject>(gameObject4); val4.transform.SetParent(gameObject4.transform.parent); val4.transform.localPosition = new Vector3(4.8f, 0f, 1.1f); val4.transform.localRotation = Quaternion.Euler(0f, -40f, 0f); } if (((Object)((Component)__instance).gameObject).name.Contains("Module - Manor - DE - 1 - Small Bedroom")) { GameObject gameObject5 = ((Component)((Component)__instance).transform.GetChild(4).GetChild(0).GetChild(0)).gameObject; GameObject val5 = Object.Instantiate<GameObject>(gameObject5); val5.transform.SetParent(gameObject5.transform.parent); val5.transform.localPosition = new Vector3(0.5f, 2.07f, -6.85f); val5.transform.localRotation = Quaternion.Euler(-254f, -179f, 180f); ((Behaviour)((Component)val5.transform.GetChild(1)).GetComponent<NavMeshModifier>()).enabled = false; ((Component)val5.transform.GetChild(1)).gameObject.layer = LayerMask.NameToLayer("PlayerOnlyCollision"); } if (((Object)((Component)__instance).gameObject).name.Contains("Module - Manor - P - 1 - Outside Alley")) { ((Component)((Component)__instance).transform.GetChild(16)).transform.localPosition = new Vector3(6.2f, -0.9f, -0.89f); ((Component)((Component)__instance).transform.GetChild(17)).transform.localPosition = new Vector3(6.2f, 4.1f, -0.89f); ((Component)((Component)__instance).transform.GetChild(18)).transform.localPosition = new Vector3(6.2f, 9.1f, -0.89f); ((Component)((Component)__instance).transform.GetChild(19)).transform.localPosition = new Vector3(6.2f, 14.1f, -0.89f); } if (((Object)((Component)__instance).gameObject).name.Contains("Module - Manor - P - 1 - Nook")) { GameObject gameObject6 = ((Component)((Component)__instance).transform.GetChild(4)).gameObject; GameObject val6 = Object.Instantiate<GameObject>(gameObject6); val6.transform.SetParent(gameObject6.transform.parent); val6.transform.localPosition = new Vector3(-0.4f, 0f, -6.1f); val6.transform.localRotation = Quaternion.Euler(0f, 293f, 0f); } return true; } } [HarmonyPatch(typeof(ModuleConnectObject), "Start")] public class DoorModulePatcher { [HarmonyPrefix] public static bool Prefix(ModuleConnectObject __instance) { //IL_0147: 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_0196: Expected O, but got Unknown if (((Object)((Component)__instance).gameObject).name.Contains("Manor Door") || (((Object)((Component)__instance).gameObject).name.Contains("Door") && ((Object)((Component)((Component)__instance).transform.GetChild(0)).gameObject).name == "Hinge")) { PhysGrabHinge component = ((Component)((Component)__instance).transform.GetChild(0)).GetComponent<PhysGrabHinge>(); component.drag *= 10f; PhysAttribute val = Object.Instantiate<PhysAttribute>(((Component)((Component)__instance).transform.GetChild(0)).GetComponent<NotValuableObject>().physAttributePreset); val.mass = 16f; ((Component)((Component)__instance).transform.GetChild(0)).GetComponent<NotValuableObject>().physAttributePreset = val; Material material = ((Renderer)((Component)((Component)__instance).transform.GetChild(0).GetChild(0)).GetComponent<MeshRenderer>()).material; material.SetFloat("_Metallic", 1f); ((Renderer)((Component)((Component)__instance).transform.GetChild(0).GetChild(0)).GetComponent<MeshRenderer>()).material.SetFloat("_Metallic", 0.5f); ((Renderer)((Component)((Component)__instance).transform.GetChild(0).GetChild(0)).GetComponent<MeshRenderer>()).material.color = new Color(0.8f, 0.8f, 0.8f, 1f); AudioSource component2 = ((Component)((Component)__instance).transform.GetChild(0).GetChild(2)).GetComponent<AudioSource>(); component2.pitch /= 2f; ((Component)((Component)__instance).transform.GetChild(0)).GetComponent<NotValuableObject>().durabilityPreset = new Durability(); ((Component)((Component)__instance).transform.GetChild(0)).GetComponent<NotValuableObject>().durabilityPreset.fragility = 100f; ((Component)((Component)__instance).transform.GetChild(0)).GetComponent<NotValuableObject>().durabilityPreset.durability = 0f; ((Component)((Component)__instance).transform.GetChild(0)).GetComponent<NotValuableObject>().hasHealth = true; ((Component)((Component)__instance).transform.GetChild(0)).GetComponent<NotValuableObject>().healthMax = 50; ((Component)((Component)__instance).transform.GetChild(0)).GetComponent<NotValuableObject>().healthLossOnBreakLight = 2500; ((Component)((Component)__instance).transform.GetChild(0)).GetComponent<NotValuableObject>().healthLossOnBreakMedium = 4500; ((Component)((Component)__instance).transform.GetChild(0)).GetComponent<NotValuableObject>().healthLossOnBreakHeavy = 5000; } return true; } } [HarmonyPatch(typeof(Module), "Start")] public class SplitMineModulePatcher { [HarmonyPrefix] public static bool Prefix(Module __instance) { if (((Object)((Component)__instance).gameObject).name.Contains("Module - Manor - P - 3 - Split Mine")) { ((Component)((Component)__instance).transform.GetChild(1)).gameObject.SetActive(false); } return true; } } } } namespace RepoCaosMod.Scripts.Items { internal class ItemUpgradeChangeMaterial { [HarmonyPatch(typeof(ItemUpgrade), "Start")] public class ItemUpgradeStart { [HarmonyPrefix] public static bool Prefix(ItemUpgrade __instance) { if (!Plugin.ChangeSmallShit.Value) { return true; } if (((Object)((Component)__instance).gameObject).name.Contains("Item Upgrade Player Health")) { if ((Object)(object)HealthMaterial == (Object)null) { AssetBundle val = AssetBundle.LoadFromMemory(Resource1.pedroche); HealthMaterial = val.LoadAsset<Material>("upgrade_pedroche"); } ((Renderer)((Component)((Component)__instance).transform.GetChild(5)).GetComponent<MeshRenderer>()).material = HealthMaterial; } return true; } } public static Material HealthMaterial; } internal class PhysGrabCartPatch { [HarmonyPatch(typeof(PhysGrabCart), "SetHaulText")] public class PhysGrabCartMoneySetHaultText { [HarmonyPrefix] public static bool Prefix(PhysGrabCart __instance, int ___haulCurrent) { if (___haulCurrent == 0 && Plugin.ChangeSmallShit.Value) { ((TMP_Text)__instance.displayText).text = "<color=red>POOR"; return false; } return true; } } } } namespace RepoCaosMod.Scripts.Events { internal class EnemyEventsPatcher { [HarmonyPatch(typeof(EnemyOnScreen), "GetOnScreen")] public static class EnemyOnScreen_GetOnScreen_Patch { [HarmonyPrefix] public static bool Prefix(EnemyOnScreen __instance, PlayerAvatar _playerAvatar, ref bool __result) { if (Plugin.EventActive("alwaysWatching")) { __result = true; if (PlayerController.instance.Crouching) { __result = false; } return false; } return true; } } [HarmonyPatch(typeof(Enemy), "Freeze")] public class EnemyPatch { [HarmonyPrefix] public static bool Prefix(FlashlightController __instance, ref float time) { if (Plugin.EventActive("notFreeze")) { time = 0f; return true; } return true; } } [HarmonyPatch(typeof(EnemyStateStunned), "Set")] public class EnemyStateStunnedPatch { [HarmonyPrefix] public static bool Prefix(EnemyStateStunned __instance, ref float time) { if (Plugin.EventActive("notFreeze")) { time = 0f; return true; } return true; } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public class EnemyHealthHurt { [HarmonyPrefix] public static bool Prefix(EnemyHealth __instance, int _damage, Vector3 _hurtDirection) { if (Plugin.EventActive("enemyNoHurt")) { return false; } return true; } } } internal class ItemEventsPatcher { [HarmonyPatch(typeof(ItemGun), "Misfire")] public class ItemGunMisFire { [HarmonyPrefix] public static bool Prefix(ItemGun __instance, ItemBattery ___itemBattery) { if (Plugin.EventActive("gunFire")) { ___itemBattery.batteryLife = 1f; __instance.Shoot(); return false; } return true; } } [HarmonyPatch(typeof(ItemDrone), "TargetFindPlayer")] public class ItemDroneDontFindPlayer { [HarmonyPrefix] public static bool Prefix(ItemDrone __instance) { if (Plugin.EventActive("droneDoesntFind")) { return false; } return true; } } } internal class PhysObjectEventsPatcher { [HarmonyPatch(typeof(PhysGrabObjectImpactDetector), "EnemyInvestigate")] public class PhysGrabOjectInvestigate { [HarmonyPrefix] public static bool Prefix(PhysGrabObjectImpactDetector __instance, float radius) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) if (Plugin.EventActive("enemiesHearImpact")) { EnemyDirector.instance.SetInvestigate(((Component)__instance).transform.position, 10000f); return false; } return true; } } } internal class PlayerEventsPatcher { [HarmonyPatch(typeof(PlayerAvatar), "Start")] public class PlayerAvatarPicker { [HarmonyPrefix] public static bool Prefix(PlayerAvatar __instance) { return true; } } [HarmonyPatch(typeof(FlashlightController), "Update")] public class FlashlightOnPatch { [HarmonyPrefix] public static bool Prefix(FlashlightController __instance) { if (Plugin.EventActive("flashLightOn")) { FieldInfo fieldInfo = AccessTools.Field(typeof(FlashlightController), "hideFlashlight"); fieldInfo.SetValue(__instance, false); return false; } return true; } } [HarmonyPatch(typeof(PlayerHealth), "Heal")] public class HealPatch { [HarmonyPrefix] public static bool Prefix(PlayerHealth __instance, int healAmount, bool effect = true) { if (!Plugin.EventActive("noHeal")) { return true; } if (Plugin.EventActive("healHurts")) { __instance.Hurt(healAmount, false, -1); return true; } return false; } } [HarmonyPatch(typeof(Aim), "SetState")] public class AimPatches { [HarmonyPrefix] public static bool Prefix_Aim_SetState(State _state, Aim __instance) { //IL_002d: 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_00ce: 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) if (Plugin.EventActive("randomCursor")) { State val = (State)Random.Range(0, Enum.GetValues(typeof(State)).Length); foreach (AimState aimState in __instance.aimStates) { if (aimState.State == _state) { FieldInfo fieldInfo = AccessTools.Field(typeof(Aim), "currentState"); FieldInfo fieldInfo2 = AccessTools.Field(typeof(Aim), "currentSprite"); FieldInfo fieldInfo3 = AccessTools.Field(typeof(Aim), "currentColor"); FieldInfo fieldInfo4 = AccessTools.Field(typeof(Aim), "animLerp"); FieldInfo fieldInfo5 = AccessTools.Field(typeof(Aim), "stateTimer"); fieldInfo.SetValue(__instance, aimState.State); fieldInfo2.SetValue(__instance, aimState.Sprite); fieldInfo3.SetValue(__instance, aimState.Color); fieldInfo4.SetValue(__instance, 0f); fieldInfo5.SetValue(__instance, 0.2f); break; } } return false; } if (!Plugin.EventActive("disableCursor")) { return true; } return false; } } [HarmonyPatch(typeof(HurtCollider), "PlayerHurt")] public class HurtColliderKill { [HarmonyPrefix] public static bool Prefix(HurtCollider __instance, ref PlayerAvatar _player) { if (Plugin.EventActive("hurtColliderKill")) { _player = PlayerAvatar.instance; return true; } return true; } } } } namespace RepoCaosMod.Scripts.Enemies { internal class EnemyHealthPatch { [HarmonyPatch(typeof(EnemyHealth), "Awake")] public class AwakePatch { [HarmonyPrefix] public static bool Prefix(EnemyHealth __instance) { __instance.health *= RunManager.instance.levelsCompleted / 4 + 1; __instance.impactHeavyDamage *= 2; __instance.spawnValuableMax *= 1000; return true; } } } internal class EnemyParentPatch { [HarmonyPatch(typeof(EnemyParent), "Awake")] public class AwakePatch { [HarmonyPrefix] public static bool Prefix(EnemyParent __instance) { __instance.SpawnedTimeMax *= 0.1f / (float)(RunManager.instance.levelsCompleted + 1); __instance.SpawnedTimeMin *= 0.1f / (float)(RunManager.instance.levelsCompleted + 1); __instance.actionMultiplier *= 3f; return true; } } } internal class EnemyStateInvestigatePatch { [HarmonyPatch(typeof(EnemyStateInvestigate), "Awake")] public class AwakePatch { [HarmonyPrefix] public static bool Prefix(EnemyStateInvestigate __instance) { __instance.rangeMultiplier *= (float)(2 * (RunManager.instance.levelsCompleted + 1)); NavMeshAgent component = ((Component)__instance).GetComponent<NavMeshAgent>(); component.speed *= (float)(RunManager.instance.levelsCompleted / 2 + 1); NavMeshAgent component2 = ((Component)__instance).GetComponent<NavMeshAgent>(); component2.angularSpeed *= (float)(RunManager.instance.levelsCompleted * 2 + 1); return true; } } } } namespace RepoCaosMod.Resources { [GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [DebuggerNonUserCode] [CompilerGenerated] internal class Resource1 { private static ResourceManager resourceMan; private static CultureInfo resourceCulture; [EditorBrowsable(EditorBrowsableState.Advanced)] internal static ResourceManager ResourceManager { get { if (resourceMan == null) { ResourceManager resourceManager = new ResourceManager("RepoCaosMod.Resources.Resource1", typeof(Resource1).Assembly); resourceMan = resourceManager; } return resourceMan; } } [EditorBrowsable(EditorBrowsableState.Advanced)] internal static CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } internal static byte[] audios { get { object @object = ResourceManager.GetObject("audios", resourceCulture); return (byte[])@object; } } internal static byte[] pedroche { get { object @object = ResourceManager.GetObject("pedroche", resourceCulture); return (byte[])@object; } } internal Resource1() { } } } namespace RepoCaos { [BepInPlugin("duviz.repocaos.repo", "REPOCAOS", "69.0.6")] public class Plugin : BaseUnityPlugin { public static bool debug = false; public static bool hideUI = true; public static List<string> caosNames = new List<string>(); public static Dictionary<string, Object> spawnerKeys; public static Dictionary<string, string> spawnerPaths; public static string selectedString; public static float timeToSelectNewEvent; public static float timeToAffect; public static int LastGamemode = 0; public static float LastTime = 7f; private const byte AFFECT_EVENT_CODE = 1; public static ConfigEntry<bool> ReplaceMenuMusic; public static ConfigEntry<bool> ChangeSmallShit; public static ConfigEntry<bool> ChangeShop; private void Awake() { //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Expected O, but got Unknown ((Object)((Component)this).gameObject).hideFlags = (HideFlags)61; ((Object)ThreadingHelper.Instance).hideFlags = (HideFlags)61; ((ConfigEntry<bool>)AccessTools.Field(typeof(Chainloader), "ConfigHideBepInExGOs").GetValue(null)).Value = true; caosNames.Add("enemiesHearImpact"); caosNames.Add("enemiesInvestigate"); caosNames.Add("decreaseSpawnTime"); caosNames.Add("spawnEnemy"); caosNames.Add("none"); spawnerKeys = new Dictionary<string, Object>(); spawnerPaths = new Dictionary<string, string>(); AddSpawn("diamond", "valuables/01 tiny/Valuable Diamond"); AddSpawn("trophy", "valuables/03 medium/Valuable Trophy"); AddSpawn("clown", "valuables/03 medium/Valuable Clown"); AddSpawn("dinosaur", "valuables/05 wide/Valuable Dinosaur"); AddSpawn("ice", "valuables/05 wide/Valuable Animal Crate"); AddSpawn("vase", "valuables/04 big/Valuable Vase Big"); AddSpawn("television", "valuables/04 big/Valuable Television"); AddSpawn("handgun", "items/Item Gun Handgun"); AddSpawn("shotgun", "items/Item Gun Shotgun"); AddSpawn("stungun", "items/Item Gun Tranq"); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Hello, the Instagram community!"); Harmony val = new Harmony("duviz.repocaos.repo"); val.PatchAll(); ChangeShop = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Change shop items", true, "If true, replaces all the items in the shop with upgrades and C.A.R.T.s"); ReplaceMenuMusic = ((BaseUnityPlugin)this).Config.Bind<bool>("Extra", "ReplaceMenuMusic", false, "If true, replaces the menu music the FLINT N STEEL!!!"); ChangeSmallShit = ((BaseUnityPlugin)this).Config.Bind<bool>("Extra", "ChangeSmallShit", false, "If true, some things are replaced with meme ones"); } public static void AddSpawn(string objectName, string ResourcePath) { spawnerKeys.Add(objectName, Resources.Load(ResourcePath)); spawnerPaths.Add(objectName, ResourcePath); } public static string GetRandomSpawnerKey() { if (spawnerKeys.Count == 0) { return null; } List<string> list = new List<string>(spawnerKeys.Keys); int index = Random.Range(0, list.Count); return list[index]; } private void SpawnItem(string itemId = "trophy", float YOffset = 0f, bool decreaseValue = false, float decreaseAmount = 6f, PlayerAvatar avatar = null) { //IL_008d: 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_00b4: 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_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_0069: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)avatar == (Object)null) { avatar = PlayerAvatar.instance; } if (GameManager.instance.gameMode == 0 || !SemiFunc.IsMultiplayer()) { Object.Instantiate(spawnerKeys[itemId], ((Component)avatar).transform.position + new Vector3(0f, 0f + YOffset, 0f), ((Component)avatar).transform.rotation); return; } GameObject val = PhotonNetwork.InstantiateRoomObject(spawnerPaths[itemId], ((Component)avatar).transform.position + new Vector3(0f, 0f + YOffset, 0f), ((Component)avatar).transform.rotation, (byte)0, (object[])null); ValuableObject component = val.GetComponent<ValuableObject>(); if ((Object)(object)component != (Object)null && decreaseValue) { Value val2 = Object.Instantiate<Value>(component.valuePreset); val2.valueMin /= decreaseAmount; val2.valueMax /= decreaseAmount; component.valuePreset = val2; } } private void Start() { PhotonNetwork.NetworkingClient.EventReceived += OnEvent; PhotonNetwork.NetworkingClient.StateChanged += OnStateChanged; } private void OnStateChanged(ClientState from, ClientState to) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Invalid comparison between Unknown and I4 //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Invalid comparison between Unknown and I4 if ((int)to == 9) { PhotonNetwork.AddCallbackTarget((object)this); } else if ((int)from == 9) { PhotonNetwork.RemoveCallbackTarget((object)this); } } private void Update() { //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Invalid comparison between Unknown and I4 //IL_0245: 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_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Expected O, but got Unknown //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) if (Input.GetKeyDown((KeyCode)107) && debug) { SpawnItem("trophy", 0f, decreaseValue: true, 0.005f); } if (Input.GetKey((KeyCode)106) && debug) { SpawnItem("trophy", 0f, decreaseValue: true, 0.005f); } if (Input.GetKey((KeyCode)122) && debug) { timeToAffect -= Time.deltaTime * 10f; timeToSelectNewEvent -= Time.deltaTime * 10f; } if (Input.GetKeyDown((KeyCode)120) && debug) { GetNewEvent(); } if ((Object)(object)PlayerVoiceChat.instance != (Object)null) { } if (!((Object)(object)HealthUI.instance == (Object)null) && GameManager.instance.gameMode != 0 && (int)GameDirector.instance.currentState == 2 && !SemiFunc.IsMainMenu() && !SemiFunc.RunIsLobbyMenu() && !SemiFunc.RunIsShop()) { if (GameManager.instance.gameMode != LastGamemode) { LastGamemode = GameManager.instance.gameMode; LastTime = Time.time + 7f; timeToSelectNewEvent = Random.Range(155, 200); timeToAffect = Random.Range(150, 200); } FieldInfo fieldInfo = AccessTools.Field(typeof(HealthUI), "playerHealthValue"); float num = Time.deltaTime / 50f * (float)(int)fieldInfo.GetValue(HealthUI.instance); timeToSelectNewEvent -= num; if (timeToSelectNewEvent < 0f) { timeToSelectNewEvent = Random.Range(75, 200); GetNewEvent(); } timeToAffect -= num; if (timeToAffect < 0f) { timeToAffect = Random.Range(60, 200); object[] array = new object[2] { selectedString, ((Component)PlayerAvatar.instance).GetComponent<PhotonView>().ViewID }; RaiseEventOptions val = new RaiseEventOptions { Receivers = (ReceiverGroup)2 }; SendOptions val2 = default(SendOptions); ((SendOptions)(ref val2)).Reliability = true; SendOptions val3 = val2; PhotonNetwork.RaiseEvent((byte)1, (object)array, val, val3); } } } public void OnEvent(EventData photonEvent) { if (photonEvent.Code != 1) { return; } object[] array = (object[])photonEvent.CustomData; string currentEvent = (string)array[0]; int num = (int)array[1]; PhotonView obj = PhotonView.Find(num); GameObject val = ((obj != null) ? ((Component)obj).gameObject : null); if (!((Object)(object)val == (Object)null)) { PlayerAvatar component = val.GetComponent<PlayerAvatar>(); if (!((Object)(object)component == (Object)null)) { AffectEvent(currentEvent, component); } } } [PunRPC] public void AffectEventRPC(string currentEvent, int playerViewID) { GameObject gameObject = ((Component)PhotonView.Find(playerViewID)).gameObject; PlayerAvatar component = gameObject.GetComponent<PlayerAvatar>(); AffectEvent(currentEvent, component); } public void AffectEvent(string currentEvent, PlayerAvatar instance) { //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_050f: Unknown result type (might be due to invalid IL or missing references) string text = selectedString; selectedString = currentEvent; FieldInfo fieldInfo = AccessTools.Field(typeof(HealthUI), "playerHealthValue"); float num = Time.deltaTime / 50f * (float)(int)fieldInfo.GetValue(HealthUI.instance); if (EventActive("cameraGlitch") && (Object)(object)CameraGlitch.Instance != (Object)null) { GetNewEvent(); } if (EventActive("spawnTrophy")) { SpawnItem("trophy", 0f, decreaseValue: true, 100f); } if (EventActive("spawnItem")) { List<string> list = new List<string>(); list.Add("stungun"); list.Add("clown"); SpawnItem(list[Random.Range(0, list.Count)], 1f, decreaseValue: true, 6f, instance); } if (EventActive("shotgun")) { for (int i = 0; i < Random.Range(1, 2); i++) { SpawnItem("shotgun", 2f, decreaseValue: false, 6f, instance); } EnemyDirector.instance.SetInvestigate(((Component)instance).transform.position, 10000f); } if (EventActive("literallyDie")) { ((Component)instance).GetComponent<PlayerHealth>().Hurt(1000000, false, -1); ((Component)instance).GetComponent<PlayerHealth>().Death(); } if (EventActive("getHurt")) { ((Component)instance).GetComponent<PlayerHealth>().Hurt(Random.Range(0, Mathf.Clamp((int)fieldInfo.GetValue(HealthUI.instance), 0, 50)), true, -1); } if (EventActive("moreMoney")) { StatsManager.instance.runStats["currency"] -= Random.Range(0, 6); } if (EventActive("stunPlayer")) { instance.tumble.TumbleRequest(true, false); instance.tumble.TumbleForce(new Vector3((float)Random.Range(1, 10), (float)Random.Range(1, 10), (float)Random.Range(1, 10))); } if (EventActive("superStun")) { instance.tumble.TumbleRequest(true, false); instance.tumble.TumbleForce(new Vector3((float)Random.Range(100000, 1000000), (float)Random.Range(100000, 1000000), (float)Random.Range(100000, 1000000))); } if (EventActive("enemiesInvestigate")) { EnemyDirector.instance.SetInvestigate(((Component)instance).transform.position, 10000f); } if (EventActive("spawnEnemy")) { EnemyDirector instance2 = EnemyDirector.instance; List<EnemySetup> list2 = new List<EnemySetup>(); foreach (EnemySetup item2 in instance2.enemiesDifficulty1) { list2.Add(item2); } foreach (EnemySetup item3 in instance2.enemiesDifficulty2) { list2.Add(item3); } foreach (EnemySetup item4 in instance2.enemiesDifficulty3) { list2.Add(item4); } EnemySetup item = list2[Random.Range(0, list2.Count)]; RunManager.instance.enemiesSpawned.Add(item); selectedString = "decreaseSpawnTime"; } if (EventActive("decreaseSpawnTime")) { foreach (EnemyParent item5 in EnemyDirector.instance.enemiesSpawned) { if (item5.DespawnedTimer > 0f) { item5.DespawnedTimerSet(0f, false); } } } if (EventActive("explodeGrenades")) { ItemGrenade[] array = Object.FindObjectsOfType<ItemGrenade>(); foreach (ItemGrenade val in array) { ((MonoBehaviour)val).Invoke("TickStart", 0f); } } if (EventActive("shootGuns")) { ItemGun[] array2 = Object.FindObjectsOfType<ItemGun>(); foreach (ItemGun val2 in array2) { val2.Shoot(); } } if (EventActive("healMonsters")) { EnemyHealth[] array3 = Object.FindObjectsOfType<EnemyHealth>(); foreach (EnemyHealth val3 in array3) { val3.Hurt(-25, Vector3.zero); } } if (EventActive("frogJump")) { FrogTrap[] array4 = Object.FindObjectsOfType<FrogTrap>(); foreach (FrogTrap val4 in array4) { for (int n = 0; n < 10; n++) { ((MonoBehaviour)val4).Invoke("FrogJump", (float)n); } } ToiletFun[] array5 = Object.FindObjectsOfType<ToiletFun>(); foreach (ToiletFun val5 in array5) { for (int num3 = 0; num3 < 10; num3++) { ((MonoBehaviour)val5).Invoke("Explosion", (float)num3); } } } selectedString = text; } private void OnGUI() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown //IL_0065: 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_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Expected O, but got Unknown //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) string text = "REPOCAOS is working :3c"; if (LastGamemode == 0) { text = ""; } GUIStyle val = new GUIStyle(); val.fontSize = 30; float num = 0.5f; num = Mathf.Clamp(num - Time.time + LastTime, 0f, 1f); val.normal.textColor = new Color(1f, 1f, 1f, num); float num2 = 10f; float num3 = 400f; float num4 = 30f; Rect val2 = default(Rect); ((Rect)(ref val2))..ctor(num2, (float)Screen.height - num4 - num2, num3, num4); GUI.Label(val2, text, val); if (debug && !hideUI) { text = $"Current event: {selectedString}\nTime for new event: {timeToSelectNewEvent}\nTime to affect event: {timeToAffect}"; val = new GUIStyle(); val.fontSize = 16; val.normal.textColor = Color.white; num2 = 10f; num3 = 400f; num4 = 100f; ((Rect)(ref val2))..ctor(num2, (float)Screen.height - num4 - num2 - 500f, num3, num4); GUI.Label(val2, text, val); } } public static void GetNewEvent() { selectedString = caosNames[Random.Range(0, caosNames.Count)]; } public static bool EventActive(string name) { if (selectedString == name) { return true; } return false; } } }