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 REPOrium v0.0.1
REPOrium.dll
Decompiled a year agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using HarmonyLib; using Photon.Pun; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("REPOrium")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("REPOrium")] [assembly: AssemblyCopyright("Copyright © 2025")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("24fbf9a1-d629-45c9-849e-3a0c2671c0d9")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace REPOrium; [BepInPlugin("chboo1.repo.reporium", "REPOrium", "0.0.1")] public class REPOrium : BaseUnityPlugin { public static ManualLogSource logger; private static Harmony harmony = null; public static bool godmode = false; public static bool fly = false; public static bool freecam = false; public static bool infiniteRange = false; public static bool infiniteStrength = false; public static bool infiniteStamina = false; public static bool trueInfiniteStrength = false; public static bool nodeath = false; public static bool weakEnemy = false; public static bool batteryDrain = true; public static bool verySqueakyHammer = false; public static bool noTarget = false; public static bool invisible = false; public static bool quiet = false; public static bool infiniteMoney = false; public static bool doTraps = true; public static bool itemDamage = true; public static bool testHallway = false; public static int previousMoney = -1; public static float previousGrabStrength = -1f; public static float previousGrabRange = -1f; public static int annoyingCount = 0; public static Level savedLevel = null; public static Dictionary<string, Object> spawnerKeys; public static Dictionary<string, EnemySetup> enemySpawnerKeys; public static bool spawning = false; public void Awake() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown logger = Logger.CreateLogSource("chboo1.repo.reporium"); logger.LogInfo((object)"Loading REPORIUM..."); harmony = new Harmony("chboo1.repo.reporium"); spawnerKeys = new Dictionary<string, Object>(); spawnerKeys.Add("diamond", Resources.Load("valuables/01 tiny/Valuable Diamond")); spawnerKeys.Add("bracelet", Resources.Load("valuables/01 tiny/Valuable Emerald Bracelet")); spawnerKeys.Add("goblet", Resources.Load("valuables/01 tiny/Valuable Goblet")); spawnerKeys.Add("ocarina", Resources.Load("valuables/01 tiny/Valuable Ocarina")); spawnerKeys.Add("watch", Resources.Load("valuables/01 tiny/Valuable Pocket Watch")); spawnerKeys.Add("pocketwatch", Resources.Load("valuables/01 tiny/Valuable Pocket Watch")); spawnerKeys.Add("mug", Resources.Load("valuables/01 tiny/Valuable Uranium Mug")); spawnerKeys.Add("uraniummug", Resources.Load("valuables/01 tiny/Valuable Uranium Mug")); logger.LogInfo((object)"Tiny items loaded!"); spawnerKeys.Add("bonsai", Resources.Load("valuables/02 small/Valuable Arctic Bonsai")); spawnerKeys.Add("hdd", Resources.Load("valuables/02 small/Valuable Arctic HDD")); spawnerKeys.Add("drive", Resources.Load("valuables/02 small/Valuable Arctic HDD")); spawnerKeys.Add("harddrive", Resources.Load("valuables/02 small/Valuable Arctic HDD")); spawnerKeys.Add("book", Resources.Load("valuables/02 small/Valuable Chomp Book")); spawnerKeys.Add("chompbook", Resources.Load("valuables/02 small/Valuable Chomp Book")); spawnerKeys.Add("crown", Resources.Load("valuables/02 small/Valuable Crown")); spawnerKeys.Add("doll", Resources.Load("valuables/02 small/Valuable Doll")); spawnerKeys.Add("frog", Resources.Load("valuables/02 small/Valuable Frog")); spawnerKeys.Add("gembox", Resources.Load("valuables/02 small/Valuable Gem Box")); spawnerKeys.Add("globe", Resources.Load("valuables/02 small/Valuable Globe")); spawnerKeys.Add("potion", Resources.Load("valuables/02 small/Valuable Love Potion")); spawnerKeys.Add("lovepotion", Resources.Load("valuables/02 small/Valuable Love Potion")); spawnerKeys.Add("money", Resources.Load("valuables/02 small/Valuable Money")); spawnerKeys.Add("musicbox", Resources.Load("valuables/02 small/Valuable Music Box")); spawnerKeys.Add("monkey", Resources.Load("valuables/02 small/Valuable Toy Monkey")); spawnerKeys.Add("plate", Resources.Load("valuables/02 small/Valuable Uranium Plate")); spawnerKeys.Add("uraniumplate", Resources.Load("valuables/02 small/Valuable Uranium Plate")); spawnerKeys.Add("smallvase", Resources.Load("valuables/02 small/Valuable Vase Small")); logger.LogInfo((object)"Small items loaded!"); spawnerKeys.Add("3dprinter", Resources.Load("valuables/03 medium/Valuable Arctic 3D Printer")); spawnerKeys.Add("printer", Resources.Load("valuables/03 medium/Valuable Arctic 3D Printer")); spawnerKeys.Add("laptop", Resources.Load("valuables/03 medium/Valuable Arctic Laptop")); spawnerKeys.Add("propane", Resources.Load("valuables/03 medium/Valuable Arctic Propane Tank")); spawnerKeys.Add("propanetank", Resources.Load("valuables/03 medium/Valuable Arctic Propane Tank")); spawnerKeys.Add("samplepack", Resources.Load("valuables/03 medium/Valuable Arctic Sample Six Pack")); spawnerKeys.Add("sample", Resources.Load("valuables/03 medium/Valuable Arctic Sample")); spawnerKeys.Add("bottle", Resources.Load("valuables/03 medium/Valuable Bottle")); spawnerKeys.Add("clown", Resources.Load("valuables/03 medium/Valuable Clown")); spawnerKeys.Add("computer", Resources.Load("valuables/03 medium/Valuable Computer")); spawnerKeys.Add("fan", Resources.Load("valuables/03 medium/Valuable Fan")); spawnerKeys.Add("gramophone", Resources.Load("valuables/03 medium/Valuable Gramophone")); spawnerKeys.Add("table", Resources.Load("valuables/03 medium/Valuable Marble Table")); spawnerKeys.Add("marbletable", Resources.Load("valuables/03 medium/Valuable Marble Table")); spawnerKeys.Add("radio", Resources.Load("valuables/03 medium/Valuable Radio")); spawnerKeys.Add("ship", Resources.Load("valuables/03 medium/Valuable Ship in a bottle")); spawnerKeys.Add("shipbottle", Resources.Load("valuables/03 medium/Valuable Ship in a bottle")); spawnerKeys.Add("bottleship", Resources.Load("valuables/03 medium/Valuable Ship in a bottle")); spawnerKeys.Add("shipinabottle", Resources.Load("valuables/03 medium/Valuable Valuable Ship in a bottle")); spawnerKeys.Add("trophy", Resources.Load("valuables/03 medium/Valuable Trophy")); spawnerKeys.Add("vase", Resources.Load("valuables/03 medium/Valuable Vase")); spawnerKeys.Add("mediumvase", Resources.Load("valuables/03 medium/Valuable Vase")); spawnerKeys.Add("goblin", Resources.Load("valuables/03 medium/Valuable Wizard Goblin Head")); spawnerKeys.Add("goblinhead", Resources.Load("valuables/03 medium/Valuable Wizard Goblin Head")); spawnerKeys.Add("wizardcrystal", Resources.Load("valuables/03 medium/Valuable Wizard Power Crystal")); spawnerKeys.Add("timeglass", Resources.Load("valuables/03 medium/Valuable Wizard Time Glass")); spawnerKeys.Add("hourglass", Resources.Load("valuables/03 medium/Valuable Wizard Time Glass")); logger.LogInfo((object)"Medium items loaded!"); spawnerKeys.Add("barrel", Resources.Load("valuables/04 big/Valuable Arctic Barrel")); spawnerKeys.Add("samplebig", Resources.Load("valuables/04 big/Valuable Arctic Big Sample")); spawnerKeys.Add("bigsample", Resources.Load("valuables/04 big/Valuable Arctic Big Sample")); spawnerKeys.Add("leg", Resources.Load("valuables/04 big/Valuable Arctic Creature Leg")); spawnerKeys.Add("flamethrower", Resources.Load("valuables/04 big/Valuable Arctic Flamethrower")); spawnerKeys.Add("guitar", Resources.Load("valuables/04 big/Valuable Arctic Guitar")); spawnerKeys.Add("cooler", Resources.Load("valuables/04 big/Valuable Arctic Sample Cooler")); spawnerKeys.Add("samplecooler", Resources.Load("valuables/04 big/Valuable Arctic Sample Cooler")); spawnerKeys.Add("diamonddisplay", Resources.Load("valuables/04 big/Valuable Diamond Display")); spawnerKeys.Add("saw", Resources.Load("valuables/04 big/Valuable Ice Saw")); spawnerKeys.Add("icesaw", Resources.Load("valuables/04 big/Valuable Ice Saw")); spawnerKeys.Add("bigdoll", Resources.Load("valuables/04 big/Valuable Scream Doll")); spawnerKeys.Add("screamdoll", Resources.Load("valuables/04 big/Valuable Scream Doll")); spawnerKeys.Add("tv", Resources.Load("valuables/04 big/Valuable Television")); spawnerKeys.Add("television", Resources.Load("valuables/04 big/Valuable Television")); spawnerKeys.Add("bigvase", Resources.Load("valuables/04 big/Valuable Vase Big")); spawnerKeys.Add("vasebig", Resources.Load("valuables/04 big/Valuable Vase big")); spawnerKeys.Add("cube", Resources.Load("valuables/04 big/Valuable Wizard Cube of Knowledge")); spawnerKeys.Add("wizardcube", Resources.Load("valuables/04 big/Valuable Wizard Cube of Knowledge")); spawnerKeys.Add("cubeofknowledge", Resources.Load("valuables/04 big/Valuable Wizard Cube of Knowledge")); spawnerKeys.Add("bigpotion", Resources.Load("valuables/04 big/Valuable Wizard Master Potion")); spawnerKeys.Add("masterpotion", Resources.Load("valuables/04 big/Valuable Wizard Master Potion")); logger.LogInfo((object)"Big items loaded!"); spawnerKeys.Add("crate", Resources.Load("valuables/05 wide/Valuable Animal Crate")); spawnerKeys.Add("animalcrate", Resources.Load("valuables/05 wide/Valuable Animal Crate")); spawnerKeys.Add("skeleton", Resources.Load("valuables/05 wide/Valuable Arctic Ice Block")); spawnerKeys.Add("ice", Resources.Load("valuables/05 wide/Valuable Arctic Ice Block")); spawnerKeys.Add("iceblock", Resources.Load("valuables/05 wide/Valuable Arctic Ice Block")); spawnerKeys.Add("dino", Resources.Load("valuables/05 wide/Valuable Dinosaur")); spawnerKeys.Add("dinosaur", Resources.Load("valuables/05 wide/Valuable Dinosaur")); spawnerKeys.Add("piano", Resources.Load("valuables/05 wide/Valuable Piano")); spawnerKeys.Add("griffin", Resources.Load("valuables/05 wide/Valuable Wizard Griffin Statue")); spawnerKeys.Add("griffinstatue", Resources.Load("valuables/05 wide/Valuable Wizard Griffin Statue")); logger.LogInfo((object)"Wide items loaded!"); spawnerKeys.Add("sciencestation", Resources.Load("valuables/06 tall/Valuable Arctic Science Station")); spawnerKeys.Add("harp", Resources.Load("valuables/06 tall/Valuable Harp")); spawnerKeys.Add("painting", Resources.Load("valuables/06 tall/Valuable Painting")); spawnerKeys.Add("staff", Resources.Load("valuables/06 tall/Valuable Wizard Dumgolfs Staff")); spawnerKeys.Add("greatsword", Resources.Load("valuables/06 tall/Valuable Wizard Sword")); spawnerKeys.Add("wizardsword", Resources.Load("valuables/06 tall/Valuable Wizard Sword")); logger.LogInfo((object)"Tall items loaded!"); spawnerKeys.Add("server", Resources.Load("valuables/07 very tall/Valuable Arctic Server Rack")); spawnerKeys.Add("servers", Resources.Load("valuables/07 very tall/Valuable Arctic Server Rack")); spawnerKeys.Add("serverrack", Resources.Load("valuables/07 very tall/Valuable Arctic Server Rack")); spawnerKeys.Add("statue", Resources.Load("valuables/07 very tall/Valuable Golden Statue")); spawnerKeys.Add("goldstatue", Resources.Load("valuables/07 very tall/Valuable Golden Statue")); spawnerKeys.Add("goldenstatue", Resources.Load("valuables/07 very tall/Valuable Golden Statue")); spawnerKeys.Add("clock", Resources.Load("valuables/07 very tall/Valuable Grandfather Clock")); spawnerKeys.Add("grandfatherclock", Resources.Load("valuables/07 very tall/Valuable Grandfather Clock")); spawnerKeys.Add("broom", Resources.Load("valuables/07 very tall/Valuable Wizard Broom")); logger.LogInfo((object)"Very tall items loaded!"); spawnerKeys.Add("bigcart", Resources.Load("items/Cart Big")); spawnerKeys.Add("cart", Resources.Load("items/Item Cart Medium")); spawnerKeys.Add("smallcart", Resources.Load("items/Item Cart Small")); spawnerKeys.Add("pocketcart", Resources.Load("items/Item Cart Small")); spawnerKeys.Add("rechargedrone", Resources.Load("items/Item Drone Battery")); spawnerKeys.Add("featherdrone", Resources.Load("items/Item Drone Feather")); spawnerKeys.Add("indestructibledrone", Resources.Load("items/Item Drone Indestructible")); spawnerKeys.Add("rolldrone", Resources.Load("items/Item Drone Torque")); spawnerKeys.Add("zerogravitydrone", Resources.Load("items/Item Drone Zero Gravity")); spawnerKeys.Add("extracttracker", Resources.Load("items/Item Extraction Tracker")); spawnerKeys.Add("extractiontracker", Resources.Load("items/Item Extraction Tracker")); spawnerKeys.Add("ducttapegrenade", Resources.Load("items/Item Grenade Duct Taped")); spawnerKeys.Add("ducttapedgrenade", Resources.Load("items/Item Grenade Duct Taped")); spawnerKeys.Add("explosivegrenade", Resources.Load("items/Item Grenade Explosive")); spawnerKeys.Add("humangrenade", Resources.Load("items/Item Grenade Human")); spawnerKeys.Add("shockwavegrenade", Resources.Load("items/Item Grenade Shockwave")); spawnerKeys.Add("stungrenade", Resources.Load("items/Item Grenade Stun")); spawnerKeys.Add("handgun", Resources.Load("items/Item Gun Handgun")); spawnerKeys.Add("pistol", Resources.Load("items/Item Gun Handgun")); spawnerKeys.Add("gun", Resources.Load("items/Item Gun Handgun")); spawnerKeys.Add("shotgun", Resources.Load("items/Item Gun Shotgun")); spawnerKeys.Add("tranq", Resources.Load("items/Item Gun Tranq")); spawnerKeys.Add("tranqgun", Resources.Load("items/Item Gun Tranq")); spawnerKeys.Add("largehealth", Resources.Load("items/Item Health Pack Large")); spawnerKeys.Add("largehealthpack", Resources.Load("items/Item Health Pack Large")); spawnerKeys.Add("mediumhealth", Resources.Load("items/Item Health Pack Medium")); spawnerKeys.Add("mediumhealthpack", Resources.Load("items/Item Health Pack Medium")); spawnerKeys.Add("smallhealth", Resources.Load("items/Item Health Pack Small")); spawnerKeys.Add("smallhealthpack", Resources.Load("items/Item Health Pack Small")); spawnerKeys.Add("bat", Resources.Load("items/Item Melee Baseball Bat")); spawnerKeys.Add("baseballbat", Resources.Load("items/Item Melee Baseball Bat")); spawnerKeys.Add("pan", Resources.Load("items/Item Melee Frying Pan")); spawnerKeys.Add("fryingpan", Resources.Load("items/Item Melee Frying Pan")); spawnerKeys.Add("squeakyhammer", Resources.Load("items/Item Melee Inflatable Hammer")); spawnerKeys.Add("inflatablehammer", Resources.Load("items/Item Melee Inflatable Hammer")); spawnerKeys.Add("sledgehammer", Resources.Load("items/Item Melee Sledge Hammer")); spawnerKeys.Add("sword", Resources.Load("items/Item Melee Sword")); spawnerKeys.Add("explosivemine", Resources.Load("items/Item Mine Explosive")); spawnerKeys.Add("shockwavemine", Resources.Load("items/Item Mine Shockwave")); spawnerKeys.Add("stunmine", Resources.Load("items/Item Mine Stun")); spawnerKeys.Add("zerogravityorb", Resources.Load("items/Item Orb Zero Gravity")); spawnerKeys.Add("powercrystal", Resources.Load("items/Item Power Crystal")); spawnerKeys.Add("crystal", Resources.Load("items/Item Power Crystal")); spawnerKeys.Add("rubberduck", Resources.Load("items/Item Rubber Duck")); spawnerKeys.Add("valuabletracker", Resources.Load("items/Item Valuable Tracker")); spawnerKeys.Add("scraptracker", Resources.Load("items/Item Valuable Tracker")); logger.LogInfo((object)"Shop items loaded!"); spawnerKeys.Add("strengthupgrade", Resources.Load("items/Item Upgrade Player Grab Strength")); spawnerKeys.Add("rangeupgrade", Resources.Load("items/Item Upgrade Player Grab Range")); spawnerKeys.Add("jumpupgrade", Resources.Load("items/Item Upgrade Player Extra Jump")); spawnerKeys.Add("extrajumpupgrade", Resources.Load("items/Item Upgrade Player Extra Jump")); spawnerKeys.Add("throwupgrade", Resources.Load("items/Item Upgrade Player Grab Throw")); spawnerKeys.Add("staminaupgrade", Resources.Load("items/Item Upgrade Player Energy")); spawnerKeys.Add("healthupgrade", Resources.Load("items/Item Upgrade Player Health")); spawnerKeys.Add("speedupgrade", Resources.Load("items/Item Upgrade Player Sprint Speed")); spawnerKeys.Add("sprintspeedupgrade", Resources.Load("items/Item Upgrade Player Sprint Speed")); spawnerKeys.Add("tumbleupgrade", Resources.Load("items/Item Upgrade Player Tumble Launch")); spawnerKeys.Add("launchupgrade", Resources.Load("items/Item Upgrade Player Tumble Launch")); spawnerKeys.Add("tumblelaunchupgrade", Resources.Load("items/Item Upgrade Player Tumble Launch")); spawnerKeys.Add("playercountupgrade", Resources.Load("items/Item Upgrade Map Player Count")); spawnerKeys.Add("mapplayercountupgrade", Resources.Load("items/Item Upgrade Map Player Count")); logger.LogInfo((object)"Upgrades loaded!"); AddPrefix(typeof(ChatManager), "MessageSend"); AddPrefix(typeof(PlayerHealth), "Update"); AddPrefix(typeof(ExtractionPoint), "Update"); AddPrefix(typeof(EnemyVision), "VisionTrigger"); AddPrefix(typeof(EnemyDirector), "SetInvestigate"); AddPrefix(typeof(PhysGrabber), "Update"); AddPrefix(typeof(RunManager), "Update"); AddPrefix(typeof(PlayerHealth), "Hurt"); AddPrefix(typeof(LevelGenerator), "Generate"); AddPrefix(typeof(ChatManager), "Update"); AddPrefix(typeof(PhysGrabObjectImpactDetector), "Break"); AddPostfix(typeof(ItemBattery), "Update"); AddPrefix(typeof(EnemyHealth), "Hurt"); AddPrefix(typeof(ItemMeleeInflatableHammer), "OnHit"); AddPrefix(typeof(EnemyParent), "Despawn"); AddPrefix(typeof(Enemy), "Update"); AddPrefix(typeof(EnemyAnimal), "Update"); AddPrefix(typeof(EnemyBangDirector), "Update"); AddPrefix(typeof(EnemyBeamer), "Update"); AddPrefix(typeof(EnemyBowtie), "Update"); AddPrefix(typeof(EnemyDuck), "Update"); AddPrefix(typeof(EnemyGnomeDirector), "Update"); AddPrefix(typeof(EnemyHidden), "Update"); AddPrefix(typeof(EnemySlowMouth), "Update"); AddPrefix(typeof(EnemySlowWalker), "Update"); AddPrefix(typeof(EnemyThinMan), "Update"); AddPrefix(typeof(EnemyValuableThrower), "Update"); AddPrefix(typeof(EnemyCeilingEye), "Update"); AddPrefix(typeof(EnemyRobe), "Update"); AddPrefix(typeof(EnemyFloater), "Update"); AddPrefix(typeof(EnemyUpscream), "Update"); AddPrefix(typeof(EnemyTumbler), "Update"); AddPrefix(typeof(EnemyRunner), "Update"); } public static void AddPostfix(Type type, string funcname) { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Expected O, but got Unknown MethodInfo methodInfo = AccessTools.Method(type, funcname, (Type[])null, (Type[])null); MethodInfo methodInfo2 = AccessTools.Method(typeof(REPOrium), type.Name + "_" + funcname + "_Postfix", (Type[])null, (Type[])null); if (methodInfo == null || methodInfo2 == null) { logger.LogInfo((object)"Cannot find original function or postfix!"); } else { harmony.Patch((MethodBase)methodInfo, (HarmonyMethod)null, new HarmonyMethod(methodInfo2), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } } public static void AddPrefix(Type type, string funcname) { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Expected O, but got Unknown MethodInfo methodInfo = AccessTools.Method(type, funcname, (Type[])null, (Type[])null); MethodInfo methodInfo2 = AccessTools.Method(typeof(REPOrium), type.Name + "_" + funcname + "_Prefix", (Type[])null, (Type[])null); if (methodInfo == null || methodInfo2 == null) { logger.LogInfo((object)"Cannot find original function or prefix!"); } else { harmony.Patch((MethodBase)methodInfo, new HarmonyMethod(methodInfo2), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } } public static bool ParseChat(ref string text) { //IL_16a4: Unknown result type (might be due to invalid IL or missing references) //IL_1503: Unknown result type (might be due to invalid IL or missing references) //IL_1508: Unknown result type (might be due to invalid IL or missing references) //IL_13c2: Unknown result type (might be due to invalid IL or missing references) //IL_13c7: Unknown result type (might be due to invalid IL or missing references) //IL_16c9: Unknown result type (might be due to invalid IL or missing references) //IL_16ce: Unknown result type (might be due to invalid IL or missing references) //IL_16dd: Unknown result type (might be due to invalid IL or missing references) //IL_1533: Unknown result type (might be due to invalid IL or missing references) //IL_1538: Unknown result type (might be due to invalid IL or missing references) //IL_1421: Unknown result type (might be due to invalid IL or missing references) //IL_1592: Unknown result type (might be due to invalid IL or missing references) //IL_1484: Unknown result type (might be due to invalid IL or missing references) //IL_15f5: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.IsMasterClientOrSingleplayer()) { return true; } string[] array = text.ToLower().Split(new char[1] { ' ' }); switch (array[0]) { case "!god": if (array.Length > 1) { if (array[1] == "true" || array[1] == "enable" || array[1] == "enabled" || array[1] == "on") { godmode = true; } else if (array[1] == "false" || array[1] == "disable" || array[1] == "disabled" || array[1] == "off") { godmode = false; } } else { godmode = !godmode; } logger.LogInfo((object)("Set godmode to " + godmode)); return false; case "!fly": if (array.Length > 1) { if (array[1] == "true" || array[1] == "enable" || array[1] == "enabled" || array[1] == "on") { fly = true; } else if (array[1] == "false" || array[1] == "disable" || array[1] == "disabled" || array[1] == "off") { fly = false; } } else { fly = !fly; } return false; case "!freecam": if (array.Length > 1) { if (array[1] == "true" || array[1] == "enable" || array[1] == "enabled" || array[1] == "on") { freecam = true; } else if (array[1] == "false" || array[1] == "disable" || array[1] == "disabled" || array[1] == "off") { freecam = false; } } else { freecam = !freecam; } return false; case "!range": if (array.Length > 1) { if (array[1] == "true" || array[1] == "enable" || array[1] == "enabled" || array[1] == "on") { infiniteRange = true; } else if (array[1] == "false" || array[1] == "disable" || array[1] == "disabled" || array[1] == "off") { infiniteRange = false; } } else { infiniteRange = !infiniteRange; } logger.LogInfo((object)("Set infiniteRange to " + infiniteRange)); return false; case "!strength": if (array.Length > 1) { if (array[1] == "true" || array[1] == "enable" || array[1] == "enabled" || array[1] == "on") { infiniteStrength = true; } else if (array[1] == "false" || array[1] == "disable" || array[1] == "disabled" || array[1] == "off") { infiniteStrength = false; } } else { infiniteStrength = !infiniteStrength; } return false; case "!toomuchstrength": if (!trueInfiniteStrength) { text = "Only if you say please."; if (array.Length > 1) { if (array[1] == "please") { text = "But do you mean it? Say please twice, then."; if (array[2] == "please") { text = "Ok, but are you worthy? Say my name."; } } if (array[1] == "chboo1") { text = "Correct, but I still don't know. What's the best item in Lethal Company?"; } if (array[1] == "hairdryer") { text = "Ok, I'll do it. Just say \"doit\""; } if (array[1] == "doit") { trueInfiniteStrength = true; } } } else { switch (annoyingCount) { case 0: text = "I'm not turning it off."; break; case 1: text = "I said I'm not turning it off."; break; case 2: text = "You made your choice already."; break; case 3: text = "You need to live with it."; break; case 4: text = "Stop it."; break; case 5: text = "I mean it."; break; case 6: text = "One more chance."; break; case 7: Application.Quit(); break; } annoyingCount++; } return true; case "!stamina": if (array.Length > 1) { if (array[1] == "true" || array[1] == "enable" || array[1] == "enabled" || array[1] == "on") { infiniteStamina = true; } else if (array[1] == "false" || array[1] == "disable" || array[1] == "disabled" || array[1] == "off") { infiniteStamina = false; } } else { infiniteStamina = !infiniteStamina; } return false; case "!nodeath": if (array.Length > 1) { if (array[1] == "true" || array[1] == "enable" || array[1] == "enabled" || array[1] == "on") { nodeath = true; } else if (array[1] == "false" || array[1] == "disable" || array[1] == "disabled" || array[1] == "off") { nodeath = false; } } else { nodeath = !nodeath; } return false; case "!weakenemies": if (array.Length > 1) { if (array[1] == "true" || array[1] == "enable" || array[1] == "enabled" || array[1] == "on") { weakEnemy = true; } else if (array[1] == "false" || array[1] == "disable" || array[1] == "disabled" || array[1] == "off") { weakEnemy = false; } } else { weakEnemy = !weakEnemy; } return false; case "!battery": if (array.Length > 1) { if (array[1] == "true" || array[1] == "enable" || array[1] == "enabled" || array[1] == "on") { batteryDrain = false; } else if (array[1] == "false" || array[1] == "disable" || array[1] == "disabled" || array[1] == "off") { batteryDrain = true; } } else { batteryDrain = !batteryDrain; } batteryDrain = !batteryDrain; return false; case "!boomhammer": if (array.Length > 1) { if (array[1] == "true" || array[1] == "enable" || array[1] == "enabled" || array[1] == "on") { verySqueakyHammer = true; } else if (array[1] == "false" || array[1] == "disable" || array[1] == "disabled" || array[1] == "off") { verySqueakyHammer = false; } } else { verySqueakyHammer = !verySqueakyHammer; } return false; case "!notarget": if (array.Length > 1) { if (array[1] == "true" || array[1] == "enable" || array[1] == "enabled" || array[1] == "on") { noTarget = true; } else if (array[1] == "false" || array[1] == "disable" || array[1] == "disabled" || array[1] == "off") { noTarget = false; } } else { noTarget = !noTarget; } return false; case "!invisible": if (array.Length > 1) { if (array[1] == "true" || array[1] == "enable" || array[1] == "enabled" || array[1] == "on") { invisible = true; } else if (array[1] == "false" || array[1] == "disable" || array[1] == "disabled" || array[1] == "off") { invisible = false; } } else { invisible = !invisible; } return false; case "!quiet": if (array.Length > 1) { if (array[1] == "true" || array[1] == "enable" || array[1] == "enabled" || array[1] == "on") { quiet = true; } else if (array[1] == "false" || array[1] == "disable" || array[1] == "disabled" || array[1] == "off") { quiet = false; } } else { quiet = !quiet; } return false; case "!infinitemoney": if (array.Length > 1) { if (array[1] == "true" || array[1] == "enable" || array[1] == "enabled" || array[1] == "on") { infiniteMoney = true; } else if (array[1] == "false" || array[1] == "disable" || array[1] == "disabled" || array[1] == "off") { infiniteMoney = false; } } else { infiniteMoney = !infiniteMoney; } return false; case "!setmap": if (array.Length > 1) { string text2 = array[1]; if (array[1] == "manor") { text2 = "Manor"; } else if (array[1] == "station" || array[1] == "arctic") { text2 = "Arctic"; } else if (array[1] == "school" || array[1] == "academy" || array[1] == "wizard") { text2 = "Wizard"; } foreach (Level level in RunManager.instance.levels) { if (level.ResourcePath == text2) { savedLevel = level; break; } } } return false; case "!setlevel": { int result11 = 0; if (array.Length > 1 && int.TryParse(array[1], out result11)) { RunManager.instance.levelsCompleted = result11 - 1; } return false; } case "!nobreak": if (array.Length > 1) { if (array[1] == "true" || array[1] == "enable" || array[1] == "enabled" || array[1] == "on") { itemDamage = false; } else if (array[1] == "false" || array[1] == "disable" || array[1] == "disabled" || array[1] == "off") { itemDamage = true; } } else { itemDamage = !itemDamage; } return false; case "!notraps": if (array.Length > 1) { if (array[1] == "true" || array[1] == "enable" || array[1] == "enabled" || array[1] == "on") { doTraps = false; } else if (array[1] == "false" || array[1] == "disable" || array[1] == "disabled" || array[1] == "off") { doTraps = true; } } else { doTraps = !doTraps; } return false; case "!spawn": { if (array.Length <= 1) { text = "Must provide a thing to spawn!"; return true; } int result10 = 1; if ((Object)(object)PlayerController.instance == (Object)null) { text = "No player controller exists! Either you're not yet in a game or something is broken!"; return true; } if (array.Length > 2 && (!int.TryParse(array[2], out result10) || result10 <= 0)) { text = "Second argument must be a non-zero positive integer; the amount to spawn! Using 1."; result10 = 1; } if (array.Length > 1) { if (array[1] == "enemy") { EnemySetup val = null; try { val = enemySpawnerKeys[array[2]]; } catch (KeyNotFoundException) { if (array[2] == "dredge") { text = "It's called 'trudge' you dingus"; return true; } val = null; } if ((Object)(object)val == (Object)null) { text = "Invalid or null enemy to spawn!"; return true; } spawning = true; AccessTools.Field(typeof(LevelGenerator), "EnemiesSpawned").SetValue(LevelGenerator.Instance, -1); if (val.spawnObjects.Count == 1) { for (int i = 0; i < result10; i++) { GameObject val2 = Object.Instantiate<GameObject>(val.spawnObjects[0], ((Component)PlayerController.instance).transform.position, Quaternion.identity); EnemyParent component = val2.GetComponent<EnemyParent>(); if (!((Object)(object)component != (Object)null)) { continue; } AccessTools.Field(typeof(EnemyParent), "SetupDone").SetValue(component, true); val2.GetComponentInChildren<Enemy>().EnemyTeleported(((Component)PlayerController.instance).transform.position); EnemyDirector.instance.FirstSpawnPointAdd(component); EnemyDirector.instance.enemiesSpawned.Add(component); foreach (PlayerAvatar player in GameDirector.instance.PlayerList) { ((Enemy)AccessTools.Field(typeof(EnemyParent), "Enemy").GetValue(component)).PlayerAdded(player.photonView.ViewID); } } } else if (val.spawnObjects.Count > 1) { Object.Instantiate<GameObject>(val.spawnObjects[0], ((Component)PlayerController.instance).transform.position, Quaternion.identity); for (int j = 0; j < result10; j++) { GameObject val3 = Object.Instantiate<GameObject>(val.spawnObjects[1], ((Component)PlayerController.instance).transform.position, Quaternion.identity); EnemyParent component2 = val3.GetComponent<EnemyParent>(); if (!((Object)(object)component2 != (Object)null)) { continue; } AccessTools.Field(typeof(EnemyParent), "SetupDone").SetValue(component2, true); val3.GetComponentInChildren<Enemy>().EnemyTeleported(((Component)PlayerController.instance).transform.position); EnemyDirector.instance.FirstSpawnPointAdd(component2); EnemyDirector.instance.enemiesSpawned.Add(component2); foreach (PlayerAvatar player2 in GameDirector.instance.PlayerList) { ((Enemy)AccessTools.Field(typeof(EnemyParent), "Enemy").GetValue(component2)).PlayerAdded(player2.photonView.ViewID); } } } } if (array[1] == "item") { Object val4 = null; try { val4 = spawnerKeys[array[2]]; } catch (KeyNotFoundException) { val4 = null; } if (val4 == (Object)null) { text = "Invalid or null object to spawn!"; return true; } for (int k = 0; k < result10; k++) { Object.Instantiate(val4, ((Component)PlayerController.instance).transform.position + new Vector3((result10 < 50) ? ((float)k * 0.2f) : 0f, 0f, 0f), ((Component)PlayerController.instance).transform.rotation); } } } return false; } case "!upgrade": if (array.Length < 3 && (array.Length < 2 || array[1] == "playercount")) { return true; } switch (array[1]) { case "strength": { if (int.TryParse(array[2], out var result9)) { StatsManager.instance.playerUpgradeStrength[SemiFunc.PlayerGetSteamID(PlayerAvatar.instance)] = result9; PlayerAvatar.instance.physGrabber.grabStrength = 1f + 0.2f * (float)result9; } return false; } case "range": { if (int.TryParse(array[2], out var result2)) { StatsManager.instance.playerUpgradeRange[SemiFunc.PlayerGetSteamID(PlayerAvatar.instance)] = result2; PlayerAvatar.instance.physGrabber.grabRange = 2.5f + 1f * (float)result2; } return false; } case "health": { if (int.TryParse(array[2], out var result8)) { AccessTools.Field(typeof(PlayerHealth), "health").SetValue(PlayerAvatar.instance.playerHealth, (result8 - StatsManager.instance.playerUpgradeHealth[SemiFunc.PlayerGetSteamID(PlayerAvatar.instance)]) * 20 + (int)AccessTools.Field(typeof(PlayerHealth), "health").GetValue(PlayerAvatar.instance.playerHealth)); AccessTools.Field(typeof(PlayerHealth), "maxHealth").SetValue(PlayerAvatar.instance.playerHealth, 100 + 20 * result8); StatsManager.instance.playerUpgradeHealth[SemiFunc.PlayerGetSteamID(PlayerAvatar.instance)] = result8; } return false; } case "stamina": { if (int.TryParse(array[2], out var result6)) { StatsManager.instance.playerUpgradeStamina[SemiFunc.PlayerGetSteamID(PlayerAvatar.instance)] = result6; PlayerController.instance.EnergyStart = 40 + 10 * result6; } return false; } case "speed": { if (int.TryParse(array[2], out var result5)) { StatsManager.instance.playerUpgradeSpeed[SemiFunc.PlayerGetSteamID(PlayerAvatar.instance)] = result5; PlayerController.instance.SprintSpeed = 5f + (float)result5; } return false; } case "playercount": { if (int.TryParse(array[2], out var result3)) { StatsManager.instance.playerUpgradeMapPlayerCount[SemiFunc.PlayerGetSteamID(PlayerAvatar.instance)] = result3; } else if (array.Length > 2) { if (array[2] == "true" || array[2] == "enable" || array[2] == "enabled" || array[2] == "on") { StatsManager.instance.playerUpgradeMapPlayerCount[SemiFunc.PlayerGetSteamID(PlayerAvatar.instance)] = 1; } else if (array[2] == "false" || array[2] == "disable" || array[2] == "disabled" || array[2] == "off") { StatsManager.instance.playerUpgradeMapPlayerCount[SemiFunc.PlayerGetSteamID(PlayerAvatar.instance)] = 0; } } else { StatsManager.instance.playerUpgradeMapPlayerCount[SemiFunc.PlayerGetSteamID(PlayerAvatar.instance)] = ((StatsManager.instance.playerUpgradeMapPlayerCount[SemiFunc.PlayerGetSteamID(PlayerAvatar.instance)] == 0) ? 1 : 0); } AccessTools.Field(typeof(PlayerAvatar), "upgradeMapPlayerCount").SetValue(PlayerAvatar.instance, StatsManager.instance.playerUpgradeMapPlayerCount[SemiFunc.PlayerGetSteamID(PlayerAvatar.instance)]); return false; } case "jump": { if (int.TryParse(array[2], out var result7)) { StatsManager.instance.playerUpgradeExtraJump[SemiFunc.PlayerGetSteamID(PlayerAvatar.instance)] = result7; AccessTools.Field(typeof(PlayerController), "JumpExtra").SetValue(PlayerController.instance, result7); } return false; } case "launch": { if (int.TryParse(array[2], out var result4)) { StatsManager.instance.playerUpgradeLaunch[SemiFunc.PlayerGetSteamID(PlayerAvatar.instance)] = result4; AccessTools.Field(typeof(PlayerTumble), "tumbleLaunch").SetValue(PlayerAvatar.instance.tumble, result4); } return false; } case "throw": { if (int.TryParse(array[2], out var result)) { StatsManager.instance.playerUpgradeThrow[SemiFunc.PlayerGetSteamID(PlayerAvatar.instance)] = result; PlayerAvatar.instance.physGrabber.throwStrength = 0.3f * (float)result; } return false; } default: text = "Invalid upgrade!"; return true; } default: return true; } } public static bool PhysGrabObjectImpactDetector_Break_Prefix(bool ___isEnemy) { if (itemDamage || ___isEnemy) { return true; } return false; } public static void PlayerHealth_Update_Prefix(ref bool ___godMode, PlayerAvatar ___playerAvatar) { if ((bool)AccessTools.Field(typeof(PlayerAvatar), "isLocal").GetValue(___playerAvatar)) { ___godMode = godmode; } } public static bool PlayerHealth_Hurt_Prefix(ref int damage, PlayerAvatar ___playerAvatar, int ___health) { if ((bool)AccessTools.Field(typeof(PlayerAvatar), "isLocal").GetValue(___playerAvatar) && godmode) { return false; } if ((bool)AccessTools.Field(typeof(PlayerAvatar), "isLocal").GetValue(___playerAvatar) && nodeath) { damage = Math.Min(damage, ___health - 1); if (damage == 0) { return false; } } return true; } public static void ExtractionPoint_Update_Prefix(ExtractionPoint __instance, bool ___isShop) { if (!___isShop) { return; } if (infiniteMoney) { if (previousMoney < 0) { previousMoney = StatsManager.instance.runStats["currency"]; } StatsManager.instance.runStats["currency"] = 9999; } else { if (previousMoney >= 0) { StatsManager.instance.runStats["currency"] = previousMoney; } previousMoney = -1; } } public static bool ChatManager_MessageSend_Prefix(ChatManager __instance, string ___chatMessage) { if (___chatMessage != "") { return ParseChat(ref ___chatMessage); } return true; } public static bool EnemyParent_Despawn_Prefix(float ___SpawnedTimeMin, float ___SpawnedTimeMax, ref float ___SpawnedTimer) { if (spawning) { spawning = false; ___SpawnedTimer = Random.Range(___SpawnedTimeMin, ___SpawnedTimeMax); return false; } return true; } public static bool ChatManager_Update_Prefix(ChatManager __instance, PlayerAvatar ___playerAvatar, List<PossessMessageBatch> ___possessBatchQueue, PossessMessageBatch ___currentBatch) { //IL_0160: 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_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_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Expected I4, but got Unknown AccessTools.Method(typeof(ChatManager), "PossessionActive", (Type[])null, (Type[])null).Invoke(__instance, null); if (Object.op_Implicit((Object)(object)___playerAvatar) && (bool)AccessTools.Field(typeof(PlayerAvatar), "isDisabled").GetValue(___playerAvatar) && (___possessBatchQueue.Count > 0 || ___currentBatch != null)) { AccessTools.Method(typeof(ChatManager), "InterruptCurrentPossessBatch", (Type[])null, (Type[])null).Invoke(__instance, null); } if (!LevelGenerator.Instance.Generated) { AccessTools.Method(typeof(ChatManager), "NewLevelResets", (Type[])null, (Type[])null).Invoke(__instance, null); return false; } AccessTools.Method(typeof(ChatManager), "ImportantFetches", (Type[])null, (Type[])null).Invoke(__instance, null); AccessTools.Method(typeof(ChatManager), "PossessChatCustomLogic", (Type[])null, (Type[])null).Invoke(__instance, null); if (!(bool)AccessTools.Field(typeof(ChatManager), "textMeshFetched").GetValue(__instance) || !(bool)AccessTools.Field(typeof(ChatManager), "localPlayerAvatarFetched").GetValue(__instance)) { return false; } ChatState val = (ChatState)AccessTools.Field(typeof(ChatManager), "chatState").GetValue(__instance); ChatState val2 = val; switch ((int)val2) { case 0: AccessTools.Method(typeof(ChatManager), "StateInactive", (Type[])null, (Type[])null).Invoke(__instance, null); break; case 1: AccessTools.Method(typeof(ChatManager), "StateActive", (Type[])null, (Type[])null).Invoke(__instance, null); break; case 2: AccessTools.Method(typeof(ChatManager), "StatePossessed", (Type[])null, (Type[])null).Invoke(__instance, null); break; case 3: AccessTools.Method(typeof(ChatManager), "StateSend", (Type[])null, (Type[])null).Invoke(__instance, null); break; } AccessTools.Method(typeof(ChatManager), "PossessChatCustomLogic", (Type[])null, (Type[])null).Invoke(__instance, null); FieldInfo fieldInfo = AccessTools.Field(typeof(ChatManager), "spamTimer"); if ((float)fieldInfo.GetValue(__instance) > 0f) { fieldInfo.SetValue(__instance, (float)fieldInfo.GetValue(__instance) + Time.deltaTime); } if (SemiFunc.FPSImpulse15() && (bool)AccessTools.Field(typeof(ChatManager), "betrayalActive").GetValue(__instance) && (bool)AccessTools.Field(typeof(RoomVolumeCheck), "inTruck").GetValue(PlayerController.instance.playerAvatarScript.RoomVolumeCheck)) { __instance.PossessCancelSelfDestruction(); } return false; } public static bool EnemyVision_VisionTrigger_Prefix(int playerID, PlayerAvatar player, EnemyVision __instance) { if (invisible || noTarget) { __instance.VisionTriggered[playerID] = false; __instance.VisionsTriggered[playerID] = 0; return false; } return true; } public static bool EnemyDirector_SetInvestigate_Prefix() { if (quiet || noTarget) { return false; } return true; } public static void PhysGrabber_Update_Prefix(PhysGrabber __instance) { if (infiniteRange) { if (previousGrabRange < 0f) { previousGrabRange = __instance.grabRange; } __instance.grabRange = 9999f; __instance.maxDistanceFromPlayer = 9999f; } else if (previousGrabRange >= 0f) { __instance.grabRange = previousGrabRange; previousGrabRange = -1f; __instance.maxDistanceFromPlayer = 6f; } if (infiniteStrength) { if (previousGrabStrength < 0f) { previousGrabStrength = __instance.grabStrength; } __instance.grabStrength = (trueInfiniteStrength ? 999f : 8f); } else if (previousGrabStrength >= 0f) { __instance.grabStrength = previousGrabStrength; previousGrabStrength = -1f; } } public static void ItemBattery_Update_Postfix(ItemBattery __instance, ref int ___batteryLifeInt) { if (!batteryDrain) { __instance.batteryLife = 100f; ___batteryLifeInt = 6; } } public static bool LevelGenerator_Generate_Prefix(ref IEnumerator __result) { if (enemySpawnerKeys == null) { enemySpawnerKeys = new Dictionary<string, EnemySetup>(); foreach (EnemySetup item in EnemyDirector.instance.enemiesDifficulty1) { if (((Object)item).name == "Enemy - Ceiling Eye") { enemySpawnerKeys.Add("peeper", item); } if (((Object)item).name == "Enemy - Duck") { enemySpawnerKeys.Add("duck", item); enemySpawnerKeys.Add("apexpredator", item); } if (((Object)item).name == "Enemy - Gnome") { enemySpawnerKeys.Add("gnome", item); } if (((Object)item).name == "Enemy - Slow Mouth") { enemySpawnerKeys.Add("spewer", item); } if (((Object)item).name == "Enemy - Thin Man") { enemySpawnerKeys.Add("shadowchild", item); } } foreach (EnemySetup item2 in EnemyDirector.instance.enemiesDifficulty2) { if (((Object)item2).name == "Enemy - Animal") { enemySpawnerKeys.Add("animal", item2); } if (((Object)item2).name == "Enemy - Bang") { enemySpawnerKeys.Add("banger", item2); } if (((Object)item2).name == "Enemy - Bowtie") { enemySpawnerKeys.Add("bowtie", item2); } if (((Object)item2).name == "Enemy - Floater") { enemySpawnerKeys.Add("mentalist", item2); } if (((Object)item2).name == "Enemy - Hidden") { enemySpawnerKeys.Add("hidden", item2); } if (((Object)item2).name == "Enemy - Tumbler") { enemySpawnerKeys.Add("chef", item2); } if (((Object)item2).name == "Enemy - Upscream") { enemySpawnerKeys.Add("upscream", item2); } if (((Object)item2).name == "Enemy - Valuable Thrower") { enemySpawnerKeys.Add("rugrat", item2); } } foreach (EnemySetup item3 in EnemyDirector.instance.enemiesDifficulty3) { if (((Object)item3).name == "Enemy - Beamer") { enemySpawnerKeys.Add("clown", item3); } if (((Object)item3).name == "Enemy - Head") { enemySpawnerKeys.Add("headman", item3); } if (((Object)item3).name == "Enemy - Robe") { enemySpawnerKeys.Add("robe", item3); } if (((Object)item3).name == "Enemy - Runner") { enemySpawnerKeys.Add("reaper", item3); } if (((Object)item3).name == "Enemy - Slow Walker") { enemySpawnerKeys.Add("trudge", item3); } } } if ((Object)(object)RunManager.instance.levelCurrent == (Object)(object)RunManager.instance.levelMainMenu || (Object)(object)RunManager.instance.levelCurrent == (Object)(object)RunManager.instance.levelLobbyMenu || (Object)(object)RunManager.instance.levelCurrent == (Object)(object)RunManager.instance.levelLobby || (Object)(object)RunManager.instance.levelCurrent == (Object)(object)RunManager.instance.levelRecording || (Object)(object)RunManager.instance.levelCurrent == (Object)(object)RunManager.instance.levelTutorial || (Object)(object)RunManager.instance.levelCurrent == (Object)(object)RunManager.instance.levelArena || (Object)(object)RunManager.instance.levelCurrent == (Object)(object)RunManager.instance.levelShop) { logger.LogInfo((object)"Skipping"); return true; } if ((Object)(object)savedLevel != (Object)null) { RunManager.instance.levelCurrent = savedLevel; savedLevel = null; } if (testHallway) { __result = testHallwayGeneration(); return false; } return true; } public static IEnumerator testHallwayGeneration() { logger.LogInfo((object)"Executing alternate generation."); AccessTools.Field(typeof(LevelGenerator), "AllPlayersReady").SetValue(LevelGenerator.Instance, true); LevelGenerator.Instance.Level = RunManager.instance.levelCurrent; AccessTools.Field(typeof(RunManager), "levelPrevious").SetValue(RunManager.instance, LevelGenerator.Instance.Level); LevelGenerator.Instance.State = (LevelState)2; FieldInfo levelgrid = AccessTools.Field(typeof(LevelGenerator), "LevelGrid"); Tile[,] grid = new Tile[1, 100]; LevelGenerator.Instance.LevelWidth = 1; LevelGenerator.Instance.LevelHeight = 100; for (int i = 0; i < 100; i++) { grid[0, i] = new Tile { x = 0, y = i, active = false }; } AccessTools.Field(typeof(LevelGenerator), "ModuleAmount").SetValue(LevelGenerator.Instance, 5 + RunManager.instance.levelsCompleted); AccessTools.Field(typeof(LevelGenerator), "ExtractionAmount").SetValue(LevelGenerator.Instance, (RunManager.instance.levelsCompleted >= 5) ? 3 : ((RunManager.instance.levelsCompleted >= 3) ? 2 : ((RunManager.instance.levelsCompleted >= 1) ? 1 : 0))); grid[0, 0].active = true; grid[0, 0].first = true; yield return null; for (int j = 0; j < 100; j++) { grid[0, j].active = true; grid[0, j].type = (Type)1; } yield return null; levelgrid.SetValue(LevelGenerator.Instance, grid); LevelGenerator.Instance.State = (LevelState)3; GameObject startRoomInstance = Object.Instantiate<GameObject>(LevelGenerator.Instance.Level.StartRooms[Random.Range(0, LevelGenerator.Instance.Level.StartRooms.Count)]); startRoomInstance.transform.parent = LevelGenerator.Instance.LevelParent.transform; FieldInfo waitingCoroutine = AccessTools.Field(typeof(LevelGenerator), "waitingForSubCoroutine"); while ((bool)waitingCoroutine.GetValue(LevelGenerator.Instance)) { yield return null; } LevelGenerator.Instance.State = (LevelState)5; yield return null; for (int k = 0; k < 100; k++) { GameObject spawnedModule = Object.Instantiate<GameObject>(LevelGenerator.Instance.Level.ModulesPassage1[0], new Vector3(0f, 0f, (float)k * 15f + 7.5f), Quaternion.Euler(Vector3.zero)); spawnedModule.transform.parent = LevelGenerator.Instance.LevelParent.transform; Module spawnedModuleRealModule = spawnedModule.GetComponent<Module>(); AccessTools.Field(typeof(Module), "GridX").SetValue(spawnedModuleRealModule, 0); AccessTools.Field(typeof(Module), "GridY").SetValue(spawnedModuleRealModule, k); AccessTools.Field(typeof(Module), "First").SetValue(spawnedModuleRealModule, grid[0, k].first); if (k != 99) { AccessTools.Field(typeof(Module), "ConnectingTop").SetValue(spawnedModuleRealModule, true); } AccessTools.Field(typeof(Module), "ConnectingBottom").SetValue(spawnedModuleRealModule, true); if (k % 10 == 0) { yield return null; } } yield return null; ((MonoBehaviour)LevelGenerator.Instance).StartCoroutine("GenerateBlockObjects"); while ((bool)waitingCoroutine.GetValue(LevelGenerator.Instance)) { yield return null; } FieldInfo modulesSpawnedCount = AccessTools.Field(typeof(LevelGenerator), "ModulesSpawned"); while ((int)modulesSpawnedCount.GetValue(LevelGenerator.Instance) < 100) { LevelGenerator.Instance.State = (LevelState)7; yield return (object)new WaitForSeconds(0.1f); } EnvironmentDirector.Instance.Setup(); logger.LogInfo((object)LevelGenerator.Instance); logger.LogInfo((object)LevelGenerator.Instance.Level); PostProcessing.Instance.Setup(); LevelMusic.instance.Setup(); ConstantMusic.instance.Setup(); LevelGenerator.Instance.ItemSetup(); LevelGenerator.Instance.NavMeshSetup(); LevelGenerator.Instance.PlayerSpawn(); LevelGenerator.Instance.State = (LevelState)15; AccessTools.Method(typeof(LevelGenerator), "GenerateDone", (Type[])null, (Type[])null).Invoke(LevelGenerator.Instance, new object[0]); SessionManager.instance.CrownPlayer(); } public static void RunManager_Update_Prefix() { if (infiniteStamina && (Object)(object)PlayerController.instance != (Object)null) { PlayerController.instance.EnergyCurrent = PlayerController.instance.EnergyStart; } } public static void EnemyHealth_Hurt_Prefix(ref int _damage, int ___healthCurrent) { if (weakEnemy) { _damage = ___healthCurrent; } } public static bool ItemMeleeInflatableHammer_OnHit_Prefix(ItemMeleeInflatableHammer __instance, PhotonView ___photonView) { if (verySqueakyHammer) { if (SemiFunc.IsMultiplayer()) { ___photonView.RPC("ExplosionRPC", (RpcTarget)0, Array.Empty<object>()); } else { __instance.ExplosionRPC(); } return false; } return true; } public static void Enemy_Update_Prefix(ref PlayerAvatar ___TargetPlayerAvatar) { if (noTarget) { ___TargetPlayerAvatar = null; } } public static void EnemyAnimal_Update_Prefix(ref PlayerAvatar ___playerTarget) { if (noTarget) { ___playerTarget = null; } } public static void EnemyBangDirector_Update_Prefix(ref PlayerAvatar ___playerTarget) { if (noTarget) { ___playerTarget = null; } } public static void EnemyBeamer_Update_Prefix(ref PlayerAvatar ___playerTarget) { if (noTarget) { ___playerTarget = null; } } public static void EnemyBowtie_Update_Prefix(ref PlayerAvatar ___playerTarget) { if (noTarget) { ___playerTarget = null; } } public static void EnemyDuck_Update_Prefix(ref PlayerAvatar ___playerTarget) { if (noTarget) { ___playerTarget = null; } } public static void EnemyGnomeDirector_Update_Prefix(ref PlayerAvatar ___playerTarget) { if (noTarget) { ___playerTarget = null; } } public static void EnemyHidden_Update_Prefix(ref PlayerAvatar ___playerTarget) { if (noTarget) { ___playerTarget = null; } } public static void EnemySlowMouth_Update_Prefix(ref PlayerAvatar ___playerTarget) { if (noTarget) { ___playerTarget = null; } } public static void EnemyThinMan_Update_Prefix(ref PlayerAvatar ___playerTarget) { if (noTarget) { ___playerTarget = null; } } public static void EnemyValuableThrower_Update_Prefix(ref PlayerAvatar ___playerTarget) { if (noTarget) { ___playerTarget = null; } } public static void EnemyRobe_Update_Prefix(ref PlayerAvatar ___targetPlayer) { if (noTarget) { ___targetPlayer = null; } } public static void EnemyCeilingEye_Update_Prefix(ref PlayerAvatar ___targetPlayer) { if (noTarget) { ___targetPlayer = null; } } public static void EnemyFloater_Update_Prefix(ref PlayerAvatar ___targetPlayer) { if (noTarget) { ___targetPlayer = null; } } public static void EnemyUpscream_Update_Prefix(ref PlayerAvatar ___targetPlayer) { if (noTarget) { ___targetPlayer = null; } } public static void EnemySlowWalker_Update_Prefix(ref PlayerAvatar ___targetPlayer) { if (noTarget) { ___targetPlayer = null; } } public static void EnemyTumbler_Update_Prefix(ref PlayerAvatar ___targetPlayer) { if (noTarget) { ___targetPlayer = null; } } public static void EnemyRunner_Update_Prefix(ref PlayerAvatar ___targetPlayer) { if (noTarget) { ___targetPlayer = null; } } }